changeset 10251:85bcf0f99edc jdk9-b22

Merge
author lana
date Wed, 09 Jul 2014 10:42:37 -0700
parents da87d706723b (current diff) 5bd902923ccc (diff)
children 2b88f21ec693
files make/src/classes/build/tools/tzdb/ChronoField.java make/src/classes/build/tools/tzdb/DateTimeException.java make/src/classes/build/tools/tzdb/LocalDate.java make/src/classes/build/tools/tzdb/LocalDateTime.java make/src/classes/build/tools/tzdb/LocalTime.java make/src/classes/build/tools/tzdb/TimeDefinition.java make/src/classes/build/tools/tzdb/Utils.java make/src/classes/build/tools/tzdb/ZoneOffset.java make/src/classes/build/tools/tzdb/ZoneOffsetTransition.java make/src/classes/build/tools/tzdb/ZoneOffsetTransitionRule.java make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java src/macosx/native/com/apple/laf/ScreenPopupFactory.m src/macosx/native/jobjc/JObjC.xcodeproj/default.pbxuser src/macosx/native/jobjc/JObjC.xcodeproj/project.pbxproj src/macosx/native/jobjc/README.txt src/macosx/native/jobjc/TODOS src/macosx/native/jobjc/bridgesupport.gmk src/macosx/native/jobjc/build.xml src/macosx/native/jobjc/extract_classes.pl src/macosx/native/jobjc/run-and-write-if-okay src/macosx/native/jobjc/rungen src/macosx/native/jobjc/runjava src/macosx/native/jobjc/src/core/PrimitiveCoder.hs src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CFType.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CIF.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Coder.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/FFIType.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Function.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/ID.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Invoke.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/JObjCRuntime.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/MacOSXFramework.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NSClass.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeArgumentBuffer.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeBuffer.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeObjectLifecycleManager.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Opaque.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Pointer.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/PrimitiveCoder.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/SEL.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Struct.java src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Subclassing.java src/macosx/native/jobjc/src/core/native/CIF.m src/macosx/native/jobjc/src/core/native/Coder.m src/macosx/native/jobjc/src/core/native/FFIType.m src/macosx/native/jobjc/src/core/native/Function.m src/macosx/native/jobjc/src/core/native/ID.m src/macosx/native/jobjc/src/core/native/Invoke.m src/macosx/native/jobjc/src/core/native/JObjCRuntime.m src/macosx/native/jobjc/src/core/native/MacOSXFramework.m src/macosx/native/jobjc/src/core/native/NSClass.m src/macosx/native/jobjc/src/core/native/NativeBuffer.h src/macosx/native/jobjc/src/core/native/NativeBuffer.m src/macosx/native/jobjc/src/core/native/NativeObjectLifecycleManager.m src/macosx/native/jobjc/src/core/native/SEL.m src/macosx/native/jobjc/src/core/native/Subclassing.m src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/BootClassPathMinus.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/ClassConsolidator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/ClassGenerator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/FileCopier.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/FrameworkGenerator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/FunctionGenerator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/Generator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/MethodDisambiguator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/RestrictedKeywords.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/Utils.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/AbstractObjCClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CFTypeClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CategoryClassClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CategoryClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CopiedFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/FrameworkClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/GeneratedClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/JObjCClassClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/JObjCClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/MixedPrimitiveCoderClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/OpaqueClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/OutputFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/RootJObjCClass.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/StructClassFile.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Arg.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/CFType.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Category.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Clazz.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Constant.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Element.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/ElementWType.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Framework.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Function.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/FunctionAlias.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/InformalProtocol.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Method.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/NativeEnum.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Opaque.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/OutputFileGenerator.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Protocol.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/ReturnValue.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/StringConstant.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Struct.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/TypeElement.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/CoderDescriptor.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/ComplexCoderDescriptor.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/PrimitiveCoderDescriptor.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/JType.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/NType.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/Type.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/TypeCache.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/TypeToJType.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/Fp.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/JavaLang.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/NTypeMerger.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/NTypeParser.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/NTypePrinter.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/ObjectInspector.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/QA.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/StringStream.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/StructOffsetResolver.java src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/StructOffsetResolverBigBang.java src/macosx/native/jobjc/src/generator/java/com/apple/jobjc/SuperClassExtractor.java src/macosx/native/jobjc/src/generator/java/com/apple/jobjc/UnsafeRuntimeAccess.java src/macosx/native/jobjc/src/runtime-additions/java/com/apple/jobjc/Utils.java src/macosx/native/jobjc/src/runtime-additions/native/NativeNumber.m src/macosx/native/jobjc/src/runtime-additions/native/NativeString.m src/macosx/native/jobjc/src/runtime-additions/native/NativeThread.m src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BaseBench.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchFunCall.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchIDPop.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchStructCoding.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchUnsafe.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/CategoryTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/FunctionTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/GUIDemo.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/IBDemo.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/IntroTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/NSClassTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/NativeBufferTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/NativeTypeTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/PooledTestCase.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/SELTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/StructTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/SubclassingTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/TestUtils.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/UtilsTest.java src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/VarArgsTest.java src/macosx/native/jobjc/src/tests/native/FunCallBench.m src/share/classes/com/sun/java/browser/dom/DOMAccessException.java src/share/classes/com/sun/java/browser/dom/DOMAccessor.java src/share/classes/com/sun/java/browser/dom/DOMAction.java src/share/classes/com/sun/java/browser/dom/DOMService.java src/share/classes/com/sun/java/browser/dom/DOMServiceProvider.java src/share/classes/com/sun/java/browser/dom/DOMUnsupportedException.java src/share/classes/com/sun/java/browser/net/ProxyInfo.java src/share/classes/com/sun/java/browser/net/ProxyService.java src/share/classes/com/sun/java/browser/net/ProxyServiceProvider.java src/share/classes/com/sun/media/sound/services/linux-i586/javax.sound.sampled.spi.MixerProvider src/share/classes/com/sun/media/sound/services/windows-i586/javax.sound.sampled.spi.MixerProvider src/share/classes/com/sun/media/sound/services/windows-ia64/javax.sound.sampled.spi.MixerProvider src/share/classes/sun/awt/EventQueueDelegate.java src/share/classes/sun/jvmstat/monitor/remote/BufferedMonitoredVm.java src/share/classes/sun/text/CodePointIterator.java test/com/sun/jdi/ProcessAttachDebuggee.java test/com/sun/jdi/ProcessAttachDebugger.java test/com/sun/jdi/ProcessAttachTest.sh test/com/sun/jdi/ShutdownDebuggee.java test/com/sun/jdi/SuspendNoFlagTest.sh test/com/sun/tools/attach/Shutdown.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/AbsoluteComponentCenterCalculator.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/DataFlavorSearcher.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/InterprocessMessages.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MyTransferable.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/NextFramePositionCalculator.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/SourcePanel.java test/java/awt/DataFlavor/MissedHtmlAndRtfBug/TargetPanel.java test/java/awt/EventQueue/6638195/bug6638195.java test/java/awt/datatransfer/DuplicatedNativesTest/DuplicatedNativesTest.java test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh test/sun/jvmstat/testlibrary/JavaProcess.java
diffstat 1154 files changed, 40961 insertions(+), 27405 deletions(-) [+]
line wrap: on
line diff
--- a/make/CopyFiles.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/CopyFiles.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -373,7 +373,14 @@
   POLICY_SRC_LIST += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/lib/security/java.policy
 endif
 ifndef OPENJDK
-  ifneq (, $(filter $(OPENJDK_TARGET_OS), windows solaris))
+  ifeq ($(OPENJDK_TARGET_OS), windows)
+    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+      POLICY_SRC_LIST += $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS)/lib/security/java.policy-win32
+    else
+      POLICY_SRC_LIST += $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS)/lib/security/java.policy-win64
+    endif
+  endif
+  ifeq ($(OPENJDK_TARGET_OS), solaris)
     POLICY_SRC_LIST += $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS)/lib/security/java.policy
   endif
 endif
--- a/make/GenerateData.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/GenerateData.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -62,7 +62,7 @@
 
 ##########################################################################################
 
-GENDATA_CURDATA := $(JDK_OUTPUTDIR)/lib/currency.data
+GENDATA_CURDATA := $(JDK_OUTPUTDIR)/classes/java/util/currency.data
 
 $(GENDATA_CURDATA): $(JDK_TOPDIR)/make/data/currency/CurrencyData.properties $(BUILD_TOOLS)
 	$(MKDIR) -p $(@D)
--- a/make/Setup.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/Setup.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -27,7 +27,7 @@
 
 # To build with all warnings enabled, do the following:
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,fallthrough,overloads,serial,static,try,varargs -Werror
+JAVAC_WARNINGS := -Xlint:all,-deprecation,-rawtypes,-unchecked -Werror
 
 # Any java code executed during a JDK build to build other parts of the JDK must be 
 # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
--- a/make/lib/Awt2dLibraries.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/lib/Awt2dLibraries.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -319,7 +319,6 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   LIBAWT_FILES += awt_LoadLibrary.c
-  LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 endif
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
@@ -484,7 +483,6 @@
     LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
         -framework Cocoa \
         -framework OpenGL \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
         -framework JavaNativeFoundation \
         -framework JavaRuntimeSupport \
         -framework ApplicationServices \
@@ -709,21 +707,24 @@
 
 ##########################################################################################
 
+BUILD_LIBJAVAJPEG_DIR := $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
+
 ifdef OPENJDK
-  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
+  BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
 else
-  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
-  BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
-  BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
+  BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
+  BUILD_LIBJAVAJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
+  BUILD_LIBJAVAJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJAVAJPEG_CLOSED_SRC)
 endif
 
-BUILD_LIBJPEG_REORDER :=
+BUILD_LIBJAVAJPEG_REORDER :=
 ifeq ($(OPENJDK_TARGET_OS), solaris)
   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
-    BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
+    BUILD_LIBJAVAJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
   endif
 endif
 
+
 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 # or 'vfork'": this warning indicates that some variable is placed to
 # a register by optimized compiler and it's value might be lost on longjmp().
@@ -735,37 +736,50 @@
 #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
 #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
 #  ifeq ($(CC_43_OR_NEWER), 1)
-#    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
+#    BUILD_LIBJAVAJPEG_CFLAGS_linux += -Wno-clobbered
 #  endif
 #endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
-    LIBRARY := jpeg, \
+ifeq ($(USE_EXTERNAL_LIBJPEG), true)
+  LIBJPEG_LIBS := -ljpeg
+  BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
+      imageIOJPEG.c \
+      jpegdecoder.c
+  BUILD_LIBJAVAJPEG_HEADERS :=
+else
+  LIBJPEG_LIBS :=
+  BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
+  BUILD_LIBJAVAJPEG_HEADERS := -I$(BUILD_LIBJAVAJPEG_DIR)
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
+    LIBRARY := javajpeg, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-    SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
-        $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
+    SRC := $(BUILD_LIBJAVAJPEG_CLOSED_SRC) \
+        $(BUILD_LIBJAVAJPEG_DIR), \
+    INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
     LANG := C, \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
-        $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
-        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
-    MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
-    LDFLAGS := $(LDFLAGS_JDKLIB) \
+        $(BUILD_LIBJAVAJPEG_CLOSED_INCLUDES) \
+        $(BUILD_LIBJAVAJPEG_HEADERS), \
+    MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
+    LDFLAGS := $(LDFLAGS_JDKLIB) $(LIBJPEG_LIBS) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
     LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
     RC_FLAGS := $(RC_FLAGS) \
-        -D "JDK_FNAME=jpeg.dll" \
-        -D "JDK_INTERNAL_NAME=jpeg" \
+        -D "JDK_FNAME=javajpeg.dll" \
+        -D "JDK_INTERNAL_NAME=javajpeg" \
         -D "JDK_FTYPE=0x2L", \
-    REORDER := $(BUILD_LIBJPEG_REORDER), \
+    REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-$(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
+$(BUILD_LIBJAVAJPEG): $(BUILD_LIBJAVA)
 
-BUILD_LIBRARIES += $(BUILD_LIBJPEG)
+BUILD_LIBRARIES += $(BUILD_LIBJAVAJPEG)
 
 ##########################################################################################
 
@@ -1130,12 +1144,6 @@
         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
         $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
 
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      LIBAWT_HEADLESS_CFLAGS += \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-    endif
-
     LIBAWT_HEADLESS_FILES := \
         awt_Font.c \
         HeadlessToolkit.c \
@@ -1213,6 +1221,13 @@
     GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
   endif
 
+  ifeq ($(USE_EXTERNAL_LIBJPEG), true)
+    LIBJPEG_LDFLAGS := -ljpeg
+  else
+    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
+    LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
+  endif
+
   ifeq ($(USE_EXTERNAL_LIBPNG), false)
     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/libpng
     LIBPNG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/libpng
@@ -1229,8 +1244,7 @@
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
-        $(LIBSPLASHSCREEN_CFLAGS) \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks
+        $(LIBSPLASHSCREEN_CFLAGS)
     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
 
@@ -1260,7 +1274,6 @@
         -framework ApplicationServices \
         -framework Foundation \
         -framework Cocoa \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
         -framework JavaNativeFoundation
   else ifeq ($(OPENJDK_TARGET_OS), windows)
     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
@@ -1276,12 +1289,12 @@
       LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
-                $(GIFLIB_CFLAGS) $(PNG_CFLAGS), \
+                $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) \
-                        $(GIFLIB_LDFLAGS) $(PNG_LIBS), \
+                        $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS) $(PNG_LIBS), \
       LDFLAGS_SUFFIX_solaris := -lc, \
       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
       RC_FLAGS := $(RC_FLAGS) \
@@ -1445,9 +1458,7 @@
           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
-          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
@@ -1458,7 +1469,6 @@
           -framework Cocoa \
           -framework Security \
           -framework ExceptionHandling \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework OpenGL \
@@ -1491,8 +1501,7 @@
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -Xlinker -rpath -Xlinker @loader_path, \
@@ -1500,7 +1509,6 @@
           -framework Cocoa \
           -framework Carbon \
           -framework ApplicationServices \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -ljava -ljvm, \
--- a/make/lib/CoreLibraries.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/lib/CoreLibraries.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -306,7 +306,7 @@
     LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lc, \
     LDFLAGS_SUFFIX_aix := -ljvm -ljava, \
     LDFLAGS_SUFFIX_windows := advapi32.lib jvm.lib $(WIN_JAVA_LIB), \
-    LDFLAGS_SUFFIX_macosx := -ljvm -framework CoreFoundation, \
+    LDFLAGS_SUFFIX_macosx := -ljvm -framework CoreFoundation -framework Foundation, \
     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
     RC_FLAGS := $(RC_FLAGS) \
         -D "JDK_FNAME=prefs.dll" \
--- a/make/lib/PlatformLibraries.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/lib/PlatformLibraries.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -32,14 +32,11 @@
       LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
-          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX := -framework Cocoa \
           -framework Carbon \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           $(LDFLAGS_JDKLIB_SUFFIX), \
       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
@@ -63,9 +60,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -I$(JDK_OUTPUTDIR)/gensrc_headers_icons \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_OUTPUTDIR)/gensrc_headers_icons, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := \
@@ -76,7 +71,6 @@
           -framework Cocoa \
           -framework Security \
           -framework ExceptionHandling \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework OpenGL \
@@ -107,16 +101,13 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
-          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := \
           -losxapp \
           -framework Cocoa \
           -framework ApplicationServices \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework Security \
--- a/make/lib/SecurityLibraries.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/lib/SecurityLibraries.gmk	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@
     BUILD_LIBKRB5_NAME := osxkrb5
     BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
         $(JDK_TOPDIR)/src/macosx/native/sun/security/krb5
-    BUILD_LIBKRB5_LIBS := -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+    BUILD_LIBKRB5_LIBS := \
         -framework JavaNativeFoundation \
         -framework Cocoa \
         -framework SystemConfiguration \
@@ -147,7 +147,6 @@
         CFLAGS := $(CFLAGS_JDKLIB) \
             -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5, \
         CFLAGS_windows := -I$(JDK_TOPDIR)/src/windows/native/sun/security/krb5, \
-        CFLAGS_macosx := -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
         LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \
--- a/make/mapfiles/libawt/mapfile-vers	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/mapfiles/libawt/mapfile-vers	Wed Jul 09 10:42:37 2014 -0700
@@ -155,6 +155,7 @@
 		g_CMpDataID;
 		colorValueID;
                 mul8table;
+                div8table;
                 jvm;
 
                 # ProcessPath entry points and data
--- a/make/profile-includes.txt	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/profile-includes.txt	Wed Jul 09 10:42:37 2014 -0700
@@ -56,7 +56,6 @@
     $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/Xusage.txt \
     calendars.properties \
     classlist \
-    currency.data \
     ext/localedata.jar \
     ext/meta-index \
     ext/sunec.jar \
--- a/make/src/classes/build/tools/generatenimbus/PainterGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/src/classes/build/tools/generatenimbus/PainterGenerator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -57,6 +57,9 @@
  * @author  Jasper Potts
  */
 public class PainterGenerator {
+
+    private static final boolean debug = false;
+
     //a handful of counters, incremented whenever the associated object type is encounted.
     //These counters form the basis of the field and method suffixes.
     //These are all 1 based, because I felt like it :-)
@@ -384,16 +387,24 @@
         }
 
         if (Float.isNaN(r)) {
-            System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 0;
         } else if (Float.isInfinite(r)) {
-            System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 0;
         } else if (r < 0) {
-            System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 0;
         } else if (r > 3) {
-            System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            if (debug) {
+                System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            }
             return 3;
         } else {
             return r;
--- a/make/src/classes/build/tools/tzdb/ChronoField.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * Copyright (c) 2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package build.tools.tzdb;
-
-/**
- * A standard set of date/time fields.
- *
- * @since 1.8
- */
-enum ChronoField {
-
-    /**
-     * The second-of-minute.
-     * <p>
-     * This counts the second within the minute, from 0 to 59.
-     * This field has the same meaning for all calendar systems.
-     */
-    SECOND_OF_MINUTE("SecondOfMinute", 0, 59),
-
-    /**
-     * The second-of-day.
-     * <p>
-     * This counts the second within the day, from 0 to (24 * 60 * 60) - 1.
-     * This field has the same meaning for all calendar systems.
-     */
-    SECOND_OF_DAY("SecondOfDay", 0, 86400 - 1),
-
-    /**
-     * The minute-of-hour.
-     * <p>
-     * This counts the minute within the hour, from 0 to 59.
-     * This field has the same meaning for all calendar systems.
-     */
-    MINUTE_OF_HOUR("MinuteOfHour", 0, 59),
-
-    /**
-     * The hour-of-day.
-     * <p>
-     * This counts the hour within the day, from 0 to 23.
-     * This is the hour that would be observed on a standard 24-hour digital clock.
-     * This field has the same meaning for all calendar systems.
-     */
-    HOUR_OF_DAY("HourOfDay", 0, 23),
-
-
-    /**
-     * The day-of-month.
-     * <p>
-     * This represents the concept of the day within the month.
-     * In the default ISO calendar system, this has values from 1 to 31 in most months.
-     * April, June, September, November have days from 1 to 30, while February has days
-     * from 1 to 28, or 29 in a leap year.
-     * <p>
-     * Non-ISO calendar systems should implement this field using the most recognized
-     * day-of-month values for users of the calendar system.
-     * Normally, this is a count of days from 1 to the length of the month.
-     */
-    DAY_OF_MONTH("DayOfMonth", 1, 31),
-
-    /**
-     * The month-of-year, such as March.
-     * <p>
-     * This represents the concept of the month within the year.
-     * In the default ISO calendar system, this has values from January (1) to December (12).
-     * <p>
-     * Non-ISO calendar systems should implement this field using the most recognized
-     * month-of-year values for users of the calendar system.
-     * Normally, this is a count of months starting from 1.
-     */
-    MONTH_OF_YEAR("MonthOfYear", 1, 12),
-
-    /**
-     * The proleptic year, such as 2012.
-     * <p>
-     * This represents the concept of the year, counting sequentially and using negative numbers.
-     * The proleptic year is not interpreted in terms of the era.
-     * See {@link #YEAR_OF_ERA} for an example showing the mapping from proleptic year to year-of-era.
-     * <p>
-     * The standard mental model for a date is based on three concepts - year, month and day.
-     * These map onto the {@code YEAR}, {@code MONTH_OF_YEAR} and {@code DAY_OF_MONTH} fields.
-     * Note that there is no reference to eras.
-     * The full model for a date requires four concepts - era, year, month and day. These map onto
-     * the {@code ERA}, {@code YEAR_OF_ERA}, {@code MONTH_OF_YEAR} and {@code DAY_OF_MONTH} fields.
-     * Whether this field or {@code YEAR_OF_ERA} is used depends on which mental model is being used.
-     * See {@link ChronoLocalDate} for more discussion on this topic.
-     * <p>
-     * Non-ISO calendar systems should implement this field as follows.
-     * If the calendar system has only two eras, before and after a fixed date, then the
-     * proleptic-year value must be the same as the year-of-era value for the later era,
-     * and increasingly negative for the earlier era.
-     * If the calendar system has more than two eras, then the proleptic-year value may be
-     * defined with any appropriate value, although defining it to be the same as ISO may be
-     * the best option.
-     */
-    YEAR("Year", -999_999_999, 999_999_999);
-
-    private final String name;
-    private final int min;
-    private final int max;
-
-    private ChronoField(String name, int min, int max) {
-        this.name = name;
-        this.min= min;
-        this.max= max;
-    }
-
-    /**
-     * Checks that the specified value is valid for this field.
-     * <p>
-     *
-     * @param value  the value to check
-     * @return the value that was passed in
-     */
-    public int checkValidValue(int value) {
-        if (value >= min && value <= max) {
-            return value;
-        }
-        throw new DateTimeException("Invalid value for " + name + " value: " + value);
-    }
-
-    public String toString() {
-        return name;
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/DateTimeException.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2008-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-/**
- * Exception used to indicate a problem while calculating a date-time.
- * <p>
- * This exception is used to indicate problems with creating, querying
- * and manipulating date-time objects.
- *
- * @since 1.8
- */
-class DateTimeException extends RuntimeException {
-
-    /**
-     * Serialization version.
-     */
-    private static final long serialVersionUID = -1632418723876261839L;
-
-    /**
-     * Constructs a new date-time exception with the specified message.
-     *
-     * @param message  the message to use for this exception, may be null
-     */
-    public DateTimeException(String message) {
-        super(message);
-    }
-
-    /**
-     * Constructs a new date-time exception with the specified message and cause.
-     *
-     * @param message  the message to use for this exception, may be null
-     * @param cause  the cause of the exception, may be null
-     */
-    public DateTimeException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/LocalDate.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import static build.tools.tzdb.Utils.*;
-import static build.tools.tzdb.LocalTime.SECONDS_PER_DAY;
-import static build.tools.tzdb.ChronoField.DAY_OF_MONTH;
-import static build.tools.tzdb.ChronoField.MONTH_OF_YEAR;
-import static build.tools.tzdb.ChronoField.YEAR;
-
-import java.util.Objects;
-
-/**
- * A date without a time-zone in the ISO-8601 calendar system,
- * such as {@code 2007-12-03}.
- *
- * @since 1.8
- */
-final class LocalDate {
-
-    /**
-     * The minimum supported {@code LocalDate}, '-999999999-01-01'.
-     * This could be used by an application as a "far past" date.
-     */
-    public static final LocalDate MIN = new LocalDate(YEAR_MIN_VALUE, 1, 1);
-    /**
-     * The maximum supported {@code LocalDate}, '+999999999-12-31'.
-     * This could be used by an application as a "far future" date.
-     */
-    public static final LocalDate MAX = new LocalDate(YEAR_MAX_VALUE, 12, 31);
-
-    /**
-     * The number of days in a 400 year cycle.
-     */
-    private static final int DAYS_PER_CYCLE = 146097;
-    /**
-     * The number of days from year zero to year 1970.
-     * There are five 400 year cycles from year zero to 2000.
-     * There are 7 leap years from 1970 to 2000.
-     */
-    static final long DAYS_0000_TO_1970 = (DAYS_PER_CYCLE * 5L) - (30L * 365L + 7L);
-
-    /**
-     * The year.
-     */
-    private final int year;
-    /**
-     * The month-of-year.
-     */
-    private final short month;
-    /**
-     * The day-of-month.
-     */
-    private final short day;
-
-    /**
-     * Obtains an instance of {@code LocalDate} from a year, month and day.
-     * <p>
-     * The day must be valid for the year and month, otherwise an exception will be thrown.
-     *
-     * @param year  the year to represent, from MIN_YEAR to MAX_YEAR
-     * @param month  the month-of-year to represent, from 1 (January) to 12 (December)
-     * @param dayOfMonth  the day-of-month to represent, from 1 to 31
-     * @return the local date, not null
-     * @throws DateTimeException if the value of any field is out of range
-     * @throws DateTimeException if the day-of-month is invalid for the month-year
-     */
-    public static LocalDate of(int year, int month, int dayOfMonth) {
-        YEAR.checkValidValue(year);
-        MONTH_OF_YEAR.checkValidValue(month);
-        DAY_OF_MONTH.checkValidValue(dayOfMonth);
-        if (dayOfMonth > 28 && dayOfMonth > lengthOfMonth(month, isLeapYear(year))) {
-            if (dayOfMonth == 29) {
-                throw new DateTimeException("Invalid date 'February 29' as '" + year + "' is not a leap year");
-            } else {
-                throw new DateTimeException("Invalid date '" + month + " " + dayOfMonth + "'");
-            }
-        }
-        return new LocalDate(year, month, dayOfMonth);
-    }
-
-    /**
-     * Constructor, previously validated.
-     *
-     * @param year  the year to represent, from MIN_YEAR to MAX_YEAR
-     * @param month  the month-of-year to represent, not null
-     * @param dayOfMonth  the day-of-month to represent, valid for year-month, from 1 to 31
-     */
-    private LocalDate(int year, int month, int dayOfMonth) {
-        this.year = year;
-        this.month = (short) month;
-        this.day = (short) dayOfMonth;
-    }
-
-    /**
-     * Gets the year field.
-     * <p>
-     * This method returns the primitive {@code int} value for the year.
-     * <p>
-     * The year returned by this method is proleptic as per {@code get(YEAR)}.
-     * To obtain the year-of-era, use {@code get(YEAR_OF_ERA}.
-     *
-     * @return the year, from MIN_YEAR to MAX_YEAR
-     */
-    public int getYear() {
-        return year;
-    }
-
-    /**
-     * Gets the month-of-year field as an int from 1 to 12.
-     *
-     * @return the month-of-year
-     */
-    public int getMonth() {
-        return month;
-    }
-
-    /**
-     * Gets the day-of-month field.
-     * <p>
-     * This method returns the primitive {@code int} value for the day-of-month.
-     *
-     * @return the day-of-month, from 1 to 31
-     */
-    public int getDayOfMonth() {
-        return day;
-    }
-
-    /**
-     * Gets the day-of-week field, which is an int from 1 to 7.
-     *
-     * @return the day-of-week
-     */
-    public int getDayOfWeek() {
-        return (int)floorMod(toEpochDay() + 3, 7) + 1;
-    }
-
-    /**
-     * Returns a copy of this {@code LocalDate} with the specified number of days added.
-     * <p>
-     * This method adds the specified amount to the days field incrementing the
-     * month and year fields as necessary to ensure the result remains valid.
-     * The result is only invalid if the maximum/minimum year is exceeded.
-     * <p>
-     * For example, 2008-12-31 plus one day would result in 2009-01-01.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param daysToAdd  the days to add, may be negative
-     * @return a {@code LocalDate} based on this date with the days added, not null
-     * @throws DateTimeException if the result exceeds the supported date range
-     */
-    public LocalDate plusDays(long daysToAdd) {
-        if (daysToAdd == 0) {
-            return this;
-        }
-        long mjDay = addExact(toEpochDay(), daysToAdd);
-        return LocalDate.ofEpochDay(mjDay);
-    }
-
-    /**
-     * Returns a copy of this {@code LocalDate} with the specified number of days subtracted.
-     * <p>
-     * This method subtracts the specified amount from the days field decrementing the
-     * month and year fields as necessary to ensure the result remains valid.
-     * The result is only invalid if the maximum/minimum year is exceeded.
-     * <p>
-     * For example, 2009-01-01 minus one day would result in 2008-12-31.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param daysToSubtract  the days to subtract, may be negative
-     * @return a {@code LocalDate} based on this date with the days subtracted, not null
-     * @throws DateTimeException if the result exceeds the supported date range
-     */
-    public LocalDate minusDays(long daysToSubtract) {
-        return (daysToSubtract == Long.MIN_VALUE ? plusDays(Long.MAX_VALUE).plusDays(1) : plusDays(-daysToSubtract));
-    }
-
-    /**
-     * Obtains an instance of {@code LocalDate} from the epoch day count.
-     * <p>
-     * The Epoch Day count is a simple incrementing count of days
-     * where day 0 is 1970-01-01. Negative numbers represent earlier days.
-     *
-     * @param epochDay  the Epoch Day to convert, based on the epoch 1970-01-01
-     * @return the local date, not null
-     * @throws DateTimeException if the epoch days exceeds the supported date range
-     */
-    public static LocalDate ofEpochDay(long epochDay) {
-        long zeroDay = epochDay + DAYS_0000_TO_1970;
-        // find the march-based year
-        zeroDay -= 60;  // adjust to 0000-03-01 so leap day is at end of four year cycle
-        long adjust = 0;
-        if (zeroDay < 0) {
-            // adjust negative years to positive for calculation
-            long adjustCycles = (zeroDay + 1) / DAYS_PER_CYCLE - 1;
-            adjust = adjustCycles * 400;
-            zeroDay += -adjustCycles * DAYS_PER_CYCLE;
-        }
-        long yearEst = (400 * zeroDay + 591) / DAYS_PER_CYCLE;
-        long doyEst = zeroDay - (365 * yearEst + yearEst / 4 - yearEst / 100 + yearEst / 400);
-        if (doyEst < 0) {
-            // fix estimate
-            yearEst--;
-            doyEst = zeroDay - (365 * yearEst + yearEst / 4 - yearEst / 100 + yearEst / 400);
-        }
-        yearEst += adjust;  // reset any negative year
-        int marchDoy0 = (int) doyEst;
-
-        // convert march-based values back to january-based
-        int marchMonth0 = (marchDoy0 * 5 + 2) / 153;
-        int month = (marchMonth0 + 2) % 12 + 1;
-        int dom = marchDoy0 - (marchMonth0 * 306 + 5) / 10 + 1;
-        yearEst += marchMonth0 / 10;
-
-        // check year now we are certain it is correct
-        int year = YEAR.checkValidValue((int)yearEst);
-        return new LocalDate(year, month, dom);
-    }
-
-    public long toEpochDay() {
-        long y = year;
-        long m = month;
-        long total = 0;
-        total += 365 * y;
-        if (y >= 0) {
-            total += (y + 3) / 4 - (y + 99) / 100 + (y + 399) / 400;
-        } else {
-            total -= y / -4 - y / -100 + y / -400;
-        }
-        total += ((367 * m - 362) / 12);
-        total += day - 1;
-        if (m > 2) {
-            total--;
-            if (isLeapYear(year) == false) {
-                total--;
-            }
-        }
-        return total - DAYS_0000_TO_1970;
-    }
-
-    /**
-     * Compares this date to another date.
-     * <p>
-     * The comparison is primarily based on the date, from earliest to latest.
-     * It is "consistent with equals", as defined by {@link Comparable}.
-     * <p>
-     * If all the dates being compared are instances of {@code LocalDate},
-     * then the comparison will be entirely based on the date.
-     * If some dates being compared are in different chronologies, then the
-     * chronology is also considered, see {@link java.time.temporal.ChronoLocalDate#compareTo}.
-     *
-     * @param other  the other date to compare to, not null
-     * @return the comparator value, negative if less, positive if greater
-     */
-    public int compareTo(LocalDate otherDate) {
-        int cmp = (year - otherDate.year);
-        if (cmp == 0) {
-            cmp = (month - otherDate.month);
-            if (cmp == 0) {
-                cmp = (day - otherDate.day);
-            }
-        }
-        return cmp;
-    }
-
-    /**
-     * Checks if this date is equal to another date.
-     * <p>
-     * Compares this {@code LocalDate} with another ensuring that the date is the same.
-     * <p>
-     * Only objects of type {@code LocalDate} are compared, other types return false.
-     * To compare the dates of two {@code TemporalAccessor} instances, including dates
-     * in two different chronologies, use {@link ChronoField#EPOCH_DAY} as a comparator.
-     *
-     * @param obj  the object to check, null returns false
-     * @return true if this is equal to the other date
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof LocalDate) {
-            return compareTo((LocalDate) obj) == 0;
-        }
-        return false;
-    }
-
-    /**
-     * A hash code for this date.
-     *
-     * @return a suitable hash code
-     */
-    @Override
-    public int hashCode() {
-        int yearValue = year;
-        int monthValue = month;
-        int dayValue = day;
-        return (yearValue & 0xFFFFF800) ^ ((yearValue << 11) + (monthValue << 6) + (dayValue));
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/LocalDateTime.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,427 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import static build.tools.tzdb.Utils.*;
-import static build.tools.tzdb.LocalTime.HOURS_PER_DAY;
-import static build.tools.tzdb.LocalTime.MICROS_PER_DAY;
-import static build.tools.tzdb.LocalTime.MILLIS_PER_DAY;
-import static build.tools.tzdb.LocalTime.MINUTES_PER_DAY;
-import static build.tools.tzdb.LocalTime.SECONDS_PER_DAY;
-import static build.tools.tzdb.LocalTime.SECONDS_PER_MINUTE;
-import static build.tools.tzdb.LocalTime.SECONDS_PER_HOUR;
-
-import java.util.Objects;
-
-/**
- * A date-time without a time-zone in the ISO-8601 calendar system,
- * such as {@code 2007-12-03T10:15:30}.
- *
- * @since 1.8
- */
-final class LocalDateTime {
-
-    /**
-     * The minimum supported {@code LocalDateTime}, '-999999999-01-01T00:00:00'.
-     * This is the local date-time of midnight at the start of the minimum date.
-     * This combines {@link LocalDate#MIN} and {@link LocalTime#MIN}.
-     * This could be used by an application as a "far past" date-time.
-     */
-    public static final LocalDateTime MIN = LocalDateTime.of(LocalDate.MIN, LocalTime.MIN);
-    /**
-     * The maximum supported {@code LocalDateTime}, '+999999999-12-31T23:59:59.999999999'.
-     * This is the local date-time just before midnight at the end of the maximum date.
-     * This combines {@link LocalDate#MAX} and {@link LocalTime#MAX}.
-     * This could be used by an application as a "far future" date-time.
-     */
-    public static final LocalDateTime MAX = LocalDateTime.of(LocalDate.MAX, LocalTime.MAX);
-
-    /**
-     * The date part.
-     */
-    private final LocalDate date;
-    /**
-     * The time part.
-     */
-    private final LocalTime time;
-
-    /**
-     * Obtains an instance of {@code LocalDateTime} from year, month,
-     * day, hour and minute, setting the second and nanosecond to zero.
-     * <p>
-     * The day must be valid for the year and month, otherwise an exception will be thrown.
-     * The second and nanosecond fields will be set to zero.
-     *
-     * @param year  the year to represent, from MIN_YEAR to MAX_YEAR
-     * @param month  the month-of-year to represent, from 1 (January) to 12 (December)
-     * @param dayOfMonth  the day-of-month to represent, from 1 to 31
-     * @param hour  the hour-of-day to represent, from 0 to 23
-     * @param minute  the minute-of-hour to represent, from 0 to 59
-     * @return the local date-time, not null
-     * @throws DateTimeException if the value of any field is out of range
-     * @throws DateTimeException if the day-of-month is invalid for the month-year
-     */
-    public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute) {
-        LocalDate date = LocalDate.of(year, month, dayOfMonth);
-        LocalTime time = LocalTime.of(hour, minute);
-        return new LocalDateTime(date, time);
-    }
-
-    /**
-     * Obtains an instance of {@code LocalDateTime} from a date and time.
-     *
-     * @param date  the local date, not null
-     * @param time  the local time, not null
-     * @return the local date-time, not null
-     */
-    public static LocalDateTime of(LocalDate date, LocalTime time) {
-        Objects.requireNonNull(date, "date");
-        Objects.requireNonNull(time, "time");
-        return new LocalDateTime(date, time);
-    }
-
-    /**
-     * Obtains an instance of {@code LocalDateTime} using seconds from the
-     * epoch of 1970-01-01T00:00:00Z.
-     * <p>
-     * This allows the {@link ChronoField#INSTANT_SECONDS epoch-second} field
-     * to be converted to a local date-time. This is primarily intended for
-     * low-level conversions rather than general application usage.
-     *
-     * @param epochSecond  the number of seconds from the epoch of 1970-01-01T00:00:00Z
-     * @param nanoOfSecond  the nanosecond within the second, from 0 to 999,999,999
-     * @param offset  the zone offset, not null
-     * @return the local date-time, not null
-     * @throws DateTimeException if the result exceeds the supported range
-     */
-    public static LocalDateTime ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset offset) {
-        Objects.requireNonNull(offset, "offset");
-        long localSecond = epochSecond + offset.getTotalSeconds();  // overflow caught later
-        long localEpochDay = floorDiv(localSecond, SECONDS_PER_DAY);
-        int secsOfDay = (int)floorMod(localSecond, SECONDS_PER_DAY);
-        LocalDate date = LocalDate.ofEpochDay(localEpochDay);
-        LocalTime time = LocalTime.ofSecondOfDay(secsOfDay);  // ignore nano
-        return new LocalDateTime(date, time);
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param date  the date part of the date-time, validated not null
-     * @param time  the time part of the date-time, validated not null
-     */
-    private LocalDateTime(LocalDate date, LocalTime time) {
-        this.date = date;
-        this.time = time;
-    }
-
-    /**
-     * Returns a copy of this date-time with the new date and time, checking
-     * to see if a new object is in fact required.
-     *
-     * @param newDate  the date of the new date-time, not null
-     * @param newTime  the time of the new date-time, not null
-     * @return the date-time, not null
-     */
-    private LocalDateTime with(LocalDate newDate, LocalTime newTime) {
-        if (date == newDate && time == newTime) {
-            return this;
-        }
-        return new LocalDateTime(newDate, newTime);
-    }
-
-    /**
-     * Gets the {@code LocalDate} part of this date-time.
-     * <p>
-     * This returns a {@code LocalDate} with the same year, month and day
-     * as this date-time.
-     *
-     * @return the date part of this date-time, not null
-     */
-    public LocalDate getDate() {
-        return date;
-    }
-
-    /**
-     * Gets the year field.
-     * <p>
-     * This method returns the primitive {@code int} value for the year.
-     * <p>
-     * The year returned by this method is proleptic as per {@code get(YEAR)}.
-     * To obtain the year-of-era, use {@code get(YEAR_OF_ERA}.
-     *
-     * @return the year, from MIN_YEAR to MAX_YEAR
-     */
-    public int getYear() {
-        return date.getYear();
-    }
-
-    /**
-     * Gets the month-of-year field as an int from 1 to 12.
-     *
-     * @return the month-of-year
-     */
-    public int getMonth() {
-        return date.getMonth();
-    }
-
-    /**
-     * Gets the day-of-month field.
-     * <p>
-     * This method returns the primitive {@code int} value for the day-of-month.
-     *
-     * @return the day-of-month, from 1 to 31
-     */
-    public int getDayOfMonth() {
-        return date.getDayOfMonth();
-    }
-
-    /**
-     * Gets the day-of-week field, which is an integer from 1 to 7.
-     *
-     * @return the day-of-week, from 1 to 7
-     */
-    public int getDayOfWeek() {
-        return date.getDayOfWeek();
-    }
-
-    /**
-     * Gets the {@code LocalTime} part of this date-time.
-     * <p>
-     * This returns a {@code LocalTime} with the same hour, minute, second and
-     * nanosecond as this date-time.
-     *
-     * @return the time part of this date-time, not null
-     */
-    public LocalTime getTime() {
-        return time;
-    }
-
-    /**
-     * Gets the hour-of-day field.
-     *
-     * @return the hour-of-day, from 0 to 23
-     */
-    public int getHour() {
-        return time.getHour();
-    }
-
-    /**
-     * Gets the minute-of-hour field.
-     *
-     * @return the minute-of-hour, from 0 to 59
-     */
-    public int getMinute() {
-        return time.getMinute();
-    }
-
-    /**
-     * Gets the second-of-minute field.
-     *
-     * @return the second-of-minute, from 0 to 59
-     */
-    public int getSecond() {
-        return time.getSecond();
-    }
-
-    /**
-     * Converts this date-time to the number of seconds from the epoch
-     * of 1970-01-01T00:00:00Z.
-     * <p>
-     * This combines this local date-time and the specified offset to calculate the
-     * epoch-second value, which is the number of elapsed seconds from 1970-01-01T00:00:00Z.
-     * Instants on the time-line after the epoch are positive, earlier are negative.
-     * <p>
-     * This default implementation calculates from the epoch-day of the date and the
-     * second-of-day of the time.
-     *
-     * @param offset  the offset to use for the conversion, not null
-     * @return the number of seconds from the epoch of 1970-01-01T00:00:00Z
-     */
-    public long toEpochSecond(ZoneOffset offset) {
-        Objects.requireNonNull(offset, "offset");
-        long epochDay = getDate().toEpochDay();
-        long secs = epochDay * 86400 + getTime().toSecondOfDay();
-        secs -= offset.getTotalSeconds();
-        return secs;
-    }
-
-    /**
-     * Returns a copy of this {@code LocalDateTime} with the specified period in days added.
-     * <p>
-     * This method adds the specified amount to the days field incrementing the
-     * month and year fields as necessary to ensure the result remains valid.
-     * The result is only invalid if the maximum/minimum year is exceeded.
-     * <p>
-     * For example, 2008-12-31 plus one day would result in 2009-01-01.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param days  the days to add, may be negative
-     * @return a {@code LocalDateTime} based on this date-time with the days added, not null
-     * @throws DateTimeException if the result exceeds the supported date range
-     */
-    public LocalDateTime plusDays(long days) {
-        LocalDate newDate = date.plusDays(days);
-        return with(newDate, time);
-    }
-
-    /**
-     * Returns a copy of this {@code LocalDateTime} with the specified period in seconds added.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param seconds  the seconds to add, may be negative
-     * @return a {@code LocalDateTime} based on this date-time with the seconds added, not null
-     * @throws DateTimeException if the result exceeds the supported date range
-     */
-    public LocalDateTime plusSeconds(long seconds) {
-        return plusWithOverflow(date, 0, 0, seconds, 1);
-    }
-
-    /**
-     * Returns a copy of this {@code LocalDateTime} with the specified period added.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param newDate  the new date to base the calculation on, not null
-     * @param hours  the hours to add, may be negative
-     * @param minutes the minutes to add, may be negative
-     * @param seconds the seconds to add, may be negative
-     * @param nanos the nanos to add, may be negative
-     * @param sign  the sign to determine add or subtract
-     * @return the combined result, not null
-     */
-    private LocalDateTime plusWithOverflow(LocalDate newDate, long hours, long minutes, long seconds, int sign) {
-        if ((hours | minutes | seconds) == 0) {
-            return with(newDate, time);
-        }
-        long totDays = seconds / SECONDS_PER_DAY +                //   max/24*60*60
-                       minutes / MINUTES_PER_DAY +                //   max/24*60
-                       hours / HOURS_PER_DAY;                     //   max/24
-        totDays *= sign;                                          // total max*0.4237...
-        long totSecs = (seconds % SECONDS_PER_DAY) +
-                       (minutes % MINUTES_PER_DAY) * SECONDS_PER_MINUTE +
-                       (hours % HOURS_PER_DAY) * SECONDS_PER_HOUR;
-        long curSoD = time.toSecondOfDay();
-        totSecs = totSecs * sign + curSoD;                    // total 432000000000000
-        totDays += floorDiv(totSecs, SECONDS_PER_DAY);
-
-        int newSoD = (int)floorMod(totSecs, SECONDS_PER_DAY);
-        LocalTime newTime = (newSoD == curSoD ? time : LocalTime.ofSecondOfDay(newSoD));
-        return with(newDate.plusDays(totDays), newTime);
-    }
-
-    /**
-     * Compares this date-time to another date-time.
-     * <p>
-     * The comparison is primarily based on the date-time, from earliest to latest.
-     * It is "consistent with equals", as defined by {@link Comparable}.
-     * <p>
-     * If all the date-times being compared are instances of {@code LocalDateTime},
-     * then the comparison will be entirely based on the date-time.
-     * If some dates being compared are in different chronologies, then the
-     * chronology is also considered, see {@link ChronoLocalDateTime#compareTo}.
-     *
-     * @param other  the other date-time to compare to, not null
-     * @return the comparator value, negative if less, positive if greater
-     */
-    public int compareTo(LocalDateTime other) {
-        int cmp = date.compareTo(other.getDate());
-        if (cmp == 0) {
-            cmp = time.compareTo(other.getTime());
-        }
-        return cmp;
-    }
-
-    /**
-     * Checks if this date-time is equal to another date-time.
-     * <p>
-     * Compares this {@code LocalDateTime} with another ensuring that the date-time is the same.
-     * Only objects of type {@code LocalDateTime} are compared, other types return false.
-     *
-     * @param obj  the object to check, null returns false
-     * @return true if this is equal to the other date-time
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof LocalDateTime) {
-            LocalDateTime other = (LocalDateTime) obj;
-            return date.equals(other.date) && time.equals(other.time);
-        }
-        return false;
-    }
-
-    /**
-     * A hash code for this date-time.
-     *
-     * @return a suitable hash code
-     */
-    @Override
-    public int hashCode() {
-        return date.hashCode() ^ time.hashCode();
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/LocalTime.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,388 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import static build.tools.tzdb.ChronoField.HOUR_OF_DAY;
-import static build.tools.tzdb.ChronoField.MINUTE_OF_HOUR;
-import static build.tools.tzdb.ChronoField.SECOND_OF_MINUTE;
-import static build.tools.tzdb.ChronoField.SECOND_OF_DAY;
-
-import java.util.Objects;
-
-/**
- * A time without time-zone in the ISO-8601 calendar system,
- * such as {@code 10:15:30}.
- *
- */
-final class LocalTime {
-
-    /**
-     * The minimum supported {@code LocalTime}, '00:00'.
-     * This is the time of midnight at the start of the day.
-     */
-    public static final LocalTime MIN;
-    /**
-     * The minimum supported {@code LocalTime}, '23:59:59.999999999'.
-     * This is the time just before midnight at the end of the day.
-     */
-    public static final LocalTime MAX;
-    /**
-     * The time of midnight at the start of the day, '00:00'.
-     */
-    public static final LocalTime MIDNIGHT;
-    /**
-     * The time of noon in the middle of the day, '12:00'.
-     */
-    public static final LocalTime NOON;
-    /**
-     * Constants for the local time of each hour.
-     */
-    private static final LocalTime[] HOURS = new LocalTime[24];
-    static {
-        for (int i = 0; i < HOURS.length; i++) {
-            HOURS[i] = new LocalTime(i, 0, 0);
-        }
-        MIDNIGHT = HOURS[0];
-        NOON = HOURS[12];
-        MIN = HOURS[0];
-        MAX = new LocalTime(23, 59, 59);
-    }
-
-    /**
-     * Hours per day.
-     */
-    static final int HOURS_PER_DAY = 24;
-    /**
-     * Minutes per hour.
-     */
-    static final int MINUTES_PER_HOUR = 60;
-    /**
-     * Minutes per day.
-     */
-    static final int MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY;
-    /**
-     * Seconds per minute.
-     */
-    static final int SECONDS_PER_MINUTE = 60;
-    /**
-     * Seconds per hour.
-     */
-    static final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
-    /**
-     * Seconds per day.
-     */
-    static final int SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;
-    /**
-     * Milliseconds per day.
-     */
-    static final long MILLIS_PER_DAY = SECONDS_PER_DAY * 1000L;
-    /**
-     * Microseconds per day.
-     */
-    static final long MICROS_PER_DAY = SECONDS_PER_DAY * 1000_000L;
-
-    /**
-     * The hour.
-     */
-    private final byte hour;
-    /**
-     * The minute.
-     */
-    private final byte minute;
-    /**
-     * The second.
-     */
-    private final byte second;
-
-    /**
-     * Obtains an instance of {@code LocalTime} from an hour and minute.
-     * <p>
-     * The second and nanosecond fields will be set to zero by this factory method.
-     * <p>
-     * This factory may return a cached value, but applications must not rely on this.
-     *
-     * @param hour  the hour-of-day to represent, from 0 to 23
-     * @param minute  the minute-of-hour to represent, from 0 to 59
-     * @return the local time, not null
-     * @throws DateTimeException if the value of any field is out of range
-     */
-    public static LocalTime of(int hour, int minute) {
-        HOUR_OF_DAY.checkValidValue(hour);
-        if (minute == 0) {
-            return HOURS[hour];  // for performance
-        }
-        MINUTE_OF_HOUR.checkValidValue(minute);
-        return new LocalTime(hour, minute, 0);
-    }
-
-    /**
-     * Obtains an instance of {@code LocalTime} from an hour, minute and second.
-     * <p>
-     * The nanosecond field will be set to zero by this factory method.
-     * <p>
-     * This factory may return a cached value, but applications must not rely on this.
-     *
-     * @param hour  the hour-of-day to represent, from 0 to 23
-     * @param minute  the minute-of-hour to represent, from 0 to 59
-     * @param second  the second-of-minute to represent, from 0 to 59
-     * @return the local time, not null
-     * @throws DateTimeException if the value of any field is out of range
-     */
-    public static LocalTime of(int hour, int minute, int second) {
-        HOUR_OF_DAY.checkValidValue(hour);
-        if ((minute | second) == 0) {
-            return HOURS[hour];  // for performance
-        }
-        MINUTE_OF_HOUR.checkValidValue(minute);
-        SECOND_OF_MINUTE.checkValidValue(second);
-        return new LocalTime(hour, minute, second);
-    }
-
-    /**
-     * Obtains an instance of {@code LocalTime} from a second-of-day value.
-     * <p>
-     * This factory may return a cached value, but applications must not rely on this.
-     *
-     * @param secondOfDay  the second-of-day, from {@code 0} to {@code 24 * 60 * 60 - 1}
-     * @return the local time, not null
-     * @throws DateTimeException if the second-of-day value is invalid
-     */
-    public static LocalTime ofSecondOfDay(int secondOfDay) {
-        SECOND_OF_DAY.checkValidValue(secondOfDay);
-        int hours = secondOfDay / SECONDS_PER_HOUR;
-        secondOfDay -= hours * SECONDS_PER_HOUR;
-        int minutes = secondOfDay / SECONDS_PER_MINUTE;
-        secondOfDay -= minutes * SECONDS_PER_MINUTE;
-        return create(hours, minutes, secondOfDay);
-    }
-
-
-    /**
-     * Creates a local time from the hour, minute, second and nanosecond fields.
-     * <p>
-     * This factory may return a cached value, but applications must not rely on this.
-     *
-     * @param hour  the hour-of-day to represent, validated from 0 to 23
-     * @param minute  the minute-of-hour to represent, validated from 0 to 59
-     * @param second  the second-of-minute to represent, validated from 0 to 59
-     * @return the local time, not null
-     */
-    private static LocalTime create(int hour, int minute, int second) {
-        if ((minute | second) == 0) {
-            return HOURS[hour];
-        }
-        return new LocalTime(hour, minute, second);
-    }
-
-    /**
-     * Constructor, previously validated.
-     *
-     * @param hour  the hour-of-day to represent, validated from 0 to 23
-     * @param minute  the minute-of-hour to represent, validated from 0 to 59
-     * @param second  the second-of-minute to represent, validated from 0 to 59
-     */
-    private LocalTime(int hour, int minute, int second) {
-        this.hour = (byte) hour;
-        this.minute = (byte) minute;
-        this.second = (byte) second;
-    }
-
-    /**
-     * Gets the hour-of-day field.
-     *
-     * @return the hour-of-day, from 0 to 23
-     */
-    public int getHour() {
-        return hour;
-    }
-
-    /**
-     * Gets the minute-of-hour field.
-     *
-     * @return the minute-of-hour, from 0 to 59
-     */
-    public int getMinute() {
-        return minute;
-    }
-
-    /**
-     * Gets the second-of-minute field.
-     *
-     * @return the second-of-minute, from 0 to 59
-     */
-    public int getSecond() {
-        return second;
-    }
-
-    /**
-     * Returns a copy of this {@code LocalTime} with the specified period in seconds added.
-     * <p>
-     * This adds the specified number of seconds to this time, returning a new time.
-     * The calculation wraps around midnight.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param secondstoAdd  the seconds to add, may be negative
-     * @return a {@code LocalTime} based on this time with the seconds added, not null
-     */
-    public LocalTime plusSeconds(long secondstoAdd) {
-        if (secondstoAdd == 0) {
-            return this;
-        }
-        int sofd = hour * SECONDS_PER_HOUR +
-                    minute * SECONDS_PER_MINUTE + second;
-        int newSofd = ((int) (secondstoAdd % SECONDS_PER_DAY) + sofd + SECONDS_PER_DAY) % SECONDS_PER_DAY;
-        if (sofd == newSofd) {
-            return this;
-        }
-        int newHour = newSofd / SECONDS_PER_HOUR;
-        int newMinute = (newSofd / SECONDS_PER_MINUTE) % MINUTES_PER_HOUR;
-        int newSecond = newSofd % SECONDS_PER_MINUTE;
-        return create(newHour, newMinute, newSecond);
-    }
-
-    /**
-     * Returns a copy of this {@code LocalTime} with the specified period in seconds subtracted.
-     * <p>
-     * This subtracts the specified number of seconds from this time, returning a new time.
-     * The calculation wraps around midnight.
-     * <p>
-     * This instance is immutable and unaffected by this method call.
-     *
-     * @param secondsToSubtract  the seconds to subtract, may be negative
-     * @return a {@code LocalTime} based on this time with the seconds subtracted, not null
-     */
-    public LocalTime minusSeconds(long secondsToSubtract) {
-        return plusSeconds(-(secondsToSubtract % SECONDS_PER_DAY));
-    }
-
-    /**
-     * Extracts the time as seconds of day,
-     * from {@code 0} to {@code 24 * 60 * 60 - 1}.
-     *
-     * @return the second-of-day equivalent to this time
-     */
-    public int toSecondOfDay() {
-        int total = hour * SECONDS_PER_HOUR;
-        total += minute * SECONDS_PER_MINUTE;
-        total += second;
-        return total;
-    }
-
-     /**
-     * Compares this {@code LocalTime} to another time.
-     * <p>
-     * The comparison is based on the time-line position of the local times within a day.
-     * It is "consistent with equals", as defined by {@link Comparable}.
-     *
-     * @param other  the other time to compare to, not null
-     * @return the comparator value, negative if less, positive if greater
-     * @throws NullPointerException if {@code other} is null
-     */
-    public int compareTo(LocalTime other) {
-        int cmp = Integer.compare(hour, other.hour);
-        if (cmp == 0) {
-            cmp = Integer.compare(minute, other.minute);
-            if (cmp == 0) {
-                cmp = Integer.compare(second, other.second);
-             }
-        }
-        return cmp;
-    }
-
-    /**
-     * Checks if this time is equal to another time.
-     * <p>
-     * The comparison is based on the time-line position of the time within a day.
-     * <p>
-     * Only objects of type {@code LocalTime} are compared, other types return false.
-     * To compare the date of two {@code TemporalAccessor} instances, use
-     * {@link ChronoField#NANO_OF_DAY} as a comparator.
-     *
-     * @param obj  the object to check, null returns false
-     * @return true if this is equal to the other time
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof LocalTime) {
-            LocalTime other = (LocalTime) obj;
-            return hour == other.hour && minute == other.minute &&
-                    second == other.second;
-        }
-        return false;
-    }
-
-    /**
-     * A hash code for this time.
-     *
-     * @return a suitable hash code
-     */
-    @Override
-    public int hashCode() {
-        long sod = toSecondOfDay();
-        return (int) (sod ^ (sod >>> 32));
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/TimeDefinition.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import java.util.Objects;
-
-/**
- * A definition of the way a local time can be converted to the actual
- * transition date-time.
- * <p>
- * Time zone rules are expressed in one of three ways:
- * <p><ul>
- * <li>Relative to UTC</li>
- * <li>Relative to the standard offset in force</li>
- * <li>Relative to the wall offset (what you would see on a clock on the wall)</li>
- * </ul><p>
- */
-public enum TimeDefinition {
-    /** The local date-time is expressed in terms of the UTC offset. */
-    UTC,
-    /** The local date-time is expressed in terms of the wall offset. */
-    WALL,
-    /** The local date-time is expressed in terms of the standard offset. */
-    STANDARD;
-
-    /**
-     * Converts the specified local date-time to the local date-time actually
-     * seen on a wall clock.
-     * <p>
-     * This method converts using the type of this enum.
-     * The output is defined relative to the 'before' offset of the transition.
-     * <p>
-     * The UTC type uses the UTC offset.
-     * The STANDARD type uses the standard offset.
-     * The WALL type returns the input date-time.
-     * The result is intended for use with the wall-offset.
-     *
-     * @param dateTime  the local date-time, not null
-     * @param standardOffset  the standard offset, not null
-     * @param wallOffset  the wall offset, not null
-     * @return the date-time relative to the wall/before offset, not null
-     */
-    public LocalDateTime createDateTime(LocalDateTime dateTime, ZoneOffset standardOffset, ZoneOffset wallOffset) {
-        switch (this) {
-            case UTC: {
-                int difference = wallOffset.getTotalSeconds() - ZoneOffset.UTC.getTotalSeconds();
-                return dateTime.plusSeconds(difference);
-            }
-            case STANDARD: {
-                int difference = wallOffset.getTotalSeconds() - standardOffset.getTotalSeconds();
-                return dateTime.plusSeconds(difference);
-            }
-            default:  // WALL
-                return dateTime;
-        }
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,8 +56,6 @@
  */
 package build.tools.tzdb;
 
-import static build.tools.tzdb.Utils.*;
-
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
 import java.nio.charset.StandardCharsets;
@@ -179,15 +177,41 @@
                 System.exit(1);
                 System.err.println("Source directory does not contain file: VERSION");
             }
+
+            // load source files
             printVerbose("Compiling TZDB version " + version);
-            // parse source files
-            for (Path file : srcFiles) {
-                printVerbose("Parsing file: " + file);
-                parseFile(file);
-            }
+            TzdbZoneRulesProvider provider = new TzdbZoneRulesProvider(srcFiles);
+
             // build zone rules
             printVerbose("Building rules");
-            buildZoneRules();
+
+            // Build the rules, zones and links into real zones.
+            SortedMap<String, ZoneRules> builtZones = new TreeMap<>();
+
+            // build zones
+            for (String zoneId : provider.getZoneIds()) {
+                printVerbose("Building zone " + zoneId);
+                builtZones.put(zoneId, provider.getZoneRules(zoneId));
+            }
+
+            // build aliases
+            Map<String, String> links = provider.getAliasMap();
+            for (String aliasId : links.keySet()) {
+                String realId = links.get(aliasId);
+                printVerbose("Linking alias " + aliasId + " to " + realId);
+                ZoneRules realRules = builtZones.get(realId);
+                if (realRules == null) {
+                    realId = links.get(realId);  // try again (handle alias liked to alias)
+                    printVerbose("Relinking alias " + aliasId + " to " + realId);
+                    realRules = builtZones.get(realId);
+                    if (realRules == null) {
+                        throw new IllegalArgumentException("Alias '" + aliasId + "' links to invalid zone '" + realId);
+                    }
+                    links.put(aliasId, realId);
+                }
+                builtZones.put(aliasId, realRules);
+            }
+
             // output to file
             printVerbose("Outputting tzdb file: " + dstFile);
             outputFile(dstFile, version, builtZones, links);
@@ -269,361 +293,13 @@
         }
     }
 
-    private static final Pattern YEAR = Pattern.compile("(?i)(?<min>min)|(?<max>max)|(?<only>only)|(?<year>[0-9]+)");
-    private static final Pattern MONTH = Pattern.compile("(?i)(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec)");
-    private static final Matcher DOW = Pattern.compile("(?i)(mon)|(tue)|(wed)|(thu)|(fri)|(sat)|(sun)").matcher("");
-    private static final Matcher TIME = Pattern.compile("(?<neg>-)?+(?<hour>[0-9]{1,2})(:(?<minute>[0-5][0-9]))?+(:(?<second>[0-5][0-9]))?+").matcher("");
-
-    /** The TZDB rules. */
-    private final Map<String, List<TZDBRule>> rules = new HashMap<>();
-
-    /** The TZDB zones. */
-    private final Map<String, List<TZDBZone>> zones = new HashMap<>();
-
-    /** The TZDB links. */
-    private final Map<String, String> links = new HashMap<>();
-
-    /** The built zones. */
-    private final SortedMap<String, ZoneRules> builtZones = new TreeMap<>();
-
     /** Whether to output verbose messages. */
     private boolean verbose;
 
     /**
      * private contructor
      */
-    private TzdbZoneRulesCompiler() {
-    }
-
-    /**
-     * Parses a source file.
-     *
-     * @param file  the file being read, not null
-     * @throws Exception if an error occurs
-     */
-    private void parseFile(Path file) throws Exception {
-        int lineNumber = 1;
-        String line = null;
-        try {
-            List<String> lines = Files.readAllLines(file, StandardCharsets.ISO_8859_1);
-            List<TZDBZone> openZone = null;
-            for (; lineNumber < lines.size(); lineNumber++) {
-                line = lines.get(lineNumber);
-                int index = line.indexOf('#');  // remove comments (doesn't handle # in quotes)
-                if (index >= 0) {
-                    line = line.substring(0, index);
-                }
-                if (line.trim().length() == 0) {  // ignore blank lines
-                    continue;
-                }
-                Scanner s = new Scanner(line);
-                if (openZone != null && Character.isWhitespace(line.charAt(0)) && s.hasNext()) {
-                    if (parseZoneLine(s, openZone)) {
-                        openZone = null;
-                    }
-                } else {
-                    if (s.hasNext()) {
-                        String first = s.next();
-                        if (first.equals("Zone")) {
-                            openZone = new ArrayList<>();
-                            try {
-                                zones.put(s.next(), openZone);
-                                if (parseZoneLine(s, openZone)) {
-                                    openZone = null;
-                                }
-                            } catch (NoSuchElementException x) {
-                                printVerbose("Invalid Zone line in file: " + file + ", line: " + line);
-                                throw new IllegalArgumentException("Invalid Zone line");
-                            }
-                        } else {
-                            openZone = null;
-                            if (first.equals("Rule")) {
-                                try {
-                                    parseRuleLine(s);
-                                } catch (NoSuchElementException x) {
-                                    printVerbose("Invalid Rule line in file: " + file + ", line: " + line);
-                                    throw new IllegalArgumentException("Invalid Rule line");
-                                }
-                            } else if (first.equals("Link")) {
-                                try {
-                                    String realId = s.next();
-                                    String aliasId = s.next();
-                                    links.put(aliasId, realId);
-                                } catch (NoSuchElementException x) {
-                                    printVerbose("Invalid Link line in file: " + file + ", line: " + line);
-                                    throw new IllegalArgumentException("Invalid Link line");
-                                }
-
-                            } else {
-                                throw new IllegalArgumentException("Unknown line");
-                            }
-                        }
-                    }
-                }
-            }
-        } catch (Exception ex) {
-            throw new Exception("Failed while parsing file '" + file + "' on line " + lineNumber + " '" + line + "'", ex);
-        }
-    }
-
-    /**
-     * Parses a Rule line.
-     *
-     * @param s  the line scanner, not null
-     */
-    private void parseRuleLine(Scanner s) {
-        TZDBRule rule = new TZDBRule();
-        String name = s.next();
-        if (rules.containsKey(name) == false) {
-            rules.put(name, new ArrayList<TZDBRule>());
-        }
-        rules.get(name).add(rule);
-        rule.startYear = parseYear(s, 0);
-        rule.endYear = parseYear(s, rule.startYear);
-        if (rule.startYear > rule.endYear) {
-            throw new IllegalArgumentException("Year order invalid: " + rule.startYear + " > " + rule.endYear);
-        }
-        parseOptional(s.next());  // type is unused
-        parseMonthDayTime(s, rule);
-        rule.savingsAmount = parsePeriod(s.next());
-        rule.text = parseOptional(s.next());
-    }
-
-    /**
-     * Parses a Zone line.
-     *
-     * @param s  the line scanner, not null
-     * @return true if the zone is complete
-     */
-    private boolean parseZoneLine(Scanner s, List<TZDBZone> zoneList) {
-        TZDBZone zone = new TZDBZone();
-        zoneList.add(zone);
-        zone.standardOffset = parseOffset(s.next());
-        String savingsRule = parseOptional(s.next());
-        if (savingsRule == null) {
-            zone.fixedSavingsSecs = 0;
-            zone.savingsRule = null;
-        } else {
-            try {
-                zone.fixedSavingsSecs = parsePeriod(savingsRule);
-                zone.savingsRule = null;
-            } catch (Exception ex) {
-                zone.fixedSavingsSecs = null;
-                zone.savingsRule = savingsRule;
-            }
-        }
-        zone.text = s.next();
-        if (s.hasNext()) {
-            zone.year = Integer.parseInt(s.next());
-            if (s.hasNext()) {
-                parseMonthDayTime(s, zone);
-            }
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    /**
-     * Parses a Rule line.
-     *
-     * @param s  the line scanner, not null
-     * @param mdt  the object to parse into, not null
-     */
-    private void parseMonthDayTime(Scanner s, TZDBMonthDayTime mdt) {
-        mdt.month = parseMonth(s);
-        if (s.hasNext()) {
-            String dayRule = s.next();
-            if (dayRule.startsWith("last")) {
-                mdt.dayOfMonth = -1;
-                mdt.dayOfWeek = parseDayOfWeek(dayRule.substring(4));
-                mdt.adjustForwards = false;
-            } else {
-                int index = dayRule.indexOf(">=");
-                if (index > 0) {
-                    mdt.dayOfWeek = parseDayOfWeek(dayRule.substring(0, index));
-                    dayRule = dayRule.substring(index + 2);
-                } else {
-                    index = dayRule.indexOf("<=");
-                    if (index > 0) {
-                        mdt.dayOfWeek = parseDayOfWeek(dayRule.substring(0, index));
-                        mdt.adjustForwards = false;
-                        dayRule = dayRule.substring(index + 2);
-                    }
-                }
-                mdt.dayOfMonth = Integer.parseInt(dayRule);
-            }
-            if (s.hasNext()) {
-                String timeStr = s.next();
-                int secsOfDay = parseSecs(timeStr);
-                if (secsOfDay == 86400) {
-                    mdt.endOfDay = true;
-                    secsOfDay = 0;
-                }
-                LocalTime time = LocalTime.ofSecondOfDay(secsOfDay);
-                mdt.time = time;
-                mdt.timeDefinition = parseTimeDefinition(timeStr.charAt(timeStr.length() - 1));
-            }
-        }
-    }
-
-    private int parseYear(Scanner s, int defaultYear) {
-        if (s.hasNext(YEAR)) {
-            s.next(YEAR);
-            MatchResult mr = s.match();
-            if (mr.group(1) != null) {
-                return 1900;  // systemv has min
-            } else if (mr.group(2) != null) {
-                return YEAR_MAX_VALUE;
-            } else if (mr.group(3) != null) {
-                return defaultYear;
-            }
-            return Integer.parseInt(mr.group(4));
-            /*
-            if (mr.group("min") != null) {
-                //return YEAR_MIN_VALUE;
-                return 1900;  // systemv has min
-            } else if (mr.group("max") != null) {
-                return YEAR_MAX_VALUE;
-            } else if (mr.group("only") != null) {
-                return defaultYear;
-            }
-            return Integer.parseInt(mr.group("year"));
-            */
-        }
-        throw new IllegalArgumentException("Unknown year: " + s.next());
-    }
-
-    private int parseMonth(Scanner s) {
-        if (s.hasNext(MONTH)) {
-            s.next(MONTH);
-            for (int moy = 1; moy < 13; moy++) {
-                if (s.match().group(moy) != null) {
-                    return moy;
-                }
-            }
-        }
-        throw new IllegalArgumentException("Unknown month: " + s.next());
-    }
-
-    private int parseDayOfWeek(String str) {
-        if (DOW.reset(str).matches()) {
-            for (int dow = 1; dow < 8; dow++) {
-                if (DOW.group(dow) != null) {
-                    return dow;
-                }
-            }
-        }
-        throw new IllegalArgumentException("Unknown day-of-week: " + str);
-    }
-
-    private String parseOptional(String str) {
-        return str.equals("-") ? null : str;
-    }
-
-    private int parseSecs(String str) {
-        if (str.equals("-")) {
-            return 0;
-        }
-        try {
-            if (TIME.reset(str).find()) {
-                int secs = Integer.parseInt(TIME.group("hour")) * 60 * 60;
-                if (TIME.group("minute") != null) {
-                    secs += Integer.parseInt(TIME.group("minute")) * 60;
-                }
-                if (TIME.group("second") != null) {
-                    secs += Integer.parseInt(TIME.group("second"));
-                }
-                if (TIME.group("neg") != null) {
-                    secs = -secs;
-                }
-                return secs;
-            }
-        } catch (NumberFormatException x) {}
-        throw new IllegalArgumentException(str);
-    }
-
-    private ZoneOffset parseOffset(String str) {
-        int secs = parseSecs(str);
-        return ZoneOffset.ofTotalSeconds(secs);
-    }
-
-    private int parsePeriod(String str) {
-        return parseSecs(str);
-    }
-
-    private TimeDefinition parseTimeDefinition(char c) {
-        switch (c) {
-            case 's':
-            case 'S':
-                // standard time
-                return TimeDefinition.STANDARD;
-            case 'u':
-            case 'U':
-            case 'g':
-            case 'G':
-            case 'z':
-            case 'Z':
-                // UTC
-                return TimeDefinition.UTC;
-            case 'w':
-            case 'W':
-            default:
-                // wall time
-                return TimeDefinition.WALL;
-        }
-    }
-
-    /**
-     * Build the rules, zones and links into real zones.
-     *
-     * @throws Exception if an error occurs
-     */
-    private void buildZoneRules() throws Exception {
-        // build zones
-        for (String zoneId : zones.keySet()) {
-            printVerbose("Building zone " + zoneId);
-            List<TZDBZone> tzdbZones = zones.get(zoneId);
-            ZoneRulesBuilder bld = new ZoneRulesBuilder();
-            for (TZDBZone tzdbZone : tzdbZones) {
-                bld = tzdbZone.addToBuilder(bld, rules);
-            }
-            builtZones.put(zoneId, bld.toRules(zoneId));
-        }
-
-        // build aliases
-        for (String aliasId : links.keySet()) {
-            String realId = links.get(aliasId);
-            printVerbose("Linking alias " + aliasId + " to " + realId);
-            ZoneRules realRules = builtZones.get(realId);
-            if (realRules == null) {
-                realId = links.get(realId);  // try again (handle alias liked to alias)
-                printVerbose("Relinking alias " + aliasId + " to " + realId);
-                realRules = builtZones.get(realId);
-                if (realRules == null) {
-                    throw new IllegalArgumentException("Alias '" + aliasId + "' links to invalid zone '" + realId);
-                }
-                links.put(aliasId, realId);
-            }
-            builtZones.put(aliasId, realRules);
-        }
-        // remove UTC and GMT
-        // 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");
-        // remove ROC, which is not supported in j.u.tz
-        builtZones.remove("ROC");
-        links.remove("ROC");
-        // remove EST, HST and MST. They are supported via
-        // the short-id mapping
-        builtZones.remove("EST");
-        builtZones.remove("HST");
-        builtZones.remove("MST");
-    }
+    private TzdbZoneRulesCompiler() {}
 
     /**
      * Prints a verbose message.
@@ -635,109 +311,4 @@
             System.out.println(message);
         }
     }
-
-    /**
-     * Class representing a month-day-time in the TZDB file.
-     */
-    abstract class TZDBMonthDayTime {
-        /** The month of the cutover. */
-        int month = 1;
-        /** The day-of-month of the cutover. */
-        int dayOfMonth = 1;
-        /** Whether to adjust forwards. */
-        boolean adjustForwards = true;
-        /** The day-of-week of the cutover. */
-        int dayOfWeek = -1;
-        /** The time of the cutover. */
-        LocalTime time = LocalTime.MIDNIGHT;
-        /** Whether this is midnight end of day. */
-        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);
-                dayOfMonth = adjustedDate.getDayOfMonth();
-                month = adjustedDate.getMonth();
-                adjustForwards = true;
-            }
-        }
-    }
-
-    /**
-     * Class representing a rule line in the TZDB file.
-     */
-    final class TZDBRule extends TZDBMonthDayTime {
-        /** The start year. */
-        int startYear;
-        /** The end year. */
-        int endYear;
-        /** The amount of savings. */
-        int savingsAmount;
-        /** The text name of the zone. */
-        String text;
-
-        void addToBuilder(ZoneRulesBuilder bld) {
-            adjustToFowards(2004);  // irrelevant, treat as leap year
-            bld.addRuleToWindow(startYear, endYear, month, dayOfMonth, dayOfWeek, time, endOfDay, timeDefinition, savingsAmount);
-        }
-    }
-
-    /**
-     * Class representing a linked set of zone lines in the TZDB file.
-     */
-    final class TZDBZone extends TZDBMonthDayTime {
-        /** The standard offset. */
-        ZoneOffset standardOffset;
-        /** The fixed savings amount. */
-        Integer fixedSavingsSecs;
-        /** The savings rule. */
-        String savingsRule;
-        /** The text name of the zone. */
-        String text;
-        /** The year of the cutover. */
-        int year = YEAR_MAX_VALUE;
-
-        ZoneRulesBuilder addToBuilder(ZoneRulesBuilder bld, Map<String, List<TZDBRule>> rules) {
-            if (year != YEAR_MAX_VALUE) {
-                bld.addWindow(standardOffset, toDateTime(year), timeDefinition);
-            } else {
-                bld.addWindowForever(standardOffset);
-            }
-            if (fixedSavingsSecs != null) {
-                bld.setFixedSavingsToWindow(fixedSavingsSecs);
-            } else {
-                List<TZDBRule> tzdbRules = rules.get(savingsRule);
-                if (tzdbRules == null) {
-                    throw new IllegalArgumentException("Rule not found: " + savingsRule);
-                }
-                for (TZDBRule tzdbRule : tzdbRules) {
-                    tzdbRule.addToBuilder(bld);
-                }
-            }
-            return bld;
-        }
-
-        private LocalDateTime toDateTime(int year) {
-            adjustToFowards(year);
-            LocalDate date;
-            if (dayOfMonth == -1) {
-                dayOfMonth = lengthOfMonth(month, isLeapYear(year));
-                date = LocalDate.of(year, month, dayOfMonth);
-                if (dayOfWeek != -1) {
-                    date = previousOrSame(date, dayOfWeek);
-                }
-            } else {
-                date = LocalDate.of(year, month, dayOfMonth);
-                if (dayOfWeek != -1) {
-                    date = nextOrSame(date, dayOfWeek);
-                }
-            }
-            LocalDateTime ldt = LocalDateTime.of(date, time);
-            if (endOfDay) {
-                ldt = ldt.plusDays(1);
-            }
-            return ldt;
-        }
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,843 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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 build.tools.tzdb;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.NavigableMap;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.time.*;
+import java.time.Year;
+import java.time.chrono.IsoChronology;
+import java.time.temporal.TemporalAdjusters;
+import java.time.zone.ZoneOffsetTransition;
+import java.time.zone.ZoneOffsetTransitionRule;
+import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition;
+import java.time.zone.ZoneRulesException;
+
+/**
+ * Compile and build time-zone rules from IANA timezone data
+ *
+ * @author Xueming Shen
+ * @author Stephen Colebourne
+ * @author Michael Nascimento Santos
+ *
+ * @since   1.9
+ */
+
+class TzdbZoneRulesProvider {
+
+    /**
+     * Creates an instance.
+     *
+     * @throws ZoneRulesException if unable to load
+     */
+    public TzdbZoneRulesProvider(List<Path> files) {
+        try {
+             load(files);
+        } catch (Exception ex) {
+            throw new ZoneRulesException("Unable to load TZDB time-zone rules", ex);
+        }
+    }
+
+    public Set<String> getZoneIds() {
+        return new TreeSet(regionIds);
+    }
+
+    public Map<String, String> getAliasMap() {
+        return links;
+    }
+
+    public ZoneRules getZoneRules(String zoneId) {
+        Object obj = zones.get(zoneId);
+        if (obj == null) {
+            String zoneId0 = zoneId;
+            if (links.containsKey(zoneId)) {
+                zoneId = links.get(zoneId);
+                obj = zones.get(zoneId);
+            }
+            if (obj == null) {
+                throw new ZoneRulesException("Unknown time-zone ID: " + zoneId0);
+            }
+        }
+        if (obj instanceof ZoneRules) {
+            return (ZoneRules)obj;
+        }
+        try {
+            ZoneRules zrules = buildRules(zoneId, (List<ZoneLine>)obj);
+            zones.put(zoneId, zrules);
+            return zrules;
+        } catch (Exception ex) {
+            throw new ZoneRulesException(
+                "Invalid binary time-zone data: TZDB:" + zoneId, ex);
+        }
+    }
+
+    //////////////////////////////////////////////////////////////////////
+
+    /**
+     * All the regions that are available.
+     */
+    private List<String> regionIds = new ArrayList<>(600);
+
+    /**
+     * Zone region to rules mapping
+     */
+    private final Map<String, Object> zones = new ConcurrentHashMap<>();
+
+    /**
+     * compatibility list
+     */
+    private static HashSet<String> excludedZones;
+    static {
+        // (1) exclude EST, HST and MST. They are supported
+        //     via the short-id mapping
+        // (2) remove UTC and GMT
+        // (3) remove ROC, which is not supported in j.u.tz
+        excludedZones = new HashSet<>(10);
+        excludedZones.add("EST");
+        excludedZones.add("HST");
+        excludedZones.add("MST");
+        excludedZones.add("GMT+0");
+        excludedZones.add("GMT-0");
+        excludedZones.add("ROC");
+    }
+
+    private Map<String, String> links = new HashMap<>(150);
+    private Map<String, List<RuleLine>> rules = new HashMap<>(500);
+
+    private void load(List<Path> files) throws IOException {
+
+        for (Path file : files) {
+            List<ZoneLine> openZone = null;
+            try {
+                for (String line : Files.readAllLines(file, StandardCharsets.ISO_8859_1)) {
+                    if (line.length() == 0 || line.charAt(0) == '#') {
+                        continue;
+                    }
+                    //StringIterator itr = new StringIterator(line);
+                    String[] tokens = split(line);
+                    if (openZone != null &&               // continuing zone line
+                        Character.isWhitespace(line.charAt(0)) &&
+                        tokens.length > 0) {
+                        ZoneLine zLine = new ZoneLine();
+                        openZone.add(zLine);
+                        if (zLine.parse(tokens, 0)) {
+                            openZone = null;
+                        }
+                        continue;
+                    }
+                    if (line.startsWith("Zone")) {        // parse Zone line
+                        String name = tokens[1];
+                        if (excludedZones.contains(name)){
+                            continue;
+                        }
+                        if (zones.containsKey(name)) {
+                            throw new IllegalArgumentException(
+                                "Duplicated zone name in file: " + name +
+                                ", line: [" + line + "]");
+                        }
+                        openZone = new ArrayList<>(10);
+                        zones.put(name, openZone);
+                        regionIds.add(name);
+                        ZoneLine zLine = new ZoneLine();
+                        openZone.add(zLine);
+                        if (zLine.parse(tokens, 2)) {
+                            openZone = null;
+                        }
+                    } else if (line.startsWith("Rule")) { // parse Rule line
+                        String name = tokens[1];
+                        if (!rules.containsKey(name)) {
+                            rules.put(name, new ArrayList<RuleLine>(10));
+                        }
+                        rules.get(name).add(new RuleLine().parse(tokens));
+                    } else if (line.startsWith("Link")) { // parse link line
+                        if (tokens.length >= 3) {
+                            String realId = tokens[1];
+                            String aliasId = tokens[2];
+                            if (excludedZones.contains(aliasId)){
+                                continue;
+                            }
+                            links.put(aliasId, realId);
+                            regionIds.add(aliasId);
+                        } else {
+                            throw new IllegalArgumentException(
+                                "Invalid Link line in file" +
+                                file + ", line: [" + line + "]");
+                        }
+                    } else {
+                        // skip unknown line
+                    }
+                }
+
+            } catch (Exception ex) {
+                throw new RuntimeException("Failed while processing file [" + file +
+                                           "]", ex);
+            }
+        }
+    }
+
+    private String[] split(String str) {
+        int off = 0;
+        int end = str.length();
+        ArrayList<String> list = new ArrayList<>(10);
+        while (off < end) {
+            char c = str.charAt(off);
+            if (c == '\t' || c == ' ') {
+                off++;
+                continue;
+            }
+            if (c == '#') {    // comment
+                break;
+            }
+            int start = off;
+            while (off < end) {
+                c = str.charAt(off);
+                if (c == ' ' || c == '\t') {
+                    break;
+                }
+                off++;
+            }
+            if (start != off) {
+                list.add(str.substring(start, off));
+            }
+        }
+        return list.toArray(new String[list.size()]);
+    }
+
+    /**
+     * Class representing a month-day-time in the TZDB file.
+     */
+    private static abstract class MonthDayTime {
+        /** The month of the cutover. */
+        Month month = Month.JANUARY;
+
+        /** The day-of-month of the cutover. */
+        int dayOfMonth = 1;
+
+        /** Whether to adjust forwards. */
+        boolean adjustForwards = true;
+
+        /** The day-of-week of the cutover. */
+        DayOfWeek dayOfWeek;
+
+        /** The time of the cutover, in second of day */
+        int secsOfDay = 0;
+
+        /** Whether this is midnight end of day. */
+        boolean endOfDay;
+        /** The time of the cutover. */
+
+        TimeDefinition timeDefinition = TimeDefinition.WALL;
+
+        void adjustToForwards(int year) {
+            if (adjustForwards == false && dayOfMonth > 0) {
+                // weekDay<=monthDay case, don't have it in tzdb data for now
+                LocalDate adjustedDate = LocalDate.of(year, month, dayOfMonth).minusDays(6);
+                dayOfMonth = adjustedDate.getDayOfMonth();
+                month = adjustedDate.getMonth();
+                adjustForwards = true;
+            }
+        }
+
+        LocalDateTime toDateTime(int year) {
+            LocalDate date;
+            if (dayOfMonth < 0) {
+                int monthLen = month.length(IsoChronology.INSTANCE.isLeapYear(year));
+                date = LocalDate.of(year, month, monthLen + 1 + dayOfMonth);
+                if (dayOfWeek != null) {
+                    date = date.with(TemporalAdjusters.previousOrSame(dayOfWeek));
+                }
+            } else {
+                date = LocalDate.of(year, month, dayOfMonth);
+                if (dayOfWeek != null) {
+                    date = date.with(TemporalAdjusters.nextOrSame(dayOfWeek));
+                }
+            }
+            if (endOfDay) {
+                date = date.plusDays(1);
+            }
+            return LocalDateTime.of(date, LocalTime.ofSecondOfDay(secsOfDay));
+        }
+
+        /**
+         * Parses the MonthDaytime segment of a tzdb line.
+         */
+        private void parse(String[] tokens, int off) {
+            month = parseMonth(tokens[off++]);
+            if (off < tokens.length) {
+                String dayRule = tokens[off++];
+                if (dayRule.startsWith("last")) {
+                    dayOfMonth = -1;
+                    dayOfWeek = parseDayOfWeek(dayRule.substring(4));
+                    adjustForwards = false;
+                } else {
+                    int index = dayRule.indexOf(">=");
+                    if (index > 0) {
+                        dayOfWeek = parseDayOfWeek(dayRule.substring(0, index));
+                        dayRule = dayRule.substring(index + 2);
+                    } else {
+                        index = dayRule.indexOf("<=");
+                        if (index > 0) {
+                            dayOfWeek = parseDayOfWeek(dayRule.substring(0, index));
+                            adjustForwards = false;
+                            dayRule = dayRule.substring(index + 2);
+                        }
+                    }
+                    dayOfMonth = Integer.parseInt(dayRule);
+                    if (dayOfMonth < -28 || dayOfMonth > 31 || dayOfMonth == 0) {
+                       throw new IllegalArgumentException(
+                          "Day of month indicator must be between -28 and 31 inclusive excluding zero");
+                    }
+                }
+                if (off < tokens.length) {
+                    String timeStr = tokens[off++];
+                    secsOfDay = parseSecs(timeStr);
+                    if (secsOfDay == 86400) {
+                        // time must be midnight when end of day flag is true
+                        endOfDay = true;
+                        secsOfDay = 0;
+                    }
+                    timeDefinition = parseTimeDefinition(timeStr.charAt(timeStr.length() - 1));
+                }
+            }
+        }
+
+        int parseYear(String year, int defaultYear) {
+            switch (year.toLowerCase()) {
+            case "min":  return 1900;
+            case "max":  return Year.MAX_VALUE;
+            case "only": return defaultYear;
+            }
+            return Integer.parseInt(year);
+        }
+
+        Month parseMonth(String mon) {
+            switch (mon) {
+            case "Jan": return Month.JANUARY;
+            case "Feb": return Month.FEBRUARY;
+            case "Mar": return Month.MARCH;
+            case "Apr": return Month.APRIL;
+            case "May": return Month.MAY;
+            case "Jun": return Month.JUNE;
+            case "Jul": return Month.JULY;
+            case "Aug": return Month.AUGUST;
+            case "Sep": return Month.SEPTEMBER;
+            case "Oct": return Month.OCTOBER;
+            case "Nov": return Month.NOVEMBER;
+            case "Dec": return Month.DECEMBER;
+            }
+            throw new IllegalArgumentException("Unknown month: " + mon);
+        }
+
+        DayOfWeek parseDayOfWeek(String dow) {
+            switch (dow) {
+            case "Mon": return DayOfWeek.MONDAY;
+            case "Tue": return DayOfWeek.TUESDAY;
+            case "Wed": return DayOfWeek.WEDNESDAY;
+            case "Thu": return DayOfWeek.THURSDAY;
+            case "Fri": return DayOfWeek.FRIDAY;
+            case "Sat": return DayOfWeek.SATURDAY;
+            case "Sun": return DayOfWeek.SUNDAY;
+            }
+            throw new IllegalArgumentException("Unknown day-of-week: " + dow);
+        }
+
+        String parseOptional(String str) {
+            return str.equals("-") ? null : str;
+        }
+
+        static final boolean isDigit(char c) {
+            return c >= '0' && c <= '9';
+        }
+
+        private int parseSecs(String time) {
+            if (time.equals("-")) {
+                return 0;
+            }
+            // faster hack
+            int secs = 0;
+            int sign = 1;
+            int off = 0;
+            int len = time.length();
+            if (off < len && time.charAt(off) == '-') {
+                sign = -1;
+                off++;
+            }
+            char c0, c1;
+            if (off < len && isDigit(c0 = time.charAt(off++))) {
+                int hour = c0 - '0';
+                if (off < len && isDigit(c1 = time.charAt(off))) {
+                    hour = hour * 10 + c1 - '0';
+                    off++;
+                }
+                secs = hour * 60 * 60;
+                if (off < len && time.charAt(off++) == ':') {
+                    if (off + 1 < len &&
+                        isDigit(c0 = time.charAt(off++)) &&
+                        isDigit(c1 = time.charAt(off++))) {
+                        // minutes
+                        secs += ((c0 - '0') * 10 + c1 - '0') * 60;
+                        if (off < len && time.charAt(off++) == ':') {
+                            if (off + 1 < len &&
+                                isDigit(c0 = time.charAt(off++)) &&
+                                isDigit(c1 = time.charAt(off++))) {
+                                // seconds
+                                secs += ((c0 - '0') * 10 + c1 - '0');
+                            }
+                        }
+                    }
+
+                }
+                return secs * sign;
+            }
+            throw new IllegalArgumentException("[" + time + "]");
+        }
+
+        int parseOffset(String str) {
+            int secs = parseSecs(str);
+            if (Math.abs(secs) > 18 * 60 * 60) {
+                throw new IllegalArgumentException(
+                    "Zone offset not in valid range: -18:00 to +18:00");
+            }
+            return secs;
+        }
+
+        int parsePeriod(String str) {
+            return parseSecs(str);
+        }
+
+        TimeDefinition parseTimeDefinition(char c) {
+            switch (c) {
+            case 's':
+            case 'S':
+                // standard time
+                return TimeDefinition.STANDARD;
+            case 'u':
+            case 'U':
+            case 'g':
+            case 'G':
+            case 'z':
+            case 'Z':
+                // UTC
+                return TimeDefinition.UTC;
+            case 'w':
+            case 'W':
+            default:
+                // wall time
+                return TimeDefinition.WALL;
+            }
+        }
+    }
+
+    /**
+     * Class representing a rule line in the TZDB file.
+     */
+    private static class RuleLine extends MonthDayTime {
+        /** The start year. */
+        int startYear;
+
+        /** The end year. */
+        int endYear;
+
+        /** The amount of savings, in seconds. */
+        int savingsAmount;
+
+        /** The text name of the zone. */
+        String text;
+
+        /**
+         * Converts this to a transition rule.
+         *
+         * @param standardOffset  the active standard offset, not null
+         * @param savingsBeforeSecs  the active savings before the transition in seconds
+         * @return the transition, not null
+        */
+        ZoneOffsetTransitionRule toTransitionRule(ZoneOffset stdOffset, int savingsBefore) {
+            // rule shared by different zones, so don't change it
+            Month month = this.month;
+            int dayOfMonth = this.dayOfMonth;
+            DayOfWeek dayOfWeek = this.dayOfWeek;
+            boolean endOfDay = this.endOfDay;
+
+            // optimize stored format
+            if (dayOfMonth < 0) {
+                if (month != Month.FEBRUARY) {    // not Month.FEBRUARY
+                    dayOfMonth = month.maxLength() - 6;
+                }
+            }
+            if (endOfDay && dayOfMonth > 0 &&
+                (dayOfMonth == 28 && month == Month.FEBRUARY) == false) {
+                LocalDate date = LocalDate.of(2004, month, dayOfMonth).plusDays(1);  // leap-year
+                month = date.getMonth();
+                dayOfMonth = date.getDayOfMonth();
+                if (dayOfWeek != null) {
+                    dayOfWeek = dayOfWeek.plus(1);
+                }
+                endOfDay = false;
+            }
+            // build rule
+            return ZoneOffsetTransitionRule.of(
+                    //month, dayOfMonth, dayOfWeek, time, endOfDay, timeDefinition,
+                    month, dayOfMonth, dayOfWeek,
+                    LocalTime.ofSecondOfDay(secsOfDay), endOfDay, timeDefinition,
+                    stdOffset,
+                    ZoneOffset.ofTotalSeconds(stdOffset.getTotalSeconds() + savingsBefore),
+                    ZoneOffset.ofTotalSeconds(stdOffset.getTotalSeconds() + savingsAmount));
+        }
+
+        RuleLine parse(String[] tokens) {
+            startYear = parseYear(tokens[2], 0);
+            endYear = parseYear(tokens[3], startYear);
+            if (startYear > endYear) {
+                throw new IllegalArgumentException(
+                    "Invalid <Rule> line/Year order invalid:" + startYear + " > " + endYear);
+            }
+            //parseOptional(s.next());  // type is unused
+            super.parse(tokens, 5);     // monthdaytime parsing
+            savingsAmount = parsePeriod(tokens[8]);
+            //rule.text = parseOptional(s.next());
+            return this;
+        }
+    }
+
+    /**
+     * Class representing a linked set of zone lines in the TZDB file.
+     */
+    private static class ZoneLine extends MonthDayTime {
+        /** The standard offset. */
+        int stdOffsetSecs;
+
+        /** The fixed savings amount. */
+        int fixedSavingsSecs = 0;
+
+        /** The savings rule. */
+        String savingsRule;
+
+        /** The text name of the zone. */
+        String text;
+
+        /** The cutover year */
+        int year = Year.MAX_VALUE;
+
+        /** The cutover date time */
+        LocalDateTime ldt;
+
+        /** The cutover date/time in epoch seconds/UTC */
+        long ldtSecs = Long.MIN_VALUE;
+
+        LocalDateTime toDateTime() {
+            if (ldt == null) {
+                ldt = toDateTime(year);
+            }
+            return ldt;
+        }
+
+        /**
+         * Creates the date-time epoch second in the wall offset for the local
+         * date-time at the end of the window.
+         *
+         * @param savingsSecs  the amount of savings in use in seconds
+         * @return the created date-time epoch second in the wall offset, not null
+         */
+        long toDateTimeEpochSecond(int savingsSecs) {
+            if (ldtSecs == Long.MIN_VALUE) {
+                ldtSecs = toDateTime().toEpochSecond(ZoneOffset.UTC);
+            }
+            switch(timeDefinition) {
+            case UTC:      return ldtSecs;
+            case STANDARD: return ldtSecs - stdOffsetSecs;
+            default:       return ldtSecs - (stdOffsetSecs + savingsSecs); // WALL
+            }
+        }
+
+        boolean parse(String[] tokens, int off) {
+            stdOffsetSecs = parseOffset(tokens[off++]);
+            savingsRule = parseOptional(tokens[off++]);
+            if (savingsRule != null && savingsRule.length() > 0 &&
+                (savingsRule.charAt(0) == '-' || isDigit(savingsRule.charAt(0)))) {
+                try {
+                    fixedSavingsSecs = parsePeriod(savingsRule);
+                    savingsRule = null;
+                } catch (Exception ex) {
+                    fixedSavingsSecs = 0;
+                }
+            }
+            text = tokens[off++];
+            if (off < tokens.length) {
+                year = Integer.parseInt(tokens[off++]);
+                if (off < tokens.length) {
+                    super.parse(tokens, off);  // MonthDayTime
+                }
+                return false;
+            } else {
+                return true;
+            }
+        }
+    }
+
+    /**
+     * Class representing a rule line in the TZDB file for a particular year.
+     */
+    private static class TransRule implements Comparable<TransRule>
+    {
+        private int year;
+        private RuleLine rule;
+
+        /** The trans date/time */
+        private LocalDateTime ldt;
+
+        /** The trans date/time in epoch seconds (assume UTC) */
+        long ldtSecs;
+
+        TransRule(int year, RuleLine rule) {
+            this.year = year;
+            this.rule = rule;
+            this.ldt = rule.toDateTime(year);
+            this.ldtSecs = ldt.toEpochSecond(ZoneOffset.UTC);
+        }
+
+        ZoneOffsetTransition toTransition(ZoneOffset standardOffset, int savingsBeforeSecs) {
+            // copy of code in ZoneOffsetTransitionRule to avoid infinite loop
+            ZoneOffset wallOffset = ZoneOffset.ofTotalSeconds(
+                standardOffset.getTotalSeconds() + savingsBeforeSecs);
+            ZoneOffset offsetAfter = ZoneOffset.ofTotalSeconds(
+                standardOffset.getTotalSeconds() + rule.savingsAmount);
+            LocalDateTime dt = rule.timeDefinition
+                                   .createDateTime(ldt, standardOffset, wallOffset);
+            return ZoneOffsetTransition.of(dt, wallOffset, offsetAfter);
+        }
+
+        long toEpochSecond(ZoneOffset stdOffset, int savingsBeforeSecs) {
+            switch(rule.timeDefinition) {
+            case UTC:      return ldtSecs;
+            case STANDARD: return ldtSecs - stdOffset.getTotalSeconds();
+            default:       return ldtSecs - (stdOffset.getTotalSeconds() + savingsBeforeSecs); // WALL
+            }
+        }
+
+        /**
+         * Tests if this a real transition with the active savings in seconds
+         *
+         * @param savingsBefore the active savings in seconds
+         * @return true, if savings changes
+         */
+        boolean isTransition(int savingsBefore) {
+            return rule.savingsAmount != savingsBefore;
+        }
+
+        public int compareTo(TransRule other) {
+            return (ldtSecs < other.ldtSecs)? -1 : ((ldtSecs == other.ldtSecs) ? 0 : 1);
+        }
+    }
+
+    private ZoneRules buildRules(String zoneId, List<ZoneLine> zones) {
+        if (zones.isEmpty()) {
+            throw new IllegalStateException("No available zone window");
+        }
+        final List<ZoneOffsetTransition> standardTransitionList = new ArrayList<>(4);
+        final List<ZoneOffsetTransition> transitionList = new ArrayList<>(256);
+        final List<ZoneOffsetTransitionRule> lastTransitionRuleList = new ArrayList<>(2);
+
+        final ZoneLine zone0 = zones.get(0);
+        // initialize the standard offset, wallOffset and savings for loop
+
+        //ZoneOffset stdOffset = zone0.standardOffset;
+        ZoneOffset stdOffset = ZoneOffset.ofTotalSeconds(zone0.stdOffsetSecs);
+
+        int savings = zone0.fixedSavingsSecs;
+        ZoneOffset wallOffset = ZoneOffset.ofTotalSeconds(stdOffset.getTotalSeconds() + savings);
+
+        // start ldt of each zone window
+        LocalDateTime zoneStart = LocalDateTime.MIN;
+
+        // first stanard offset
+        ZoneOffset firstStdOffset = stdOffset;
+        // first wall offset
+        ZoneOffset firstWallOffset = wallOffset;
+
+        for (ZoneLine zone : zones) {
+            // check if standard offset changed, update it if yes
+            ZoneOffset stdOffsetPrev = stdOffset;  // for effectiveSavings check
+            if (zone.stdOffsetSecs != stdOffset.getTotalSeconds()) {
+                ZoneOffset stdOffsetNew = ZoneOffset.ofTotalSeconds(zone.stdOffsetSecs);
+                standardTransitionList.add(
+                    ZoneOffsetTransition.of(
+                        LocalDateTime.ofEpochSecond(zoneStart.toEpochSecond(wallOffset),
+                                                    0,
+                                                    stdOffset),
+                        stdOffset,
+                        stdOffsetNew));
+                stdOffset = stdOffsetNew;
+            }
+
+            LocalDateTime zoneEnd;
+            if (zone.year == Year.MAX_VALUE) {
+                zoneEnd = LocalDateTime.MAX;
+            } else {
+                zoneEnd = zone.toDateTime();
+            }
+            if (zoneEnd.compareTo(zoneStart) < 0) {
+                throw new IllegalStateException("Windows must be in date-time order: " +
+                        zoneEnd + " < " + zoneStart);
+            }
+            // calculate effective savings at the start of the window
+            List<TransRule> trules = null;
+            List<TransRule> lastRules = null;
+
+            int effectiveSavings = zone.fixedSavingsSecs;
+            if (zone.savingsRule != null) {
+                List<RuleLine> tzdbRules = rules.get(zone.savingsRule);
+                if (tzdbRules == null) {
+                   throw new IllegalArgumentException("<Rule> not found: " +
+                                                       zone.savingsRule);
+                }
+                trules = new ArrayList<>(256);
+                lastRules = new ArrayList<>(2);
+                int lastRulesStartYear = Year.MIN_VALUE;
+
+                // merge the rules to transitions
+                for (RuleLine rule : tzdbRules) {
+                    if (rule.startYear > zoneEnd.getYear()) {
+                        // rules will not be used for this zone entry
+                        continue;
+                    }
+                    rule.adjustToForwards(2004);  // irrelevant, treat as leap year
+
+                    int startYear = rule.startYear;
+                    int endYear = rule.endYear;
+                    if (zoneEnd.equals(LocalDateTime.MAX)) {
+                        if (endYear == Year.MAX_VALUE) {
+                            endYear = startYear;
+                            lastRules.add(new TransRule(endYear, rule));
+                            lastRulesStartYear = Math.max(startYear, lastRulesStartYear);
+                        }
+                    } else {
+                        if (endYear == Year.MAX_VALUE) {
+                            //endYear = zoneEnd.getYear();
+                            endYear = zone.year;
+                        }
+                    }
+                    int year = startYear;
+                    while (year <= endYear) {
+                        trules.add(new TransRule(year, rule));
+                        year++;
+                    }
+                }
+
+                // last rules, fill the gap years between different last rules
+                if (zoneEnd.equals(LocalDateTime.MAX)) {
+                    lastRulesStartYear = Math.max(lastRulesStartYear, zoneStart.getYear()) + 1;
+                    for (TransRule rule : lastRules) {
+                        if (rule.year <= lastRulesStartYear) {
+                            int year = rule.year;
+                            while (year <= lastRulesStartYear) {
+                                trules.add(new TransRule(year, rule.rule));
+                                year++;
+                            }
+                            rule.year = lastRulesStartYear;
+                            rule.ldt = rule.rule.toDateTime(year);
+                            rule.ldtSecs = rule.ldt.toEpochSecond(ZoneOffset.UTC);
+                        }
+                    }
+                    Collections.sort(lastRules);
+                }
+                // sort the merged rules
+                Collections.sort(trules);
+
+                effectiveSavings = 0;
+                for (TransRule rule : trules) {
+                    if (rule.toEpochSecond(stdOffsetPrev, savings) >
+                        zoneStart.toEpochSecond(wallOffset)) {
+                        // previous savings amount found, which could be the
+                        // savings amount at the instant that the window starts
+                        // (hence isAfter)
+                        break;
+                    }
+                    effectiveSavings = rule.rule.savingsAmount;
+                }
+            }
+            // check if the start of the window represents a transition
+            ZoneOffset effectiveWallOffset =
+                ZoneOffset.ofTotalSeconds(stdOffset.getTotalSeconds() + effectiveSavings);
+
+            if (!wallOffset.equals(effectiveWallOffset)) {
+                transitionList.add(ZoneOffsetTransition.of(zoneStart,
+                                                           wallOffset,
+                                                           effectiveWallOffset));
+            }
+            savings = effectiveSavings;
+            // apply rules within the window
+            if (trules != null) {
+                long zoneStartEpochSecs = zoneStart.toEpochSecond(wallOffset);
+                for (TransRule trule : trules) {
+                    if (trule.isTransition(savings)) {
+                        long epochSecs = trule.toEpochSecond(stdOffset, savings);
+                        if (epochSecs < zoneStartEpochSecs ||
+                            epochSecs >= zone.toDateTimeEpochSecond(savings)) {
+                            continue;
+                        }
+                        transitionList.add(trule.toTransition(stdOffset, savings));
+                        savings = trule.rule.savingsAmount;
+                    }
+                }
+            }
+            if (lastRules != null) {
+                for (TransRule trule : lastRules) {
+                    lastTransitionRuleList.add(trule.rule.toTransitionRule(stdOffset, savings));
+                    savings = trule.rule.savingsAmount;
+                }
+            }
+
+            // finally we can calculate the true end of the window, passing it to the next window
+            wallOffset = ZoneOffset.ofTotalSeconds(stdOffset.getTotalSeconds() + savings);
+            zoneStart = LocalDateTime.ofEpochSecond(zone.toDateTimeEpochSecond(savings),
+                                                    0,
+                                                    wallOffset);
+        }
+        return new ZoneRules(firstStdOffset,
+                             firstWallOffset,
+                             standardTransitionList,
+                             transitionList,
+                             lastTransitionRuleList);
+    }
+
+}
--- a/make/src/classes/build/tools/tzdb/Utils.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import java.util.Objects;
-
-class Utils {
-
-    // Returns the largest (closest to positive infinity)
-    public static long floorDiv(long x, long y) {
-        long r = x / y;
-        // if the signs are different and modulo not zero, round down
-        if ((x ^ y) < 0 && (r * y != x)) {
-            r--;
-        }
-        return r;
-    }
-
-    // Returns the floor modulus of the {@code long} arguments.
-    public static long floorMod(long x, long y) {
-        return x - floorDiv(x, y) * y;
-    }
-
-    // Returns the sum of its arguments,
-    public static long addExact(long x, long y) {
-        long r = x + y;
-        // HD 2-12 Overflow iff both arguments have the opposite sign of the result
-        if (((x ^ r) & (y ^ r)) < 0) {
-            throw new ArithmeticException("long overflow");
-        }
-        return r;
-    }
-
-    // Year
-
-    // Returns true if the specified year is a leap year.
-    public static boolean isLeapYear(int year) {
-        return ((year & 3) == 0) && ((year % 100) != 0 || (year % 400) == 0);
-    }
-
-    // The minimum supported year, '-999,999,999'.
-    public static final int YEAR_MIN_VALUE = -999_999_999;
-
-    // The maximum supported year, '+999,999,999'.
-    public static final int YEAR_MAX_VALUE = 999_999_999;
-
-
-    // Gets the length of the specified month in days.
-    public static int lengthOfMonth(int month, boolean leapYear) {
-        switch (month) {
-            case 2:        //FEBRUARY:
-                return (leapYear ? 29 : 28);
-            case 4:        //APRIL:
-            case 6:        //JUNE:
-            case 9:        //SEPTEMBER:
-            case 11:       //NOVEMBER:
-                return 30;
-            default:
-                return 31;
-        }
-    }
-
-    // Gets the maximum length of the specified month in days.
-    public static int maxLengthOfMonth(int month) {
-        switch (month) {
-            case 2:           //FEBRUARY:
-                return 29;
-            case 4:           //APRIL:
-            case 6:           //JUNE:
-            case 9:           //SEPTEMBER:
-            case 11:          //NOVEMBER:
-                return 30;
-            default:
-                return 31;
-        }
-    }
-
-    // DayOfWeek
-
-    // Returns the day-of-week that is the specified number of days after
-    // this one, from 1 to 7 for Monday to Sunday.
-    public static int plusDayOfWeek(int dow, long days) {
-        int amount = (int) (days % 7);
-        return (dow - 1 + (amount + 7)) % 7 + 1;
-    }
-
-    // Returns the day-of-week that is the specified number of days before
-    // this one, from 1 to 7 for Monday to Sunday.
-    public static int minusDayOfWeek(int dow, long days) {
-        return plusDayOfWeek(dow, -(days % 7));
-    }
-
-    // Adjusts the date to the first occurrence of the specified day-of-week
-    // before the date being adjusted unless it is already on that day in
-    // which case the same object is returned.
-    public static LocalDate previousOrSame(LocalDate date, int dayOfWeek) {
-        return adjust(date, dayOfWeek, 1);
-    }
-
-    // Adjusts the date to the first occurrence of the specified day-of-week
-    // after the date being adjusted unless it is already on that day in
-    // which case the same object is returned.
-    public static LocalDate nextOrSame(LocalDate date, int dayOfWeek) {
-        return adjust(date, dayOfWeek, 0);
-    }
-
-    // Implementation of next, previous or current day-of-week.
-    // @param relative  whether the current date is a valid answer
-    private static final LocalDate adjust(LocalDate date, int dow, int relative) {
-        int calDow = date.getDayOfWeek();
-        if (relative < 2 && calDow == dow) {
-            return date;
-        }
-        if ((relative & 1) == 0) {
-            int daysDiff = calDow - dow;
-            return date.plusDays(daysDiff >= 0 ? 7 - daysDiff : -daysDiff);
-        } else {
-            int daysDiff = dow - calDow;
-            return date.minusDays(daysDiff >= 0 ? 7 - daysDiff : -daysDiff);
-        }
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/ZoneOffset.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,474 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * A time-zone offset from Greenwich/UTC, such as {@code +02:00}.
- * <p>
- * A time-zone offset is the period of time that a time-zone differs from Greenwich/UTC.
- * This is usually a fixed number of hours and minutes.
- *
- * @since 1.8
- */
-final class ZoneOffset implements Comparable<ZoneOffset> {
-
-    /** Cache of time-zone offset by offset in seconds. */
-    private static final ConcurrentMap<Integer, ZoneOffset> SECONDS_CACHE = new ConcurrentHashMap<>(16, 0.75f, 4);
-    /** Cache of time-zone offset by ID. */
-    private static final ConcurrentMap<String, ZoneOffset> ID_CACHE = new ConcurrentHashMap<>(16, 0.75f, 4);
-
-    /**
-     * The number of seconds per hour.
-     */
-    private static final int SECONDS_PER_HOUR = 60 * 60;
-    /**
-     * The number of seconds per minute.
-     */
-    private static final int SECONDS_PER_MINUTE = 60;
-    /**
-     * The number of minutes per hour.
-     */
-    private static final int MINUTES_PER_HOUR = 60;
-    /**
-     * The abs maximum seconds.
-     */
-    private static final int MAX_SECONDS = 18 * SECONDS_PER_HOUR;
-    /**
-     * Serialization version.
-     */
-    private static final long serialVersionUID = 2357656521762053153L;
-
-    /**
-     * The time-zone offset for UTC, with an ID of 'Z'.
-     */
-    public static final ZoneOffset UTC = ZoneOffset.ofTotalSeconds(0);
-    /**
-     * Constant for the maximum supported offset.
-     */
-    public static final ZoneOffset MIN = ZoneOffset.ofTotalSeconds(-MAX_SECONDS);
-    /**
-     * Constant for the maximum supported offset.
-     */
-    public static final ZoneOffset MAX = ZoneOffset.ofTotalSeconds(MAX_SECONDS);
-
-    /**
-     * The total offset in seconds.
-     */
-    private final int totalSeconds;
-    /**
-     * The string form of the time-zone offset.
-     */
-    private final transient String id;
-
-    //-----------------------------------------------------------------------
-    /**
-     * Obtains an instance of {@code ZoneOffset} using the ID.
-     * <p>
-     * This method parses the string ID of a {@code ZoneOffset} to
-     * return an instance. The parsing accepts all the formats generated by
-     * {@link #getId()}, plus some additional formats:
-     * <p><ul>
-     * <li>{@code Z} - for UTC
-     * <li>{@code +h}
-     * <li>{@code +hh}
-     * <li>{@code +hh:mm}
-     * <li>{@code -hh:mm}
-     * <li>{@code +hhmm}
-     * <li>{@code -hhmm}
-     * <li>{@code +hh:mm:ss}
-     * <li>{@code -hh:mm:ss}
-     * <li>{@code +hhmmss}
-     * <li>{@code -hhmmss}
-     * </ul><p>
-     * Note that &plusmn; means either the plus or minus symbol.
-     * <p>
-     * The ID of the returned offset will be normalized to one of the formats
-     * described by {@link #getId()}.
-     * <p>
-     * The maximum supported range is from +18:00 to -18:00 inclusive.
-     *
-     * @param offsetId  the offset ID, not null
-     * @return the zone-offset, not null
-     * @throws DateTimeException if the offset ID is invalid
-     */
-    @SuppressWarnings("fallthrough")
-    public static ZoneOffset of(String offsetId) {
-        Objects.requireNonNull(offsetId, "offsetId");
-        // "Z" is always in the cache
-        ZoneOffset offset = ID_CACHE.get(offsetId);
-        if (offset != null) {
-            return offset;
-        }
-
-        // parse - +h, +hh, +hhmm, +hh:mm, +hhmmss, +hh:mm:ss
-        final int hours, minutes, seconds;
-        switch (offsetId.length()) {
-            case 2:
-                offsetId = offsetId.charAt(0) + "0" + offsetId.charAt(1);  // fallthru
-            case 3:
-                hours = parseNumber(offsetId, 1, false);
-                minutes = 0;
-                seconds = 0;
-                break;
-            case 5:
-                hours = parseNumber(offsetId, 1, false);
-                minutes = parseNumber(offsetId, 3, false);
-                seconds = 0;
-                break;
-            case 6:
-                hours = parseNumber(offsetId, 1, false);
-                minutes = parseNumber(offsetId, 4, true);
-                seconds = 0;
-                break;
-            case 7:
-                hours = parseNumber(offsetId, 1, false);
-                minutes = parseNumber(offsetId, 3, false);
-                seconds = parseNumber(offsetId, 5, false);
-                break;
-            case 9:
-                hours = parseNumber(offsetId, 1, false);
-                minutes = parseNumber(offsetId, 4, true);
-                seconds = parseNumber(offsetId, 7, true);
-                break;
-            default:
-                throw new DateTimeException("Zone offset ID '" + offsetId + "' is invalid");
-        }
-        char first = offsetId.charAt(0);
-        if (first != '+' && first != '-') {
-            throw new DateTimeException("Zone offset ID '" + offsetId + "' is invalid: Plus/minus not found when expected");
-        }
-        if (first == '-') {
-            return ofHoursMinutesSeconds(-hours, -minutes, -seconds);
-        } else {
-            return ofHoursMinutesSeconds(hours, minutes, seconds);
-        }
-    }
-
-    /**
-     * Parse a two digit zero-prefixed number.
-     *
-     * @param offsetId  the offset ID, not null
-     * @param pos  the position to parse, valid
-     * @param precededByColon  should this number be prefixed by a precededByColon
-     * @return the parsed number, from 0 to 99
-     */
-    private static int parseNumber(CharSequence offsetId, int pos, boolean precededByColon) {
-        if (precededByColon && offsetId.charAt(pos - 1) != ':') {
-            throw new DateTimeException("Zone offset ID '" + offsetId + "' is invalid: Colon not found when expected");
-        }
-        char ch1 = offsetId.charAt(pos);
-        char ch2 = offsetId.charAt(pos + 1);
-        if (ch1 < '0' || ch1 > '9' || ch2 < '0' || ch2 > '9') {
-            throw new DateTimeException("Zone offset ID '" + offsetId + "' is invalid: Non numeric characters found");
-        }
-        return (ch1 - 48) * 10 + (ch2 - 48);
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Obtains an instance of {@code ZoneOffset} using an offset in hours.
-     *
-     * @param hours  the time-zone offset in hours, from -18 to +18
-     * @return the zone-offset, not null
-     * @throws DateTimeException if the offset is not in the required range
-     */
-    public static ZoneOffset ofHours(int hours) {
-        return ofHoursMinutesSeconds(hours, 0, 0);
-    }
-
-    /**
-     * Obtains an instance of {@code ZoneOffset} using an offset in
-     * hours and minutes.
-     * <p>
-     * The sign of the hours and minutes components must match.
-     * Thus, if the hours is negative, the minutes must be negative or zero.
-     * If the hours is zero, the minutes may be positive, negative or zero.
-     *
-     * @param hours  the time-zone offset in hours, from -18 to +18
-     * @param minutes  the time-zone offset in minutes, from 0 to &plusmn;59, sign matches hours
-     * @return the zone-offset, not null
-     * @throws DateTimeException if the offset is not in the required range
-     */
-    public static ZoneOffset ofHoursMinutes(int hours, int minutes) {
-        return ofHoursMinutesSeconds(hours, minutes, 0);
-    }
-
-    /**
-     * Obtains an instance of {@code ZoneOffset} using an offset in
-     * hours, minutes and seconds.
-     * <p>
-     * The sign of the hours, minutes and seconds components must match.
-     * Thus, if the hours is negative, the minutes and seconds must be negative or zero.
-     *
-     * @param hours  the time-zone offset in hours, from -18 to +18
-     * @param minutes  the time-zone offset in minutes, from 0 to &plusmn;59, sign matches hours and seconds
-     * @param seconds  the time-zone offset in seconds, from 0 to &plusmn;59, sign matches hours and minutes
-     * @return the zone-offset, not null
-     * @throws DateTimeException if the offset is not in the required range
-     */
-    public static ZoneOffset ofHoursMinutesSeconds(int hours, int minutes, int seconds) {
-        validate(hours, minutes, seconds);
-        int totalSeconds = totalSeconds(hours, minutes, seconds);
-        return ofTotalSeconds(totalSeconds);
-    }
-
-    /**
-     * Validates the offset fields.
-     *
-     * @param hours  the time-zone offset in hours, from -18 to +18
-     * @param minutes  the time-zone offset in minutes, from 0 to &plusmn;59
-     * @param seconds  the time-zone offset in seconds, from 0 to &plusmn;59
-     * @throws DateTimeException if the offset is not in the required range
-     */
-    private static void validate(int hours, int minutes, int seconds) {
-        if (hours < -18 || hours > 18) {
-            throw new DateTimeException("Zone offset hours not in valid range: value " + hours +
-                    " is not in the range -18 to 18");
-        }
-        if (hours > 0) {
-            if (minutes < 0 || seconds < 0) {
-                throw new DateTimeException("Zone offset minutes and seconds must be positive because hours is positive");
-            }
-        } else if (hours < 0) {
-            if (minutes > 0 || seconds > 0) {
-                throw new DateTimeException("Zone offset minutes and seconds must be negative because hours is negative");
-            }
-        } else if ((minutes > 0 && seconds < 0) || (minutes < 0 && seconds > 0)) {
-            throw new DateTimeException("Zone offset minutes and seconds must have the same sign");
-        }
-        if (Math.abs(minutes) > 59) {
-            throw new DateTimeException("Zone offset minutes not in valid range: abs(value) " +
-                    Math.abs(minutes) + " is not in the range 0 to 59");
-        }
-        if (Math.abs(seconds) > 59) {
-            throw new DateTimeException("Zone offset seconds not in valid range: abs(value) " +
-                    Math.abs(seconds) + " is not in the range 0 to 59");
-        }
-        if (Math.abs(hours) == 18 && (Math.abs(minutes) > 0 || Math.abs(seconds) > 0)) {
-            throw new DateTimeException("Zone offset not in valid range: -18:00 to +18:00");
-        }
-    }
-
-    /**
-     * Calculates the total offset in seconds.
-     *
-     * @param hours  the time-zone offset in hours, from -18 to +18
-     * @param minutes  the time-zone offset in minutes, from 0 to &plusmn;59, sign matches hours and seconds
-     * @param seconds  the time-zone offset in seconds, from 0 to &plusmn;59, sign matches hours and minutes
-     * @return the total in seconds
-     */
-    private static int totalSeconds(int hours, int minutes, int seconds) {
-        return hours * SECONDS_PER_HOUR + minutes * SECONDS_PER_MINUTE + seconds;
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Obtains an instance of {@code ZoneOffset} specifying the total offset in seconds
-     * <p>
-     * The offset must be in the range {@code -18:00} to {@code +18:00}, which corresponds to -64800 to +64800.
-     *
-     * @param totalSeconds  the total time-zone offset in seconds, from -64800 to +64800
-     * @return the ZoneOffset, not null
-     * @throws DateTimeException if the offset is not in the required range
-     */
-    public static ZoneOffset ofTotalSeconds(int totalSeconds) {
-        if (Math.abs(totalSeconds) > MAX_SECONDS) {
-            throw new DateTimeException("Zone offset not in valid range: -18:00 to +18:00");
-        }
-        if (totalSeconds % (15 * SECONDS_PER_MINUTE) == 0) {
-            Integer totalSecs = totalSeconds;
-            ZoneOffset result = SECONDS_CACHE.get(totalSecs);
-            if (result == null) {
-                result = new ZoneOffset(totalSeconds);
-                SECONDS_CACHE.putIfAbsent(totalSecs, result);
-                result = SECONDS_CACHE.get(totalSecs);
-                ID_CACHE.putIfAbsent(result.getId(), result);
-            }
-            return result;
-        } else {
-            return new ZoneOffset(totalSeconds);
-        }
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param totalSeconds  the total time-zone offset in seconds, from -64800 to +64800
-     */
-    private ZoneOffset(int totalSeconds) {
-        super();
-        this.totalSeconds = totalSeconds;
-        id = buildId(totalSeconds);
-    }
-
-    private static String buildId(int totalSeconds) {
-        if (totalSeconds == 0) {
-            return "Z";
-        } else {
-            int absTotalSeconds = Math.abs(totalSeconds);
-            StringBuilder buf = new StringBuilder();
-            int absHours = absTotalSeconds / SECONDS_PER_HOUR;
-            int absMinutes = (absTotalSeconds / SECONDS_PER_MINUTE) % MINUTES_PER_HOUR;
-            buf.append(totalSeconds < 0 ? "-" : "+")
-                .append(absHours < 10 ? "0" : "").append(absHours)
-                .append(absMinutes < 10 ? ":0" : ":").append(absMinutes);
-            int absSeconds = absTotalSeconds % SECONDS_PER_MINUTE;
-            if (absSeconds != 0) {
-                buf.append(absSeconds < 10 ? ":0" : ":").append(absSeconds);
-            }
-            return buf.toString();
-        }
-    }
-
-    /**
-     * Gets the total zone offset in seconds.
-     * <p>
-     * This is the primary way to access the offset amount.
-     * It returns the total of the hours, minutes and seconds fields as a
-     * single offset that can be added to a time.
-     *
-     * @return the total zone offset amount in seconds
-     */
-    public int getTotalSeconds() {
-        return totalSeconds;
-    }
-
-    /**
-     * Gets the normalized zone offset ID.
-     * <p>
-     * The ID is minor variation to the standard ISO-8601 formatted string
-     * for the offset. There are three formats:
-     * <p><ul>
-     * <li>{@code Z} - for UTC (ISO-8601)
-     * <li>{@code +hh:mm} or {@code -hh:mm} - if the seconds are zero (ISO-8601)
-     * <li>{@code +hh:mm:ss} or {@code -hh:mm:ss} - if the seconds are non-zero (not ISO-8601)
-     * </ul><p>
-     *
-     * @return the zone offset ID, not null
-     */
-    public String getId() {
-        return id;
-    }
-
-    /**
-     * Compares this offset to another offset in descending order.
-     * <p>
-     * The offsets are compared in the order that they occur for the same time
-     * of day around the world. Thus, an offset of {@code +10:00} comes before an
-     * offset of {@code +09:00} and so on down to {@code -18:00}.
-     * <p>
-     * The comparison is "consistent with equals", as defined by {@link Comparable}.
-     *
-     * @param other  the other date to compare to, not null
-     * @return the comparator value, negative if less, postive if greater
-     * @throws NullPointerException if {@code other} is null
-     */
-    @Override
-    public int compareTo(ZoneOffset other) {
-        return other.totalSeconds - totalSeconds;
-    }
-
-    /**
-     * Checks if this offset is equal to another offset.
-     * <p>
-     * The comparison is based on the amount of the offset in seconds.
-     * This is equivalent to a comparison by ID.
-     *
-     * @param obj  the object to check, null returns false
-     * @return true if this is equal to the other offset
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-           return true;
-        }
-        if (obj instanceof ZoneOffset) {
-            return totalSeconds == ((ZoneOffset) obj).totalSeconds;
-        }
-        return false;
-    }
-
-    /**
-     * A hash code for this offset.
-     *
-     * @return a suitable hash code
-     */
-    @Override
-    public int hashCode() {
-        return totalSeconds;
-    }
-
-    /**
-     * Outputs this offset as a {@code String}, using the normalized ID.
-     *
-     * @return a string representation of this offset, not null
-     */
-    @Override
-    public String toString() {
-        return id;
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/ZoneOffsetTransition.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,290 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * A transition between two offsets caused by a discontinuity in the local time-line.
- *
- * @since 1.8
- */
-final class ZoneOffsetTransition implements Comparable<ZoneOffsetTransition> {
-
-    /**
-     * The local transition date-time at the transition.
-     */
-    private final LocalDateTime transition;
-    /**
-     * The offset before transition.
-     */
-    private final ZoneOffset offsetBefore;
-    /**
-     * The offset after transition.
-     */
-    private final ZoneOffset offsetAfter;
-
-    /**
-     * Creates an instance defining a transition between two offsets.
-     *
-     * @param transition  the transition date-time with the offset before the transition, not null
-     * @param offsetBefore  the offset before the transition, not null
-     * @param offsetAfter  the offset at and after the transition, not null
-     */
-    ZoneOffsetTransition(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) {
-        Objects.requireNonNull(transition, "transition");
-        Objects.requireNonNull(offsetBefore, "offsetBefore");
-        Objects.requireNonNull(offsetAfter, "offsetAfter");
-        if (offsetBefore.equals(offsetAfter)) {
-            throw new IllegalArgumentException("Offsets must not be equal");
-        }
-        this.transition = transition;
-        this.offsetBefore = offsetBefore;
-        this.offsetAfter = offsetAfter;
-    }
-
-    /**
-     * Creates an instance from epoch-second and offsets.
-     *
-     * @param epochSecond  the transition epoch-second
-     * @param offsetBefore  the offset before the transition, not null
-     * @param offsetAfter  the offset at and after the transition, not null
-     */
-    ZoneOffsetTransition(long epochSecond, ZoneOffset offsetBefore, ZoneOffset offsetAfter) {
-        this.transition = LocalDateTime.ofEpochSecond(epochSecond, 0, offsetBefore);
-        this.offsetBefore = offsetBefore;
-        this.offsetAfter = offsetAfter;
-    }
-
-    /**
-     * Gets the transition instant as an epoch second.
-     *
-     * @return the transition epoch second
-     */
-    public long toEpochSecond() {
-        return transition.toEpochSecond(offsetBefore);
-    }
-
-    /**
-     * Gets the local transition date-time, as would be expressed with the 'before' offset.
-     * <p>
-     * This is the date-time where the discontinuity begins expressed with the 'before' offset.
-     * At this instant, the 'after' offset is actually used, therefore the combination of this
-     * date-time and the 'before' offset will never occur.
-     * <p>
-     * The combination of the 'before' date-time and offset represents the same instant
-     * as the 'after' date-time and offset.
-     *
-     * @return the transition date-time expressed with the before offset, not null
-     */
-    public LocalDateTime getDateTimeBefore() {
-        return transition;
-    }
-
-    /**
-     * Gets the local transition date-time, as would be expressed with the 'after' offset.
-     * <p>
-     * This is the first date-time after the discontinuity, when the new offset applies.
-     * <p>
-     * The combination of the 'before' date-time and offset represents the same instant
-     * as the 'after' date-time and offset.
-     *
-     * @return the transition date-time expressed with the after offset, not null
-     */
-    public LocalDateTime getDateTimeAfter() {
-        return transition.plusSeconds(getDurationSeconds());
-    }
-
-    /**
-     * Gets the offset before the transition.
-     * <p>
-     * This is the offset in use before the instant of the transition.
-     *
-     * @return the offset before the transition, not null
-     */
-    public ZoneOffset getOffsetBefore() {
-        return offsetBefore;
-    }
-
-    /**
-     * Gets the offset after the transition.
-     * <p>
-     * This is the offset in use on and after the instant of the transition.
-     *
-     * @return the offset after the transition, not null
-     */
-    public ZoneOffset getOffsetAfter() {
-        return offsetAfter;
-    }
-
-    /**
-     * Gets the duration of the transition in seconds.
-     *
-     * @return the duration in seconds
-     */
-    private int getDurationSeconds() {
-        return getOffsetAfter().getTotalSeconds() - getOffsetBefore().getTotalSeconds();
-    }
-
-    /**
-     * Does this transition represent a gap in the local time-line.
-     * <p>
-     * Gaps occur where there are local date-times that simply do not not exist.
-     * An example would be when the offset changes from {@code +01:00} to {@code +02:00}.
-     * This might be described as 'the clocks will move forward one hour tonight at 1am'.
-     *
-     * @return true if this transition is a gap, false if it is an overlap
-     */
-    public boolean isGap() {
-        return getOffsetAfter().getTotalSeconds() > getOffsetBefore().getTotalSeconds();
-    }
-
-    /**
-     * Does this transition represent a gap in the local time-line.
-     * <p>
-     * Overlaps occur where there are local date-times that exist twice.
-     * An example would be when the offset changes from {@code +02:00} to {@code +01:00}.
-     * This might be described as 'the clocks will move back one hour tonight at 2am'.
-     *
-     * @return true if this transition is an overlap, false if it is a gap
-     */
-    public boolean isOverlap() {
-        return getOffsetAfter().getTotalSeconds() < getOffsetBefore().getTotalSeconds();
-    }
-
-    /**
-     * Checks if the specified offset is valid during this transition.
-     * <p>
-     * This checks to see if the given offset will be valid at some point in the transition.
-     * A gap will always return false.
-     * An overlap will return true if the offset is either the before or after offset.
-     *
-     * @param offset  the offset to check, null returns false
-     * @return true if the offset is valid during the transition
-     */
-    public boolean isValidOffset(ZoneOffset offset) {
-        return isGap() ? false : (getOffsetBefore().equals(offset) || getOffsetAfter().equals(offset));
-    }
-
-    /**
-     * Gets the valid offsets during this transition.
-     * <p>
-     * A gap will return an empty list, while an overlap will return both offsets.
-     *
-     * @return the list of valid offsets
-     */
-    List<ZoneOffset> getValidOffsets() {
-        if (isGap()) {
-            return Collections.emptyList();
-        }
-        return Arrays.asList(getOffsetBefore(), getOffsetAfter());
-    }
-
-    /**
-     * Compares this transition to another based on the transition instant.
-     * <p>
-     * This compares the instants of each transition.
-     * The offsets are ignored, making this order inconsistent with equals.
-     *
-     * @param transition  the transition to compare to, not null
-     * @return the comparator value, negative if less, positive if greater
-     */
-    @Override
-    public int compareTo(ZoneOffsetTransition transition) {
-        return Long.compare(this.toEpochSecond(), transition.toEpochSecond());
-    }
-
-    /**
-     * Checks if this object equals another.
-     * <p>
-     * The entire state of the object is compared.
-     *
-     * @param other  the other object to compare to, null returns false
-     * @return true if equal
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if (other instanceof ZoneOffsetTransition) {
-            ZoneOffsetTransition d = (ZoneOffsetTransition) other;
-            return transition.equals(d.transition) &&
-                offsetBefore.equals(d.offsetBefore) && offsetAfter.equals(d.offsetAfter);
-        }
-        return false;
-    }
-
-    /**
-     * Returns a suitable hash code.
-     *
-     * @return the hash code
-     */
-    @Override
-    public int hashCode() {
-        return transition.hashCode() ^ offsetBefore.hashCode() ^ Integer.rotateLeft(offsetAfter.hashCode(), 16);
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/ZoneOffsetTransitionRule.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import static build.tools.tzdb.Utils.*;
-import java.util.Objects;
-
-/**
- * A rule expressing how to create a transition.
- * <p>
- * This class allows rules for identifying future transitions to be expressed.
- * A rule might be written in many forms:
- * <p><ul>
- * <li>the 16th March
- * <li>the Sunday on or after the 16th March
- * <li>the Sunday on or before the 16th March
- * <li>the last Sunday in February
- * </ul><p>
- * These different rule types can be expressed and queried.
- *
- * <h3>Specification for implementors</h3>
- * This class is immutable and thread-safe.
- *
- * @since 1.8
- */
-final class ZoneOffsetTransitionRule {
-
-    /**
-     * The month of the month-day of the first day of the cutover week.
-     * The actual date will be adjusted by the dowChange field.
-     */
-    final int month;
-    /**
-     * The day-of-month of the month-day of the cutover week.
-     * If positive, it is the start of the week where the cutover can occur.
-     * If negative, it represents the end of the week where cutover can occur.
-     * The value is the number of days from the end of the month, such that
-     * {@code -1} is the last day of the month, {@code -2} is the second
-     * to last day, and so on.
-     */
-    final byte dom;
-    /**
-     * The cutover day-of-week, -1 to retain the day-of-month.
-     */
-    final int dow;
-    /**
-     * The cutover time in the 'before' offset.
-     */
-    final LocalTime time;
-    /**
-     * Whether the cutover time is midnight at the end of day.
-     */
-    final boolean timeEndOfDay;
-    /**
-     * The definition of how the local time should be interpreted.
-     */
-    final TimeDefinition timeDefinition;
-    /**
-     * The standard offset at the cutover.
-     */
-    final ZoneOffset standardOffset;
-    /**
-     * The offset before the cutover.
-     */
-    final ZoneOffset offsetBefore;
-    /**
-     * The offset after the cutover.
-     */
-    final ZoneOffset offsetAfter;
-
-    /**
-     * Creates an instance defining the yearly rule to create transitions between two offsets.
-     *
-     * @param month  the month of the month-day of the first day of the cutover week, from 1 to 12
-     * @param dayOfMonthIndicator  the day of the month-day of the cutover week, positive if the week is that
-     *  day or later, negative if the week is that day or earlier, counting from the last day of the month,
-     *  from -28 to 31 excluding 0
-     * @param dayOfWeek  the required day-of-week, -1 if the month-day should not be changed
-     * @param time  the cutover time in the 'before' offset, not null
-     * @param timeEndOfDay  whether the time is midnight at the end of day
-     * @param timeDefnition  how to interpret the cutover
-     * @param standardOffset  the standard offset in force at the cutover, not null
-     * @param offsetBefore  the offset before the cutover, not null
-     * @param offsetAfter  the offset after the cutover, not null
-     * @throws IllegalArgumentException if the day of month indicator is invalid
-     * @throws IllegalArgumentException if the end of day flag is true when the time is not midnight
-     */
-    ZoneOffsetTransitionRule(
-            int month,
-            int dayOfMonthIndicator,
-            int dayOfWeek,
-            LocalTime time,
-            boolean timeEndOfDay,
-            TimeDefinition timeDefnition,
-            ZoneOffset standardOffset,
-            ZoneOffset offsetBefore,
-            ZoneOffset offsetAfter) {
-        Objects.requireNonNull(time, "time");
-        Objects.requireNonNull(timeDefnition, "timeDefnition");
-        Objects.requireNonNull(standardOffset, "standardOffset");
-        Objects.requireNonNull(offsetBefore, "offsetBefore");
-        Objects.requireNonNull(offsetAfter, "offsetAfter");
-        if (month < 1 || month > 12) {
-            throw new IllegalArgumentException("month must be between 1 and 12");
-        }
-        if (dayOfMonthIndicator < -28 || dayOfMonthIndicator > 31 || dayOfMonthIndicator == 0) {
-            throw new IllegalArgumentException("Day of month indicator must be between -28 and 31 inclusive excluding zero");
-        }
-        if (timeEndOfDay && time.equals(LocalTime.MIDNIGHT) == false) {
-            throw new IllegalArgumentException("Time must be midnight when end of day flag is true");
-        }
-        this.month = month;
-        this.dom = (byte) dayOfMonthIndicator;
-        this.dow = dayOfWeek;
-        this.time = time;
-        this.timeEndOfDay = timeEndOfDay;
-        this.timeDefinition = timeDefnition;
-        this.standardOffset = standardOffset;
-        this.offsetBefore = offsetBefore;
-        this.offsetAfter = offsetAfter;
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Checks if this object equals another.
-     * <p>
-     * The entire state of the object is compared.
-     *
-     * @param otherRule  the other object to compare to, null returns false
-     * @return true if equal
-     */
-    @Override
-    public boolean equals(Object otherRule) {
-        if (otherRule == this) {
-            return true;
-        }
-        if (otherRule instanceof ZoneOffsetTransitionRule) {
-            ZoneOffsetTransitionRule other = (ZoneOffsetTransitionRule) otherRule;
-            return month == other.month && dom == other.dom && dow == other.dow &&
-                timeDefinition == other.timeDefinition &&
-                time.equals(other.time) &&
-                timeEndOfDay == other.timeEndOfDay &&
-                standardOffset.equals(other.standardOffset) &&
-                offsetBefore.equals(other.offsetBefore) &&
-                offsetAfter.equals(other.offsetAfter);
-        }
-        return false;
-    }
-
-    /**
-     * Returns a suitable hash code.
-     *
-     * @return the hash code
-     */
-    @Override
-    public int hashCode() {
-        int hash = ((time.toSecondOfDay() + (timeEndOfDay ? 1 : 0)) << 15) +
-                (month << 11) + ((dom + 32) << 5) +
-                ((dow == -1 ? 8 : dow) << 2) + (timeDefinition.ordinal());
-        return hash ^ standardOffset.hashCode() ^
-                offsetBefore.hashCode() ^ offsetAfter.hashCode();
-    }
-
-}
--- a/make/src/classes/build/tools/tzdb/ZoneRules.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/src/classes/build/tools/tzdb/ZoneRules.java	Wed Jul 09 10:42:37 2014 -0700
@@ -64,6 +64,12 @@
 import java.io.DataOutput;
 import java.io.IOException;
 import java.io.ObjectOutput;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneOffset;
+import java.time.zone.ZoneOffsetTransition;
+import java.time.zone.ZoneOffsetTransitionRule;
+import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
@@ -224,15 +230,15 @@
      * @throws IOException if an error occurs
      */
     static void writeRule(ZoneOffsetTransitionRule rule, DataOutput out) throws IOException {
-        int month = rule.month;
-        byte dom = rule.dom;
-        int dow = rule.dow;
-        LocalTime time = rule.time;
-        boolean timeEndOfDay = rule.timeEndOfDay;
-        TimeDefinition timeDefinition = rule.timeDefinition;
-        ZoneOffset standardOffset = rule.standardOffset;
-        ZoneOffset offsetBefore = rule.offsetBefore;
-        ZoneOffset offsetAfter = rule.offsetAfter;
+        int month = rule.getMonth().getValue();
+        byte dom = (byte)rule.getDayOfMonthIndicator();
+        int dow = rule.getDayOfWeek().getValue();
+        LocalTime time = rule.getLocalTime();
+        boolean timeEndOfDay = rule.isMidnightEndOfDay();
+        TimeDefinition timeDefinition = rule.getTimeDefinition();
+        ZoneOffset standardOffset = rule.getStandardOffset();
+        ZoneOffset offsetBefore = rule.getOffsetBefore();
+        ZoneOffset offsetAfter = rule.getOffsetAfter();
 
         int timeSecs = (timeEndOfDay ? 86400 : time.toSecondOfDay());
         int stdOffset = standardOffset.getTotalSeconds();
--- a/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,743 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- *  * Neither the name of JSR-310 nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package build.tools.tzdb;
-
-import static build.tools.tzdb.Utils.*;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * A mutable builder used to create all the rules for a historic time-zone.
- * <p>
- * The rules of a time-zone describe how the offset changes over time.
- * The rules are created by building windows on the time-line within which
- * the different rules apply. The rules may be one of two kinds:
- * <p><ul>
- * <li>Fixed savings - A single fixed amount of savings from the standard offset will apply.</li>
- * <li>Rules - A set of one or more rules describe how daylight savings changes during the window.</li>
- * </ul><p>
- *
- * <h4>Implementation notes</h4>
- * This class is a mutable builder used to create zone instances.
- * It must only be used from a single thread.
- * The created instances are immutable and thread-safe.
- *
- * @since 1.8
- */
-public class ZoneRulesBuilder {
-
-    /**
-     * The list of windows.
-     */
-    private List<TZWindow> windowList = new ArrayList<>();
-
-    //-----------------------------------------------------------------------
-    /**
-     * Constructs an instance of the builder that can be used to create zone rules.
-     * <p>
-     * The builder is used by adding one or more windows representing portions
-     * of the time-line. The standard offset from UTC/Greenwich will be constant
-     * within a window, although two adjacent windows can have the same standard offset.
-     * <p>
-     * Within each window, there can either be a
-     * {@link #setFixedSavingsToWindow fixed savings amount} or a
-     * {@link #addRuleToWindow list of rules}.
-     */
-    public ZoneRulesBuilder() {
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Adds a window to the builder that can be used to filter a set of rules.
-     * <p>
-     * This method defines and adds a window to the zone where the standard offset is specified.
-     * The window limits the effect of subsequent additions of transition rules
-     * or fixed savings. If neither rules or fixed savings are added to the window
-     * then the window will default to no savings.
-     * <p>
-     * Each window must be added sequentially, as the start instant of the window
-     * is derived from the until instant of the previous window.
-     *
-     * @param standardOffset  the standard offset, not null
-     * @param until  the date-time that the offset applies until, not null
-     * @param untilDefinition  the time type for the until date-time, not null
-     * @return this, for chaining
-     * @throws IllegalStateException if the window order is invalid
-     */
-    public ZoneRulesBuilder addWindow(
-            ZoneOffset standardOffset,
-            LocalDateTime until,
-            TimeDefinition untilDefinition) {
-        Objects.requireNonNull(standardOffset, "standardOffset");
-        Objects.requireNonNull(until, "until");
-        Objects.requireNonNull(untilDefinition, "untilDefinition");
-        TZWindow window = new TZWindow(standardOffset, until, untilDefinition);
-        if (windowList.size() > 0) {
-            TZWindow previous = windowList.get(windowList.size() - 1);
-            window.validateWindowOrder(previous);
-        }
-        windowList.add(window);
-        return this;
-    }
-
-    /**
-     * Adds a window that applies until the end of time to the builder that can be
-     * used to filter a set of rules.
-     * <p>
-     * This method defines and adds a window to the zone where the standard offset is specified.
-     * The window limits the effect of subsequent additions of transition rules
-     * or fixed savings. If neither rules or fixed savings are added to the window
-     * then the window will default to no savings.
-     * <p>
-     * This must be added after all other windows.
-     * No more windows can be added after this one.
-     *
-     * @param standardOffset  the standard offset, not null
-     * @return this, for chaining
-     * @throws IllegalStateException if a forever window has already been added
-     */
-    public ZoneRulesBuilder addWindowForever(ZoneOffset standardOffset) {
-        return addWindow(standardOffset, LocalDateTime.MAX, TimeDefinition.WALL);
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Sets the previously added window to have fixed savings.
-     * <p>
-     * Setting a window to have fixed savings simply means that a single daylight
-     * savings amount applies throughout the window. The window could be small,
-     * such as a single summer, or large, such as a multi-year daylight savings.
-     * <p>
-     * A window can either have fixed savings or rules but not both.
-     *
-     * @param fixedSavingAmountSecs  the amount of saving to use for the whole window, not null
-     * @return this, for chaining
-     * @throws IllegalStateException if no window has yet been added
-     * @throws IllegalStateException if the window already has rules
-     */
-    public ZoneRulesBuilder setFixedSavingsToWindow(int fixedSavingAmountSecs) {
-        if (windowList.isEmpty()) {
-            throw new IllegalStateException("Must add a window before setting the fixed savings");
-        }
-        TZWindow window = windowList.get(windowList.size() - 1);
-        window.setFixedSavings(fixedSavingAmountSecs);
-        return this;
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Adds a single transition rule to the current window.
-     * <p>
-     * This adds a rule such that the offset, expressed as a daylight savings amount,
-     * changes at the specified date-time.
-     *
-     * @param transitionDateTime  the date-time that the transition occurs as defined by timeDefintion, not null
-     * @param timeDefinition  the definition of how to convert local to actual time, not null
-     * @param savingAmountSecs  the amount of saving from the standard offset after the transition in seconds
-     * @return this, for chaining
-     * @throws IllegalStateException if no window has yet been added
-     * @throws IllegalStateException if the window already has fixed savings
-     * @throws IllegalStateException if the window has reached the maximum capacity of 2000 rules
-     */
-    public ZoneRulesBuilder addRuleToWindow(
-            LocalDateTime transitionDateTime,
-            TimeDefinition timeDefinition,
-            int savingAmountSecs) {
-        Objects.requireNonNull(transitionDateTime, "transitionDateTime");
-        return addRuleToWindow(
-                transitionDateTime.getYear(), transitionDateTime.getYear(),
-                transitionDateTime.getMonth(), transitionDateTime.getDayOfMonth(),
-                -1, transitionDateTime.getTime(), false, timeDefinition, savingAmountSecs);
-    }
-
-    /**
-     * Adds a single transition rule to the current window.
-     * <p>
-     * This adds a rule such that the offset, expressed as a daylight savings amount,
-     * changes at the specified date-time.
-     *
-     * @param year  the year of the transition, from MIN_YEAR to MAX_YEAR
-     * @param month  the month of the transition, not null
-     * @param dayOfMonthIndicator  the day-of-month of the transition, adjusted by dayOfWeek,
-     *   from 1 to 31 adjusted later, or -1 to -28 adjusted earlier from the last day of the month
-     * @param time  the time that the transition occurs as defined by timeDefintion, not null
-     * @param timeEndOfDay  whether midnight is at the end of day
-     * @param timeDefinition  the definition of how to convert local to actual time, not null
-     * @param savingAmountSecs  the amount of saving from the standard offset after the transition in seconds
-     * @return this, for chaining
-     * @throws DateTimeException if a date-time field is out of range
-     * @throws IllegalStateException if no window has yet been added
-     * @throws IllegalStateException if the window already has fixed savings
-     * @throws IllegalStateException if the window has reached the maximum capacity of 2000 rules
-     */
-    public ZoneRulesBuilder addRuleToWindow(
-            int year,
-            int month,
-            int dayOfMonthIndicator,
-            LocalTime time,
-            boolean timeEndOfDay,
-            TimeDefinition timeDefinition,
-            int savingAmountSecs) {
-        return addRuleToWindow(year, year, month, dayOfMonthIndicator, -1, time, timeEndOfDay, timeDefinition, savingAmountSecs);
-    }
-
-    /**
-     * Adds a multi-year transition rule to the current window.
-     * <p>
-     * This adds a rule such that the offset, expressed as a daylight savings amount,
-     * changes at the specified date-time for each year in the range.
-     *
-     * @param startYear  the start year of the rule, from MIN_YEAR to MAX_YEAR
-     * @param endYear  the end year of the rule, from MIN_YEAR to MAX_YEAR
-     * @param month  the month of the transition, from 1 to 12
-     * @param dayOfMonthIndicator  the day-of-month of the transition, adjusted by dayOfWeek,
-     *   from 1 to 31 adjusted later, or -1 to -28 adjusted earlier from the last day of the month
-     * @param dayOfWeek  the day-of-week to adjust to, -1 if day-of-month should not be adjusted
-     * @param time  the time that the transition occurs as defined by timeDefintion, not null
-     * @param timeEndOfDay  whether midnight is at the end of day
-     * @param timeDefinition  the definition of how to convert local to actual time, not null
-     * @param savingAmountSecs  the amount of saving from the standard offset after the transition in seconds
-     * @return this, for chaining
-     * @throws DateTimeException if a date-time field is out of range
-     * @throws IllegalArgumentException if the day of month indicator is invalid
-     * @throws IllegalArgumentException if the end of day midnight flag does not match the time
-     * @throws IllegalStateException if no window has yet been added
-     * @throws IllegalStateException if the window already has fixed savings
-     * @throws IllegalStateException if the window has reached the maximum capacity of 2000 rules
-     */
-    public ZoneRulesBuilder addRuleToWindow(
-            int startYear,
-            int endYear,
-            int month,
-            int dayOfMonthIndicator,
-            int dayOfWeek,
-            LocalTime time,
-            boolean timeEndOfDay,
-            TimeDefinition timeDefinition,
-            int savingAmountSecs) {
-        Objects.requireNonNull(time, "time");
-        Objects.requireNonNull(timeDefinition, "timeDefinition");
-        if (dayOfMonthIndicator < -28 || dayOfMonthIndicator > 31 || dayOfMonthIndicator == 0) {
-            throw new IllegalArgumentException("Day of month indicator must be between -28 and 31 inclusive excluding zero");
-        }
-        if (timeEndOfDay && time.equals(LocalTime.MIDNIGHT) == false) {
-            throw new IllegalArgumentException("Time must be midnight when end of day flag is true");
-        }
-        if (windowList.isEmpty()) {
-            throw new IllegalStateException("Must add a window before adding a rule");
-        }
-        TZWindow window = windowList.get(windowList.size() - 1);
-        window.addRule(startYear, endYear, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
-        return this;
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * Completes the build converting the builder to a set of time-zone rules.
-     * <p>
-     * Calling this method alters the state of the builder.
-     * Further rules should not be added to this builder once this method is called.
-     *
-     * @param zoneId  the time-zone ID, not null
-     * @return the zone rules, not null
-     * @throws IllegalStateException if no windows have been added
-     * @throws IllegalStateException if there is only one rule defined as being forever for any given window
-     */
-    public ZoneRules toRules(String zoneId) {
-        Objects.requireNonNull(zoneId, "zoneId");
-        if (windowList.isEmpty()) {
-            throw new IllegalStateException("No windows have been added to the builder");
-        }
-
-        final List<ZoneOffsetTransition> standardTransitionList = new ArrayList<>(4);
-        final List<ZoneOffsetTransition> transitionList = new ArrayList<>(256);
-        final List<ZoneOffsetTransitionRule> lastTransitionRuleList = new ArrayList<>(2);
-
-        // initialize the standard offset calculation
-        final TZWindow firstWindow = windowList.get(0);
-        ZoneOffset loopStandardOffset = firstWindow.standardOffset;
-        int loopSavings = 0;
-        if (firstWindow.fixedSavingAmountSecs != null) {
-            loopSavings = firstWindow.fixedSavingAmountSecs;
-        }
-        final ZoneOffset firstWallOffset = ZoneOffset.ofTotalSeconds(loopStandardOffset.getTotalSeconds() + loopSavings);
-        LocalDateTime loopWindowStart = LocalDateTime.of(YEAR_MIN_VALUE, 1, 1, 0, 0);
-        ZoneOffset loopWindowOffset = firstWallOffset;
-
-        // build the windows and rules to interesting data
-        for (TZWindow window : windowList) {
-            // tidy the state
-            window.tidy(loopWindowStart.getYear());
-
-            // calculate effective savings at the start of the window
-            Integer effectiveSavings = window.fixedSavingAmountSecs;
-            if (effectiveSavings == null) {
-                // apply rules from this window together with the standard offset and
-                // savings from the last window to find the savings amount applicable
-                // at start of this window
-                effectiveSavings = 0;
-                for (TZRule rule : window.ruleList) {
-                    if (rule.toEpochSecond(loopStandardOffset, loopSavings) > loopWindowStart.toEpochSecond(loopWindowOffset)) {
-                        // previous savings amount found, which could be the savings amount at
-                        // the instant that the window starts (hence isAfter)
-                        break;
-                    }
-                    effectiveSavings = rule.savingAmountSecs;
-                }
-            }
-
-            // check if standard offset changed, and update it
-            if (loopStandardOffset.equals(window.standardOffset) == false) {
-                standardTransitionList.add(
-                    new ZoneOffsetTransition(
-                        LocalDateTime.ofEpochSecond(loopWindowStart.toEpochSecond(loopWindowOffset), 0, loopStandardOffset),
-                        loopStandardOffset, window.standardOffset));
-                loopStandardOffset = window.standardOffset;
-            }
-
-            // check if the start of the window represents a transition
-            ZoneOffset effectiveWallOffset = ZoneOffset.ofTotalSeconds(loopStandardOffset.getTotalSeconds() + effectiveSavings);
-            if (loopWindowOffset.equals(effectiveWallOffset) == false) {
-                transitionList.add(new ZoneOffsetTransition(loopWindowStart, loopWindowOffset, effectiveWallOffset));
-            }
-            loopSavings = effectiveSavings;
-
-            // apply rules within the window
-            for (TZRule rule : window.ruleList) {
-                if (rule.isTransition(loopSavings)) {
-                    ZoneOffsetTransition trans = rule.toTransition(loopStandardOffset, loopSavings);
-                    if (trans.toEpochSecond() < loopWindowStart.toEpochSecond(loopWindowOffset) == false &&
-                        trans.toEpochSecond() < window.createDateTimeEpochSecond(loopSavings)) {
-                        transitionList.add(trans);
-                        loopSavings = rule.savingAmountSecs;
-                    }
-                }
-            }
-
-            // calculate last rules
-            for (TZRule lastRule : window.lastRuleList) {
-                lastTransitionRuleList.add(lastRule.toTransitionRule(loopStandardOffset, loopSavings));
-                loopSavings = lastRule.savingAmountSecs;
-            }
-
-            // finally we can calculate the true end of the window, passing it to the next window
-            loopWindowOffset = window.createWallOffset(loopSavings);
-            loopWindowStart = LocalDateTime.ofEpochSecond(
-                    window.createDateTimeEpochSecond(loopSavings), 0, loopWindowOffset);
-        }
-
-        return new ZoneRules(
-                firstWindow.standardOffset, firstWallOffset, standardTransitionList,
-                transitionList, lastTransitionRuleList);
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * A definition of a window in the time-line.
-     * The window will have one standard offset and will either have a
-     * fixed DST savings or a set of rules.
-     */
-    class TZWindow {
-        /** The standard offset during the window, not null. */
-        private final ZoneOffset standardOffset;
-        /** The end local time, not null. */
-        private final LocalDateTime windowEnd;
-        /** The type of the end time, not null. */
-        private final TimeDefinition timeDefinition;
-
-        /** The fixed amount of the saving to be applied during this window. */
-        private Integer fixedSavingAmountSecs;
-        /** The rules for the current window. */
-        private List<TZRule> ruleList = new ArrayList<>();
-        /** The latest year that the last year starts at. */
-        private int maxLastRuleStartYear = YEAR_MIN_VALUE;
-        /** The last rules. */
-        private List<TZRule> lastRuleList = new ArrayList<>();
-
-        /**
-         * Constructor.
-         *
-         * @param standardOffset  the standard offset applicable during the window, not null
-         * @param windowEnd  the end of the window, relative to the time definition, null if forever
-         * @param timeDefinition  the time definition for calculating the true end, not null
-         */
-        TZWindow(
-                ZoneOffset standardOffset,
-                LocalDateTime windowEnd,
-                TimeDefinition timeDefinition) {
-            super();
-            this.windowEnd = windowEnd;
-            this.timeDefinition = timeDefinition;
-            this.standardOffset = standardOffset;
-        }
-
-        /**
-         * Sets the fixed savings amount for the window.
-         *
-         * @param fixedSavingAmount  the amount of daylight saving to apply throughout the window, may be null
-         * @throws IllegalStateException if the window already has rules
-         */
-        void setFixedSavings(int fixedSavingAmount) {
-            if (ruleList.size() > 0 || lastRuleList.size() > 0) {
-                throw new IllegalStateException("Window has DST rules, so cannot have fixed savings");
-            }
-            this.fixedSavingAmountSecs = fixedSavingAmount;
-        }
-
-        /**
-         * Adds a rule to the current window.
-         *
-         * @param startYear  the start year of the rule, from MIN_YEAR to MAX_YEAR
-         * @param endYear  the end year of the rule, from MIN_YEAR to MAX_YEAR
-         * @param month  the month of the transition, not null
-         * @param dayOfMonthIndicator  the day-of-month of the transition, adjusted by dayOfWeek,
-         *   from 1 to 31 adjusted later, or -1 to -28 adjusted earlier from the last day of the month
-         * @param dayOfWeek  the day-of-week to adjust to, null if day-of-month should not be adjusted
-         * @param time  the time that the transition occurs as defined by timeDefintion, not null
-         * @param timeEndOfDay  whether midnight is at the end of day
-         * @param timeDefinition  the definition of how to convert local to actual time, not null
-         * @param savingAmountSecs  the amount of saving from the standard offset in seconds
-         * @throws IllegalStateException if the window already has fixed savings
-         * @throws IllegalStateException if the window has reached the maximum capacity of 2000 rules
-         */
-        void addRule(
-                int startYear,
-                int endYear,
-                int month,
-                int dayOfMonthIndicator,
-                int dayOfWeek,
-                LocalTime time,
-                boolean timeEndOfDay,
-                TimeDefinition timeDefinition,
-                int savingAmountSecs) {
-
-            if (fixedSavingAmountSecs != null) {
-                throw new IllegalStateException("Window has a fixed DST saving, so cannot have DST rules");
-            }
-            if (ruleList.size() >= 2000) {
-                throw new IllegalStateException("Window has reached the maximum number of allowed rules");
-            }
-            boolean lastRule = false;
-            if (endYear == YEAR_MAX_VALUE) {
-                lastRule = true;
-                endYear = startYear;
-            }
-            int year = startYear;
-            while (year <= endYear) {
-                TZRule rule = new TZRule(year, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
-                if (lastRule) {
-                    lastRuleList.add(rule);
-                    maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
-                } else {
-                    ruleList.add(rule);
-                }
-                year++;
-            }
-        }
-
-        /**
-         * Validates that this window is after the previous one.
-         *
-         * @param previous  the previous window, not null
-         * @throws IllegalStateException if the window order is invalid
-         */
-        void validateWindowOrder(TZWindow previous) {
-            if (windowEnd.compareTo(previous.windowEnd) < 0) {
-                throw new IllegalStateException("Windows must be added in date-time order: " +
-                        windowEnd + " < " + previous.windowEnd);
-            }
-        }
-
-        /**
-         * Adds rules to make the last rules all start from the same year.
-         * Also add one more year to avoid weird case where penultimate year has odd offset.
-         *
-         * @param windowStartYear  the window start year
-         * @throws IllegalStateException if there is only one rule defined as being forever
-         */
-        void tidy(int windowStartYear) {
-            if (lastRuleList.size() == 1) {
-                throw new IllegalStateException("Cannot have only one rule defined as being forever");
-            }
-
-            // handle last rules
-            if (windowEnd.equals(LocalDateTime.MAX)) {
-                // setup at least one real rule, which closes off other windows nicely
-                maxLastRuleStartYear = Math.max(maxLastRuleStartYear, windowStartYear) + 1;
-                for (TZRule lastRule : lastRuleList) {
-                    addRule(lastRule.year, maxLastRuleStartYear, lastRule.month, lastRule.dayOfMonthIndicator,
-                        lastRule.dayOfWeek, lastRule.time, lastRule.timeEndOfDay, lastRule.timeDefinition, lastRule.savingAmountSecs);
-                    lastRule.year = maxLastRuleStartYear + 1;
-                }
-                if (maxLastRuleStartYear == YEAR_MAX_VALUE) {
-                    lastRuleList.clear();
-                } else {
-                    maxLastRuleStartYear++;
-                }
-            } else {
-                // convert all within the endYear limit
-                int endYear = windowEnd.getYear();
-                for (TZRule lastRule : lastRuleList) {
-                    addRule(lastRule.year, endYear + 1, lastRule.month, lastRule.dayOfMonthIndicator,
-                        lastRule.dayOfWeek, lastRule.time, lastRule.timeEndOfDay, lastRule.timeDefinition, lastRule.savingAmountSecs);
-                }
-                lastRuleList.clear();
-                maxLastRuleStartYear = YEAR_MAX_VALUE;
-            }
-
-            // ensure lists are sorted
-            Collections.sort(ruleList);
-            Collections.sort(lastRuleList);
-
-            // default fixed savings to zero
-            if (ruleList.size() == 0 && fixedSavingAmountSecs == null) {
-                fixedSavingAmountSecs = 0;
-            }
-        }
-
-        /**
-         * Checks if the window is empty.
-         *
-         * @return true if the window is only a standard offset
-         */
-        boolean isSingleWindowStandardOffset() {
-            return windowEnd.equals(LocalDateTime.MAX) && timeDefinition == TimeDefinition.WALL &&
-                    fixedSavingAmountSecs == null && lastRuleList.isEmpty() && ruleList.isEmpty();
-        }
-
-        /**
-         * Creates the wall offset for the local date-time at the end of the window.
-         *
-         * @param savingsSecs  the amount of savings in use in seconds
-         * @return the created date-time epoch second in the wall offset, not null
-         */
-        ZoneOffset createWallOffset(int savingsSecs) {
-            return ZoneOffset.ofTotalSeconds(standardOffset.getTotalSeconds() + savingsSecs);
-        }
-
-        /**
-         * Creates the offset date-time for the local date-time at the end of the window.
-         *
-         * @param savingsSecs  the amount of savings in use in seconds
-         * @return the created date-time epoch second in the wall offset, not null
-         */
-        long createDateTimeEpochSecond(int savingsSecs) {
-            ZoneOffset wallOffset = createWallOffset(savingsSecs);
-            LocalDateTime ldt = timeDefinition.createDateTime(windowEnd, standardOffset, wallOffset);
-            return ldt.toEpochSecond(wallOffset);
-        }
-    }
-
-    //-----------------------------------------------------------------------
-    /**
-     * A definition of the way a local time can be converted to an offset time.
-     */
-    class TZRule implements Comparable<TZRule> {
-        private int year;
-        private int month;
-        private int dayOfMonthIndicator;
-        private int dayOfWeek;
-        private LocalTime time;
-        private boolean timeEndOfDay; // Whether the local time is end of day.
-        private TimeDefinition timeDefinition; // The type of the time.
-        private int savingAmountSecs; // The amount of the saving to be applied after this point.
-
-        /**
-         * Constructor.
-         *
-         * @param year  the year
-         * @param month  the month, value from 1 to 12
-         * @param dayOfMonthIndicator  the day-of-month of the transition, adjusted by dayOfWeek,
-         *   from 1 to 31 adjusted later, or -1 to -28 adjusted earlier from the last day of the month
-         * @param dayOfWeek  the day-of-week, -1 if day-of-month is exact
-         * @param time  the time, not null
-         * @param timeEndOfDay  whether midnight is at the end of day
-         * @param timeDefinition  the time definition, not null
-         * @param savingAfterSecs  the savings amount in seconds
-         */
-        TZRule(int year, int month, int dayOfMonthIndicator,
-                int dayOfWeek, LocalTime time, boolean timeEndOfDay,
-                TimeDefinition timeDefinition, int savingAfterSecs) {
-            this.year = year;
-            this.month = month;
-            this.dayOfMonthIndicator = dayOfMonthIndicator;
-            this.dayOfWeek = dayOfWeek;
-            this.time = time;
-            this.timeEndOfDay = timeEndOfDay;
-            this.timeDefinition = timeDefinition;
-            this.savingAmountSecs = savingAfterSecs;
-        }
-
-        /**
-         * Converts this to a transition.
-         *
-         * @param standardOffset  the active standard offset, not null
-         * @param savingsBeforeSecs  the active savings in seconds
-         * @return the transition, not null
-         */
-        ZoneOffsetTransition toTransition(ZoneOffset standardOffset, int savingsBeforeSecs) {
-            // copy of code in ZoneOffsetTransitionRule to avoid infinite loop
-            LocalDate date = toLocalDate();
-            LocalDateTime ldt = LocalDateTime.of(date, time);
-            ZoneOffset wallOffset = ZoneOffset.ofTotalSeconds(standardOffset.getTotalSeconds() + savingsBeforeSecs);
-            LocalDateTime dt = timeDefinition.createDateTime(ldt, standardOffset, wallOffset);
-            ZoneOffset offsetAfter = ZoneOffset.ofTotalSeconds(standardOffset.getTotalSeconds() + savingAmountSecs);
-            return new ZoneOffsetTransition(dt, wallOffset, offsetAfter);
-        }
-
-        /**
-         * Returns the apoch second of this rules with the specified
-         * active standard offset and active savings
-         *
-         * @param standardOffset  the active standard offset, not null
-         * @param savingsBeforeSecs  the active savings in seconds
-         * @return the transition epoch second
-         */
-        long toEpochSecond(ZoneOffset standardOffset, int savingsBeforeSecs) {
-            LocalDateTime ldt = LocalDateTime.of(toLocalDate(), time);
-            ZoneOffset wallOffset = ZoneOffset.ofTotalSeconds(standardOffset.getTotalSeconds() + savingsBeforeSecs);
-            return timeDefinition.createDateTime(ldt, standardOffset, wallOffset)
-                                 .toEpochSecond(wallOffset);
-        }
-
-        /**
-         * Tests if this a real transition with the active savings in seconds
-         *
-         * @param savingsBeforeSecs  the active savings in seconds
-         * @return true, if savings in seconds changes
-         */
-        boolean isTransition(int savingsBeforeSecs) {
-            return savingAmountSecs != savingsBeforeSecs;
-        }
-
-        /**
-         * Converts this to a transition rule.
-         *
-         * @param standardOffset  the active standard offset, not null
-         * @param savingsBeforeSecs  the active savings before the transition in seconds
-         * @return the transition, not null
-         */
-        ZoneOffsetTransitionRule toTransitionRule(ZoneOffset standardOffset, int savingsBeforeSecs) {
-            // optimize stored format
-            if (dayOfMonthIndicator < 0) {
-                if (month != 2) {    // not Month.FEBRUARY
-                    dayOfMonthIndicator = maxLengthOfMonth(month) - 6;
-                }
-            }
-            if (timeEndOfDay && dayOfMonthIndicator > 0 &&
-                (dayOfMonthIndicator == 28 && month == 2) == false) {
-                LocalDate date = LocalDate.of(2004, month, dayOfMonthIndicator).plusDays(1);  // leap-year
-                month = date.getMonth();
-                dayOfMonthIndicator = date.getDayOfMonth();
-                if (dayOfWeek != -1) {
-                    dayOfWeek = plusDayOfWeek(dayOfWeek, 1);
-                }
-                timeEndOfDay = false;
-            }
-            // build rule
-            return new ZoneOffsetTransitionRule(
-                    month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition,
-                    standardOffset,
-                    ZoneOffset.ofTotalSeconds(standardOffset.getTotalSeconds() + savingsBeforeSecs),
-                    ZoneOffset.ofTotalSeconds(standardOffset.getTotalSeconds() + savingAmountSecs));
-        }
-
-        public int compareTo(TZRule other) {
-            int cmp = year - other.year;
-            cmp = (cmp == 0 ? month - other.month : cmp);
-            if (cmp == 0) {
-                // convert to date to handle dow/domIndicator/timeEndOfDay
-                LocalDate thisDate = toLocalDate();
-                LocalDate otherDate = other.toLocalDate();
-                cmp = thisDate.compareTo(otherDate);
-            }
-            cmp = (cmp == 0 ? time.compareTo(other.time) : cmp);
-            return cmp;
-        }
-
-        private LocalDate toLocalDate() {
-            LocalDate date;
-            if (dayOfMonthIndicator < 0) {
-                int monthLen = lengthOfMonth(month, isLeapYear(year));
-                date = LocalDate.of(year, month, monthLen + 1 + dayOfMonthIndicator);
-                if (dayOfWeek != -1) {
-                    date = previousOrSame(date, dayOfWeek);
-                }
-            } else {
-                date = LocalDate.of(year, month, dayOfMonthIndicator);
-                if (dayOfWeek != -1) {
-                    date = nextOrSame(date, dayOfWeek);
-                }
-            }
-            if (timeEndOfDay) {
-                date = date.plusDays(1);
-            }
-            return date;
-        }
-    }
-
-}
--- a/make/src/native/genconstants/ch/genSocketOptionRegistry.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/make/src/native/genconstants/ch/genSocketOptionRegistry.c	Wed Jul 09 10:42:37 2014 -0700
@@ -110,6 +110,7 @@
     emit_inet("StandardSocketOptions.IP_MULTICAST_LOOP", IPPROTO_IP,     IP_MULTICAST_LOOP);
 
 #ifdef AF_INET6
+    emit_inet6("StandardSocketOptions.IP_TOS",            IPPROTO_IPV6,  IPV6_TCLASS);
     emit_inet6("StandardSocketOptions.IP_MULTICAST_IF",   IPPROTO_IPV6,  IPV6_MULTICAST_IF);
     emit_inet6("StandardSocketOptions.IP_MULTICAST_TTL",  IPPROTO_IPV6,  IPV6_MULTICAST_HOPS);
     emit_inet6("StandardSocketOptions.IP_MULTICAST_LOOP", IPPROTO_IPV6,  IPV6_MULTICAST_LOOP);
--- a/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -522,15 +522,17 @@
     };
 
     @SuppressWarnings("serial") // anonymous class
-    private static Action hideAction = new AbstractAction() {
+    private final Action hideAction = new AbstractAction() {
         @Override
         public void actionPerformed(final ActionEvent e) {
             final JComboBox comboBox = (JComboBox)e.getSource();
+            comboBox.firePopupMenuCanceled();
+            comboBox.setPopupVisible(false);
+        }
 
-            if (comboBox.isPopupVisible()) {
-                comboBox.firePopupMenuCanceled();
-                comboBox.setPopupVisible(false);
-            }
+        @Override
+        public boolean isEnabled() {
+            return comboBox.isPopupVisible() && super.isEnabled();
         }
     };
 
--- a/src/macosx/classes/com/apple/laf/AquaFileSystemModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaFileSystemModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -366,6 +366,11 @@
             final SortableFile otherFile = (SortableFile)other;
             return otherFile.fFile.equals(fFile);
         }
+
+        @Override
+        public int hashCode() {
+            return Objects.hashCode(fFile);
+        }
     }
 
     class LoadFilesThread extends Thread {
--- a/src/macosx/classes/com/apple/laf/ScreenPopupFactory.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/ScreenPopupFactory.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,18 +29,9 @@
 import javax.swing.*;
 
 import sun.lwawt.macosx.CPlatformWindow;
+import sun.swing.SwingAccessor;
 
 class ScreenPopupFactory extends PopupFactory {
-    static {
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("osxui");
-                    return null;
-                }
-            });
-    }
-
     static final Float TRANSLUCENT = new Float(248f/255f);
     static final Float OPAQUE = new Float(1.0f);
 
@@ -59,19 +50,13 @@
         return (Window)w;
     }
 
-    /*
-     * Since we can't change the signature of PopupFactory, we have to call the
-     * private method getPopup(Component, Component, int, int, int) through JNI
-     * (see AquaLookAndFeel.m)
-     */
-    native Popup _getHeavyWeightPopup(Component comp, Component invoker, int x, int y);
-
     public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
         if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");
 
         final Popup popup;
         if (fIsActive) {
-            popup = _getHeavyWeightPopup(comp, invoker, x, y);
+            popup = SwingAccessor.getPopupFactoryAccessor()
+                    .getHeavyWeightPopup(this, comp, invoker, x, y);
         } else {
             popup = super.getPopup(comp, invoker, x, y);
         }
--- a/src/macosx/classes/sun/font/CStrike.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/font/CStrike.java	Wed Jul 09 10:42:37 2014 -0700
@@ -415,7 +415,7 @@
                 generalCache = new HashMap<Integer, Long>();
             }
 
-            generalCache.put(new Integer(index), new Long(value));
+            generalCache.put(new Integer(index), Long.valueOf(value));
         }
 
         public synchronized void dispose() {
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -317,6 +317,8 @@
      * subclasses to initialize specific peers properties.
      */
     void initializeImpl() {
+        // note that these methods can be overridden by the user and
+        // can return some strange values like null.
         setBackground(target.getBackground());
         setForeground(target.getForeground());
         setFont(target.getFont());
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -444,6 +444,12 @@
     }
 
     @Override
+    public void setBackground(final Color c) {
+        super.setBackground(c);
+        updateOpaque();
+    }
+
+    @Override
     public void setOpacity(float opacity) {
         getPlatformWindow().setOpacity(opacity);
         repaintPeer();
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -97,7 +97,8 @@
     public void handleKeyEvent(int eventType, int modifierFlags, String characters,
                                String charsIgnoringMods, boolean isRepeat, short keyCode,
                                boolean needsKeyTyped) {
-        responder.handleKeyEvent(eventType, modifierFlags, charsIgnoringMods, keyCode, needsKeyTyped, isRepeat);
+        responder.handleKeyEvent(eventType, modifierFlags, characters, charsIgnoringMods,
+                keyCode, needsKeyTyped, isRepeat);
     }
 
     public void handleInputEvent(String text) {
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformLWWindow.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformLWWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,12 +29,18 @@
 import java.awt.FontMetrics;
 import java.awt.Graphics;
 import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
 import java.awt.Insets;
 import java.awt.MenuBar;
 import java.awt.Point;
+import java.awt.Rectangle;
 import java.awt.Window;
+import sun.awt.CGraphicsDevice;
+import sun.awt.CGraphicsEnvironment;
 import sun.awt.CausedFocusEvent;
+import sun.awt.LightweightFrame;
 import sun.java2d.SurfaceData;
+import sun.lwawt.LWLightweightFramePeer;
 import sun.lwawt.LWWindowPeer;
 import sun.lwawt.PlatformWindow;
 
@@ -73,11 +79,6 @@
     }
 
     @Override
-    public GraphicsDevice getGraphicsDevice() {
-        return null;
-    }
-
-    @Override
     public SurfaceData getScreenSurface() {
         return null;
     }
@@ -199,4 +200,24 @@
     public long getLayerPtr() {
         return 0;
     }
+
+    @Override
+    public GraphicsDevice getGraphicsDevice() {
+        CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
+                                  getLocalGraphicsEnvironment();
+
+        LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
+        int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();
+
+        Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
+        for (GraphicsDevice d : ge.getScreenDevices()) {
+            if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
+                ((CGraphicsDevice)d).getScaleFactor() == scale)
+            {
+                return d;
+            }
+        }
+        // We shouldn't be here...
+        return ge.getDefaultScreenDevice();
+    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Wed Jul 09 10:42:37 2014 -0700
@@ -125,7 +125,7 @@
     /**
      * Handles key events.
      */
-    void handleKeyEvent(int eventType, int modifierFlags, String chars,
+    void handleKeyEvent(int eventType, int modifierFlags, String chars, String charsIgnoringModifiers,
                         short keyCode, boolean needsKeyTyped, boolean needsKeyReleased) {
         boolean isFlagsChangedEvent =
             isNpapiCallback ? (eventType == CocoaConstants.NPCocoaEventFlagsChanged) :
@@ -153,7 +153,10 @@
                 testChar = chars.charAt(0);
             }
 
-            int[] in = new int[] {testChar, isDeadChar ? 1 : 0, modifierFlags, keyCode};
+            char testCharIgnoringModifiers = charsIgnoringModifiers != null && charsIgnoringModifiers.length() > 0 ?
+                    charsIgnoringModifiers.charAt(0) : KeyEvent.CHAR_UNDEFINED;
+
+            int[] in = new int[] {testCharIgnoringModifiers, isDeadChar ? 1 : 0, modifierFlags, keyCode};
             int[] out = new int[3]; // [jkeyCode, jkeyLocation, deadChar]
 
             postsTyped = NSEvent.nsToJavaKeyInfo(in, out);
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -200,7 +200,7 @@
     }
 
     private void deliverKeyEvent(NSEvent event) {
-        responder.handleKeyEvent(event.getType(), event.getModifierFlags(),
+        responder.handleKeyEvent(event.getType(), event.getModifierFlags(), event.getCharacters(),
                                  event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
     }
 
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -119,6 +119,7 @@
     static final int NONACTIVATING = 1 << 24;
     static final int IS_DIALOG = 1 << 25;
     static final int IS_MODAL = 1 << 26;
+    static final int IS_POPUP = 1 << 27;
 
     static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
 
@@ -318,6 +319,7 @@
             styleBits = SET(styleBits, TEXTURED, false);
             // Popups in applets don't activate applet's process
             styleBits = SET(styleBits, NONACTIVATING, true);
+            styleBits = SET(styleBits, IS_POPUP, true);
         }
 
         if (Window.Type.UTILITY.equals(target.getType())) {
@@ -744,20 +746,22 @@
     @Override
     public void setOpaque(boolean isOpaque) {
         CWrapper.NSWindow.setOpaque(getNSWindowPtr(), isOpaque);
-        boolean isTextured = (peer == null)? false : peer.isTextured();
-        if (!isOpaque && !isTextured) {
-            long clearColor = CWrapper.NSColor.clearColor();
-            CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), clearColor);
+        boolean isTextured = (peer == null) ? false : peer.isTextured();
+        if (!isTextured) {
+            if (!isOpaque) {
+                CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), 0);
+            } else if (peer != null) {
+                Color color = peer.getBackground();
+                if (color != null) {
+                    int rgb = color.getRGB();
+                    CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), rgb);
+                }
+            }
         }
 
         //This is a temporary workaround. Looks like after 7124236 will be fixed
         //the correct place for invalidateShadow() is CGLayer.drawInCGLContext.
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                invalidateShadow();
-            }
-        });
+        SwingUtilities.invokeLater(this::invalidateShadow);
     }
 
     @Override
--- a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Wed Jul 09 10:42:37 2014 -0700
@@ -61,7 +61,14 @@
 
         static native void setAlphaValue(long window, float alpha);
         static native void setOpaque(long window, boolean opaque);
-        static native void setBackgroundColor(long window, long color);
+
+        /**
+         * Sets background color of the NSWindow.
+         *
+         * @param window the pointer of the NSWindow
+         * @param color the color in argb format
+         */
+        static native void setBackgroundColor(long window, int color);
 
         static native void miniaturize(long window);
         static native void deminiaturize(long window);
@@ -82,8 +89,4 @@
 
         static native void setToolTip(long view, String msg);
     }
-
-    static final class NSColor {
-        static native long clearColor();
-    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/NSEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/NSEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -47,13 +47,15 @@
 
     // Key event information
     private short keyCode;
+    private String characters;
     private String charactersIgnoringModifiers;
 
     // Called from native
-    NSEvent(int type, int modifierFlags, short keyCode, String charactersIgnoringModifiers) {
+    NSEvent(int type, int modifierFlags, short keyCode, String characters, String charactersIgnoringModifiers) {
         this.type = type;
         this.modifierFlags = modifierFlags;
         this.keyCode = keyCode;
+        this.characters = characters;
         this.charactersIgnoringModifiers = charactersIgnoringModifiers;
     }
 
@@ -121,12 +123,16 @@
         return charactersIgnoringModifiers;
     }
 
+    String getCharacters() {
+        return characters;
+    }
+
     @Override
     public String toString() {
         return "NSEvent[" + getType() + " ," + getModifierFlags() + " ,"
                 + getClickCount() + " ," + getButtonNumber() + " ," + getX() + " ,"
                 + getY() + " ," + getAbsX() + " ," + getAbsY()+ " ," + getKeyCode() + " ,"
-                + getCharactersIgnoringModifiers() + "]";
+                + getCharacters() + " ," + getCharactersIgnoringModifiers() + "]";
     }
 
     /*
--- a/src/macosx/native/com/apple/laf/ScreenPopupFactory.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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
- * 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.
- */
-
-#import "com_apple_laf_ScreenPopupFactory.h"
-#import <JavaNativeFoundation/JavaNativeFoundation.h>
-
-static JNF_CLASS_CACHE(sjc_PopupFactory, "javax/swing/PopupFactory");
-static JNF_MEMBER_CACHE(jm_getPopup, sjc_PopupFactory, "getPopup", "(Ljava/awt/Component;Ljava/awt/Component;III)Ljavax/swing/Popup;");
-
-/*
- * Class:     com_apple_laf_ScreenPopupFactory
- * Method:    _getHeavyWeightPopup
- * Signature: (Ljava/awt/Component;Ljava/awt/Component;II)Ljavax/swing/Popup;
- */
-JNIEXPORT jobject /* javax.swing.Popup */ JNICALL Java_com_apple_laf_ScreenPopupFactory__1getHeavyWeightPopup
-(JNIEnv *env, jobject screenPopupFactory, jobject comp, jobject invoker, jint x, jint y) {
-    jobject popup;
-JNF_COCOA_ENTER(env);
-    popup = JNFCallObjectMethod(env, screenPopupFactory, jm_getPopup, comp, invoker, x, y, 2);
-JNF_COCOA_EXIT(env);
-    return popup;
-}
--- a/src/macosx/native/jobjc/JObjC.xcodeproj/default.pbxuser	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +0,0 @@
-// !$*UTF8*$!
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-{
-        00E6828EFEC88D1A11DB9C8B /* Project object */ = {
-                activeBuildConfigurationName = Release;
-                activeExecutable = 6A9FA6570246BA6C0CC91562 /* JObjC */;
-                activeTarget = EB9FD8610AEECCF5008E157E /* JObjC */;
-                addToTargets = (
-                        4CEBA78E08679EF10015D03E /* JNILib */,
-                );
-                breakpointsGroup = 0AB3651F0B2F67B300788B6C /* XCBreakpointsBucket */;
-                codeSenseManager = 0AB364DB0B2F66FD00788B6C /* Code sense */;
-                executables = (
-                        6A9FA6570246BA6C0CC91562 /* JObjC */,
-                );
-                perUserDictionary = {
-                        PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
-                                PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                                PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
-                                PBXFileTableDataSourceColumnWidthsKey = (
-                                        22,
-                                        300,
-                                        131,
-                                );
-                                PBXFileTableDataSourceColumnsKey = (
-                                        PBXExecutablesDataSource_ActiveFlagID,
-                                        PBXExecutablesDataSource_NameID,
-                                        PBXExecutablesDataSource_CommentsID,
-                                );
-                        };
-                        PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
-                                PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                                PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-                                PBXFileTableDataSourceColumnWidthsKey = (
-                                        20,
-                                        245,
-                                        20,
-                                        48,
-                                        43,
-                                        43,
-                                        20,
-                                );
-                                PBXFileTableDataSourceColumnsKey = (
-                                        PBXFileDataSource_FiletypeID,
-                                        PBXFileDataSource_Filename_ColumnID,
-                                        PBXFileDataSource_Built_ColumnID,
-                                        PBXFileDataSource_ObjectSize_ColumnID,
-                                        PBXFileDataSource_Errors_ColumnID,
-                                        PBXFileDataSource_Warnings_ColumnID,
-                                        PBXFileDataSource_Target_ColumnID,
-                                );
-                        };
-                        PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
-                                PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                                PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-                                PBXFileTableDataSourceColumnWidthsKey = (
-                                        20,
-                                        200,
-                                        65,
-                                        20,
-                                        48,
-                                        43,
-                                        43,
-                                );
-                                PBXFileTableDataSourceColumnsKey = (
-                                        PBXFileDataSource_FiletypeID,
-                                        PBXFileDataSource_Filename_ColumnID,
-                                        PBXTargetDataSource_PrimaryAttribute,
-                                        PBXFileDataSource_Built_ColumnID,
-                                        PBXFileDataSource_ObjectSize_ColumnID,
-                                        PBXFileDataSource_Errors_ColumnID,
-                                        PBXFileDataSource_Warnings_ColumnID,
-                                );
-                        };
-                };
-                sourceControlManager = 0AB364DA0B2F66FD00788B6C /* Source Control */;
-                userBuildSettings = {
-                };
-        };
-        0AB364DA0B2F66FD00788B6C /* Source Control */ = {
-                isa = PBXSourceControlManager;
-                fallbackIsa = XCSourceControlManager;
-                isSCMEnabled = 0;
-                scmConfiguration = {
-                };
-                scmType = "";
-        };
-        0AB364DB0B2F66FD00788B6C /* Code sense */ = {
-                isa = PBXCodeSenseManager;
-                indexTemplatePath = "";
-        };
-        0AB3651F0B2F67B300788B6C /* XCBreakpointsBucket */ = {
-                isa = XCBreakpointsBucket;
-                name = "Project Breakpoints";
-                objects = (
-                );
-        };
-        0AB365570B2F6ABB00788B6C /* JObjCdylib.c */ = {
-                uiCtxt = {
-                        sepNavIntBoundsRect = "{{0, 0}, {847, 783}}";
-                        sepNavSelRange = "{0, 0}";
-                        sepNavVisRect = "{{0, 0}, {847, 783}}";
-                        sepNavWindowFrame = "{{84, 198}, {886, 912}}";
-                };
-        };
-        0A3CC35E0B94BB8800F6BA26 /* java */ = {
-                isa = PBXFileReference;
-                explicitFileType = "compiled.mach-o.executable";
-                name = java;
-                path = /usr/bin/java;
-                sourceTree = "<absolute>";
-        };
-        363028F90383184400C91562 /* Manifest */ = {
-                uiCtxt = {
-                        sepNavIntBoundsRect = "{{0, 0}, {847, 783}}";
-                        sepNavSelRange = "{0, 0}";
-                        sepNavVisRect = "{{0, 0}, {847, 783}}";
-                        sepNavWindowFrame = "{{38, 240}, {886, 912}}";
-                };
-        };
-        4CEBA78E08679EF10015D03E /* Dylib */ = {
-                activeExec = 0;
-        };
-        6A9FA6570246BA6C0CC91562 /* JObjC */ = {
-                isa = PBXExecutable;
-                activeArgIndex = 0;
-                activeArgIndices = (
-                        YES,
-                );
-                argumentStrings = (
-                        "-cp JObjC.jar JObjC",
-                );
-                autoAttachOnCrash = 1;
-                configStateDict = {
-                        "PBXLSLaunchAction-0" = {
-                                PBXLSLaunchAction = 0;
-                                PBXLSLaunchStartAction = 1;
-                                PBXLSLaunchStdioStyle = 2;
-                                PBXLSLaunchStyle = 0;
-                                class = PBXLSRunLaunchConfig;
-                                displayName = "Executable Runner";
-                                identifier = com.apple.Xcode.launch.runConfig;
-                                remoteHostInfo = "";
-                                startActionInfo = "";
-                        };
-                        "PBXLSLaunchAction-1" = {
-                                PBXLSLaunchAction = 1;
-                                PBXLSLaunchStartAction = 1;
-                                PBXLSLaunchStdioStyle = 2;
-                                PBXLSLaunchStyle = 0;
-                                class = PBXJavaDebuggingNativeLaunchConfig;
-                                displayName = "Java Debugger";
-                                identifier = com.apple.Xcode.launch.JavaDebugNativeConfig;
-                                remoteHostInfo = "";
-                                startActionInfo = "";
-                        };
-                };
-                customDataFormattersEnabled = 1;
-                debuggerPlugin = GDBDebugging;
-                disassemblyDisplayState = 0;
-                dylibVariantSuffix = "";
-                enableDebugStr = 1;
-                environmentEntries = (
-                );
-                executableSystemSymbolLevel = 0;
-                executableUserSymbolLevel = 0;
-                launchableReference = 0A3CC35E0B94BB8800F6BA26 /* java */;
-                libgmallocEnabled = 0;
-                name = JObjC;
-                sourceDirectories = (
-                );
-                startupPath = "dist";
-        };
-        EB9FD8610AEECCF5008E157E /* JObjC */ = {
-                activeExec = 0;
-        };
-        EB9FD8720AEECD83008E157E /* build.xml */ = {
-                uiCtxt = {
-                        sepNavIntBoundsRect = "{{0, 0}, {847, 1260}}";
-                        sepNavSelRange = "{1260, 0}";
-                        sepNavVisRect = "{{0, 8}, {847, 783}}";
-                        sepNavWindowFrame = "{{752, 266}, {886, 912}}";
-                };
-        };
-}
--- a/src/macosx/native/jobjc/JObjC.xcodeproj/project.pbxproj	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1397 +0,0 @@
-// !$*UTF8*$!
-{
-        archiveVersion = 1;
-        classes = {
-        };
-        objectVersion = 44;
-        objects = {
-
-/* Begin PBXAggregateTarget section */
-                89EBD58C0C95F43D000F04A0 /* B&I */ = {
-                        isa = PBXAggregateTarget;
-                        buildConfigurationList = 89EBD5930C95F44E000F04A0 /* Build configuration list for PBXAggregateTarget "B&I" */;
-                        buildPhases = (
-                        );
-                        dependencies = (
-                                C592D6590E12F27400D076FF /* PBXTargetDependency */,
-                                C592D65B0E12F27600D076FF /* PBXTargetDependency */,
-                                C592D65D0E12F27E00D076FF /* PBXTargetDependency */,
-                                89D7CB9C0CDC64F800472EA2 /* PBXTargetDependency */,
-                                C592D65F0E12F28500D076FF /* PBXTargetDependency */,
-                                C592D6610E12F28E00D076FF /* PBXTargetDependency */,
-                                C592D6630E12F29200D076FF /* PBXTargetDependency */,
-                                89D7CC920CDE7A8200472EA2 /* PBXTargetDependency */,
-                        );
-                        name = "B&I";
-                        productName = "B&I";
-                };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
-                89D7C9F70CDB900E00472EA2 /* CIF.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9EC0CDB900E00472EA2 /* CIF.m */; };
-                89D7C9F80CDB900E00472EA2 /* Coder.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9ED0CDB900E00472EA2 /* Coder.m */; };
-                89D7C9F90CDB900E00472EA2 /* Function.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9EE0CDB900E00472EA2 /* Function.m */; };
-                89D7C9FA0CDB900E00472EA2 /* ID.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9EF0CDB900E00472EA2 /* ID.m */; };
-                89D7C9FB0CDB900E00472EA2 /* JObjCRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F00CDB900E00472EA2 /* JObjCRuntime.m */; };
-                89D7C9FC0CDB900E00472EA2 /* MacOSXFramework.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F10CDB900E00472EA2 /* MacOSXFramework.m */; };
-                89D7C9FD0CDB900E00472EA2 /* NativeBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D7C9F20CDB900E00472EA2 /* NativeBuffer.h */; };
-                89D7C9FE0CDB900E00472EA2 /* NativeBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F30CDB900E00472EA2 /* NativeBuffer.m */; };
-                89D7C9FF0CDB900E00472EA2 /* NativeObjectLifecycleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F40CDB900E00472EA2 /* NativeObjectLifecycleManager.m */; };
-                89D7CA000CDB900E00472EA2 /* NSClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F50CDB900E00472EA2 /* NSClass.m */; };
-                89D7CA010CDB900E00472EA2 /* SEL.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F60CDB900E00472EA2 /* SEL.m */; };
-                89D7CB770CDC4A6500472EA2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 890FBACC0C6F782C00902C32 /* Foundation.framework */; };
-                89D7CB780CDC4A6500472EA2 /* JavaVM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 890FBACA0C6F781000902C32 /* JavaVM.framework */; };
-                89D7CB790CDC4A6500472EA2 /* JavaNativeFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 896D90BB0CC2877C005625F5 /* JavaNativeFoundation.framework */; };
-                89D7CB7A0CDC4A6500472EA2 /* libffi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 89E437680C97A7F200C756EE /* libffi.dylib */; };
-                89D7CCA40CDF9A2600472EA2 /* NativeBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D7C9F20CDB900E00472EA2 /* NativeBuffer.h */; };
-                89D7CCA60CDF9A2600472EA2 /* CIF.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9EC0CDB900E00472EA2 /* CIF.m */; };
-                89D7CCA70CDF9A2600472EA2 /* Coder.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9ED0CDB900E00472EA2 /* Coder.m */; };
-                89D7CCA80CDF9A2600472EA2 /* Function.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9EE0CDB900E00472EA2 /* Function.m */; };
-                89D7CCA90CDF9A2600472EA2 /* ID.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9EF0CDB900E00472EA2 /* ID.m */; };
-                89D7CCAA0CDF9A2600472EA2 /* JObjCRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F00CDB900E00472EA2 /* JObjCRuntime.m */; };
-                89D7CCAB0CDF9A2600472EA2 /* MacOSXFramework.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F10CDB900E00472EA2 /* MacOSXFramework.m */; };
-                89D7CCAC0CDF9A2600472EA2 /* NativeBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F30CDB900E00472EA2 /* NativeBuffer.m */; };
-                89D7CCAD0CDF9A2600472EA2 /* NativeObjectLifecycleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F40CDB900E00472EA2 /* NativeObjectLifecycleManager.m */; };
-                89D7CCAE0CDF9A2600472EA2 /* NSClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F50CDB900E00472EA2 /* NSClass.m */; };
-                89D7CCAF0CDF9A2600472EA2 /* SEL.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7C9F60CDB900E00472EA2 /* SEL.m */; };
-                89D7CCB10CDF9A2600472EA2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 890FBACC0C6F782C00902C32 /* Foundation.framework */; };
-                89D7CCB20CDF9A2600472EA2 /* JavaVM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 890FBACA0C6F781000902C32 /* JavaVM.framework */; };
-                89D7CCB30CDF9A2600472EA2 /* JavaNativeFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 896D90BB0CC2877C005625F5 /* JavaNativeFoundation.framework */; };
-                89D7CCB40CDF9A2600472EA2 /* libffi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 89E437680C97A7F200C756EE /* libffi.dylib */; };
-                89D7CCBB0CDF9AA200472EA2 /* NativeString.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7CCBA0CDF9AA200472EA2 /* NativeString.m */; };
-                89D7CCBD0CDF9AB100472EA2 /* NativeNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7CCBC0CDF9AB100472EA2 /* NativeNumber.m */; };
-                89D7CCBF0CDF9AC600472EA2 /* NativeThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D7CCBE0CDF9AC600472EA2 /* NativeThread.m */; };
-                C5742F6D0E316EFA00093838 /* Subclassing.m in Sources */ = {isa = PBXBuildFile; fileRef = C5742F6B0E316EFA00093838 /* Subclassing.m */; };
-                C5742F700E316F8600093838 /* Subclassing.m in Sources */ = {isa = PBXBuildFile; fileRef = C5742F6B0E316EFA00093838 /* Subclassing.m */; };
-                C5D196C90DF9E43C006F9FB9 /* FFIType.m in Sources */ = {isa = PBXBuildFile; fileRef = C5D196C80DF9E43C006F9FB9 /* FFIType.m */; };
-                C5D197D90DFB77C6006F9FB9 /* FFIType.m in Sources */ = {isa = PBXBuildFile; fileRef = C5D196C80DF9E43C006F9FB9 /* FFIType.m */; };
-                C5E4547B0E36729F0046D3E8 /* Invoke.m in Sources */ = {isa = PBXBuildFile; fileRef = C5E454790E36729F0046D3E8 /* Invoke.m */; };
-                C5E4547D0E367DAB0046D3E8 /* Invoke.m in Sources */ = {isa = PBXBuildFile; fileRef = C5E454790E36729F0046D3E8 /* Invoke.m */; };
-                C5F3B23D0E39948300B771AE /* FunCallBench.m in Sources */ = {isa = PBXBuildFile; fileRef = C5F3B1370E398F8E00B771AE /* FunCallBench.m */; };
-                C5F3B2620E3AB0F300B771AE /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5F3B2610E3AB0F300B771AE /* AppKit.framework */; };
-                C5F3B2640E3AB0F300B771AE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5F3B2630E3AB0F300B771AE /* Cocoa.framework */; };
-                C5F3B2650E3AB0F300B771AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 890FBACC0C6F782C00902C32 /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-                2CC7556013A1322100B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = EB9FD8610AEECCF5008E157E;
-                        remoteInfo = "build-core-java";
-                };
-                2CC7556213A1322800B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = C5F3B1530E39927900B771AE;
-                        remoteInfo = "build-test-java";
-                };
-                2CC7556413A1323700B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CA160CDBA94D00472EA2;
-                        remoteInfo = "build-generator-java";
-                };
-                2CC7556613A1324300B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CC600CDE75EC00472EA2;
-                        remoteInfo = "build-additions-java";
-                };
-                2CC7556813A1325700B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CB870CDC4ED000472EA2;
-                        remoteInfo = "run-generator";
-                };
-                2CC7556A13A132AF00B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 4CEBA78E08679EF10015D03E;
-                        remoteInfo = "build-core-native";
-                };
-                2CC7556C13A132B200B09D1B /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = EB9FD8610AEECCF5008E157E;
-                        remoteInfo = "build-core-java";
-                };
-                89D7CB9B0CDC64F800472EA2 /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CB870CDC4ED000472EA2;
-                        remoteInfo = "run-generator";
-                };
-                89D7CC910CDE7A8200472EA2 /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CC720CDE767500472EA2;
-                        remoteInfo = "assemble-product-java";
-                };
-                C592D6580E12F27400D076FF /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = EB9FD8610AEECCF5008E157E;
-                        remoteInfo = "build-core-java";
-                };
-                C592D65A0E12F27600D076FF /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 4CEBA78E08679EF10015D03E;
-                        remoteInfo = "build-core-native";
-                };
-                C592D65C0E12F27E00D076FF /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CA160CDBA94D00472EA2;
-                        remoteInfo = "build-generator-java";
-                };
-                C592D65E0E12F28500D076FF /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CC4C0CDE4C0400472EA2;
-                        remoteInfo = "build-generated-java";
-                };
-                C592D6600E12F28E00D076FF /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CC600CDE75EC00472EA2;
-                        remoteInfo = "build-additions-java";
-                };
-                C592D6620E12F29200D076FF /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 89D7CCA20CDF9A2600472EA2;
-                        remoteInfo = "build-additions-native";
-                };
-                C5D197DA0DFB77E4006F9FB9 /* PBXContainerItemProxy */ = {
-                        isa = PBXContainerItemProxy;
-                        containerPortal = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-                        proxyType = 1;
-                        remoteGlobalIDString = 4CEBA78E08679EF10015D03E;
-                        remoteInfo = "build-core-native";
-                };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
-                0AB364E40B2F671600788B6C /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = src; sourceTree = "<group>"; };
-                890FBACA0C6F781000902C32 /* JavaVM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaVM.framework; path = /System/Library/Frameworks/JavaVM.framework; sourceTree = "<absolute>"; };
-                890FBACC0C6F782C00902C32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
-                896D90BB0CC2877C005625F5 /* JavaNativeFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaNativeFoundation.framework; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework; sourceTree = "<absolute>"; };
-                896D91230CC2ED34005625F5 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
-                89736E5F0CE819E5008C4205 /* JObjC.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = JObjC.jar; sourceTree = BUILT_PRODUCTS_DIR; };
-                89D7C9EC0CDB900E00472EA2 /* CIF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIF.m; sourceTree = "<group>"; };
-                89D7C9ED0CDB900E00472EA2 /* Coder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Coder.m; sourceTree = "<group>"; };
-                89D7C9EE0CDB900E00472EA2 /* Function.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Function.m; sourceTree = "<group>"; };
-                89D7C9EF0CDB900E00472EA2 /* ID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ID.m; sourceTree = "<group>"; };
-                89D7C9F00CDB900E00472EA2 /* JObjCRuntime.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JObjCRuntime.m; sourceTree = "<group>"; };
-                89D7C9F10CDB900E00472EA2 /* MacOSXFramework.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MacOSXFramework.m; sourceTree = "<group>"; };
-                89D7C9F20CDB900E00472EA2 /* NativeBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeBuffer.h; sourceTree = "<group>"; };
-                89D7C9F30CDB900E00472EA2 /* NativeBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeBuffer.m; sourceTree = "<group>"; };
-                89D7C9F40CDB900E00472EA2 /* NativeObjectLifecycleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeObjectLifecycleManager.m; sourceTree = "<group>"; };
-                89D7C9F50CDB900E00472EA2 /* NSClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSClass.m; sourceTree = "<group>"; };
-                89D7C9F60CDB900E00472EA2 /* SEL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SEL.m; sourceTree = "<group>"; };
-                89D7CCB80CDF9A2600472EA2 /* libJObjC.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libJObjC.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
-                89D7CCBA0CDF9AA200472EA2 /* NativeString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeString.m; sourceTree = "<group>"; };
-                89D7CCBC0CDF9AB100472EA2 /* NativeNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeNumber.m; sourceTree = "<group>"; };
-                89D7CCBE0CDF9AC600472EA2 /* NativeThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeThread.m; sourceTree = "<group>"; };
-                89E437680C97A7F200C756EE /* libffi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libffi.dylib; path = /usr/lib/libffi.dylib; sourceTree = "<absolute>"; };
-                C5742F6B0E316EFA00093838 /* Subclassing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Subclassing.m; sourceTree = "<group>"; };
-                C5D196C80DF9E43C006F9FB9 /* FFIType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFIType.m; sourceTree = "<group>"; };
-                C5E454790E36729F0046D3E8 /* Invoke.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Invoke.m; sourceTree = "<group>"; };
-                C5F3B1370E398F8E00B771AE /* FunCallBench.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunCallBench.m; sourceTree = "<group>"; };
-                C5F3B1450E39910500B771AE /* libJObjC-tests.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "libJObjC-tests.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
-                C5F3B2610E3AB0F300B771AE /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
-                C5F3B2630E3AB0F300B771AE /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
-                EB9FD8720AEECD83008E157E /* build.xml */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = build.xml; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-                4CEBA78D08679EF10015D03E /* Frameworks */ = {
-                        isa = PBXFrameworksBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                89D7CB770CDC4A6500472EA2 /* Foundation.framework in Frameworks */,
-                                89D7CB780CDC4A6500472EA2 /* JavaVM.framework in Frameworks */,
-                                89D7CB790CDC4A6500472EA2 /* JavaNativeFoundation.framework in Frameworks */,
-                                89D7CB7A0CDC4A6500472EA2 /* libffi.dylib in Frameworks */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-                89D7CCB00CDF9A2600472EA2 /* Frameworks */ = {
-                        isa = PBXFrameworksBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                89D7CCB10CDF9A2600472EA2 /* Foundation.framework in Frameworks */,
-                                89D7CCB20CDF9A2600472EA2 /* JavaVM.framework in Frameworks */,
-                                89D7CCB30CDF9A2600472EA2 /* JavaNativeFoundation.framework in Frameworks */,
-                                89D7CCB40CDF9A2600472EA2 /* libffi.dylib in Frameworks */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-                C5F3B1430E39910500B771AE /* Frameworks */ = {
-                        isa = PBXFrameworksBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                C5F3B2620E3AB0F300B771AE /* AppKit.framework in Frameworks */,
-                                C5F3B2640E3AB0F300B771AE /* Cocoa.framework in Frameworks */,
-                                C5F3B2650E3AB0F300B771AE /* Foundation.framework in Frameworks */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-                00E6828FFEC88D1A11DB9C8B = {
-                        isa = PBXGroup;
-                        children = (
-                                896D91230CC2ED34005625F5 /* README.txt */,
-                                EB9FD8720AEECD83008E157E /* build.xml */,
-                                0AB364E40B2F671600788B6C /* src */,
-                                89D7C9EB0CDB900E00472EA2 /* native-core */,
-                                89D7CA020CDB902200472EA2 /* native-additions */,
-                                C5A9597F0E398F050057C96D /* native-tests */,
-                                89D7CA030CDB903000472EA2 /* products */,
-                                890FBAC90C6F77B700902C32 /* frameworks */,
-                                C5F3B1450E39910500B771AE /* libJObjC-tests.dylib */,
-                                C5F3B2610E3AB0F300B771AE /* AppKit.framework */,
-                                C5F3B2630E3AB0F300B771AE /* Cocoa.framework */,
-                        );
-                        sourceTree = "<group>";
-                };
-                890FBAC90C6F77B700902C32 /* frameworks */ = {
-                        isa = PBXGroup;
-                        children = (
-                                890FBACC0C6F782C00902C32 /* Foundation.framework */,
-                                890FBACA0C6F781000902C32 /* JavaVM.framework */,
-                                896D90BB0CC2877C005625F5 /* JavaNativeFoundation.framework */,
-                                89E437680C97A7F200C756EE /* libffi.dylib */,
-                        );
-                        name = frameworks;
-                        sourceTree = "<group>";
-                };
-                89D7C9EB0CDB900E00472EA2 /* native-core */ = {
-                        isa = PBXGroup;
-                        children = (
-                                89D7C9EC0CDB900E00472EA2 /* CIF.m */,
-                                89D7C9ED0CDB900E00472EA2 /* Coder.m */,
-                                C5D196C80DF9E43C006F9FB9 /* FFIType.m */,
-                                89D7C9EE0CDB900E00472EA2 /* Function.m */,
-                                89D7C9EF0CDB900E00472EA2 /* ID.m */,
-                                C5E454790E36729F0046D3E8 /* Invoke.m */,
-                                89D7C9F00CDB900E00472EA2 /* JObjCRuntime.m */,
-                                89D7C9F10CDB900E00472EA2 /* MacOSXFramework.m */,
-                                89D7C9F20CDB900E00472EA2 /* NativeBuffer.h */,
-                                89D7C9F30CDB900E00472EA2 /* NativeBuffer.m */,
-                                89D7C9F40CDB900E00472EA2 /* NativeObjectLifecycleManager.m */,
-                                89D7C9F50CDB900E00472EA2 /* NSClass.m */,
-                                89D7C9F60CDB900E00472EA2 /* SEL.m */,
-                                C5742F6B0E316EFA00093838 /* Subclassing.m */,
-                        );
-                        name = "native-core";
-                        path = src/core/native;
-                        sourceTree = "<group>";
-                };
-                89D7CA020CDB902200472EA2 /* native-additions */ = {
-                        isa = PBXGroup;
-                        children = (
-                                89D7CCBA0CDF9AA200472EA2 /* NativeString.m */,
-                                89D7CCBC0CDF9AB100472EA2 /* NativeNumber.m */,
-                                89D7CCBE0CDF9AC600472EA2 /* NativeThread.m */,
-                        );
-                        name = "native-additions";
-                        path = "src/runtime-additions/native";
-                        sourceTree = "<group>";
-                };
-                89D7CA030CDB903000472EA2 /* products */ = {
-                        isa = PBXGroup;
-                        children = (
-                                89736E5F0CE819E5008C4205 /* JObjC.jar */,
-                                89D7CCB80CDF9A2600472EA2 /* libJObjC.dylib */,
-                        );
-                        name = products;
-                        path = "src/runtime-additions/native";
-                        sourceTree = "<group>";
-                };
-                C5A9597F0E398F050057C96D /* native-tests */ = {
-                        isa = PBXGroup;
-                        children = (
-                                C5F3B1370E398F8E00B771AE /* FunCallBench.m */,
-                        );
-                        name = "native-tests";
-                        path = src/tests/native;
-                        sourceTree = "<group>";
-                };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-                4CEBA78B08679EF10015D03E /* Headers */ = {
-                        isa = PBXHeadersBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                89D7C9FD0CDB900E00472EA2 /* NativeBuffer.h in Headers */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-                89D7CCA30CDF9A2600472EA2 /* Headers */ = {
-                        isa = PBXHeadersBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                89D7CCA40CDF9A2600472EA2 /* NativeBuffer.h in Headers */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-                C5F3B1410E39910500B771AE /* Headers */ = {
-                        isa = PBXHeadersBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXLegacyTarget section */
-                89D7CA160CDBA94D00472EA2 /* build-generator-java */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = 89D7CA1C0CDBA9B000472EA2 /* Build configuration list for PBXLegacyTarget "build-generator-java" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        dependencies = (
-                                2CC7556D13A132B200B09D1B /* PBXTargetDependency */,
-                                2CC7556B13A132AF00B09D1B /* PBXTargetDependency */,
-                        );
-                        name = "build-generator-java";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = "generator-build-java";
-                };
-                89D7CB870CDC4ED000472EA2 /* run-generator */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = 89D7CB8E0CDC4ED900472EA2 /* Build configuration list for PBXLegacyTarget "run-generator" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        dependencies = (
-                                2CC7556513A1323700B09D1B /* PBXTargetDependency */,
-                        );
-                        name = "run-generator";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = "run-generator";
-                };
-                89D7CC4C0CDE4C0400472EA2 /* build-generated-java */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = 89D7CC510CDE4C5200472EA2 /* Build configuration list for PBXLegacyTarget "build-generated-java" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        dependencies = (
-                                2CC7556913A1325700B09D1B /* PBXTargetDependency */,
-                        );
-                        name = "build-generated-java";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = "build-generated-java";
-                };
-                89D7CC600CDE75EC00472EA2 /* build-additions-java */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = 89D7CC630CDE762000472EA2 /* Build configuration list for PBXLegacyTarget "build-additions-java" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        dependencies = (
-                        );
-                        name = "build-additions-java";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = "build-additions-java";
-                };
-                89D7CC720CDE767500472EA2 /* assemble-product-java */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = 89D7CC7A0CDE76F500472EA2 /* Build configuration list for PBXLegacyTarget "assemble-product-java" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        dependencies = (
-                        );
-                        name = "assemble-product-java";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = "package-product";
-                };
-                C5F3B1530E39927900B771AE /* build-test-java */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = C5F3B15B0E3992AC00B771AE /* Build configuration list for PBXLegacyTarget "build-test-java" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        dependencies = (
-                        );
-                        name = "build-test-java";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = "build-test";
-                };
-                EB9FD8610AEECCF5008E157E /* build-core-java */ = {
-                        isa = PBXLegacyTarget;
-                        buildArgumentsString = "-verbose -emacs $ACTION";
-                        buildConfigurationList = EB9FD8690AEECD13008E157E /* Build configuration list for PBXLegacyTarget "build-core-java" */;
-                        buildPhases = (
-                        );
-                        buildToolPath = /usr/bin/ant;
-                        buildWorkingDirectory = "";
-                        dependencies = (
-                        );
-                        name = "build-core-java";
-                        passBuildSettingsInEnvironment = 1;
-                        productName = AntJNIWrapper;
-                };
-/* End PBXLegacyTarget section */
-
-/* Begin PBXNativeTarget section */
-                4CEBA78E08679EF10015D03E /* build-core-native */ = {
-                        isa = PBXNativeTarget;
-                        buildConfigurationList = 4CEBA79108679F100015D03E /* Build configuration list for PBXNativeTarget "build-core-native" */;
-                        buildPhases = (
-                                4CEBA78B08679EF10015D03E /* Headers */,
-                                4CEBA78C08679EF10015D03E /* Sources */,
-                                4CEBA78D08679EF10015D03E /* Frameworks */,
-                        );
-                        buildRules = (
-                        );
-                        dependencies = (
-                                2CC7556113A1322100B09D1B /* PBXTargetDependency */,
-                        );
-                        name = "build-core-native";
-                        productName = DylibN;
-                        productType = "com.apple.product-type.library.dynamic";
-                };
-                89D7CCA20CDF9A2600472EA2 /* build-additions-native */ = {
-                        isa = PBXNativeTarget;
-                        buildConfigurationList = 89D7CCB50CDF9A2600472EA2 /* Build configuration list for PBXNativeTarget "build-additions-native" */;
-                        buildPhases = (
-                                89D7CCA30CDF9A2600472EA2 /* Headers */,
-                                89D7CCA50CDF9A2600472EA2 /* Sources */,
-                                89D7CCB00CDF9A2600472EA2 /* Frameworks */,
-                        );
-                        buildRules = (
-                        );
-                        dependencies = (
-                                2CC7556713A1324300B09D1B /* PBXTargetDependency */,
-                                C5D197DB0DFB77E4006F9FB9 /* PBXTargetDependency */,
-                        );
-                        name = "build-additions-native";
-                        productName = DylibN;
-                        productReference = 89D7CCB80CDF9A2600472EA2 /* libJObjC.dylib */;
-                        productType = "com.apple.product-type.library.dynamic";
-                };
-                C5F3B1440E39910500B771AE /* build-test-native */ = {
-                        isa = PBXNativeTarget;
-                        buildConfigurationList = C5F3B1480E39917500B771AE /* Build configuration list for PBXNativeTarget "build-test-native" */;
-                        buildPhases = (
-                                C5F3B1410E39910500B771AE /* Headers */,
-                                C5F3B1420E39910500B771AE /* Sources */,
-                                C5F3B1430E39910500B771AE /* Frameworks */,
-                        );
-                        buildRules = (
-                        );
-                        dependencies = (
-                                2CC7556313A1322800B09D1B /* PBXTargetDependency */,
-                        );
-                        name = "build-test-native";
-                        productName = "build-tests-native";
-                        productReference = C5F3B1450E39910500B771AE /* libJObjC-tests.dylib */;
-                        productType = "com.apple.product-type.library.dynamic";
-                };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-                00E6828EFEC88D1A11DB9C8B /* Project object */ = {
-                        isa = PBXProject;
-                        attributes = {
-                                LastUpgradeCheck = 0410;
-                        };
-                        buildConfigurationList = 4CEBA75C08679E4D0015D03E /* Build configuration list for PBXProject "JObjC" */;
-                        compatibilityVersion = "Xcode 3.0";
-                        developmentRegion = English;
-                        hasScannedForEncodings = 1;
-                        knownRegions = (
-                                English,
-                                Japanese,
-                                French,
-                                German,
-                        );
-                        mainGroup = 00E6828FFEC88D1A11DB9C8B;
-                        productRefGroup = 00E6828FFEC88D1A11DB9C8B;
-                        projectDirPath = "";
-                        projectRoot = "";
-                        targets = (
-                                89EBD58C0C95F43D000F04A0 /* B&I */,
-                                EB9FD8610AEECCF5008E157E /* build-core-java */,
-                                4CEBA78E08679EF10015D03E /* build-core-native */,
-                                89D7CA160CDBA94D00472EA2 /* build-generator-java */,
-                                89D7CB870CDC4ED000472EA2 /* run-generator */,
-                                89D7CC4C0CDE4C0400472EA2 /* build-generated-java */,
-                                89D7CC600CDE75EC00472EA2 /* build-additions-java */,
-                                89D7CCA20CDF9A2600472EA2 /* build-additions-native */,
-                                89D7CC720CDE767500472EA2 /* assemble-product-java */,
-                                C5F3B1530E39927900B771AE /* build-test-java */,
-                                C5F3B1440E39910500B771AE /* build-test-native */,
-                        );
-                };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
-                4CEBA78C08679EF10015D03E /* Sources */ = {
-                        isa = PBXSourcesBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                C5E4547B0E36729F0046D3E8 /* Invoke.m in Sources */,
-                                C5742F6D0E316EFA00093838 /* Subclassing.m in Sources */,
-                                89D7C9F70CDB900E00472EA2 /* CIF.m in Sources */,
-                                89D7C9F80CDB900E00472EA2 /* Coder.m in Sources */,
-                                89D7C9F90CDB900E00472EA2 /* Function.m in Sources */,
-                                89D7C9FA0CDB900E00472EA2 /* ID.m in Sources */,
-                                89D7C9FB0CDB900E00472EA2 /* JObjCRuntime.m in Sources */,
-                                89D7C9FC0CDB900E00472EA2 /* MacOSXFramework.m in Sources */,
-                                89D7C9FE0CDB900E00472EA2 /* NativeBuffer.m in Sources */,
-                                89D7C9FF0CDB900E00472EA2 /* NativeObjectLifecycleManager.m in Sources */,
-                                89D7CA000CDB900E00472EA2 /* NSClass.m in Sources */,
-                                89D7CA010CDB900E00472EA2 /* SEL.m in Sources */,
-                                C5D196C90DF9E43C006F9FB9 /* FFIType.m in Sources */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-                89D7CCA50CDF9A2600472EA2 /* Sources */ = {
-                        isa = PBXSourcesBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                C5E4547D0E367DAB0046D3E8 /* Invoke.m in Sources */,
-                                C5742F700E316F8600093838 /* Subclassing.m in Sources */,
-                                89D7CCA60CDF9A2600472EA2 /* CIF.m in Sources */,
-                                89D7CCA70CDF9A2600472EA2 /* Coder.m in Sources */,
-                                89D7CCA80CDF9A2600472EA2 /* Function.m in Sources */,
-                                89D7CCA90CDF9A2600472EA2 /* ID.m in Sources */,
-                                89D7CCAA0CDF9A2600472EA2 /* JObjCRuntime.m in Sources */,
-                                89D7CCAB0CDF9A2600472EA2 /* MacOSXFramework.m in Sources */,
-                                89D7CCAC0CDF9A2600472EA2 /* NativeBuffer.m in Sources */,
-                                89D7CCAD0CDF9A2600472EA2 /* NativeObjectLifecycleManager.m in Sources */,
-                                89D7CCAE0CDF9A2600472EA2 /* NSClass.m in Sources */,
-                                89D7CCAF0CDF9A2600472EA2 /* SEL.m in Sources */,
-                                89D7CCBB0CDF9AA200472EA2 /* NativeString.m in Sources */,
-                                89D7CCBD0CDF9AB100472EA2 /* NativeNumber.m in Sources */,
-                                89D7CCBF0CDF9AC600472EA2 /* NativeThread.m in Sources */,
-                                C5D197D90DFB77C6006F9FB9 /* FFIType.m in Sources */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-                C5F3B1420E39910500B771AE /* Sources */ = {
-                        isa = PBXSourcesBuildPhase;
-                        buildActionMask = 2147483647;
-                        files = (
-                                C5F3B23D0E39948300B771AE /* FunCallBench.m in Sources */,
-                        );
-                        runOnlyForDeploymentPostprocessing = 0;
-                };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
-                2CC7556113A1322100B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = EB9FD8610AEECCF5008E157E /* build-core-java */;
-                        targetProxy = 2CC7556013A1322100B09D1B /* PBXContainerItemProxy */;
-                };
-                2CC7556313A1322800B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = C5F3B1530E39927900B771AE /* build-test-java */;
-                        targetProxy = 2CC7556213A1322800B09D1B /* PBXContainerItemProxy */;
-                };
-                2CC7556513A1323700B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CA160CDBA94D00472EA2 /* build-generator-java */;
-                        targetProxy = 2CC7556413A1323700B09D1B /* PBXContainerItemProxy */;
-                };
-                2CC7556713A1324300B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CC600CDE75EC00472EA2 /* build-additions-java */;
-                        targetProxy = 2CC7556613A1324300B09D1B /* PBXContainerItemProxy */;
-                };
-                2CC7556913A1325700B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CB870CDC4ED000472EA2 /* run-generator */;
-                        targetProxy = 2CC7556813A1325700B09D1B /* PBXContainerItemProxy */;
-                };
-                2CC7556B13A132AF00B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 4CEBA78E08679EF10015D03E /* build-core-native */;
-                        targetProxy = 2CC7556A13A132AF00B09D1B /* PBXContainerItemProxy */;
-                };
-                2CC7556D13A132B200B09D1B /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = EB9FD8610AEECCF5008E157E /* build-core-java */;
-                        targetProxy = 2CC7556C13A132B200B09D1B /* PBXContainerItemProxy */;
-                };
-                89D7CB9C0CDC64F800472EA2 /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CB870CDC4ED000472EA2 /* run-generator */;
-                        targetProxy = 89D7CB9B0CDC64F800472EA2 /* PBXContainerItemProxy */;
-                };
-                89D7CC920CDE7A8200472EA2 /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CC720CDE767500472EA2 /* assemble-product-java */;
-                        targetProxy = 89D7CC910CDE7A8200472EA2 /* PBXContainerItemProxy */;
-                };
-                C592D6590E12F27400D076FF /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = EB9FD8610AEECCF5008E157E /* build-core-java */;
-                        targetProxy = C592D6580E12F27400D076FF /* PBXContainerItemProxy */;
-                };
-                C592D65B0E12F27600D076FF /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 4CEBA78E08679EF10015D03E /* build-core-native */;
-                        targetProxy = C592D65A0E12F27600D076FF /* PBXContainerItemProxy */;
-                };
-                C592D65D0E12F27E00D076FF /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CA160CDBA94D00472EA2 /* build-generator-java */;
-                        targetProxy = C592D65C0E12F27E00D076FF /* PBXContainerItemProxy */;
-                };
-                C592D65F0E12F28500D076FF /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CC4C0CDE4C0400472EA2 /* build-generated-java */;
-                        targetProxy = C592D65E0E12F28500D076FF /* PBXContainerItemProxy */;
-                };
-                C592D6610E12F28E00D076FF /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CC600CDE75EC00472EA2 /* build-additions-java */;
-                        targetProxy = C592D6600E12F28E00D076FF /* PBXContainerItemProxy */;
-                };
-                C592D6630E12F29200D076FF /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 89D7CCA20CDF9A2600472EA2 /* build-additions-native */;
-                        targetProxy = C592D6620E12F29200D076FF /* PBXContainerItemProxy */;
-                };
-                C5D197DB0DFB77E4006F9FB9 /* PBXTargetDependency */ = {
-                        isa = PBXTargetDependency;
-                        target = 4CEBA78E08679EF10015D03E /* build-core-native */;
-                        targetProxy = C5D197DA0DFB77E4006F9FB9 /* PBXContainerItemProxy */;
-                };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
-                4CEBA75D08679E4D0015D03E /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = (
-                                        "$(NATIVE_ARCH_32_BIT)",
-                                        "$(NATIVE_ARCH_64_BIT)",
-                                );
-                                GCC_ENABLE_OBJC_GC = supported;
-                                SYMROOT = build;
-                        };
-                        name = Debug;
-                };
-                4CEBA75E08679E4D0015D03E /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                GCC_ENABLE_OBJC_GC = supported;
-                                INSTALL_PATH = /System/Library/Java/Extensions;
-                        };
-                        name = Release;
-                };
-                4CEBA79208679F100015D03E /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = (
-                                        "$(NATIVE_ARCH_32_BIT)",
-                                        "$(NATIVE_ARCH_64_BIT)",
-                                );
-                                COPY_PHASE_STRIP = NO;
-                                DYLIB_COMPATIBILITY_VERSION = 1;
-                                DYLIB_CURRENT_VERSION = 1;
-                                EXECUTABLE_EXTENSION = dylib;
-                                EXECUTABLE_PREFIX = lib;
-                                FRAMEWORK_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                );
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                                GCC_MODEL_TUNING = G5;
-                                GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
-                                GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
-                                GCC_TREAT_WARNINGS_AS_ERRORS = YES;
-                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                                GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                                GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
-                                GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
-                                GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
-                                GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
-                                GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
-                                GCC_WARN_MISSING_PARENTHESES = YES;
-                                GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
-                                GCC_WARN_PEDANTIC = NO;
-                                GCC_WARN_PROTOTYPE_CONVERSION = NO;
-                                GCC_WARN_SHADOW = YES;
-                                GCC_WARN_SIGN_COMPARE = YES;
-                                GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
-                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                                GCC_WARN_UNKNOWN_PRAGMAS = YES;
-                                GCC_WARN_UNUSED_FUNCTION = YES;
-                                GCC_WARN_UNUSED_VARIABLE = YES;
-                                HEADER_SEARCH_PATHS = (
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                        /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers,
-                                );
-                                HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/core\" \"$(OBJROOT)/src/jni_headers/core\"";
-                                LIBRARY_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
-                                );
-                                LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries\"";
-                                LIBRARY_STYLE = DYNAMIC;
-                                MACH_O_TYPE = mh_dylib;
-                                OTHER_LDFLAGS = "";
-                                OTHER_REZFLAGS = "";
-                                PRODUCT_NAME = JObjC;
-                                SECTORDER_FLAGS = "";
-                                VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc";
-                                WARNING_CFLAGS = (
-                                        "-Wmost",
-                                        "-Wno-four-char-constants",
-                                        "-Wno-unknown-pragmas",
-                                        "-Wformat",
-                                        "-Wformat-security",
-                                        "-Wcast-align",
-                                        "-Wwrite-strings",
-                                        "-Wuninitialized",
-                                        "-Wshadow",
-                                        "-Wshorten-64-to-32",
-                                        "-Wsign-compare",
-                                        "-Wpointer-arith",
-                                        "-Wall",
-                                );
-                                ZERO_LINK = NO;
-                        };
-                        name = Debug;
-                };
-                4CEBA79308679F100015D03E /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = (
-                                        i386,
-                                        ppc,
-                                        x86_64,
-                                );
-                                COPY_PHASE_STRIP = YES;
-                                DYLIB_COMPATIBILITY_VERSION = 1;
-                                DYLIB_CURRENT_VERSION = 1;
-                                EXECUTABLE_EXTENSION = dylib;
-                                EXECUTABLE_PREFIX = lib;
-                                FRAMEWORK_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                );
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-                                GCC_MODEL_TUNING = G5;
-                                GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
-                                GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
-                                GCC_TREAT_WARNINGS_AS_ERRORS = YES;
-                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                                GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                                GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
-                                GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
-                                GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
-                                GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
-                                GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
-                                GCC_WARN_MISSING_PARENTHESES = YES;
-                                GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
-                                GCC_WARN_PEDANTIC = NO;
-                                GCC_WARN_PROTOTYPE_CONVERSION = NO;
-                                GCC_WARN_SHADOW = YES;
-                                GCC_WARN_SIGN_COMPARE = YES;
-                                GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
-                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                                GCC_WARN_UNKNOWN_PRAGMAS = YES;
-                                GCC_WARN_UNUSED_FUNCTION = YES;
-                                GCC_WARN_UNUSED_VARIABLE = YES;
-                                HEADER_SEARCH_PATHS = (
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                        /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers,
-                                );
-                                HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/core\" \"$(OBJROOT)/src/jni_headers/core\"";
-                                LIBRARY_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                );
-                                LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries\"";
-                                LIBRARY_STYLE = DYNAMIC;
-                                MACH_O_TYPE = mh_dylib;
-                                OTHER_LDFLAGS = "";
-                                OTHER_REZFLAGS = "";
-                                PRODUCT_NAME = JObjC;
-                                SECTORDER_FLAGS = "";
-                                VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc";
-                                WARNING_CFLAGS = (
-                                        "-Wmost",
-                                        "-Wno-four-char-constants",
-                                        "-Wno-unknown-pragmas",
-                                        "-Wformat",
-                                        "-Wformat-security",
-                                        "-Wcast-align",
-                                        "-Wwrite-strings",
-                                        "-Wuninitialized",
-                                        "-Wshadow",
-                                        "-Wshorten-64-to-32",
-                                        "-Wsign-compare",
-                                        "-Wpointer-arith",
-                                        "-Wall",
-                                );
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89D7CA170CDBA94D00472EA2 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "build-generator";
-                        };
-                        name = Debug;
-                };
-                89D7CA180CDBA94D00472EA2 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "build-generator";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89D7CB880CDC4ED000472EA2 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = "\U00010";
-                                PRODUCT_NAME = "run-generator";
-                        };
-                        name = Debug;
-                };
-                89D7CB890CDC4ED000472EA2 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "run-generator";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89D7CC4D0CDE4C0400472EA2 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "build-generated";
-                        };
-                        name = Debug;
-                };
-                89D7CC4E0CDE4C0400472EA2 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "build-generated";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89D7CC610CDE75EC00472EA2 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "build-additions";
-                        };
-                        name = Debug;
-                };
-                89D7CC620CDE75EC00472EA2 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "build-additions";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89D7CC730CDE767500472EA2 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "assemble-product";
-                        };
-                        name = Debug;
-                };
-                89D7CC740CDE767500472EA2 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "assemble-product";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89D7CCB60CDF9A2600472EA2 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = (
-                                        "$(NATIVE_ARCH_32_BIT)",
-                                        "$(NATIVE_ARCH_64_BIT)",
-                                );
-                                COPY_PHASE_STRIP = NO;
-                                DYLIB_COMPATIBILITY_VERSION = 1;
-                                DYLIB_CURRENT_VERSION = 1;
-                                EXECUTABLE_EXTENSION = dylib;
-                                EXECUTABLE_PREFIX = lib;
-                                FRAMEWORK_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                );
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                                GCC_MODEL_TUNING = G5;
-                                GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
-                                GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
-                                GCC_TREAT_WARNINGS_AS_ERRORS = NO;
-                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                                GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                                GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
-                                GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
-                                GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
-                                GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
-                                GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
-                                GCC_WARN_MISSING_PARENTHESES = YES;
-                                GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
-                                GCC_WARN_PEDANTIC = NO;
-                                GCC_WARN_PROTOTYPE_CONVERSION = NO;
-                                GCC_WARN_SHADOW = YES;
-                                GCC_WARN_SIGN_COMPARE = YES;
-                                GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
-                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                                GCC_WARN_UNKNOWN_PRAGMAS = YES;
-                                GCC_WARN_UNUSED_FUNCTION = YES;
-                                GCC_WARN_UNUSED_VARIABLE = YES;
-                                HEADER_SEARCH_PATHS = (
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                        /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers,
-                                );
-                                HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/core\" \"$(OBJROOT)/src/jni_headers/core\"";
-                                HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/additions\" \"$(OBJROOT)/src/jni_headers/additions\"";
-                                INSTALL_PATH = /usr/local/lib;
-                                LIBRARY_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
-                                );
-                                LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries\"";
-                                LIBRARY_STYLE = DYNAMIC;
-                                MACH_O_TYPE = mh_dylib;
-                                OTHER_LDFLAGS = "";
-                                OTHER_REZFLAGS = "";
-                                PRODUCT_NAME = JObjC;
-                                SECTORDER_FLAGS = "";
-                                VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc";
-                                WARNING_CFLAGS = (
-                                        "-Wmost",
-                                        "-Wno-four-char-constants",
-                                        "-Wno-unknown-pragmas",
-                                        "-Wformat",
-                                        "-Wformat-security",
-                                        "-Wcast-align",
-                                        "-Wwrite-strings",
-                                        "-Wuninitialized",
-                                        "-Wshadow",
-                                        "-Wshorten-64-to-32",
-                                        "-Wsign-compare",
-                                        "-Wpointer-arith",
-                                        "-Wall",
-                                );
-                                ZERO_LINK = NO;
-                        };
-                        name = Debug;
-                };
-                89D7CCB70CDF9A2600472EA2 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ARCHS = (
-                                        x86_64,
-                                        ppc,
-                                        i386,
-                                );
-                                COPY_PHASE_STRIP = YES;
-                                DYLIB_COMPATIBILITY_VERSION = 1;
-                                DYLIB_CURRENT_VERSION = 1;
-                                EXECUTABLE_EXTENSION = dylib;
-                                EXECUTABLE_PREFIX = lib;
-                                FRAMEWORK_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                );
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-                                GCC_MODEL_TUNING = G5;
-                                GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
-                                GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
-                                GCC_TREAT_WARNINGS_AS_ERRORS = NO;
-                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                                GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                                GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
-                                GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
-                                GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
-                                GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
-                                GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
-                                GCC_WARN_MISSING_PARENTHESES = YES;
-                                GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
-                                GCC_WARN_PEDANTIC = NO;
-                                GCC_WARN_PROTOTYPE_CONVERSION = NO;
-                                GCC_WARN_SHADOW = YES;
-                                GCC_WARN_SIGN_COMPARE = YES;
-                                GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
-                                GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                                GCC_WARN_UNKNOWN_PRAGMAS = YES;
-                                GCC_WARN_UNUSED_FUNCTION = YES;
-                                GCC_WARN_UNUSED_VARIABLE = YES;
-                                HEADER_SEARCH_PATHS = (
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                        /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers,
-                                );
-                                HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/core\"  \"$(OBJROOT)/src/jni_headers/core\"";
-                                HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/additions\"  \"$(OBJROOT)/src/jni_headers/additions\"";
-                                LIBRARY_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                );
-                                LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries\"";
-                                LIBRARY_STYLE = DYNAMIC;
-                                MACH_O_TYPE = mh_dylib;
-                                OTHER_LDFLAGS = "";
-                                OTHER_REZFLAGS = "";
-                                PRODUCT_NAME = JObjC;
-                                SECTORDER_FLAGS = "";
-                                VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc";
-                                WARNING_CFLAGS = (
-                                        "-Wmost",
-                                        "-Wno-four-char-constants",
-                                        "-Wno-unknown-pragmas",
-                                        "-Wformat",
-                                        "-Wformat-security",
-                                        "-Wcast-align",
-                                        "-Wwrite-strings",
-                                        "-Wuninitialized",
-                                        "-Wshadow",
-                                        "-Wshorten-64-to-32",
-                                        "-Wsign-compare",
-                                        "-Wpointer-arith",
-                                        "-Wall",
-                                );
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                89EBD58D0C95F43D000F04A0 /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "B&I";
-                        };
-                        name = Debug;
-                };
-                89EBD58E0C95F43D000F04A0 /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "B&I";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                C5F3B1460E39910500B771AE /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ALWAYS_SEARCH_USER_PATHS = YES;
-                                ARCHS = (
-                                        x86_64,
-                                        i386,
-                                        ppc,
-                                );
-                                COPY_PHASE_STRIP = NO;
-                                DEBUG_INFORMATION_FORMAT = dwarf;
-                                EXECUTABLE_EXTENSION = dylib;
-                                EXECUTABLE_PREFIX = lib;
-                                FRAMEWORK_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                );
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_MODEL_TUNING = G5;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                HEADER_SEARCH_PATHS = (
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                        /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers,
-                                        "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/core\"",
-                                        "\"$(OBJROOT)/src/jni_headers/core\"",
-                                        "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/additions\"",
-                                        "\"$(OBJROOT)/src/jni_headers/additions\"",
-                                        "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/test\"",
-                                        "\"$(OBJROOT)/src/jni_headers/test\"",
-                                );
-                                INSTALL_PATH = /usr/local/lib;
-                                LIBRARY_STYLE = DYNAMIC;
-                                MACH_O_TYPE = mh_dylib;
-                                PRODUCT_NAME = "JObjC-tests";
-                                SKIP_INSTALL = YES;
-                        };
-                        name = Debug;
-                };
-                C5F3B1470E39910500B771AE /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                ALWAYS_SEARCH_USER_PATHS = YES;
-                                ARCHS = (
-                                        x86_64,
-                                        i386,
-                                        ppc,
-                                );
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = dwarf;
-                                EXECUTABLE_EXTENSION = dylib;
-                                EXECUTABLE_PREFIX = lib;
-                                FRAMEWORK_SEARCH_PATHS = (
-                                        "$(inherited)",
-                                        "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                );
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"";
-                                GCC_MODEL_TUNING = G5;
-                                HEADER_SEARCH_PATHS = (
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
-                                        "$(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
-                                        /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers,
-                                        "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/core\"",
-                                        "\"$(OBJROOT)/src/jni_headers/core\"",
-                                        "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/additions\"",
-                                        "\"$(OBJROOT)/src/jni_headers/additions\"",
-                                        "\"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/src/jni_headers/test\"",
-                                        "\"$(OBJROOT)/src/jni_headers/test\"",
-                                );
-                                INSTALL_PATH = /usr/local/lib;
-                                LIBRARY_STYLE = DYNAMIC;
-                                MACH_O_TYPE = mh_dylib;
-                                PRODUCT_NAME = "JObjC-tests";
-                                SKIP_INSTALL = YES;
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                C5F3B1540E39927A00B771AE /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "build-test";
-                        };
-                        name = Debug;
-                };
-                C5F3B1550E39927A00B771AE /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                                PRODUCT_NAME = "build-test";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-                EB9FD86A0AEECD13008E157E /* Debug */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = NO;
-                                GCC_DYNAMIC_NO_PIC = NO;
-                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                                GCC_OPTIMIZATION_LEVEL = 0;
-                                PRODUCT_NAME = "build-core";
-                        };
-                        name = Debug;
-                };
-                EB9FD86B0AEECD13008E157E /* Release */ = {
-                        isa = XCBuildConfiguration;
-                        buildSettings = {
-                                COPY_PHASE_STRIP = YES;
-                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-                                PRODUCT_NAME = "build-core";
-                                ZERO_LINK = NO;
-                        };
-                        name = Release;
-                };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-                4CEBA75C08679E4D0015D03E /* Build configuration list for PBXProject "JObjC" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                4CEBA75D08679E4D0015D03E /* Debug */,
-                                4CEBA75E08679E4D0015D03E /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                4CEBA79108679F100015D03E /* Build configuration list for PBXNativeTarget "build-core-native" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                4CEBA79208679F100015D03E /* Debug */,
-                                4CEBA79308679F100015D03E /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89D7CA1C0CDBA9B000472EA2 /* Build configuration list for PBXLegacyTarget "build-generator-java" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89D7CA170CDBA94D00472EA2 /* Debug */,
-                                89D7CA180CDBA94D00472EA2 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89D7CB8E0CDC4ED900472EA2 /* Build configuration list for PBXLegacyTarget "run-generator" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89D7CB880CDC4ED000472EA2 /* Debug */,
-                                89D7CB890CDC4ED000472EA2 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89D7CC510CDE4C5200472EA2 /* Build configuration list for PBXLegacyTarget "build-generated-java" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89D7CC4D0CDE4C0400472EA2 /* Debug */,
-                                89D7CC4E0CDE4C0400472EA2 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89D7CC630CDE762000472EA2 /* Build configuration list for PBXLegacyTarget "build-additions-java" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89D7CC610CDE75EC00472EA2 /* Debug */,
-                                89D7CC620CDE75EC00472EA2 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89D7CC7A0CDE76F500472EA2 /* Build configuration list for PBXLegacyTarget "assemble-product-java" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89D7CC730CDE767500472EA2 /* Debug */,
-                                89D7CC740CDE767500472EA2 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89D7CCB50CDF9A2600472EA2 /* Build configuration list for PBXNativeTarget "build-additions-native" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89D7CCB60CDF9A2600472EA2 /* Debug */,
-                                89D7CCB70CDF9A2600472EA2 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                89EBD5930C95F44E000F04A0 /* Build configuration list for PBXAggregateTarget "B&I" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                89EBD58D0C95F43D000F04A0 /* Debug */,
-                                89EBD58E0C95F43D000F04A0 /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                C5F3B1480E39917500B771AE /* Build configuration list for PBXNativeTarget "build-test-native" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                C5F3B1460E39910500B771AE /* Debug */,
-                                C5F3B1470E39910500B771AE /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                C5F3B15B0E3992AC00B771AE /* Build configuration list for PBXLegacyTarget "build-test-java" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                C5F3B1540E39927A00B771AE /* Debug */,
-                                C5F3B1550E39927A00B771AE /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-                EB9FD8690AEECD13008E157E /* Build configuration list for PBXLegacyTarget "build-core-java" */ = {
-                        isa = XCConfigurationList;
-                        buildConfigurations = (
-                                EB9FD86A0AEECD13008E157E /* Debug */,
-                                EB9FD86B0AEECD13008E157E /* Release */,
-                        );
-                        defaultConfigurationIsVisible = 0;
-                        defaultConfigurationName = Release;
-                };
-/* End XCConfigurationList section */
-        };
-        rootObject = 00E6828EFEC88D1A11DB9C8B /* Project object */;
-}
--- a/src/macosx/native/jobjc/README.txt	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-#title JObjC
-#
-# 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
-# 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.
-#
-
-JObjC core provides a pure Java interface for calling C functions and
-sending ObjC messages. Given some information, it can marshal types
-automatically.
-
-It also parses BridgeSupport to generate Java wrappers around
-Framework bundles. These wrappers rely on the core to provide access
-to the C constants, enums, structs, functions, ObjC classes, etc of a
-framework.
-
-* How to build it
-
-Your best option is `ant all`. There's an Xcode "B&I" target that
-works for buildit.
-
-You'll need a recent JavaNativeFoundation, and perhaps some other
-things. Everything is usually there on SnowLeopard (or Leopard after
-the common ~javabuild/bin/update runs).
-
-The build process is quite involved. Xcode takes care of the native
-parts, ant takes care of the Java parts, and there's an unholy mix of
-external targets and hidden dependencies that keep Xcode and ant (and
-buildit on top of that) from stepping on each other. So a warning: the
-ant and Xcode targets don't have proper dependencies set up because of
-this. They have some dependencies configured, but not the entire
-chain. This is because of the jumping back and forth between
-externals. If you run the aggregate targets (Xcode B&I, ant all, ant
-test, ant bench), everything's is good. But if you manually invoke
-individual targets, chances are you'll miss something. Let's go over
-it all step by step:
-
-** ant gen-pcoder
-
-The PrimitiveCoder subclasses have a lot of boiler plate which
-simplifies the generated MixedPrimitiveCoder classes. So instead of
-maintaining it, I maintain a tiny Haskell script that spits out the
-Java code. This ant target runs that script if Haskell is available on
-the system. If it isn't available, this will silently fail. That's
-okay, because chances are the PrimitiveCoder.java that you got from
-svn is current and does not need to be updated.
-
-** ant build-core / Xcode build-core-java
-
-Build core simply builds the JObjC core java classes, and also
-generates headers for the JNI for Xcode.
-
-** ant build-core-native / Xcode build-core-native
-
-Xcode builds the native core, using the headers from the Java core. It
-generates libJObjC.dylib.
-
-** ant build-generator / Xcode build-generator-java
-
-ant builds the generator.
-
-** ant run-generator / Xcode run-generator
-
-ant runs the generator, using the core Java and native classes.
-
-What is rungen? And what's run-generator-old? run-generator-old is the
-preferred way to run the generator from ant, but there's a strange bug
-when running from buildit that causes run-generator-old to
-freeze. Pratik was helping me debug it, inspecting the stack and
-snooping dtrace probes, but we never found the reason for the
-block. So I figured that maybe if I just add a layer of indirection
-maybe it'll work around that. And it did. Sad but true.
-
-** ant build-generated / Xcode build-generated-java
-
-Build the generator output.
-
-** ant build-additions / Xcode build-additions-java
-
-Builds java additions.
-
-** ant build-additions-native / Xcode build-additions-native
-
-This builds a new version of libJObjC.dylib. It will rebuild
-everything from the core, and include everything from additions.
-
-** ant assemble-product / Xcode assemble-product-java
-
-Create a jar, copy products to destination, etc.
-
-* How to test it
-
-The test cases also contain a Java component and a native component,
-and are built similarly to the above. The benchmarks are built
-together with the tests. So "ant build-test" and "ant
-build-test-native" will build both the benchmarks and the test. "ant
-test" will run the test. "ant bench" will run benchmarks. If you only
-want to run a specific benchmark, you can pass a regexp in the
-environment variable BENCH_MATCH.
-
-<src>
-ant test
-ant bench
-BENCH_MATCH=Foo ant bench
-</src>
-
-Test and bench reports will end up in
-build/JObjC.build/Debug/test-reports/
-
-* How to use it
-
-Include the jar in your classpath and set your java.library.path to
-the directory that contains the dylib. Same thing for app bundles.
--- a/src/macosx/native/jobjc/TODOS	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# 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
-# 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.
-#
-#
-egrep "(TODO|FIXME|XXX|HACK)" -r src
--- a/src/macosx/native/jobjc/bridgesupport.gmk	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# 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
-# 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 generating a stable set of bridgesupport files that change timestamp
-# only when the bridgesupport data actually changes
-
-FRAMEWORKS_DIR = /System/Library/Frameworks
-GBM = /usr/bin/gen_bridge_metadata
-GEN_HEADERS = $(addsuffix .headers,$(FRAMEWORKS))
-GEN_BRIDGESUPPORT = $(addsuffix .bridgesupport,$(FRAMEWORKS))
-
-%.bridgesupport : %.headers $(FRAMEWORKS_DIR)/%.framework/Headers/*.h
-	@echo "generating bridge support for" $<
-	if [ -f $(FRAMEWORKS_DIR)/$(<:.headers=.framework)/Resources/BridgeSupport/$(<:.headers=Full.bridgesupport) ] ; \
-	  then cp $(FRAMEWORKS_DIR)/$(<:.headers=.framework)/Resources/BridgeSupport/$(<:.headers=Full.bridgesupport) $@ ; \
-	  else $(GBM) -F complete --framework $(<:.headers=.framework) -o $@ ; \
-	fi
-	if cmp -s $@ $(STABLE_GEN_DIR)/$(@:.bridgesupport=Full.bridgesupport) ; \
-	  then : ; \
-	  else cp $@ $(STABLE_GEN_DIR)/$(@:.bridgesupport=Full.bridgesupport) ; \
-	fi
-
-%.headers : $(FRAMEWORKS_DIR)/%.framework/Headers
-	@echo linking $<
-	ln -s $< $@
-
-$(STABLE_GEN_DIR):
-	mkdir -p $(STABLE_GEN_DIR)
-
-$(GEN_BRIDGESUPPORT): $(GEN_HEADERS) $(STABLE_GEN_DIR)
-
-all: $(GEN_BRIDGESUPPORT)
--- a/src/macosx/native/jobjc/build.xml	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,520 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-#
-# 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
-# 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.
-#
-#
--->
-<project name="JObjC" default="install" basedir=".">
-  <property environment="env"/>
-  <echoproperties/>
-
-  <target name="installhdrs">
-    <echo>Nothing to do for install-headers build phase</echo>
-  </target>
-
-  <target name="installsrc">
-    <echo>Nothing to do for install-source build phase</echo>
-  </target>
-
-  <property name="redirection-target-defined" value="${env.PRODUCT_NAME}"/>
-
-  <target name="install" description="Redirects to the target specified in $PRODUCT_NAME">
-    <fail unless="env.PRODUCT_NAME" status="-1">
-      This Ant build file depends on the native Xcode project to invoke
-      targets by defining $PRODUCT_NAME to specify the target.
-    </fail>
-
-    <echo>--- Redirecting to target "${env.PRODUCT_NAME}"</echo>
-    <antcall target="${env.PRODUCT_NAME}"/>
-  </target>
-
-  <property name="compile.debug" value="true"/>
-
-  <!-- building from the command line / xcode b&i -->
-  <condition property="src" value="." else="${env.SRCROOT}">
-    <not><isset property="env.SRCROOT"/></not>
-  </condition>
-
-  <condition property="cfg" value="Debug" else="${env.CONFIGURATION}">
-    <not><isset property="env.CONFIGURATION"/></not>
-  </condition>
-
-  <condition property="obj" value="build/JObjC.build/${cfg}" else="${env.OBJROOT}">
-    <not><isset property="env.OBJROOT"/></not>
-  </condition>
-
-  <condition property="dst" value="build/${cfg}" else="${env.DSTROOT}/${cfg}">
-    <not><isset property="env.DSTROOT"/></not>
-  </condition>
-
-  <condition property="ARCHS" value="ppc i386 x86_64" else="${env.RC_ARCHS}">
-    <not><isset property="env.RC_ARCHS"/></not>
-  </condition>
-
-  <!-- -/- -->
-
-  <property name="bin" location="${obj}/bin"/>
-  <property name="gendoc" location="${obj}/doc"/>
-
-  <condition property="nativelib.dir" value="${dst}">
-    <not><isset property="env.CONFIGURATION_BUILD_DIR"/></not>
-  </condition>
-  <condition property="nativelib.dir" value="${env.CONFIGURATION_BUILD_DIR}">
-    <isset property="env.CONFIGURATION_BUILD_DIR"/>
-  </condition>
-  <property name="nativelib.file" location="${nativelib.dir}/libJObjC.dylib" />
-
-  <property name="jniheaders" location="${obj}/src/jni_headers"/>
-
-  <property name="core.src" location="${src}/src/core/java"/>
-  <property name="core.bin" location="${bin}/core"/>
-  <property name="core.jniheaders" location="${jniheaders}/core"/>
-  <property name="core.nativelib.dir" location="${nativelib.dir}"/>
-
-  <property name="generator.src" location="${src}/src/generator/java"/>
-  <property name="generator.bin" location="${bin}/generator"/>
-
-  <property name="generated.src" location="${obj}/src/jobjc"/>
-  <property name="generated.bin" location="${bin}/generated"/>
-
-  <property name="additions.src" location="${src}/src/runtime-additions"/>
-  <property name="additions.bin" location="${bin}/additions"/>
-  <property name="additions.jniheaders" location="${jniheaders}/additions"/>
-  <property name="additions.nativelib.dir" location="${nativelib.dir}"/>
-
-  <property name="test.src" location="${src}/src/tests/java"/>
-  <property name="test.bin" location="${bin}/test"/>
-  <property name="test.jniheaders" location="${jniheaders}/test"/>
-  <property name="test.reports" location="${obj}/test-reports"/>
-
-  <condition property="product.target_path"
-             value="/System/Library/Java/Extensions"
-             else="${env.INSTALL_PATH}">
-    <not><isset property="env.INSTALL_PATH"/></not>
-  </condition>
-
-  <echo message="(Settings :src '${src}' :cfg '${cfg}' :obj '${obj}' :dst '${dst}')"/>
-
-  <path id="test.lib.path.id">
-    <fileset dir="/usr/share/java">
-      <include name="**/*.jar"/>
-    </fileset>
-  </path>
-
-  <property name="product.jarfile.dir" location="${obj}"/>
-  <property name="product.jarfile.name" value="JObjC.jar"/>
-  <property name="product.jarfile" location="${product.jarfile.dir}/${product.jarfile.name}"/>
-
-  <target name="gen-pcoder" description="Generate PrimitiveCoder.java">
-    <exec executable="ruby" failonerror="true">
-      <arg value="${src}/run-and-write-if-okay"/>
-      <arg value="${src}/src/core/PrimitiveCoder.hs"/>
-      <arg value="${src}/src/core/java/com/apple/jobjc/PrimitiveCoder.java"/>
-    </exec>
-  </target>
-
-  <target name="build-core" depends="gen-pcoder" description="Compile the core runtime classes">
-    <mkdir dir="${core.bin}" />
-    <!-- Compile PrimitiveCoder first to work around javac bug. -->
-    <javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}"
-           includes="**/PrimitiveCoder.java"
-           includeantruntime="false">
-      <classpath>
-        <path location="${obj}/../langtools/dist/lib/classes.jar"/>
-      </classpath>
-    </javac>
-    <javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">
-      <classpath>
-        <path location="${obj}/../langtools/dist/lib/classes.jar"/>
-      </classpath>
-    </javac>
-
-    <exec executable="/usr/bin/perl" outputproperty="core.classes" failonerror="true">
-      <arg value="${src}/extract_classes.pl"/>
-      <arg path="${core.bin}"/>
-    </exec>
-
-    <mkdir dir="${core.jniheaders}" />
-    <javah destdir="${core.jniheaders}" class="${core.classes}">
-      <classpath path="${core.bin}"/>
-    </javah>
-  </target>
-
-  <target name="build-core-native" depends="build-core">
-    <exec executable="xcodebuild" failonerror="true">
-      <env key="CC" value=""/>
-      <env key="CXX" value=""/>
-      <arg value="-configuration"/>
-      <arg value="${cfg}"/>
-      <arg value="-target"/>
-      <arg value="build-core-native"/>
-      <arg value="SRCROOT=${src}"/>
-      <arg value="OBJROOT=${obj}"/>
-      <arg value="DSTROOT=${dst}"/>
-      <arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="BUILD_DIR=${env.DSTROOT}"/>
-    </exec>
-  </target>
-
-  <!-- macosx jdk 7 puts jobjc core classes on the bootclasspath by default -->
-  <target name="build-generator" description="Compile and assemble the generator">
-    <mkdir dir="${generator.bin}"/>
-    <javac srcdir="${generator.src}" destdir="${generator.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">
-      <compilerarg value="-version"/>
-      <compilerarg value="-Xbootclasspath/p:${core.bin}"/>
-    </javac>
-  </target>
-
-  <!-- Use this indirection hack to work around buildit lockup when
-  running the generator. -->
-  <target name="run-generator" depends="build-generator" description="Invoke the assembled generator">
-    <mkdir dir="${generated.src}"/>
-    <exec executable="ruby" failonerror="true">
-      <arg value="${src}/rungen"/>
-      <arg value="install"/>
-      <arg value="${product.jarfile.name}"/>
-      <arg value="${nativelib.dir}"/>
-      <arg value="${obj}"/>
-      <arg value="${ARCHS}"/>
-      <arg value="${env.STABLE_GEN_DIR}"/>
-    </exec>
-  </target>
-
-  <target name="run-generator-old" depends="build-generator" description="Invoke the assembled generator">
-    <mkdir dir="${generated.src}"/>
-    <java classname="com.apple.internal.jobjc.generator.Generator" fork="true" failonerror="true">
-      <jvmarg value="-Xms128m" />
-      <jvmarg value="-Xmx512m" />
-      <assertions><enable/></assertions>
-      <classpath>
-        <path location="${core.bin}"/>
-        <path location="${generator.bin}"/>
-      </classpath>
-      <sysproperty key="java.library.path" value="${core.nativelib.dir}"/>
-      <arg value="dst=${generated.src}"/>
-    </java>
-  </target>
-
-  <target name="build-generated" description="Build and assemble the JObjC core and all generated frameworks">
-    <mkdir dir="${generated.bin}"/>
-    <javac srcdir="${generated.src}" destdir="${generated.bin}" source="1.5" target="1.5" fork="yes" memoryMaximumSize="512m" debug="${compile.debug}" includeantruntime="false">
-      <classpath>
-        <path location="${core.bin}"/>
-      </classpath>
-      <compilerarg value="-version"/>
-    </javac>
-  </target>
-
-  <target name="build-additions" depends="build-generated">
-    <mkdir dir="${additions.bin}"/>
-    <javac srcdir="${additions.src}" destdir="${additions.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">
-      <classpath>
-        <path location="${core.bin}"/>
-        <path location="${generated.bin}"/>
-      </classpath>
-      <compilerarg value="-version"/>
-    </javac>
-
-    <exec executable="/usr/bin/perl" outputproperty="additions.classes" failonerror="true">
-      <arg value="${src}/extract_classes.pl"/>
-      <arg path="${additions.bin}"/>
-    </exec>
-
-    <mkdir dir="${additions.jniheaders}"/>
-    <javah destdir="${additions.jniheaders}" class="${additions.classes}">
-      <classpath>
-        <path location="${core.bin}"/>
-        <path location="${generated.bin}"/>
-        <path location="${additions.bin}"/>
-      </classpath>
-    </javah>
-  </target>
-
-  <target name="build-additions-native">
-    <exec executable="xcodebuild" failonerror="true">
-      <env key="CC" value=""/>
-      <env key="CXX" value=""/>
-      <arg value="-configuration"/>
-      <arg value="${cfg}"/>
-      <arg value="-target"/>
-      <arg value="build-additions-native"/>
-      <arg value="SRCROOT=${src}"/>
-      <arg value="OBJROOT=${obj}"/>
-      <arg value="DSTROOT=${dst}"/>
-      <arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="BUILD_DIR=${env.DSTROOT}"/>
-    </exec>
-  </target>
-
-  <target name="assemble-product">
-    <mkdir dir="${product.jarfile.dir}"/>
-    <jar jarfile="${product.jarfile}" level="9" index="true">
-      <fileset dir="${core.bin}"/>
-      <fileset dir="${generated.bin}"/>
-      <fileset dir="${additions.bin}"/>
-    </jar>
-
-    <mkdir dir="${dst}/${product.target_path}"/>
-    <copy file="${product.jarfile}" toDir="${dst}/${product.target_path}" failonerror="true" verbose="true"/>
-    <copy file="${nativelib.file}" toDir="${dst}/${product.target_path}" failonerror="true" verbose="true"/>
-  </target>
-
-  <target name="doc-core">
-    <mkdir dir="${gendoc}"/>
-    <javadoc destdir="${gendoc}" access="protected">
-      <fileset dir="${src}/src" includes="**/*.java"/>
-    </javadoc>
-  </target>
-
-  <target name="build-test" description="compile unit tests">
-    <mkdir dir="${test.bin}"/>
-    <javac srcdir="${test.src}" destdir="${test.bin}" debug="false" includeantruntime="false">
-      <classpath>
-        <pathelement location="${core.bin}"/>
-        <pathelement location="${generator.bin}"/>
-        <pathelement location="${generated.bin}"/>
-        <pathelement location="${additions.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-      <compilerarg value="-version"/>
-    </javac>
-
-    <exec executable="/usr/bin/perl" outputproperty="test.classes" failonerror="true">
-      <arg value="${src}/extract_classes.pl"/>
-      <arg path="${test.bin}"/>
-    </exec>
-
-    <mkdir dir="${test.jniheaders}"/>
-    <javah destdir="${test.jniheaders}" class="${test.classes}">
-      <classpath>
-        <path location="${core.bin}"/>
-        <path location="${generated.bin}"/>
-        <path location="${additions.bin}"/>
-        <path location="${test.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-    </javah>
-  </target>
-
-  <target name="build-test-installed" description="compile unit tests">
-    <mkdir dir="${test.bin}"/>
-    <javac srcdir="${test.src}" destdir="${test.bin}" debug="false" includeantruntime="false">
-      <compilerarg value="-verbose"/>
-      <classpath>
-        <pathelement location="${generator.bin}"/>
-        <pathelement location="${generated.bin}"/>
-        <pathelement location="${additions.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-      <compilerarg value="-version"/>
-    </javac>
-
-    <exec executable="/usr/bin/perl" outputproperty="test.classes" failonerror="true">
-      <arg value="${src}/extract_classes.pl"/>
-      <arg path="${test.bin}"/>
-    </exec>
-
-    <mkdir dir="${test.jniheaders}"/>
-    <javah destdir="${test.jniheaders}" class="${test.classes}">
-      <classpath>
-        <path location="${generated.bin}"/>
-        <path location="${additions.bin}"/>
-        <path location="${test.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-    </javah>
-  </target>
-
-  <target name="build-test-native" depends="build-test">
-    <exec executable="xcodebuild" failonerror="true">
-      <env key="CC" value=""/>
-      <env key="CXX" value=""/>
-      <arg value="-configuration"/>
-      <arg value="${cfg}"/>
-      <arg value="-target"/>
-      <arg value="build-test-native"/>
-      <arg value="SRCROOT=${src}"/>
-      <arg value="OBJROOT=${obj}"/>
-      <arg value="DSTROOT=${dst}"/>
-      <arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="BUILD_DIR=${env.DSTROOT}"/>
-    </exec>
-  </target>
-
-  <target name="build-test-native-installed" depends="build-test-installed">
-    <exec executable="xcodebuild" failonerror="true">
-      <env key="CC" value=""/>
-      <env key="CXX" value=""/>
-      <arg value="-configuration"/>
-      <arg value="${cfg}"/>
-      <arg value="-target"/>
-      <arg value="build-test-native"/>
-      <arg value="SRCROOT=${src}"/>
-      <arg value="OBJROOT=${obj}"/>
-      <arg value="DSTROOT=${dst}"/>
-      <arg value="TARGET_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="PROJECT_TEMP_DIR=${env.DSTROOT}"/>
-      <arg value="BUILD_DIR=${env.DSTROOT}"/>
-    </exec>
-  </target>
-
-  <target name="test" depends="build-test-native" description="run unit tests">
-    <mkdir dir="${test.reports}"/>
-    <junit fork="yes" printsummary="yes">
-      <assertions>
-        <enable/>
-      </assertions>
-      <jvmarg value="-server" />
-
-      <sysproperty key="java.library.path" value="${nativelib.dir}" />
-      <classpath>
-        <pathelement location="${core.bin}"/>
-        <pathelement location="${generator.bin}"/>
-        <pathelement location="${generated.bin}"/>
-        <pathelement location="${additions.bin}"/>
-        <pathelement location="${test.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-
-      <formatter type="plain"/>
-
-      <batchtest fork="yes" todir="${test.reports}">
-        <fileset dir="${test.src}">
-          <include name="**/*Test.java"/>
-          <exclude name="**/AllTests.java"/>
-        </fileset>
-      </batchtest>
-    </junit>
-  </target>
-
-  <target name="test-installed" depends="build-test-native-installed" description="run unit tests">
-    <mkdir dir="${test.reports}"/>
-    <junit fork="yes" printsummary="yes">
-      <assertions>
-        <enable/>
-      </assertions>
-      <jvmarg value="-server" />
-
-      <sysproperty key="java.library.path" value="${nativelib.dir}" />
-      <classpath>
-        <pathelement location="${generator.bin}"/>
-        <pathelement location="${generated.bin}"/>
-        <pathelement location="${additions.bin}"/>
-        <pathelement location="${test.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-
-      <formatter type="plain"/>
-
-      <batchtest fork="yes" todir="${test.reports}">
-        <fileset dir="${test.src}">
-          <include name="**/*Test.java"/>
-          <exclude name="**/AllTests.java"/>
-        </fileset>
-      </batchtest>
-    </junit>
-  </target>
-
-
-  <condition property="bench_match" value="*" else="${env.BENCH_MATCH}">
-    <not><isset property="env.BENCH_MATCH"/></not>
-  </condition>
-
-  <target name="bench" depends="build-test-native" description="run benchmarks">
-    <mkdir dir="${test.reports}"/>
-    <junit fork="yes" printsummary="yes">
-      <sysproperty key="java.library.path" value="${nativelib.dir}" />
-      <classpath>
-        <pathelement location="${core.bin}"/>
-        <pathelement location="${generator.bin}"/>
-        <pathelement location="${generated.bin}"/>
-        <pathelement location="${additions.bin}"/>
-        <pathelement location="${test.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-
-      <jvmarg value="-Xms256m" />
-      <jvmarg value="-Xmx1024m" />
-      <jvmarg value="-server" />
-
-      <formatter type="plain"/>
-
-      <batchtest fork="yes" todir="${test.reports}">
-        <fileset dir="${test.src}">
-          <include name="**/Bench*${bench_match}*.java"/>
-        </fileset>
-      </batchtest>
-    </junit>
-  </target>
-
-  <target name="bench-installed" depends="build-test-native-installed" description="run benchmarks">
-    <mkdir dir="${test.reports}"/>
-    <junit fork="yes" printsummary="yes">
-      <sysproperty key="java.library.path" value="${nativelib.dir}" />
-      <classpath>
-        <pathelement location="${generator.bin}"/>
-        <pathelement location="${generated.bin}"/>
-        <pathelement location="${additions.bin}"/>
-        <pathelement location="${test.bin}"/>
-      </classpath>
-      <classpath refid="test.lib.path.id"/>
-
-      <jvmarg value="-Xms256m" />
-      <jvmarg value="-Xmx1024m" />
-      <jvmarg value="-server" />
-
-      <formatter type="plain"/>
-
-      <batchtest fork="yes" todir="${test.reports}">
-        <fileset dir="${test.src}">
-          <include name="**/Bench*${bench_match}*.java"/>
-        </fileset>
-      </batchtest>
-    </junit>
-  </target>
-
-  <target name="clean">
-    <delete dir="build"/>
-    <delete dir="${obj}"/>
-    <delete dir="${dst}"/>
-    <delete dir="${gendoc}"/>
-    <delete dir="${test.reports}"/>
-  </target>
-
-
-  <target name="clean-all" depends="clean,build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product">
-  </target>
-  <target name="all" depends="build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product">
-  </target>
-  <target name="all-test" depends="build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product,test-installed">
-  </target>
-  <target name="clean-all-test" depends="clean,build-core,build-core-native,build-generator,run-generator,build-generated,build-additions,build-additions-native,assemble-product,test-installed">
-  </target>
-  <target name="all-but-gen" depends="clean,build-core,build-core-native,build-generator,build-generated,build-additions,build-additions-native,assemble-product">
-  </target>
-</project>
--- a/src/macosx/native/jobjc/extract_classes.pl	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#!/usr/bin/perl
-#
-# 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
-# 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.
-##
-
-$file_dir = $ARGV[0];
-@file_list = qx("/usr/bin/find" "$file_dir");
-
-foreach $file (@file_list) {
-        if ($file =~ s/\.class//) {
-            if ($file !~ s/\$[0-9]//) {
-                $file =~ s/$file_dir\///g;
-                $file =~ s/\//\./g;
-                chomp($file);
-                print "$file,";
-            }
-        }
-}
--- a/src/macosx/native/jobjc/run-and-write-if-okay	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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
-# 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.
-#
-#
-
-if ARGV.length < 2
-  puts <<EOF
-Expects two args: EXEC and OUTPATH. First, it runs and prints
-`EXEC 2>&1`. If it returns successfully, it writes the output to OUTPATH.
-This script will return successfully unless writing the output fails.
-EOF
-  exit
-end
-
-EXECPATH = ARGV[0]
-OUTPATH  = ARGV[1]
-
-output = `#{EXECPATH}`
-puts output
-
-if $?.to_i == 0
-  puts "Writing output of #{EXECPATH} to #{OUTPATH}"
-  File.open(OUTPATH, 'w') {|f| f.write(output) }
-else
-  puts "#{EXECPATH} failed to run trial. Ignoring."
-end
--- a/src/macosx/native/jobjc/rungen	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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
-# 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.
-#
-#
-
-xcodeAction = ARGV[0]
-
-exit unless xcodeAction == "install"
-
-JOBJC_JAR = ARGV[1]
-LIBPATH = ARGV[2]
-OBJROOT = ARGV[3]
-ARCHS   = ARGV[4]
-STABLE_GEN_DIR = ARGV[5]
-
-ourJavaHome = ENV['JAVA_HOME']
-ourJavaVersion = `java -fullversion 2>&1`
-$stderr.puts "ENV['JAVA_HOME'] = #{ourJavaHome}"
-$stderr.puts "java -fullversion = #{ourJavaVersion}"
-
-$stderr.puts "jobjc_jar = #{JOBJC_JAR}"
-$stderr.puts "libpath = #{LIBPATH}"
-$stderr.puts "objroot = #{OBJROOT}"
-$stderr.puts "ARCHS   = #{ARCHS}"
-$stderr.puts "STABLE_GEN_DIR = #{STABLE_GEN_DIR}"
-
-jarch = if ARCHS =~ /x86_64/ then "-d64" else "-d32" end
-
-# compute the boot class path, but remove the JObjC jar file that may have been installed in the boot jdk
-
-bootclasspathcmd = "java -classpath #{OBJROOT}/bin/core:#{OBJROOT}/bin/generator com.apple.internal.jobjc.generator.BootClassPathMinus #{JOBJC_JAR}"
-$stderr.puts bootclasspathcmd
-bootclasspath = `#{bootclasspathcmd}`
-
-$stderr.puts "bootclasspath is: "
-$stderr.puts bootclasspath
-
-# we run the generator with our newly created JObjC.  The installed version (if available) has been removed from
-# the boot class path, so we are building with everything newly created.
-cmd = "java #{jarch} -Xms128m -Xmx512m -Djava.library.path=#{LIBPATH} -Xbootclasspath:#{bootclasspath.chomp} -classpath #{OBJROOT}/bin/core:#{OBJROOT}/bin/generator -ea com.apple.internal.jobjc.generator.Generator dst=#{OBJROOT}/src/jobjc frameworks=#{STABLE_GEN_DIR}"
-
-$stderr.puts cmd
-puts `#{cmd} 2>&1`
-
-raise $?.to_i if $?.to_i != 0
--- a/src/macosx/native/jobjc/runjava	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# 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
-# 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.
-#
-#
-java -ea -classpath "lib/junit-4.4.jar:build/JObjC.build/Debug/bin/core:build/JObjC.build/Debug/bin/generator:build/JObjC.build/Debug/bin/additions:build/JObjC.build/Debug/bin/test:build/JObjC.build/Debug/bin/generated" -Djava.library.path=build/Debug $@
--- a/src/macosx/native/jobjc/src/core/PrimitiveCoder.hs	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +0,0 @@
-#!/usr/bin/env runhaskell
-
-{-
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
--}
-{-
-The simplest way to get Haskell is through MacPorts: sudo port install ghc
-
-Otherwise, see http://www.haskell.org/ghc/
--}
-
-import Data.List
-import Data.Maybe
-import Data.Char
-
-data Width = W32 | W64
-             deriving (Show, Eq, Bounded, Enum)
-
-data NType = NBOOL | Nschar | Nuchar | Nsshort | Nushort | Nsint | Nuint
-           | Nslong | Nulong | Nslonglong | Nulonglong | Nfloat | Ndouble
-             deriving (Show, Eq, Bounded, Enum)
-
-data JPrim = Jboolean | Jbyte | Jchar | Jshort | Jint | Jlong | Jfloat | Jdouble
-             deriving (Show, Eq, Bounded, Enum)
-
-data JClass = JBoolean | JByte | JCharacter | JShort | JInteger | JLong
-            | JFloat | JDouble
-              deriving (Show, Eq, Bounded, Enum)
-
-data FFIType = SINT8 | UINT8 | SINT16 | UINT16 | SINT32 | UINT32
-             | SINT64 | UINT64 | FLOAT | DOUBLE
-             deriving (Show, Eq, Bounded, Enum)
-
-widths = [minBound..maxBound] :: [Width]
-ntypes = [minBound..maxBound] :: [NType]
-jprims = [minBound..maxBound] :: [JPrim]
-jclasses = [minBound..maxBound] :: [JClass]
-ffitypes = [minBound..maxBound] :: [FFIType]
-
--- What's the FFIType for a given Width and NType? For example: W32 NBOOL -> SINT8
-ffitype :: Width -> NType -> FFIType
-ffitype _ NBOOL   = SINT8
-ffitype _ Nschar  = SINT8
-ffitype _ Nuchar  = UINT8
-ffitype _ Nsshort = SINT16
-ffitype _ Nushort = UINT16
-ffitype _ Nsint   = SINT32
-ffitype _ Nuint   = UINT32
-ffitype W32 Nslong = SINT32
-ffitype W64 Nslong = SINT64
-ffitype W32 Nulong = UINT32
-ffitype W64 Nulong = UINT64
-ffitype _ Nslonglong = SINT64
-ffitype _ Nulonglong = UINT64
-ffitype _ Nfloat  = FLOAT
-ffitype _ Ndouble = DOUBLE
-
-sizeof :: FFIType -> Int
-sizeof SINT8  = 1
-sizeof UINT8  = 1
-sizeof SINT16 = 2
-sizeof UINT16 = 2
-sizeof SINT32 = 4
-sizeof UINT32 = 4
-sizeof SINT64 = 8
-sizeof UINT64 = 8
-sizeof FLOAT  = 4
-sizeof DOUBLE = 8
-
--- What's the Obj-C encoding for a given NType? For example: unsigned char -> 'C'
-encoding nt = fromJust $ lookup nt $
-              [(NBOOL, 'B'), (Nschar, 'c'), (Nuchar, 'C'), (Nsshort, 's'),
-               (Nushort, 'S'), (Nsint, 'i'), (Nuint, 'I'), (Nslong, 'l'),
-               (Nulong, 'L'), (Nslonglong, 'q'), (Nulonglong, 'Q'),
-               (Nfloat, 'f'), (Ndouble, 'd')]
-
--- What's the JPrim for a given NType? For example: native signed long long -> java long
-ntype2jprim nt = fromJust $ lookup nt $
-                 [(NBOOL, Jboolean), (Nschar, Jbyte), (Nuchar, Jbyte),
-                  (Nsshort, Jshort), (Nushort, Jshort), (Nsint, Jint), (Nuint, Jint),
-                  (Nslong, Jlong), (Nulong, Jlong),
-                  (Nslonglong, Jlong), (Nulonglong, Jlong),
-                  (Nfloat, Jfloat), (Ndouble, Jdouble)]
-
--- What's the JClass for a given JPrim? For example: int -> Integer
-jprim2jclass jp = fromJust $ lookup jp $
-                  [(Jboolean, JBoolean), (Jbyte, JByte), (Jchar, JCharacter),
-                   (Jshort, JShort), (Jint, JInteger), (Jlong, JLong),
-                   (Jfloat, JFloat), (Jdouble, JDouble)]
-
--- Convert a type to something suitable for Java code. For example: Jboolean -> boolean
-ntype2js nt = tail $ show nt
-jclass2js t = tail $ show t
-jprim2js p = tail $ show p
-ffitype2js f = "FFI_" ++ (show f)
-
--- Capitalize the first letter of a String
-capitalize [] = []
-capitalize s = [toUpper $ head s] ++ tail s
-
--- Given an Width and NType, return the Java code for reading said NType from memory.
-popAddr :: Width -> NType -> String
-popAddr _ NBOOL   = "rt.unsafe.getByte(addr) != 0"
-popAddr _ Nschar  = "rt.unsafe.getByte(addr)"
-popAddr _ Nuchar  = "rt.unsafe.getByte(addr)"
-popAddr W32 Nslong = "rt.unsafe.getInt(addr)"
-popAddr W32 Nulong = "rt.unsafe.getInt(addr)"
-popAddr _ ntype = "rt.unsafe.get" ++ (capitalize.jprim2js.ntype2jprim $ ntype) ++ "(addr)"
-
--- Given an Width and NType, return the Java code for writing said NType to memory.
-pushAddr :: Width -> NType -> String
-pushAddr _ NBOOL   = "rt.unsafe.putByte(addr, (byte) (x ? 1 : 0));"
-pushAddr _ Nschar  = "rt.unsafe.putByte(addr, x);"
-pushAddr _ Nuchar  = "rt.unsafe.putByte(addr, x);"
-pushAddr W32 Nslong = "rt.unsafe.putInt(addr, (int) x);"
-pushAddr W32 Nulong = "rt.unsafe.putInt(addr, (int) x);"
-pushAddr _ ntype = "rt.unsafe.put" ++ (capitalize jprimS) ++ "(addr, (" ++ jprimS ++ ") x);"
-    where jprimS = jprim2js.ntype2jprim $ ntype
-
--- Helpers for generating Java ternarnies and conditionals.
-archExpr x32 x64 = if x32 /= x64 then retdiff else x32
-    where retdiff = "(JObjCRuntime.IS64 ? (" ++ x64 ++ ") : (" ++ x32 ++ "))"
-
-archStmt x32 x64 = if x32 /= x64 then retdiff else x32
-    where retdiff = "if(JObjCRuntime.IS64){ " ++ x64 ++ " }else{ " ++ x32 ++ " }"
-
--- Get a Java expression for the correct FFIType at runtime. For example: (JObjCRuntime.IS64 ? FFI_SINT64 : FFI_SINT32)
-ffitypeVal nt = archExpr (ffitype2js $ ffitype W32 nt)
-                         (ffitype2js $ ffitype W64 nt)
-
--- Similar to ffiTypeVal. Get the correct pop expression and push statement.
-popAddrVal nt = archExpr (popAddr W32 nt) (popAddr W64 nt)
-pushAddrVal nt = archStmt (pushAddr W32 nt) (pushAddr W64 nt)
-
--- What's the Coder class name we're using for a given NType?
-coderName nt = aux nt ++ "Coder"
-    where
-      aux NBOOL   = "Bool"
-      aux Nschar  = "SChar"
-      aux Nuchar  = "UChar"
-      aux Nsshort = "SShort"
-      aux Nushort = "UShort"
-      aux Nsint   = "SInt"
-      aux Nuint   = "UInt"
-      aux Nslong  = "SLong"
-      aux Nulong  = "ULong"
-      aux Nslonglong   = "SLongLong"
-      aux Nulonglong   = "ULongLong"
-      aux Nfloat  = "Float"
-      aux Ndouble = "Double"
-
--- Operation for converting between primitives. Usually it just casts, but booleans are special.
-jconvertPrims sym Jboolean Jboolean = sym
-jconvertPrims sym Jboolean b = "((" ++ jprim2js b ++ ")(" ++ sym ++ " ? 1 : 0))"
-jconvertPrims sym a Jboolean = "(" ++ sym ++ " != 0)"
-jconvertPrims sym a b = if a == b then sym else "((" ++ jprim2js b ++ ")" ++ sym ++ ")"
-
-sizeofRet nt =
-    let ffitypes = map (\w -> ffitype w nt) widths
-        sizes = map sizeof ffitypes in
-    if (length $ nub sizes) == 1
-    then "\t\treturn " ++ (show.head $ sizes) ++ ";"
-    else unlines [
-              "\t\tswitch(w){",
-              (unlines $ map casestmt widths),
-              "\t\tdefault: return -1;",
-               "\t\t}"]
-    where
-      casestmt w = "\t\t\tcase " ++ (show w) ++ ": return " ++
-                   (show.sizeof $ ffitype w nt) ++ ";"
-
--- Generate a coder class for a given NType.
-c2java ntype =
-    unlines [
- "// native " ++ ntypeS ++ " -> java " ++ jprimS,
- "public static final class " ++ className ++ " extends PrimitiveCoder<" ++ jclassS ++ ">{",
- "\tpublic static final " ++ className ++ " INST = new " ++ className ++ "();",
- "\tpublic " ++ className ++ "(){ super("++ffitypeVal ntype++", \"" ++ [encoding ntype] ++ "\", "++jclassS++".class, "++jprimS++".class); }",
- "\t// compile time",
- "\t@Override public void push(JObjCRuntime rt, long addr, " ++ jprimS ++ " x){",
- "\t\t" ++ pushAddrVal ntype,
- "\t}",
- "\t@Override public " ++ jprimS ++ " pop" ++ capitalize jprimS ++ "(JObjCRuntime rt, long addr){",
- "\t\treturn " ++ popAddrVal ntype ++ ";",
- "\t}",
- "\t// for runtime coding",
- "\t@Override public int sizeof(Width w){",
- sizeofRet ntype,
- "\t}",
- "\t@Override public void push(JObjCRuntime rt, long addr, " ++ jclassS ++ " x){ " ++
- "push(rt, addr, (" ++ jprimS ++ ") x); }",
- "\t@Override public " ++ jclassS ++ " pop(JObjCRuntime rt, long addr){ " ++
- "return pop" ++ capitalize jprimS ++ "(rt, addr); }",
- "\t// proxies for mixed encoding",
- makeProxyMethods ntype,
- "}"
- ]
-     where
-       jprim = ntype2jprim ntype
-       jclass = jprim2jclass jprim
-       jprimS = jprim2js jprim
-       jclassS = jclass2js jclass
-       ntypeS = ntype2js ntype
-       className = coderName ntype
-
--- Generate push and pop methods that convert and proxy to actual implementation.
-makeProxyMethods nt = unlines $ map aux jprims
-    where
-      targetJPrim = ntype2jprim nt
-      targetJPrimS = jprim2js targetJPrim
-      aux jprim = if targetJPrim == jprim then "" else unlines [
-                   "\t@Override public void push(JObjCRuntime rt, long addr, " ++ jprimS ++ " x){ " ++
-                   "push(rt, addr, " ++ pushConversion "x" ++ "); }",
-                   "\t@Override public " ++ jprimS ++ " pop" ++ capitalize jprimS ++ "(JObjCRuntime rt, long addr){ " ++
-                   "return " ++ (popConversion ("pop" ++ capitalize targetJPrimS ++ "(rt, addr)")) ++ "; }"
-                  ]
-          where
-            jprimS = jprim2js jprim
-            pushConversion sym = jconvertPrims sym jprim targetJPrim
-            popConversion sym = jconvertPrims sym targetJPrim jprim
-
-main = do
-  putStrLn "package com.apple.jobjc;"
-
-  putStrLn "import com.apple.jobjc.JObjCRuntime.Width;"
-
-  putStrLn "// Auto generated by PrimitiveCoder.hs"
-  putStrLn "// Do not edit by hand."
-
-  putStrLn "public abstract class PrimitiveCoder<T> extends Coder<T>{"
-
-  putStrLn "\tpublic PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){"
-  putStrLn "\t\tsuper(ffiTypeCode, objCEncoding, jclass, jprim);"
-  putStrLn "\t}"
-
-  mapM_ (\p -> putStrLn $ unlines [makePopI p, makePushI p]) jprims
-
-  mapM_ (putStrLn . c2java) ntypes
-
-  putStrLn "}"
-    where
-      makePopI jprim = unlines ["\tpublic final " ++ jprim2js jprim ++ " pop" ++ (capitalize.jprim2js $ jprim)
-                                   ++ "(NativeArgumentBuffer args){\n"
-                                   ++ "\t\treturn pop" ++ (capitalize.jprim2js $ jprim) ++ "(args.runtime, args.retValPtr);\n"
-                                   ++ "\t}",
-                                "\tpublic abstract " ++ jprim2js jprim ++ " pop" ++ (capitalize.jprim2js $ jprim) ++ "(JObjCRuntime runtime, long addr);"]
-      makePushI jprim = unlines ["\tpublic final void push"
-          ++ "(NativeArgumentBuffer args, " ++ jprim2js jprim ++ " x){\n"
-          ++ "\t\tpush(args.runtime, args.argValuesPtr, x);\n"
-          ++ "\t\targs.didPutArgValue(sizeof());\n"
-          ++ "\t}",
-        "\tpublic abstract void push(JObjCRuntime runtime, long addr, " ++ jprim2js jprim ++ " x);"]
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CFType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public class CFType extends Pointer<Void> {
-    protected CFType(long ptr) { super(ptr); }
-    protected CFType(Pointer<?> ptr) { super(ptr.ptr); }
-
-    protected ID getTollFreeBridge(JObjCRuntime runtime){
-        return ID.getObjCObjectFor(runtime, super.ptr);
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CIF.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-
-class CIF {
-    private static native int getSizeofCIF();
-    private static final int SIZEOF = getSizeofCIF();
-    private static native boolean prepCIF(long cifPtr, int nargs, long retFFITypePtr, long argsPtr);
-
-    public static CIF createCIFFor(final NativeArgumentBuffer args, final Coder returnCoder, final Coder ... argCoders) {
-        NativeBuffer cifBuf = new NativeBuffer(SIZEOF + (argCoders.length * JObjCRuntime.PTR_LEN));
-        final long argsPtr = cifBuf.bufferPtr + SIZEOF;
-
-        {
-            long argsIterPtr = argsPtr;
-            for(final Coder coder : argCoders){
-                PrimitivePointerCoder.INST.push(args.runtime, argsIterPtr, coder.getFFITypePtr());
-                argsIterPtr += JObjCRuntime.PTR_LEN;
-            }
-        }
-
-        boolean ok = prepCIF(cifBuf.bufferPtr, argCoders.length, returnCoder.getFFITypePtr(), argsPtr);
-        if(!ok)
-            throw new RuntimeException("ffi_prep_cif failed.");
-
-        return new CIF(cifBuf, returnCoder, argCoders);
-    }
-
-    final NativeBuffer cif;
-    // CIF needs to keep refs to the Coders, so they don't get finalized and their FFITypes freed.
-    final Coder returnCoder;
-    final Coder[] argCoders;
-
-    private CIF(final NativeBuffer cif, Coder returnCoder, Coder... argCoders) {
-        this.cif = cif;
-        this.returnCoder = returnCoder;
-        this.argCoders = argCoders;
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Coder.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,289 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.io.StringWriter;
-import java.lang.reflect.Method;
-
-import com.apple.jobjc.JObjCRuntime.Width;
-import com.apple.jobjc.PrimitiveCoder.BoolCoder;
-import com.apple.jobjc.PrimitiveCoder.DoubleCoder;
-import com.apple.jobjc.PrimitiveCoder.FloatCoder;
-import com.apple.jobjc.PrimitiveCoder.SCharCoder;
-import com.apple.jobjc.PrimitiveCoder.SIntCoder;
-import com.apple.jobjc.PrimitiveCoder.SLongLongCoder;
-import com.apple.jobjc.PrimitiveCoder.SShortCoder;
-
-public abstract class Coder<T> {
-    private static native long getNativeFFITypePtrForCode(final int code);
-
-    static final int FFI_VOID        = 0;
-    static final int FFI_PTR        = FFI_VOID+1;
-
-    static final int FFI_SINT8        = FFI_PTR+1;
-    static final int FFI_UINT8        = FFI_SINT8+1;
-    static final int FFI_SINT16        = FFI_UINT8+1;
-    static final int FFI_UINT16        = FFI_SINT16+1;
-    static final int FFI_SINT32        = FFI_UINT16+1;
-    static final int FFI_UINT32        = FFI_SINT32+1;
-    static final int FFI_SINT64        = FFI_UINT32+1;
-    static final int FFI_UINT64        = FFI_SINT64+1;
-
-    static final int FFI_FLOAT        = FFI_UINT64+1;
-    static final int FFI_DOUBLE        = FFI_FLOAT+1;
-    static final int FFI_LONGDOUBLE    = FFI_DOUBLE+1;
-
-    private static long[] ffiCodesToFFITypePtrs;
-    static{
-        System.loadLibrary("JObjC");
-        ffiCodesToFFITypePtrs = new long[FFI_LONGDOUBLE + 1];
-        for (int i = 0; i < FFI_LONGDOUBLE + 1; i++) ffiCodesToFFITypePtrs[i] = getNativeFFITypePtrForCode(i);
-    }
-
-    long getFFITypePtr() {
-        return ffiCodesToFFITypePtrs[getTypeCode()];
-    }
-
-    // runtime coding
-    public abstract void push(final JObjCRuntime runtime, final long addr, final T x);
-    public abstract T pop(final JObjCRuntime runtime, final long addr);
-
-    public void push(final NativeArgumentBuffer args, final T x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-
-    public T pop(final NativeArgumentBuffer args){
-        return pop(args.runtime, args.retValPtr);
-    }
-
-    public abstract int sizeof(Width w);
-    final public int sizeof(){ return sizeof(JObjCRuntime.WIDTH); }
-
-    //
-
-    public Coder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim) {
-        this.ffiTypeCode = ffiTypeCode;
-        this.objCEncoding = objCEncoding;
-        this.jclass = jclass;
-        this.jprim = jprim;
-    }
-
-    public Coder(int ffiTypeCode, String objCEncoding, Class jclass) {
-        this(ffiTypeCode, objCEncoding, jclass, null);
-    }
-
-    private final int ffiTypeCode;
-    private final String objCEncoding;
-    private final Class jclass;
-    private final Class jprim;
-
-    final int getTypeCode() { return ffiTypeCode; }
-    final String getObjCEncoding(){ return objCEncoding; }
-    public final Class getJavaClass() { return jclass; }
-    public final Class getJavaPrimitive() { return jprim; }
-
-    // runtime coding
-
-    private static Coder[] runtimeCoders;
-    static public Coder getCoderAtRuntimeForType(Class cls){
-        if(runtimeCoders == null) runtimeCoders = new Coder[]{
-            NSClassCoder.INST, IDCoder.INST, PointerCoder.INST,
-            DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST,
-            SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST,
-            VoidCoder.INST
-        };
-
-        for(Coder c : runtimeCoders)
-            if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) ||
-                    (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls)))
-                return c;
-
-        if(Struct.class.isAssignableFrom(cls)){
-            try {
-                Method m = cls.getDeclaredMethod("getStructCoder");
-                m.setAccessible(true);
-                return (Coder) m.invoke(null);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        throw new RuntimeException("Could not find suitable coder for " + cls);
-    }
-
-    static public Coder getCoderAtRuntime(Object inst){
-        if(inst == null)              return PointerCoder.INST;
-        if(inst instanceof Struct)    return ((Struct) inst).getCoder();
-        return getCoderAtRuntimeForType(inst.getClass());
-    }
-
-    //
-
-    public static final class VoidCoder extends Coder<Object>{
-        public static final VoidCoder INST = new VoidCoder();
-        public VoidCoder(){ super(FFI_VOID, "v", Void.class, void.class); }
-        @Override public int sizeof(Width w) { return -1; }
-        @Override public Object pop(JObjCRuntime runtime, long addr) { throw new RuntimeException("Trying to pop a Void."); }
-        @Override public void push(JObjCRuntime runtime, long addr, Object x) { throw new RuntimeException("Trying to push a Void."); }
-    }
-
-    public static final class UnknownCoder extends Coder<Object> {
-        public static final UnknownCoder INST = new UnknownCoder();
-        public UnknownCoder(){ super(-1, "?", null, null); }
-        @Override public int sizeof(Width w) { return -1; }
-        @Override public void push(JObjCRuntime runtime, long addr, Object x) { throw new RuntimeException("Coder not implemented");}
-        @Override public Object pop(JObjCRuntime runtime, long addr) { throw new RuntimeException("Coder not implemented"); }
-    }
-
-    public static final class PrimitivePointerCoder extends Coder<Long> {
-        public static final PrimitivePointerCoder INST = new PrimitivePointerCoder();
-        public PrimitivePointerCoder(){ super(Coder.FFI_PTR, "^?", Long.class, long.class); }
-        @Override public int sizeof(Width w) { return JObjCRuntime.PTR_LEN; }
-
-        public void push(JObjCRuntime runtime, long addr, long x) {
-            if(JObjCRuntime.IS64)
-                runtime.unsafe.putLong(addr, x);
-            else
-                runtime.unsafe.putInt(addr, (int) x);
-        }
-
-        public void push(final JObjCRuntime runtime, final NativeArgumentBuffer argBuf, final long ptr) {
-            push(runtime, argBuf.argValuesPtr, ptr);
-            argBuf.didPutArgValue(sizeof());
-        }
-
-        public long popPtr(final JObjCRuntime runtime, final long addr) {
-            return JObjCRuntime.IS64 ? runtime.unsafe.getLong(addr) : runtime.unsafe.getInt(addr);
-        }
-
-        public long popPtr(final JObjCRuntime runtime, final NativeArgumentBuffer argBuf) {
-            return popPtr(runtime, argBuf.retValPtr);
-        }
-
-        @Override public Long pop(JObjCRuntime runtime, long addr) { return popPtr(runtime, addr); }
-        @Override public void push(JObjCRuntime runtime, long addr, Long x) { push(runtime, addr, (long) x); }
-    }
-
-    public static final class PointerCoder extends Coder<Pointer> {
-        public static final PointerCoder INST = new PointerCoder();
-        public PointerCoder(){ super(FFI_PTR, "^?", Pointer.class); }
-        @Override public int sizeof(Width w) { return PrimitivePointerCoder.INST.sizeof(w); }
-
-        @Override public Pointer pop(JObjCRuntime runtime, long addr) {
-            return new Pointer(PrimitivePointerCoder.INST.popPtr(runtime, addr));
-        }
-        @Override public void push(JObjCRuntime runtime, long addr, Pointer x) {
-            PrimitivePointerCoder.INST.push(runtime, addr, x == null ? 0 : x.ptr);
-        }
-    }
-
-    public static final class SELCoder extends Coder<SEL> {
-        public static final SELCoder INST = new SELCoder();
-        public SELCoder(){ super(FFI_PTR, ":", SEL.class); }
-        @Override public int sizeof(Width w) { return PrimitivePointerCoder.INST.sizeof(w); }
-
-        @Override public void push(JObjCRuntime runtime, long addr, SEL x) {
-            PrimitivePointerCoder.INST.push(runtime, addr, x == null ? 0 : x.selPtr);
-        }
-        @Override public SEL pop(JObjCRuntime runtime, long addr) {
-            return new SEL(PrimitivePointerCoder.INST.popPtr(runtime, addr));
-        }
-    }
-
-    public static abstract class StructCoder extends Coder<Struct> {
-        private final FFIType ffiType;
-        final int sizeof;
-
-        public StructCoder(final int sizeof, final Coder... elementCoders){
-            super(-1, objCEncoding(elementCoders), null);
-            this.ffiType = new FFIType(elementCoders);
-            this.sizeof = sizeof;
-        }
-
-        @Override public int sizeof(Width w) { return sizeof; }
-
-        private static String objCEncoding(final Coder[] elementCoders) {
-            StringWriter str = new StringWriter();
-            str.append("{?=");
-            for(Coder c : elementCoders)
-                str.append(c.getObjCEncoding());
-            str.append("}");
-            return str.toString();
-        }
-
-        @Override long getFFITypePtr() { return ffiType.getPtr(); }
-
-        @Override public void push(NativeArgumentBuffer argBuf, Struct x) {
-            // Just point to the instance on the heap instead of copying it onto the arg buf.
-            argBuf.doPutArgPtr(x.raw.bufferPtr);
-        }
-
-        @Override public void push(JObjCRuntime rt, long addr, Struct x) {
-            rt.unsafe.copyMemory(x.raw.bufferPtr, addr, sizeof);
-        }
-
-        protected abstract Struct newInstance(JObjCRuntime runtime);
-
-        @Override public Struct pop(final JObjCRuntime runtime, final long addr) {
-            Struct s = newInstance(runtime);
-            runtime.unsafe.copyMemory(addr, s.raw.bufferPtr, sizeof);
-            return s;
-        }
-    }
-
-    public static final class IDCoder extends Coder<ID>{
-        public static final IDCoder INST = new IDCoder();
-        public IDCoder(){ super(FFI_PTR, "@", ID.class); }
-        @Override public int sizeof(Width w) { return PrimitivePointerCoder.INST.sizeof(w); }
-
-        public <T extends ID> T newID(final JObjCRuntime runtime, final long objPtr) {
-            return (T) ID.getObjCObjectFor(runtime, objPtr);
-        }
-
-        @Override public ID pop(final JObjCRuntime runtime, final long addr) {
-            return newID(runtime, PrimitivePointerCoder.INST.popPtr(runtime, addr));
-        }
-
-        @Override public void push(final JObjCRuntime runtime, final long addr, final ID x) {
-            PointerCoder.INST.push(runtime, addr, x);
-        }
-    }
-
-    public static final class NSClassCoder extends Coder<NSClass>{
-        public static final NSClassCoder INST = new NSClassCoder();
-        public NSClassCoder(){ super(FFI_PTR, "#", NSClass.class); }
-        @Override public int sizeof(Width w) { return PrimitivePointerCoder.INST.sizeof(w); }
-
-        @Override public NSClass pop(JObjCRuntime runtime, long addr) {
-            final long clsPtr = PrimitivePointerCoder.INST.popPtr(runtime, addr);
-            if (clsPtr == 0) return null;
-            return NSClass.getObjCClassFor(runtime, clsPtr);
-        }
-        @Override public void push(JObjCRuntime runtime, long addr, NSClass x) {
-            PointerCoder.INST.push(runtime, addr, x);
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/FFIType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-
-
-class FFIType{
-    private static native void makeFFIType(long ffi_type_buf, long elements_buf);
-    private static native int  getFFITypeSizeof();
-    private static int FFI_TYPE_SIZEOF = getFFITypeSizeof();
-    final NativeBuffer ffi_type;
-    final NativeBuffer elements;
-    final Coder[] elementCoders;
-
-    public FFIType(final Coder... elementCoders){
-        final JObjCRuntime runtime = JObjCRuntime.inst();
-        this.elementCoders = elementCoders;
-        this.ffi_type = new NativeBuffer(FFI_TYPE_SIZEOF);
-        this.elements = new NativeBuffer(JObjCRuntime.PTR_LEN * (elementCoders.length + 1));
-
-        long elIterPtr = elements.bufferPtr;
-        for(Coder c : elementCoders){
-            PrimitivePointerCoder.INST.push(runtime, elIterPtr, c.getFFITypePtr());
-            elIterPtr += PrimitivePointerCoder.INST.sizeof();
-        }
-        PrimitivePointerCoder.INST.push(runtime, elIterPtr, 0);
-
-        makeFFIType(ffi_type.bufferPtr, elements.bufferPtr);
-    }
-
-    public long getPtr(){
-        return ffi_type.bufferPtr;
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Function.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public class Function {
-    private static native long getFxnPtrForFunctionName(final String functionName);
-    private static native long getFxnPtrForFunctionNameAndLib(final long libPtr, final String functionName);
-
-    final long fxnPtr;
-
-    Function(final long fxnPtr) {
-        this.fxnPtr = fxnPtr;
-    }
-
-    public Function(final String name) {
-        this(getFxnPtr(name));
-    }
-
-    public Function(final MacOSXFramework framework, final String name) {
-        this(getFxnPtr(name, framework));
-    }
-
-    static long getFxnPtr(final String name){
-        long fxnPtr = getFxnPtrForFunctionName(name);
-        if(fxnPtr == 0) throw new RuntimeException("Function pointer for " + name + " not found in runtime.");
-        return fxnPtr;
-    }
-
-    static long getFxnPtr(final String name, final MacOSXFramework framework){
-        long fxnPtr = 0;
-        for(int i = 0; fxnPtr == 0 && i < framework.nativeLibPtrs.length; i++){
-            fxnPtr = getFxnPtrForFunctionNameAndLib(framework.nativeLibPtrs[i], name);
-            if(fxnPtr != 0) return fxnPtr;
-        }
-        throw new RuntimeException("Function pointer for " + name + " not found in framework " + framework + ".");
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/ID.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Constructor;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-
-public class ID extends Pointer<Void>{
-    static native String getNativeDescription(final long objPtr);
-
-    final JObjCRuntime runtime;
-
-    static final Class[] CTOR_ARGS = { long.class, JObjCRuntime.class };
-    protected ID(final long objPtr, final JObjCRuntime runtime) {
-        super(objPtr);
-        runtime.assertOK();
-        this.runtime = runtime;
-    }
-
-    protected ID(final ID obj, final JObjCRuntime runtime) {
-        this(obj.ptr, runtime);
-    }
-
-    @Override protected NativeObjectLifecycleManager getNativeObjectLifecycleManager() {
-        return NativeObjectLifecycleManager.CFRetainRelease.INST;
-    }
-
-    protected final JObjCRuntime getRuntime() { return runtime; }
-
-    @Override public String toString(){
-        String s = super.toString();
-        return s + " (ObjC: " + ptr + " / " + Long.toHexString(ptr) + ")";
-    }
-
-    //
-
-    public static <T extends ID> T getInstance(final long ptr, final JObjCRuntime runtime){
-        return (T) getObjCObjectFor(runtime, ptr);
-    }
-
-    static <T extends ID> T getObjCObjectFor(final JObjCRuntime runtime, final long objPtr){
-        if (objPtr == 0) return null;
-
-        final WeakReference cachedObj = objectCache.get().get(objPtr);
-        if(cachedObj != null && cachedObj.get() != null) return (T) cachedObj.get();
-
-        final long clsPtr = NSClass.getClass(objPtr);
-
-        final T newObj = (T) (runtime.subclassing.isUserClass(clsPtr) ?
-                Subclassing.getJObjectFromIVar(objPtr)
-                : createNewObjCObjectFor(runtime, objPtr, clsPtr));
-
-        objectCache.get().put(objPtr, new WeakReference(newObj));
-        return newObj;
-    }
-
-    static <T extends ID> T createNewObjCObjectFor(final JObjCRuntime runtime, final long objPtr, final long clsPtr) {
-        final Constructor<T> ctor = getConstructorForClassPtr(runtime, clsPtr);
-        return (T) createNewObjCObjectForConstructor(ctor, objPtr, runtime);
-    }
-
-    @SuppressWarnings("unchecked")
-    static <T extends ID> Constructor<T> getConstructorForClassPtr(final JObjCRuntime runtime, final long clazzPtr){
-        final Constructor<T> cachedCtor = (Constructor<T>) constructorCache.get().get(clazzPtr);
-        if(cachedCtor != null) return cachedCtor;
-
-        final Class<T> clazz = getClassForClassPtr(runtime, clazzPtr);
-        Constructor<T> ctor;
-        try {
-            ctor = clazz.getDeclaredConstructor(CTOR_ARGS);
-        } catch (SecurityException e) {
-            throw new RuntimeException(e);
-        } catch (NoSuchMethodException e) {
-            throw new RuntimeException(e);
-        }
-        ctor.setAccessible(true);
-        constructorCache.get().put(clazzPtr, (Constructor<ID>) ctor);
-        return ctor;
-    }
-
-    @SuppressWarnings("unchecked")
-    static <T extends ID> Class<T> getClassForClassPtr(final JObjCRuntime runtime, final long clazzPtr){
-        final String className = NSClass.getClassNameOfClass(clazzPtr);
-        final Class<T> clazz = (Class<T>) runtime.getClassForNativeClassName(className);
-        if(clazz == null){
-            final long superClazzPtr = NSClass.getSuperClassOfClass(clazzPtr);
-            if(superClazzPtr != 0)
-                return getClassForClassPtr(runtime, superClazzPtr);
-        }
-        return clazz;
-    }
-
-    static <T extends ID> T createNewObjCObjectForConstructor(final Constructor ctor, final long objPtr, final JObjCRuntime runtime) {
-        try {
-            final T newInstance = (T) ctor.newInstance(new Object[] { Long.valueOf(objPtr), runtime });
-            objectCache.get().put(objPtr, new WeakReference(newInstance));
-            return newInstance;
-        } catch (final Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    static <T extends ID> T createNewObjCObjectForClass(final Class<T> clazz, final long objPtr, final JObjCRuntime runtime) {
-        try {
-            final Constructor<T> constructor = clazz.getDeclaredConstructor(CTOR_ARGS);
-            constructor.setAccessible(true);
-            return (T) createNewObjCObjectForConstructor(constructor, objPtr, runtime);
-        } catch (final Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    //
-
-    static final ThreadLocal<LinkedHashMap<Long, Constructor>> constructorCache = new ThreadLocal<LinkedHashMap<Long, Constructor>>(){
-        @Override protected LinkedHashMap<Long, Constructor> initialValue(){
-            final int MAX_ENTRIES = 1000;
-            final float LOAD_FACTOR = 0.75f;
-            return new LinkedHashMap<Long, Constructor>((int) (MAX_ENTRIES/LOAD_FACTOR), LOAD_FACTOR, true) {
-                @Override protected boolean removeEldestEntry(Map.Entry<Long, Constructor> eldest) {
-                    return size() > MAX_ENTRIES;
-                }
-            };
-        }
-    };
-
-    static final ThreadLocal<LinkedHashMap<Long, WeakReference>> objectCache = new ThreadLocal<LinkedHashMap<Long, WeakReference>>(){
-        @Override protected LinkedHashMap<Long, WeakReference> initialValue(){
-            final int MAX_ENTRIES = 1000;
-            final float LOAD_FACTOR = 0.75f;
-            return new LinkedHashMap<Long, WeakReference>((int) (MAX_ENTRIES/LOAD_FACTOR), LOAD_FACTOR, true) {
-                @Override protected boolean removeEldestEntry(Map.Entry<Long, WeakReference> eldest) {
-                    return size() > MAX_ENTRIES || eldest.getValue().get() == null;
-                }
-            };
-        }
-    };
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Invoke.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.IDCoder;
-import com.apple.jobjc.Coder.NSClassCoder;
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-import com.apple.jobjc.Coder.SELCoder;
-import com.apple.jobjc.Coder.StructCoder;
-
-
-public abstract class Invoke {
-    public abstract void invoke(NativeArgumentBuffer argBuf);
-    public abstract void invoke(NativeArgumentBuffer buffer, Struct retvalStruct);
-
-    //
-
-    public static final class FunCall extends Invoke{
-        static native void invoke(long cifPtr, long fxnPtr, long retValPtr, long argsPtr);
-
-        final long fxnPtr;
-        final CIF cif;
-
-        FunCall(long fxnPtr, CIF cif) {
-            this.fxnPtr = fxnPtr;
-            this.cif = cif;
-        }
-
-        public FunCall(final JObjCRuntime runtime, final String name, final Coder returnCoder, final Coder ... argCoders) {
-            this(Function.getFxnPtr(name), CIF.createCIFFor(runtime.getThreadLocalState(), returnCoder, argCoders));
-        }
-
-        public FunCall(final MacOSXFramework framework, final String name, final Coder returnCoder, final Coder ... argCoders) {
-            this(Function.getFxnPtr(name, framework), CIF.createCIFFor(framework.getRuntime().getThreadLocalState(), returnCoder, argCoders));
-        }
-
-        public void init(final NativeArgumentBuffer argBuf) {
-            argBuf.reset();
-        }
-
-        @Override public void invoke(final NativeArgumentBuffer argBuf) {
-            invoke(argBuf, argBuf.retValPtr);
-        }
-
-        @Override public void invoke(final NativeArgumentBuffer buffer, final Struct retvalStruct) {
-            invoke(buffer, retvalStruct.raw.bufferPtr);
-        }
-
-        void invoke(final NativeArgumentBuffer argBuf, final long retValPtr) {
-            invoke(cif.cif.bufferPtr, fxnPtr, retValPtr, argBuf.buffer.bufferPtr);
-        }
-    }
-
-    public static final class MsgSend extends Invoke{
-        static{ System.load("/usr/lib/libobjc.dylib"); }
-
-        private static final long OBJC_MSG_SEND_FXN_PTR = new Function("objc_msgSend").fxnPtr;
-        private static final long OBJC_MSG_SEND_FPRET_FXN_PTR = new Function("objc_msgSend_fpret").fxnPtr;
-        private static final long OBJC_MSG_SEND_STRET_FXN_PTR = new Function("objc_msgSend_stret").fxnPtr;
-
-        final FunCall funCall;
-        final long selPtr;
-
-        public MsgSend(final JObjCRuntime runtime, final String name, final Coder returnCoder, final Coder ... argCoders) {
-            this.funCall = new FunCall(getMsgSendFxnPtr(returnCoder),
-                    CIF.createCIFFor(runtime.getThreadLocalState(), returnCoder, getSelCoders(argCoders)));
-            this.selPtr = SEL.getSelectorPtr(name);
-        }
-
-        public void init(final NativeArgumentBuffer nativeBuffer, final ID obj) {
-            funCall.init(nativeBuffer);
-            IDCoder.INST.push(nativeBuffer, obj);
-            PrimitivePointerCoder.INST.push(nativeBuffer.runtime, nativeBuffer, selPtr);
-        }
-
-        @Override public void invoke(final NativeArgumentBuffer argBuf) {
-            funCall.invoke(argBuf);
-        }
-
-        @Override public void invoke(final NativeArgumentBuffer buffer, final Struct retvalStruct) {
-            funCall.invoke(buffer, retvalStruct);
-        }
-
-        // support
-
-        static Coder[] getSelCoders(final Coder[] argCoders) {
-            final Coder[] selArgCoders = new Coder[argCoders.length + 2];
-            selArgCoders[0] = IDCoder.INST;
-            selArgCoders[1] = SELCoder.INST;
-            for (int i = 0; i < argCoders.length; i++)
-                selArgCoders[i + 2] = argCoders[i];
-            return selArgCoders;
-        }
-
-        static long getMsgSendFxnPtr(final Coder returnCoder) {
-            if(returnCoder instanceof StructCoder){
-                StructCoder scoder = (StructCoder) returnCoder;
-
-                switch(JObjCRuntime.ARCH){
-                case ppc:
-                    return OBJC_MSG_SEND_STRET_FXN_PTR;
-                case i386:
-                    switch(scoder.sizeof){
-                    case 1: case 2: case 4: case 8:
-                        return OBJC_MSG_SEND_FXN_PTR;
-                    }
-                    return OBJC_MSG_SEND_STRET_FXN_PTR;
-                case x86_64:
-                    if(scoder.sizeof > 16)
-                        return OBJC_MSG_SEND_STRET_FXN_PTR;
-                    else
-                        return OBJC_MSG_SEND_FXN_PTR;
-                default:
-                    throw new RuntimeException();
-                }
-            }
-
-            final int typeCode = returnCoder.getTypeCode();
-
-            switch(JObjCRuntime.ARCH){
-            case ppc:
-                return OBJC_MSG_SEND_FXN_PTR;
-            case i386:
-                switch(typeCode) {
-                case Coder.FFI_FLOAT: case Coder.FFI_DOUBLE: case Coder.FFI_LONGDOUBLE:
-                    return OBJC_MSG_SEND_FPRET_FXN_PTR;
-                }
-                return OBJC_MSG_SEND_FXN_PTR;
-            case x86_64:
-                if(typeCode == Coder.FFI_LONGDOUBLE)
-                    return OBJC_MSG_SEND_FPRET_FXN_PTR;
-                return OBJC_MSG_SEND_FXN_PTR;
-            default:
-                throw new RuntimeException();
-            }
-        }
-    }
-
-    public static final class MsgSendSuper extends Invoke{
-        static{ System.load("/usr/lib/libobjc.dylib"); }
-
-        private static final long OBJC_MSG_SEND_SUPER_FXN_PTR = new Function("objc_msgSendSuper").fxnPtr;
-        private static final long OBJC_MSG_SEND_SUPER_STRET_FXN_PTR = new Function("objc_msgSendSuper_stret").fxnPtr;
-
-        final FunCall funCall;
-        final long selPtr;
-
-        public MsgSendSuper(final JObjCRuntime runtime, final String name, final Coder returnCoder, final Coder ... argCoders) {
-            this.funCall = new FunCall(getMsgSendSuperFxnPtr(returnCoder),
-                    CIF.createCIFFor(runtime.getThreadLocalState(), returnCoder, getSuperSelCoders(argCoders)));
-            this.selPtr = SEL.getSelectorPtr(name);
-        }
-
-        public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
-            funCall.init(argBuf);
-
-            // Instead of mallocing a struct, or keeping another thread local,
-            // let's write objc_super out to the argbuf, and then point an argument
-            // to the data.
-
-            final long valPtr = argBuf.argValuesPtr;
-            final int ptrLen = JObjCRuntime.PTR_LEN;
-
-            IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
-            NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
-            argBuf.argValuesPtr += ptrLen + ptrLen;
-
-            PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
-            PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
-        }
-
-        @Override public void invoke(final NativeArgumentBuffer argBuf) {
-            funCall.invoke(argBuf);
-        }
-
-        @Override public void invoke(final NativeArgumentBuffer buffer, final Struct retvalStruct) {
-            funCall.invoke(buffer, retvalStruct);
-        }
-
-        //
-
-        private final static StructCoder objc_super_coder = new StructCoder(JObjCRuntime.PTR_LEN*2, IDCoder.INST, NSClassCoder.INST){
-            @Override protected Struct newInstance(JObjCRuntime runtime) { return null; }};
-
-        static Coder[] getSuperSelCoders(final Coder[] argCoders) {
-            final Coder[] selArgCoders = new Coder[argCoders.length + 2];
-            selArgCoders[0] = objc_super_coder;
-            selArgCoders[1] = SELCoder.INST;
-            for (int i = 0; i < argCoders.length; i++)
-                selArgCoders[i + 2] = argCoders[i];
-            return selArgCoders;
-        }
-
-        static long getMsgSendSuperFxnPtr(final Coder returnCoder){
-            long normal = MsgSend.getMsgSendFxnPtr(returnCoder);
-            if(normal == MsgSend.OBJC_MSG_SEND_STRET_FXN_PTR)
-                return OBJC_MSG_SEND_SUPER_STRET_FXN_PTR;
-            else
-                return OBJC_MSG_SEND_SUPER_FXN_PTR;
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/JObjCRuntime.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.lang.reflect.Field;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.List;
-
-import sun.misc.Unsafe;
-
-
-public final class JObjCRuntime {
-    static { System.loadLibrary("JObjC"); }
-
-    public static enum Arch{ ppc, i386, x86_64 };
-    public static enum Width{ W32, W64 };
-
-    public static final Arch ARCH = getArch();
-    public static final Width WIDTH = getWidth();
-
-    private static Arch getArch(){
-        String arch = System.getProperty("os.arch");
-        if("ppc".equals(arch)) return Arch.ppc;
-        if("i386".equals(arch)) return Arch.i386;
-        if("x86_64".equals(arch)) return Arch.x86_64;
-        if("amd64".equals(arch)) return Arch.x86_64;
-        if("universal".equals(arch)) return Arch.x86_64;
-        throw new RuntimeException("Did not recognize os.arch system property: '" + arch + "'");
-    }
-
-    private static Width getWidth(){
-        String width = System.getProperty("sun.arch.data.model");
-        if("32".equals(width)) return Width.W32;
-        if("64".equals(width)) return Width.W64;
-        throw new RuntimeException("Did not recognize sun.arch.data.model system property: '" + width + "'");
-    }
-
-    public static final boolean IS32 = System.getProperty("sun.arch.data.model").equals("32");
-    public static final boolean IS64 = System.getProperty("sun.arch.data.model").equals("64");
-    public static final int PTR_LEN = IS64 ? 8 : 4;
-    public static final boolean IS_BIG_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
-    static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("JObjC.debug"));
-
-    static void checkPermission(){
-        final SecurityManager security = System.getSecurityManager();
-        if (security != null) security.checkPermission(new RuntimePermission("canProcessApplicationEvents"));
-    }
-
-    public final void assertOK(){
-        if(this != instance)
-            throw new SecurityException("runtime");
-    }
-
-    private JObjCRuntime(){}
-
-    private static JObjCRuntime instance;
-    static JObjCRuntime inst() {
-        if (instance == null) instance = new JObjCRuntime();
-        return instance;
-    }
-
-    public static JObjCRuntime getInstance() {
-        checkPermission();
-        return inst();
-    }
-
-    public final NativeArgumentBuffer getThreadLocalState() {
-        return NativeArgumentBuffer.getThreadLocalBuffer(this);
-    }
-
-    final Unsafe unsafe = getUnsafe();
-    final Subclassing subclassing = new Subclassing(this);
-    final List<String> registeredPackages = new ArrayList<String>();
-
-    @SuppressWarnings("unchecked")
-    Class<? extends ID> getClassForNativeClassName(final String className) {
-        for (final String pkg : registeredPackages) {
-            try {
-                final Class<?> clazz = Class.forName(pkg + "." + className);
-                if (clazz != null) return (Class<? extends ID>)clazz;
-            } catch (final ClassNotFoundException e) { }
-        }
-
-        return null;
-    }
-
-    private final static Unsafe getUnsafe() {
-        Unsafe inst = null;
-        try {
-            Field f = Unsafe.class.getDeclaredField("theUnsafe");
-            f.setAccessible(true);
-            inst = (Unsafe) f.get(null);
-            if(inst == null) throw new NullPointerException("Unsafe.theUnsafe == null");
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to get instance of Unsafe.", e);
-        }
-        return inst;
-    }
-
-    public void registerPackage(final String pkg) {
-        registeredPackages.add(pkg);
-    }
-
-    /**
-     * Register a subclass of NSObject to allow the native side to send
-     * messages which in turn call java methods declared on the class.
-     * If a native class by the same name already exists, registerClass
-     * will simply return without doing anything.
-     *
-     * For a usage example, see the SubclassingTest.
-     */
-    public boolean registerUserClass(Class<? extends ID> clazz, Class<? extends NSClass> clazzClazz) {
-        return subclassing.registerUserClass(clazz, clazzClazz);
-    }
-
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/MacOSXFramework.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-
-public class MacOSXFramework {
-    private static native long retainFramework(final String frameworkName);
-    private static native void releaseFramework(final long frameworkPtr);
-    private static native void getConstant(final long frameworkPtr, String symbol, final long bufferPtr, final int size);
-
-    private final JObjCRuntime runtime;
-    protected final long[] nativeLibPtrs;
-
-    final long getFrameworkPtr() { return nativeLibPtrs.length > 0 ? nativeLibPtrs[0] : 0; }
-
-    private static long[] createFrameworkPtrsFromPaths(final String[] frameworkLibPaths) {
-        final long[] libPtrs = new long[frameworkLibPaths.length];
-        for(int i = 0; i < libPtrs.length; i++){
-            libPtrs[i] = retainFramework(frameworkLibPaths[i]);
-            if(libPtrs[i] == 0) throw new RuntimeException("Could not open library at " + frameworkLibPaths[i]);
-        }
-        return libPtrs;
-    }
-
-    protected MacOSXFramework(final JObjCRuntime runtime, final String[] nativeLibPaths) {
-        runtime.assertOK();
-        this.runtime = runtime;
-        this.nativeLibPtrs = createFrameworkPtrsFromPaths(nativeLibPaths);
-    }
-
-    @Override protected final synchronized void finalize() throws Throwable {
-        for(long lib : nativeLibPtrs)
-            if(lib != 0) releaseFramework(lib);
-    }
-
-    protected final JObjCRuntime getRuntime(){ return runtime; }
-
-    protected void getConstant(final String symbol, final long retValPtr, final int size){
-        assert size >= 0;
-        assert retValPtr != 0;
-        getConstant(getFrameworkPtr(), symbol, retValPtr, size);
-    }
-
-    protected void getConstant(final String symbol, final NativeArgumentBuffer out, final int size){
-        getConstant(symbol, out.retValPtr, size);
-    }
-
-    protected void getConstant(final String symbol, final Struct out, final int size){
-        getConstant(symbol, out.raw.bufferPtr, size);
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NSClass.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Constructor;
-
-
-public class NSClass<T extends ID> extends ID {
-    public static class NSClassNotFoundException extends RuntimeException{
-        public NSClassNotFoundException(String m){ super(m); }
-        public NSClassNotFoundException(String m, Throwable cause){ super(m, cause); }
-    }
-
-    static native long getNativeClassByName(String name);
-    static native long getSuperClassOfClass(long classPtr);
-    static native String getClassNameOfClass(long classPtr);
-    static native long getClass(long objPtr);
-
-    public NSClass(final long ptr, final JObjCRuntime runtime) {
-        super(ptr, runtime);
-    }
-
-    public NSClass(final String name, final JObjCRuntime runtime) {
-        this(getNativeClassByName(name), runtime);
-        if(ptr == 0) throw new NSClassNotFoundException("NSClass pointer is 0. Found no class named " + name);
-    }
-
-    protected NSClass(final JObjCRuntime runtime){
-        super(0, runtime);
-        final String sn = getClass().getSimpleName();
-        final String name = sn.substring(0, sn.lastIndexOf("Class"));
-        ptr = getNativeClassByName(name);
-        if(ptr == 0) throw new NSClassNotFoundException("NSClass pointer is 0. Found no class named " + name);
-    }
-
-    NSClass<? super T> getSuperClass() {
-        return new NSClass<T>(getSuperClassOfClass(ptr), runtime);
-    }
-
-    String getClassName() { return getClassNameOfClass(ptr); }
-
-    @Override protected NativeObjectLifecycleManager getNativeObjectLifecycleManager() {
-        return NativeObjectLifecycleManager.Nothing.INST;
-    }
-
-    @Override public boolean equals(Object o){
-        return (o instanceof NSClass) && (this.ptr == ((NSClass) o).ptr);
-    }
-
-    //
-
-    static <T extends NSClass> T getObjCClassFor(final JObjCRuntime runtime, final long clsPtr){
-        if (clsPtr == 0) return null;
-
-        final WeakReference cachedObj = objectCache.get().get(clsPtr);
-        if(cachedObj != null && cachedObj.get() != null) return (T) cachedObj.get();
-
-        final T newObj = (T) createNewObjCClassFor(runtime, clsPtr);
-        objectCache.get().put(clsPtr, new WeakReference(newObj));
-        return newObj;
-    }
-
-    static <T extends NSClass> T createNewObjCClassFor(final JObjCRuntime runtime, final long clsPtr) {
-        final Constructor<T> ctor = getNSClassConstructorForClassPtr(runtime, clsPtr);
-        return (T) createNewObjCObjectForConstructor(ctor, clsPtr, runtime);
-    }
-
-    @SuppressWarnings("unchecked")
-    static <T extends NSClass> Constructor<T> getNSClassConstructorForClassPtr(final JObjCRuntime runtime, final long clazzPtr){
-        final Class<T> clazz = getNSClassForClassPtr(runtime, clazzPtr);
-        Constructor<T> ctor;
-        try {
-            ctor = clazz.getDeclaredConstructor(CTOR_ARGS);
-        } catch (SecurityException e) {
-            throw new RuntimeException(e);
-        } catch (NoSuchMethodException e) {
-            throw new RuntimeException(e);
-        }
-        ctor.setAccessible(true);
-        return ctor;
-    }
-
-    @SuppressWarnings("unchecked")
-    static <T extends ID> Class<T> getNSClassForClassPtr(final JObjCRuntime runtime, final long clazzPtr){
-        final String className = NSClass.getClassNameOfClass(clazzPtr);
-        final Class<T> clazz = (Class<T>) runtime.getClassForNativeClassName(className + "Class");
-        if(clazz == null){
-            final long superClazzPtr = NSClass.getSuperClassOfClass(clazzPtr);
-            if(superClazzPtr != 0)
-                return getNSClassForClassPtr(runtime, superClazzPtr);
-        }
-        return clazz;
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeArgumentBuffer.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.nio.ByteOrder;
-
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-
-
-public final class NativeArgumentBuffer{
-    private static final ThreadLocal<NativeArgumentBuffer> threadLocal = new ThreadLocal<NativeArgumentBuffer>();
-
-    static NativeArgumentBuffer getThreadLocalBuffer(final JObjCRuntime runtime) {
-        runtime.assertOK();
-        final NativeArgumentBuffer alreadyCreated = threadLocal.get();
-        if (alreadyCreated != null) return alreadyCreated;
-
-        final NativeArgumentBuffer newThreadLocalState = new NativeArgumentBuffer(runtime);
-        threadLocal.set(newThreadLocalState);
-        return newThreadLocalState;
-    }
-
-    final JObjCRuntime runtime;
-
-    final NativeBuffer buffer;
-
-    long argPtrsPtr;
-    long argValuesPtr;
-    final long retValPtr;
-
-    private static final int MAX_ARGS = 512;
-    private static final int BUF_SIZE = MAX_ARGS * 8 * 2;
-    private static final int ARG_VALS_OFFSET = BUF_SIZE/2;
-
-    private NativeArgumentBuffer(final JObjCRuntime runtime) {
-        runtime.assertOK();
-        this.runtime = runtime;
-        this.buffer = new NativeBuffer(BUF_SIZE);
-        this.buffer.buffer.order(ByteOrder.nativeOrder());
-
-        reset();
-        this.retValPtr = buffer.bufferPtr;
-    }
-
-
-    // Call before each new call
-    public void reset() {
-        argPtrsPtr = buffer.bufferPtr;
-        argValuesPtr = buffer.bufferPtr + ARG_VALS_OFFSET;
-        assert buffer.ptrInBounds(argValuesPtr);
-    }
-
-    // Push a pointer to a block of memory
-    public void doPutArgPtr(long ptr) {
-        assert buffer.ptrInBounds(argPtrsPtr);
-        PrimitivePointerCoder.INST.push(runtime, argPtrsPtr, ptr);
-        argPtrsPtr += JObjCRuntime.PTR_LEN;
-    }
-
-    // Call this after having written a value of size `sizeof` to `argValuesPtr`.
-    public void didPutArgValue(int sizeof) {
-        assert buffer.ptrInBounds(argValuesPtr);
-        doPutArgPtr(argValuesPtr);
-        argValuesPtr += sizeof;
-    }
-
-
-    @Override public String toString() {
-        final StringBuilder builder = new StringBuilder();
-        final long bptr = buffer.bufferPtr;
-
-        for(long i = bptr; i < bptr + ARG_VALS_OFFSET; i += JObjCRuntime.PTR_LEN){
-            if(argPtrsPtr == i)
-                builder.append("*");
-            builder.append(PrimitivePointerCoder.INST.popPtr(JObjCRuntime.inst(), i));
-            builder.append(" ");
-        }
-
-        builder.append("\n");
-
-        for(long i = bptr + ARG_VALS_OFFSET; i < bptr + BUF_SIZE; i += JObjCRuntime.PTR_LEN){
-            if(argValuesPtr == i)
-                builder.append("*");
-            builder.append(PrimitivePointerCoder.INST.popPtr(JObjCRuntime.inst(), i));
-            builder.append(" ");
-        }
-
-        return builder.toString();
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeBuffer.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-
-/**
- * A wrapper around a direct ByteBuffer and its native pointer. For documentation, @see java.nio.ByteBuffer
- */
-public class NativeBuffer {
-    static native long getPtrOfBuffer(final ByteBuffer byteBuffer);
-
-    public final ByteBuffer buffer;
-    public final long bufferPtr;
-
-    public NativeBuffer(final int capacity){
-        this(ByteBuffer.allocateDirect(capacity));
-    }
-
-    /**
-     * Wrap a ByteBuffer and set the ByteOrder to nativeOrder.
-     */
-    public NativeBuffer(ByteBuffer buffer){
-        this.buffer = buffer;
-        this.bufferPtr = getPtrOfBuffer(buffer);
-        assert buffer != null;
-        assert bufferPtr != 0;
-        this.buffer.order(ByteOrder.nativeOrder());
-    }
-
-    public byte   get() { return buffer.get(); }
-    public char   getChar() { return buffer.getChar(); }
-    public double getDouble() { return buffer.getDouble(); }
-    public float  getFloat() { return buffer.getFloat(); }
-    public int    getInt() { return buffer.getInt(); }
-    public long   getLong() { return buffer.getLong(); }
-    public short  getShort() { return buffer.getShort(); }
-    public NativeBuffer put(byte b) { buffer.put(b); return this; }
-    public NativeBuffer put(NativeBuffer src) { buffer.put(src.buffer); return this; }
-    public NativeBuffer putChar(char c) { buffer.putChar(c); return this; }
-    public NativeBuffer putDouble(double d) { buffer.putDouble(d); return this; }
-    public NativeBuffer putFloat(float f) { buffer.putFloat(f); return this; }
-    public NativeBuffer putInt(int i) { buffer.putInt(i); return this; }
-    public NativeBuffer putLong(long l) { buffer.putLong(l); return this; }
-    public NativeBuffer putShort(short s) { buffer.putShort(s); return this; }
-
-    public int capacity() { return buffer.capacity(); }
-    public int position() { return buffer.position(); }
-    public NativeBuffer position(int newPosition) { buffer.position(newPosition); return this; }
-    public NativeBuffer rewind(){ buffer.rewind(); return this; }
-
-    public int limit() { return buffer.limit(); }
-    public NativeBuffer limit(final int sizeof) { buffer.limit(sizeof); return this; }
-
-    public int remaining() { return buffer.remaining(); }
-
-    public NativeBuffer slice(){ return new NativeBuffer(buffer.slice()); }
-
-    @Override public String toString() {
-        final StringBuilder builder = new StringBuilder();
-
-        for(int i = 0; i < limit(); i += JObjCRuntime.PTR_LEN){
-            if(position() == i)
-                builder.append("*");
-            if(JObjCRuntime.IS32)
-                builder.append(buffer.getInt(i));
-            else
-                builder.append(buffer.getLong(i));
-            builder.append(" ");
-        }
-
-        return builder.toString();
-    }
-
-    public long positionPtr() {
-        return bufferPtr + position();
-    }
-
-    /**
-     * bufferPtr <= ptr && ptr < bufferPtr + capacity();
-     */
-    public boolean ptrInBounds(final long ptr){
-        return bufferPtr <= ptr && ptr < bufferPtr + capacity();
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeObjectLifecycleManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public abstract class NativeObjectLifecycleManager {
-    private static native void retainNativeObject(final long ptr);
-    private static native void releaseNativeObject(final long ptr);
-    private static native void freeNativeObject(final long ptr);
-
-    abstract void begin(final long ptr);
-    abstract void end(final long ptr);
-    boolean shouldPreRetain() { return false; }
-
-    public static class CFRetainRelease extends NativeObjectLifecycleManager {
-        public static final NativeObjectLifecycleManager INST = new CFRetainRelease();
-        @Override void begin(final long ptr) { retainNativeObject(ptr); }
-        @Override void end(final long ptr) { releaseNativeObject(ptr); }
-        @Override boolean shouldPreRetain() { return true; }
-    }
-
-    public static class Free extends NativeObjectLifecycleManager {
-        public static final NativeObjectLifecycleManager INST = new Free();
-        @Override void begin(final long ptr) { }
-        @Override void end(final long ptr) { freeNativeObject(ptr); }
-    }
-
-    public static class Nothing extends NativeObjectLifecycleManager {
-        public static final NativeObjectLifecycleManager INST = new Nothing();
-        @Override void begin(final long ptr) { }
-        @Override void end(final long ptr) { }
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Opaque.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public class Opaque extends Pointer<Void> {
-    protected Opaque(long ptr) { super(ptr); }
-    protected Opaque(Pointer<?> ptr) { super(ptr.ptr); }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Pointer.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public class Pointer <T> implements Comparable<Pointer<T>>{
-    long ptr;
-
-    protected Pointer(final long ptr) {
-        this.ptr = ptr;
-        getNativeObjectLifecycleManager().begin(ptr);
-    }
-
-    @Override protected final synchronized void finalize() throws Throwable {
-        long pptr = ptr;
-        ptr = 0;
-        if (pptr != 0) getNativeObjectLifecycleManager().end(pptr);
-    }
-
-    protected NativeObjectLifecycleManager getNativeObjectLifecycleManager() {
-        return NativeObjectLifecycleManager.Nothing.INST;
-    }
-
-    @Override public boolean equals(Object o) {
-        return o instanceof Pointer && ptr == ((Pointer) o).ptr;
-    }
-
-    @Override public int hashCode() { return (int)(ptr^(ptr>>>32)); }
-
-    public int compareTo(Pointer<T> o) {
-        if(this==o || ptr==o.ptr) return 0;
-        if(ptr < o.ptr) return -1;
-        return 1;
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/PrimitiveCoder.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,700 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-import com.apple.jobjc.JObjCRuntime.Width;
-// Auto generated by PrimitiveCoder.hs
-// Do not edit by hand.
-public abstract class PrimitiveCoder<T> extends Coder<T>{
-    public PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){
-        super(ffiTypeCode, objCEncoding, jclass, jprim);
-    }
-    public final boolean popBoolean(NativeArgumentBuffer args){
-        return popBoolean(args.runtime, args.retValPtr);
-    }
-    public abstract boolean popBoolean(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, boolean x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, boolean x);
-
-
-    public final byte popByte(NativeArgumentBuffer args){
-        return popByte(args.runtime, args.retValPtr);
-    }
-    public abstract byte popByte(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, byte x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, byte x);
-
-
-    public final char popChar(NativeArgumentBuffer args){
-        return popChar(args.runtime, args.retValPtr);
-    }
-    public abstract char popChar(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, char x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, char x);
-
-
-    public final short popShort(NativeArgumentBuffer args){
-        return popShort(args.runtime, args.retValPtr);
-    }
-    public abstract short popShort(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, short x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, short x);
-
-
-    public final int popInt(NativeArgumentBuffer args){
-        return popInt(args.runtime, args.retValPtr);
-    }
-    public abstract int popInt(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, int x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, int x);
-
-
-    public final long popLong(NativeArgumentBuffer args){
-        return popLong(args.runtime, args.retValPtr);
-    }
-    public abstract long popLong(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, long x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, long x);
-
-
-    public final float popFloat(NativeArgumentBuffer args){
-        return popFloat(args.runtime, args.retValPtr);
-    }
-    public abstract float popFloat(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, float x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, float x);
-
-
-    public final double popDouble(NativeArgumentBuffer args){
-        return popDouble(args.runtime, args.retValPtr);
-    }
-    public abstract double popDouble(JObjCRuntime runtime, long addr);
-
-    public final void push(NativeArgumentBuffer args, double x){
-        push(args.runtime, args.argValuesPtr, x);
-        args.didPutArgValue(sizeof());
-    }
-    public abstract void push(JObjCRuntime runtime, long addr, double x);
-
-
-// native BOOL -> java boolean
-public static final class BoolCoder extends PrimitiveCoder<Boolean>{
-    public static final BoolCoder INST = new BoolCoder();
-    public BoolCoder(){ super(FFI_SINT8, "B", Boolean.class, boolean.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){
-        rt.unsafe.putByte(addr, (byte) (x ? 1 : 0));
-    }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){
-        return rt.unsafe.getByte(addr) != 0;
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 1;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Boolean x){ push(rt, addr, (boolean) x); }
-    @Override public Boolean pop(JObjCRuntime rt, long addr){ return popBoolean(rt, addr); }
-    // proxies for mixed encoding
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, (x != 0)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)(popBoolean(rt, addr) ? 1 : 0)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, (x != 0)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)(popBoolean(rt, addr) ? 1 : 0)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, (x != 0)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)(popBoolean(rt, addr) ? 1 : 0)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, (x != 0)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)(popBoolean(rt, addr) ? 1 : 0)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, (x != 0)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)(popBoolean(rt, addr) ? 1 : 0)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, (x != 0)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)(popBoolean(rt, addr) ? 1 : 0)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, (x != 0)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)(popBoolean(rt, addr) ? 1 : 0)); }
-
-
-}
-
-// native schar -> java byte
-public static final class SCharCoder extends PrimitiveCoder<Byte>{
-    public static final SCharCoder INST = new SCharCoder();
-    public SCharCoder(){ super(FFI_SINT8, "c", Byte.class, byte.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, byte x){
-        rt.unsafe.putByte(addr, x);
-    }
-    @Override public byte popByte(JObjCRuntime rt, long addr){
-        return rt.unsafe.getByte(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 1;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Byte x){ push(rt, addr, (byte) x); }
-    @Override public Byte pop(JObjCRuntime rt, long addr){ return popByte(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((byte)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popByte(rt, addr) != 0); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((byte)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((byte)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((byte)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((byte)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((byte)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((byte)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popByte(rt, addr)); }
-
-
-}
-
-// native uchar -> java byte
-public static final class UCharCoder extends PrimitiveCoder<Byte>{
-    public static final UCharCoder INST = new UCharCoder();
-    public UCharCoder(){ super(FFI_UINT8, "C", Byte.class, byte.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, byte x){
-        rt.unsafe.putByte(addr, x);
-    }
-    @Override public byte popByte(JObjCRuntime rt, long addr){
-        return rt.unsafe.getByte(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 1;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Byte x){ push(rt, addr, (byte) x); }
-    @Override public Byte pop(JObjCRuntime rt, long addr){ return popByte(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((byte)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popByte(rt, addr) != 0); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((byte)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((byte)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((byte)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((byte)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((byte)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popByte(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((byte)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popByte(rt, addr)); }
-
-
-}
-
-// native sshort -> java short
-public static final class SShortCoder extends PrimitiveCoder<Short>{
-    public static final SShortCoder INST = new SShortCoder();
-    public SShortCoder(){ super(FFI_SINT16, "s", Short.class, short.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, short x){
-        rt.unsafe.putShort(addr, (short) x);
-    }
-    @Override public short popShort(JObjCRuntime rt, long addr){
-        return rt.unsafe.getShort(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 2;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Short x){ push(rt, addr, (short) x); }
-    @Override public Short pop(JObjCRuntime rt, long addr){ return popShort(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((short)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popShort(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((short)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((short)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popShort(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((short)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((short)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((short)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((short)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popShort(rt, addr)); }
-
-
-}
-
-// native ushort -> java short
-public static final class UShortCoder extends PrimitiveCoder<Short>{
-    public static final UShortCoder INST = new UShortCoder();
-    public UShortCoder(){ super(FFI_UINT16, "S", Short.class, short.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, short x){
-        rt.unsafe.putShort(addr, (short) x);
-    }
-    @Override public short popShort(JObjCRuntime rt, long addr){
-        return rt.unsafe.getShort(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 2;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Short x){ push(rt, addr, (short) x); }
-    @Override public Short pop(JObjCRuntime rt, long addr){ return popShort(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((short)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popShort(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((short)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((short)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popShort(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((short)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((short)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((short)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popShort(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((short)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popShort(rt, addr)); }
-
-
-}
-
-// native sint -> java int
-public static final class SIntCoder extends PrimitiveCoder<Integer>{
-    public static final SIntCoder INST = new SIntCoder();
-    public SIntCoder(){ super(FFI_SINT32, "i", Integer.class, int.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, int x){
-        rt.unsafe.putInt(addr, (int) x);
-    }
-    @Override public int popInt(JObjCRuntime rt, long addr){
-        return rt.unsafe.getInt(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 4;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Integer x){ push(rt, addr, (int) x); }
-    @Override public Integer pop(JObjCRuntime rt, long addr){ return popInt(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((int)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popInt(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((int)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((int)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((int)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popInt(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((int)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((int)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((int)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popInt(rt, addr)); }
-
-
-}
-
-// native uint -> java int
-public static final class UIntCoder extends PrimitiveCoder<Integer>{
-    public static final UIntCoder INST = new UIntCoder();
-    public UIntCoder(){ super(FFI_UINT32, "I", Integer.class, int.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, int x){
-        rt.unsafe.putInt(addr, (int) x);
-    }
-    @Override public int popInt(JObjCRuntime rt, long addr){
-        return rt.unsafe.getInt(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 4;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Integer x){ push(rt, addr, (int) x); }
-    @Override public Integer pop(JObjCRuntime rt, long addr){ return popInt(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((int)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popInt(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((int)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((int)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((int)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popInt(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((int)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((int)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popInt(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((int)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popInt(rt, addr)); }
-
-
-}
-
-// native slong -> java long
-public static final class SLongCoder extends PrimitiveCoder<Long>{
-    public static final SLongCoder INST = new SLongCoder();
-    public SLongCoder(){ super((JObjCRuntime.IS64 ? (FFI_SINT64) : (FFI_SINT32)), "l", Long.class, long.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, long x){
-        if(JObjCRuntime.IS64){ rt.unsafe.putLong(addr, (long) x); }else{ rt.unsafe.putInt(addr, (int) x); }
-    }
-    @Override public long popLong(JObjCRuntime rt, long addr){
-        return (JObjCRuntime.IS64 ? (rt.unsafe.getLong(addr)) : (rt.unsafe.getInt(addr)));
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        switch(w){
-            case W32: return 4;
-            case W64: return 8;
-
-        default: return -1;
-        }
-
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Long x){ push(rt, addr, (long) x); }
-    @Override public Long pop(JObjCRuntime rt, long addr){ return popLong(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((long)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popLong(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((long)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((long)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((long)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((long)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popLong(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((long)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((long)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popLong(rt, addr)); }
-
-
-}
-
-// native ulong -> java long
-public static final class ULongCoder extends PrimitiveCoder<Long>{
-    public static final ULongCoder INST = new ULongCoder();
-    public ULongCoder(){ super((JObjCRuntime.IS64 ? (FFI_UINT64) : (FFI_UINT32)), "L", Long.class, long.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, long x){
-        if(JObjCRuntime.IS64){ rt.unsafe.putLong(addr, (long) x); }else{ rt.unsafe.putInt(addr, (int) x); }
-    }
-    @Override public long popLong(JObjCRuntime rt, long addr){
-        return (JObjCRuntime.IS64 ? (rt.unsafe.getLong(addr)) : (rt.unsafe.getInt(addr)));
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        switch(w){
-            case W32: return 4;
-            case W64: return 8;
-
-        default: return -1;
-        }
-
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Long x){ push(rt, addr, (long) x); }
-    @Override public Long pop(JObjCRuntime rt, long addr){ return popLong(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((long)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popLong(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((long)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((long)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((long)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((long)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popLong(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((long)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((long)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popLong(rt, addr)); }
-
-
-}
-
-// native slonglong -> java long
-public static final class SLongLongCoder extends PrimitiveCoder<Long>{
-    public static final SLongLongCoder INST = new SLongLongCoder();
-    public SLongLongCoder(){ super(FFI_SINT64, "q", Long.class, long.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, long x){
-        rt.unsafe.putLong(addr, (long) x);
-    }
-    @Override public long popLong(JObjCRuntime rt, long addr){
-        return rt.unsafe.getLong(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 8;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Long x){ push(rt, addr, (long) x); }
-    @Override public Long pop(JObjCRuntime rt, long addr){ return popLong(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((long)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popLong(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((long)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((long)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((long)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((long)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popLong(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((long)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((long)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popLong(rt, addr)); }
-
-
-}
-
-// native ulonglong -> java long
-public static final class ULongLongCoder extends PrimitiveCoder<Long>{
-    public static final ULongLongCoder INST = new ULongLongCoder();
-    public ULongLongCoder(){ super(FFI_UINT64, "Q", Long.class, long.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, long x){
-        rt.unsafe.putLong(addr, (long) x);
-    }
-    @Override public long popLong(JObjCRuntime rt, long addr){
-        return rt.unsafe.getLong(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 8;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Long x){ push(rt, addr, (long) x); }
-    @Override public Long pop(JObjCRuntime rt, long addr){ return popLong(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((long)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popLong(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((long)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((long)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((long)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((long)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popLong(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((long)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popLong(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((long)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popLong(rt, addr)); }
-
-
-}
-
-// native float -> java float
-public static final class FloatCoder extends PrimitiveCoder<Float>{
-    public static final FloatCoder INST = new FloatCoder();
-    public FloatCoder(){ super(FFI_FLOAT, "f", Float.class, float.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, float x){
-        rt.unsafe.putFloat(addr, (float) x);
-    }
-    @Override public float popFloat(JObjCRuntime rt, long addr){
-        return rt.unsafe.getFloat(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 4;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Float x){ push(rt, addr, (float) x); }
-    @Override public Float pop(JObjCRuntime rt, long addr){ return popFloat(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((float)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popFloat(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((float)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popFloat(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((float)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popFloat(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((float)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popFloat(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((float)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popFloat(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((float)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popFloat(rt, addr)); }
-
-
-    @Override public void push(JObjCRuntime rt, long addr, double x){ push(rt, addr, ((float)x)); }
-    @Override public double popDouble(JObjCRuntime rt, long addr){ return ((double)popFloat(rt, addr)); }
-
-
-}
-
-// native double -> java double
-public static final class DoubleCoder extends PrimitiveCoder<Double>{
-    public static final DoubleCoder INST = new DoubleCoder();
-    public DoubleCoder(){ super(FFI_DOUBLE, "d", Double.class, double.class); }
-    // compile time
-    @Override public void push(JObjCRuntime rt, long addr, double x){
-        rt.unsafe.putDouble(addr, (double) x);
-    }
-    @Override public double popDouble(JObjCRuntime rt, long addr){
-        return rt.unsafe.getDouble(addr);
-    }
-    // for runtime coding
-    @Override public int sizeof(Width w){
-        return 8;
-    }
-    @Override public void push(JObjCRuntime rt, long addr, Double x){ push(rt, addr, (double) x); }
-    @Override public Double pop(JObjCRuntime rt, long addr){ return popDouble(rt, addr); }
-    // proxies for mixed encoding
-    @Override public void push(JObjCRuntime rt, long addr, boolean x){ push(rt, addr, ((double)(x ? 1 : 0))); }
-    @Override public boolean popBoolean(JObjCRuntime rt, long addr){ return (popDouble(rt, addr) != 0); }
-
-    @Override public void push(JObjCRuntime rt, long addr, byte x){ push(rt, addr, ((double)x)); }
-    @Override public byte popByte(JObjCRuntime rt, long addr){ return ((byte)popDouble(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, char x){ push(rt, addr, ((double)x)); }
-    @Override public char popChar(JObjCRuntime rt, long addr){ return ((char)popDouble(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, short x){ push(rt, addr, ((double)x)); }
-    @Override public short popShort(JObjCRuntime rt, long addr){ return ((short)popDouble(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, int x){ push(rt, addr, ((double)x)); }
-    @Override public int popInt(JObjCRuntime rt, long addr){ return ((int)popDouble(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, long x){ push(rt, addr, ((double)x)); }
-    @Override public long popLong(JObjCRuntime rt, long addr){ return ((long)popDouble(rt, addr)); }
-
-    @Override public void push(JObjCRuntime rt, long addr, float x){ push(rt, addr, ((double)x)); }
-    @Override public float popFloat(JObjCRuntime rt, long addr){ return ((float)popDouble(rt, addr)); }
-
-
-
-}
-
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/SEL.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public class SEL {
-    static native long getSelectorPtr(String selectorName);
-    static native String getSelectorName(long ptr);
-
-    final long selPtr;
-
-    SEL(long ptr) {
-        this.selPtr = ptr;
-    }
-
-    public SEL(final String name) {
-        this(getSelectorPtr(name));
-    }
-
-    @Override public String toString(){
-        return ((int)selPtr) + " / " + selPtr + " : " + getSelectorName(selPtr);
-    }
-
-    /**
-     * Converts something like "performSelectorOnMainThread_withObject_wait"
-     * to "performSelectorOnMainThread:withObject:wait:"
-     */
-    public static String selectorName(String jMethodName, boolean hasArgs){
-        String b = jMethodName.replaceAll("_", ":");
-        return hasArgs ? b + ":" : b;
-    }
-
-    public static String jMethodName(String selectorName){
-        return selectorName.replaceAll(":", "_").replaceAll("_$", "");
-    }
-
-    public static boolean validName(String selectorName){
-        return selectorName.matches("^[a-zA-Z_][a-zA-Z0-9_:]*$");
-    }
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Struct.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-/**
- * A struct is malloced on the C heap and accessed in Java through a ByteBuffer.
- */
-public abstract class Struct{
-    protected final NativeBuffer raw;
-    private final JObjCRuntime runtime;
-    protected final JObjCRuntime getRuntime(){ return runtime; }
-
-    /**
-     * Create a brand new struct from nothing.
-     */
-    protected Struct(final JObjCRuntime runtime, final int SIZEOF){
-        this(runtime, new NativeBuffer(SIZEOF), SIZEOF);
-    }
-
-    /**
-     * Create a struct by taking ownership of an existing buffer.
-     * Used for struct fields of type struct. For example, the origin and size fields
-     * in NSRect would be initialized with this constructor.
-     */
-    protected Struct(final JObjCRuntime runtime, final NativeBuffer buffer, final int SIZEOF){
-        if(runtime == null) throw new NullPointerException("runtime");
-        this.runtime = runtime;
-        this.raw = buffer;
-        this.raw.limit(SIZEOF);
-    }
-
-    abstract public Coder getCoder();
-}
--- a/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Subclassing.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.io.StringWriter;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Set;
-
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-import com.apple.jobjc.Coder.VoidCoder;
-import com.apple.jobjc.Invoke.MsgSend;
-
-
-final class Subclassing {
-    static native long allocateClassPair(long superClass, String name);
-    static native boolean addIVarForJObj(long clazz);
-    static native boolean patchAlloc(long classPtr);
-    static native boolean addMethod(long cls, String name, Method jMethod, CIF cif, long cifPtr, String objCEncodedType);
-    static native void registerClassPair(long clazz);
-
-    static native <T extends ID> T getJObjectFromIVar(long objPtr);
-    static native void initJObjectToIVar(long objPtr, ID object);
-
-    final Set<Long> registeredUserSubclasses = new HashSet<Long>();
-    final JObjCRuntime runtime;
-
-    Subclassing(JObjCRuntime runtime){
-        this.runtime = runtime;
-    }
-
-    boolean registerUserClass(final Class<? extends ID> clazz, final Class<? extends NSClass> clazzClazz) {
-        final String nativeClassName = clazz.getSimpleName();
-        // Is it already registered?
-        if(0 != NSClass.getNativeClassByName(nativeClassName))
-            return false;
-
-        if(clazz.isAnonymousClass())
-            throw new RuntimeException("JObjC cannot register anonymous classes.");
-
-        // Verify superclass
-        long superClass = NSClass.getNativeClassByName(clazz.getSuperclass().getSimpleName());
-        if(0 == superClass)
-            throw new RuntimeException(clazz.getSuperclass() + ", the superclass of " + clazz + ", must be a registered class.");
-
-        runtime.registerPackage(clazz.getPackage().getName());
-
-        // Create class
-        long classPtr = Subclassing.allocateClassPair(superClass, nativeClassName);
-        if(classPtr == 0) throw new RuntimeException("objc_allocateClassPair returned 0.");
-
-        // Add ivar to hold jobject
-        boolean addedI = Subclassing.addIVarForJObj(classPtr);
-        if(!addedI) throw new RuntimeException("class_addIvar returned false.");
-
-        // Verify constructor
-        try {
-            clazz.getConstructor(ID.CTOR_ARGS);
-        } catch (Exception e) {
-            throw new RuntimeException("Could not access required constructor: " + ID.CTOR_ARGS, e);
-        }
-
-        // Patch alloc to create corresponding jobject on invoke
-        patchAlloc(classPtr);
-
-        // Add methods
-        Set<String> takenSelNames = new HashSet<String>();
-        for(Method method : clazz.getDeclaredMethods()){
-            // No overloading
-            String selName = SEL.selectorName(method.getName(), method.getParameterTypes().length > 0);
-            if(takenSelNames.contains(selName))
-                throw new RuntimeException("Obj-C does not allow method overloading. The Objective-C selector '"
-                        + selName + "' appears more than once in class " + clazz.getCanonicalName() + " / " + nativeClassName + ".");
-
-            method.setAccessible(true);
-
-            // Divine CIF
-            Coder returnCoder = Coder.getCoderAtRuntimeForType(method.getReturnType());
-            Class[] paramTypes = method.getParameterTypes();
-            Coder[] argCoders = new Coder[paramTypes.length];
-            for(int i = 0; i < paramTypes.length; i++)
-                argCoders[i] = Coder.getCoderAtRuntimeForType(paramTypes[i]);
-
-            CIF cif = new MsgSend(runtime, selName, returnCoder, argCoders).funCall.cif;
-
-            // .. and objc encoding
-            StringWriter encType = new StringWriter();
-            encType.append(returnCoder.getObjCEncoding());
-            encType.append("@:");
-            for(int i = 0; i < argCoders.length; i++)
-                encType.append(argCoders[i].getObjCEncoding());
-
-            // Add it!
-            boolean addedM = Subclassing.addMethod(classPtr, selName, method, cif, cif.cif.bufferPtr, encType.toString());
-            if(!addedM) throw new RuntimeException("Failed to add method.");
-            takenSelNames.add(selName);
-        }
-
-        // Seal it
-        Subclassing.registerClassPair(classPtr);
-        registeredUserSubclasses.add(classPtr);
-
-        return true;
-    }
-
-    boolean isUserClass(long clsPtr) {
-        return registeredUserSubclasses.contains(clsPtr);
-    }
-
-    // Called from JNI
-
-    private static void initJObject(final long objPtr){
-//        System.err.println("initJObject " + objPtr + " / " + Long.toHexString(objPtr));
-        ID newObj = ID.createNewObjCObjectFor(JObjCRuntime.inst(), objPtr, NSClass.getClass(objPtr));
-//        System.err.println("... " + newObj);
-        initJObjectToIVar(objPtr, newObj);
-    }
-
-    private static void invokeFromJNI(ID obj, Method method, CIF cif, long result, long args){
-        assert obj != null;
-        assert obj.getClass().equals(method.getDeclaringClass()) :
-            obj.getClass().toString() + " != " + method.getDeclaringClass().toString();
-
-        final int argCount = method.getParameterTypes().length;
-
-        // The first two args & coders are for objc id and sel. Skip them.
-        final Object[] argObjects = new Object[argCount];
-        for(int i = 0; i < argCount; i++){
-            final long argAddrAddr = args + ((i+2) * JObjCRuntime.PTR_LEN);
-            final long argAddr = PrimitivePointerCoder.INST.popPtr(obj.runtime, argAddrAddr);
-            argObjects[i] = cif.argCoders[i + 2].pop(obj.runtime, argAddr);
-        }
-
-        Object retVal;
-        try {
-            retVal = method.invoke(obj, argObjects);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-
-        if(!(cif.returnCoder instanceof VoidCoder))
-            cif.returnCoder.push(obj.runtime, result, retVal);
-    }
-}
--- a/src/macosx/native/jobjc/src/core/native/CIF.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_CIF.h"
-
-#define MACOSX
-#include <ffi/ffi.h>
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-#include "NativeBuffer.h"
-
-JNIEXPORT jint JNICALL Java_com_apple_jobjc_CIF_getSizeofCIF
-(JNIEnv *env, jclass clazz)
-{
-    return (jint) sizeof(ffi_cif);
-}
-
-JNIEXPORT jboolean JNICALL Java_com_apple_jobjc_CIF_prepCIF
-(JNIEnv *env, jclass clazz, jlong jCIFPtr, jint jNargs, jlong jRetTypePtr, jlong jArgsPtr)
-{
-    ffi_cif *cif = jlong_to_ptr(jCIFPtr);
-    unsigned int nargs = jNargs;
-    ffi_type *rtype = jlong_to_ptr(jRetTypePtr);
-    ffi_type **atypes = jlong_to_ptr(jArgsPtr);
-
-//    NSLog(@"rtype->(size: %d, alignment: %d, type: %d)", rtype->size, rtype->alignment, rtype->type);
-    return (jboolean) (FFI_OK == ffi_prep_cif(cif, FFI_DEFAULT_ABI, nargs, rtype, atypes));
-}
--- a/src/macosx/native/jobjc/src/core/native/Coder.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Coder.h"
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-#define MACOSX
-#include <ffi/ffi.h>
-#include <AppKit/AppKit.h>
-
-/*
- * Class:     com_apple_jobjc_Coder
- * Method:    getNativeFFITypeCodeForCode
- * Signature: (I)J
- */
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_Coder_getNativeFFITypePtrForCode
-(JNIEnv *env, jclass clazz, jint code)
-{
-    switch ((long)code) {
-        case com_apple_jobjc_Coder_FFI_VOID:        return ptr_to_jlong(&ffi_type_void);
-        case com_apple_jobjc_Coder_FFI_PTR:            return ptr_to_jlong(&ffi_type_pointer);
-        case com_apple_jobjc_Coder_FFI_SINT8:        return ptr_to_jlong(&ffi_type_sint8);
-        case com_apple_jobjc_Coder_FFI_UINT8:        return ptr_to_jlong(&ffi_type_uint8);
-        case com_apple_jobjc_Coder_FFI_SINT16:        return ptr_to_jlong(&ffi_type_sint16);
-        case com_apple_jobjc_Coder_FFI_UINT16:        return ptr_to_jlong(&ffi_type_uint16);
-        case com_apple_jobjc_Coder_FFI_SINT32:        return ptr_to_jlong(&ffi_type_sint32);
-        case com_apple_jobjc_Coder_FFI_UINT32:        return ptr_to_jlong(&ffi_type_uint32);
-        case com_apple_jobjc_Coder_FFI_SINT64:        return ptr_to_jlong(&ffi_type_sint64);
-        case com_apple_jobjc_Coder_FFI_UINT64:        return ptr_to_jlong(&ffi_type_uint64);
-        case com_apple_jobjc_Coder_FFI_FLOAT:        return ptr_to_jlong(&ffi_type_float);
-        case com_apple_jobjc_Coder_FFI_DOUBLE:        return ptr_to_jlong(&ffi_type_double);
-        case com_apple_jobjc_Coder_FFI_LONGDOUBLE:    return ptr_to_jlong(&ffi_type_longdouble);
-    }
-
-    return ptr_to_jlong(NULL);
-}
--- a/src/macosx/native/jobjc/src/core/native/FFIType.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-#include <ffi/ffi.h>
-
-#include "com_apple_jobjc_FFIType.h"
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_FFIType_makeFFIType
-(JNIEnv *env, jclass clazz, jlong ffi_type_jlong, jlong ffi_type_elements_jlong)
-{
-    ffi_type *type = jlong_to_ptr(ffi_type_jlong);
-    type->elements = jlong_to_ptr(ffi_type_elements_jlong);
-    type->type = FFI_TYPE_STRUCT;
-    type->size = type->alignment = 0;
-}
-
-JNIEXPORT jint JNICALL Java_com_apple_jobjc_FFIType_getFFITypeSizeof
-(JNIEnv *env, jclass clazz)
-{
-    return (jint) sizeof(ffi_type);
-}
--- a/src/macosx/native/jobjc/src/core/native/Function.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Function.h"
-
-#define MACOSX
-#include <dlfcn.h>
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_Function_getFxnPtrForFunctionName
-(JNIEnv *env, jclass clazz, jstring fxnName)
-{
-    const char *functionName = (*env)->GetStringUTFChars(env, fxnName, NULL);
-    void *fxnPtr = dlsym(RTLD_SELF, functionName);
-    (*env)->ReleaseStringUTFChars(env, fxnName, functionName);
-    return ptr_to_jlong(fxnPtr);
-}
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_Function_getFxnPtrForFunctionNameAndLib
-(JNIEnv *env, jclass clazz, jlong frameworkPtr, jstring fxnName)
-{
-    void *frameworkHandle = jlong_to_ptr(frameworkPtr);
-
-    const char *functionName = (*env)->GetStringUTFChars(env, fxnName, NULL);
-    void *fxnPtr = dlsym(frameworkHandle, functionName);
-    (*env)->ReleaseStringUTFChars(env, fxnName, functionName);
-
-    return ptr_to_jlong(fxnPtr);
-}
--- a/src/macosx/native/jobjc/src/core/native/ID.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_ID.h"
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-#include <objc/runtime.h>
-#include <objc/message.h>
-
-/*
- * Class:     com_apple_jobjc_ID
- * Method:    getNativeDescription
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_apple_jobjc_ID_getNativeDescription
-(JNIEnv *env, jclass clazz, jlong objPtr)
-{
-    jstring ret = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    NSString *desc = [((id)jlong_to_ptr(objPtr)) description];
-    ret = JNFNSToJavaString(env, desc);
-
-JNF_COCOA_EXIT(env);
-
-    return ret;
-}
--- a/src/macosx/native/jobjc/src/core/native/Invoke.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Invoke_FunCall.h"
-#include <ffi/ffi.h>
-#include <objc/message.h>
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_Invoke_00024FunCall_invoke
-(JNIEnv *env, jclass clazz, jlong cifPtr, jlong fxnPtr, jlong retValPtr, jlong argsPtr)
-{
-    ffi_cif *cif = jlong_to_ptr(cifPtr);
-    void *fxn    = jlong_to_ptr(fxnPtr);
-    void *retVal = jlong_to_ptr(retValPtr);
-    void **args  = jlong_to_ptr(argsPtr);
-
-    ffi_call(cif, fxn, retVal, args);
-}
--- a/src/macosx/native/jobjc/src/core/native/JObjCRuntime.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "Cocoa/Cocoa.h"
-
--- a/src/macosx/native/jobjc/src/core/native/MacOSXFramework.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_MacOSXFramework.h"
-
-#include <dlfcn.h>
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-/*
- * Class:     com_apple_jobjc_MacOSXFramework
- * Method:    retainFramework
- * Signature: (Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_MacOSXFramework_retainFramework
-(JNIEnv *env, jclass clazz, jstring frameworkName)
-{
-    if (frameworkName == NULL) return ptr_to_jlong(NULL);
-    const char *frameworkNameCStr = (*env)->GetStringUTFChars(env, frameworkName, JNI_FALSE);
-    const void *library = dlopen(frameworkNameCStr, RTLD_LOCAL);
-    (*env)->ReleaseStringUTFChars(env, frameworkName, frameworkNameCStr);
-    return ptr_to_jlong(library);
-}
-
-/*
- * Class:     com_apple_jobjc_MacOSXFramework
- * Method:    releaseFramework
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_apple_jobjc_MacOSXFramework_releaseFramework
-(JNIEnv *env, jclass clazz, jlong frameworkPtr)
-{
-    dlclose(jlong_to_ptr(frameworkPtr));
-}
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_MacOSXFramework_getConstant
-(JNIEnv *env, jclass clazz, jlong frameworkPtr, jstring constSymbol, jlong retBuffer, jint size)
-{
-    const char *symbol = (*env)->GetStringUTFChars(env, constSymbol, JNI_FALSE);
-    void *handle = frameworkPtr ? jlong_to_ptr(frameworkPtr) : RTLD_DEFAULT;
-    void *data = dlsym(handle, symbol);
-    (*env)->ReleaseStringUTFChars(env, constSymbol, symbol);
-
-    if(!data)
-        (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"), dlerror());
-    else
-        memcpy(jlong_to_ptr(retBuffer), data, (size_t) size);
-}
--- a/src/macosx/native/jobjc/src/core/native/NSClass.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_NSClass.h"
-#include <objc/runtime.h>
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-/*
- * Class:     com_apple_jobjc_NSClass
- * Method:    getNativeClassByName
- * Signature: (JLjava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_NSClass_getNativeClassByName
-(JNIEnv *env, jclass clazz, jstring className)
-{
-    if (className == NULL) return ptr_to_jlong(NULL);
-    const char *classNameCStr = (*env)->GetStringUTFChars(env, className, JNI_FALSE);
-    const id obj = objc_getClass(classNameCStr);
-    (*env)->ReleaseStringUTFChars(env, className, classNameCStr);
-
-    if (obj == nil) return ptr_to_jlong(NULL);
-    return ptr_to_jlong(obj);
-}
-
-/*
- * Class:     com_apple_jobjc_NSClass
- * Method:    getSuperClass
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_NSClass_getSuperClassOfClass
-(JNIEnv *env, jclass clazz, jlong clazzPtr)
-{
-    if (clazzPtr == 0L) return ptr_to_jlong(NULL);
-    const Class objClazz = (Class)jlong_to_ptr(clazzPtr);
-    return ptr_to_jlong(class_getSuperclass(objClazz));
-}
-
-/*
- * Class:     com_apple_jobjc_NSClass
- * Method:    getClassName
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_apple_jobjc_NSClass_getClassNameOfClass
-(JNIEnv *env, jclass clazz, jlong clazzPtr)
-{
-    const char *clazzName = (char *)class_getName((Class)jlong_to_ptr(clazzPtr));
-    return (*env)->NewStringUTF(env, clazzName);
-}
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_NSClass_getClass
-(JNIEnv *env, jclass clazz, jlong objPtr)
-{
-    id obj = (id)jlong_to_ptr(objPtr);
-    return ptr_to_jlong(object_getClass(obj));
-}
--- a/src/macosx/native/jobjc/src/core/native/NativeBuffer.h	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * 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
- * 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.
- */
-
-/*
- *  NativeBuffer.h
- *  Copyright 2007 Apple Inc. All rights reserved.
- *
- */
-
-#define BUFFER_AT(buffer, offset)                (((UInt8 *)buffer) + offset)
-#define GET_VALUE(type, buffer, offset)            (*((type *)BUFFER_AT(buffer, offset)))
-#define PUT_VALUE(type, buffer, offset, value)    (*((type *)BUFFER_AT(buffer, offset)) = value)
-
-#define GET_INT_AT(buffer, offset)                GET_VALUE(jint, buffer, offset)
-#define GET_LONG_AT(buffer, offset)                GET_VALUE(jlong, buffer, offset)
-
-#define PUT_INT_AT(buffer, offset, value)        PUT_VALUE(jint, buffer, offset, value)
-#define PUT_LONG_AT(buffer, offset, value)        PUT_VALUE(jlong, buffer, offset, value)
--- a/src/macosx/native/jobjc/src/core/native/NativeBuffer.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_NativeBuffer.h"
-
-#define MACOSX
-#include <ffi/ffi.h>
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_NativeBuffer_getPtrOfBuffer
-(JNIEnv *env, jclass clazz, jobject buffer)
-{
-    if (buffer == NULL) return ptr_to_jlong(0);
-    return ptr_to_jlong((*env)->GetDirectBufferAddress(env, buffer));
-}
--- a/src/macosx/native/jobjc/src/core/native/NativeObjectLifecycleManager.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_NativeObjectLifecycleManager.h"
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-
-/*
- * Class:     com_apple_jobjc_NativeObjectLifecycleManager
- * Method:    retainNativeObject
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_apple_jobjc_NativeObjectLifecycleManager_retainNativeObject
-(JNIEnv *env, jclass clazz, jlong ptr)
-{
-    if (ptr == 0L) return;
-    CFRetain(jlong_to_ptr(ptr));
-}
-
-/*
- * Class:     com_apple_jobjc_NativeObjectLifecycleManager
- * Method:    releaseNativeObject
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_apple_jobjc_NativeObjectLifecycleManager_releaseNativeObject
-(JNIEnv *env, jclass clazz, jlong ptr)
-{
-    if (ptr == 0L) return;
-    CFRelease(jlong_to_ptr(ptr));
-}
-
-/*
- * Class:     com_apple_jobjc_NativeObjectLifecycleManager
- * Method:    freeNativeObject
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_apple_jobjc_NativeObjectLifecycleManager_freeNativeObject
-(JNIEnv *env, jclass clazz, jlong ptr)
-{
-    if (ptr == 0L) return;
-    free(jlong_to_ptr(ptr));
-}
--- a/src/macosx/native/jobjc/src/core/native/SEL.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_SEL.h"
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-#include <objc/message.h>
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_SEL_getSelectorPtr
-(JNIEnv *env, jclass jclazz, jstring selName)
-{
-    const char *selNameAsChars = (*env)->GetStringUTFChars(env, selName, JNI_FALSE);
-    const SEL sel = sel_registerName(selNameAsChars);
-    (*env)->ReleaseStringUTFChars(env, selName, selNameAsChars);
-    return ptr_to_jlong((void*)sel);
-}
-
-JNIEXPORT jstring JNICALL Java_com_apple_jobjc_SEL_getSelectorName
-(JNIEnv *env, jclass jclazz, jlong selPtr)
-{
-    return (*env)->NewStringUTF(env, sel_getName(jlong_to_ptr(selPtr)));
-}
--- a/src/macosx/native/jobjc/src/core/native/Subclassing.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,301 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Subclassing.h"
-
-#include <math.h>
-#include <assert.h>
-#include <errno.h>
-
-#include <objc/runtime.h>
-#include <objc/message.h>
-
-#include <ffi/ffi.h>
-#include <sys/mman.h>
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-// Subclassing of Obj-C classes in Java
-//
-// See:
-//  - Objective-C Runtime documentation
-//  - man ffi_prep_closure
-//  - Subclassing.java
-
-
-#pragma mark Accessing object in IVar
-
-#define JOBJ_IVAR_NAME "jObjWrapper"
-static jobject getJObjectFromIVar(id obj);
-
-jobject getJObjectFromIVar(id obj)
-{
-    JNFJObjectWrapper *wrapper = NULL;
-    object_getInstanceVariable(obj, JOBJ_IVAR_NAME, (void**) &wrapper);
-    return wrapper ? [wrapper jObject] : NULL;
-}
-
-JNIEXPORT jobject JNICALL Java_com_apple_jobjc_Subclassing_getJObjectFromIVar
-(JNIEnv *env, jclass jClass, jlong jPtr)
-{
-    id obj = (id) jlong_to_ptr(jPtr);
-    if(obj == NULL){
-        (*env)->ThrowNew(env, (*env)->FindClass(env,
-            "java/lang/NullPointerException"), "obj");
-        return NULL;
-    }
-
-    JNFJObjectWrapper *wrapper;
-
-    if(!object_getInstanceVariable(obj, JOBJ_IVAR_NAME, (void**) &wrapper)){
-        NSLog(@"IVar '%s' not found. obj: %@", JOBJ_IVAR_NAME, obj);
-        (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"),
-            "Could not find instance variable that holds Java object.");
-        return NULL;
-    }
-
-    return wrapper ? [wrapper jObject] : NULL;
-}
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_Subclassing_initJObjectToIVar
-(JNIEnv *env, jclass jClass, jlong jPtr, jobject jObject)
-{
-    id obj = (id) jlong_to_ptr(jPtr);
-    JNFJObjectWrapper *wrapper = [[JNFJObjectWrapper alloc]
-        initWithJObject:jObject withEnv:env];
-    [wrapper retain];
-
-    if(!object_setInstanceVariable(obj, JOBJ_IVAR_NAME, wrapper)){
-        NSLog(@"IVar '%s' not found. obj: %@", JOBJ_IVAR_NAME, obj);
-        (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"),
-            "Could not find instance variable that holds Java object.");
-        return;
-    }
-}
-
-#pragma mark Registering class
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_Subclassing_allocateClassPair
-(JNIEnv *env, jclass clazz, jlong jSuperClass, jstring jName)
-{
-    const Class superClass = (Class)jlong_to_ptr(jSuperClass);
-    assert(superClass);
-
-    const char *name = (*env)->GetStringUTFChars(env, jName, JNI_FALSE);
-    const Class newClass = objc_allocateClassPair(superClass, name, 0);
-    (*env)->ReleaseStringUTFChars(env, jName, name);
-
-    return ptr_to_jlong(newClass);
-}
-
-JNIEXPORT jboolean JNICALL Java_com_apple_jobjc_Subclassing_addIVarForJObj
-(JNIEnv *env, jclass clazz, jlong jSynthClass)
-{
-    return class_addIvar(
-        jlong_to_ptr(jSynthClass),
-        JOBJ_IVAR_NAME,
-        sizeof(id),
-        (uint8_t)log2((double)sizeof(id)),
-        "@");
-}
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_Subclassing_registerClassPair
-(JNIEnv *env, jclass clazz, jlong jClass)
-{
-    Class c = jlong_to_ptr(jClass);
-//    NSLog(@"Registering class pair %p / %s", c, class_getName(c));
-    objc_registerClassPair(c);
-}
-
-
-#pragma mark Patching +alloc
-
-static id patchedAllocIMP(id obj, SEL sel);
-static void addJavaInstance(id obj);
-
-JNIEXPORT jboolean JNICALL Java_com_apple_jobjc_Subclassing_patchAlloc
-(JNIEnv *env, jclass clazz, jlong jNativeClass)
-{
-    Class metaClass = object_getClass(jlong_to_ptr(jNativeClass));
-    return class_addMethod(metaClass,
-       sel_registerName("alloc"),
-       (IMP) patchedAllocIMP,
-       "@@:");
-}
-
-static id patchedAllocIMP(id cls, SEL sel){
-    id inst = class_createInstance(cls, 0);
-    addJavaInstance(inst);
-    return inst;
-}
-
-static void addJavaInstance(id obj){
-//    NSLog(@"addJavaInstance %p", obj);
-//    NSLog(@"... calling up to Java");
-
-    static JNF_CLASS_CACHE(jc_Subclassing, "com/apple/jobjc/Subclassing");
-    static JNF_STATIC_MEMBER_CACHE(jm_Subclassing_initJObject,
-        jc_Subclassing,
-        "initJObject",
-        "(J)V");
-
-    JNFThreadContext threadWasAttached = JNFThreadDetachOnThreadDeath;
-    JNIEnv *env = JNFObtainEnv(&threadWasAttached);
-    JNFCallStaticVoidMethod(env, jm_Subclassing_initJObject,
-        ptr_to_jlong(obj));
-
-    JNFReleaseEnv(env, &threadWasAttached);
-}
-
-
-#pragma mark Adding methods
-
-static ffi_closure *make_closure(ffi_cif *cif, void *user_data);
-static void sel_closure_call(ffi_cif* cif, void* result, void** args, void* user_data);
-
-typedef struct closure_data_t{
-    JNFJObjectWrapper *jMethod;
-    JNFJObjectWrapper *jCIF;
-} closure_data_t;
-
-static ffi_closure *make_closure(ffi_cif *cif, void *user_data){
-    // Allocate a page to hold the closure with read and write permissions.
-    ffi_closure *closure;
-    if ((closure = mmap(NULL, sizeof(ffi_closure), PROT_READ | PROT_WRITE,
-                        MAP_ANON | MAP_PRIVATE, -1, (off_t) 0)) == (void*)-1)
-    {
-        fprintf(stderr, "mmap failed with errno: %d", errno);
-        return NULL;
-    }
-
-    // Prepare the ffi_closure structure.
-    ffi_status status;
-    if ((status = ffi_prep_closure(closure, cif, sel_closure_call, (void *)user_data)) != FFI_OK)
-    {
-        fprintf(stderr, "ffi_prep_closure failed with ffi_status: %d", status);
-        munmap(closure, sizeof(ffi_closure));
-        return NULL;
-    }
-
-    // Ensure that the closure will execute on all architectures.
-    if (mprotect(closure, sizeof(closure), PROT_READ | PROT_EXEC) == -1)
-    {
-        fprintf(stderr, "mprotect failed with errno: %d", errno);
-        munmap(closure, sizeof(ffi_closure));
-        return NULL;
-    }
-    return closure;
-}
-
-JNIEXPORT jboolean JNICALL Java_com_apple_jobjc_Subclassing_addMethod
-(JNIEnv *env, jclass clazz, jlong jClass, jstring jSelName, jobject jMethod,
-    jobject jCIF, jlong jCIFPtr, jstring jObjCEncodedType)
-{
-    ffi_cif *cif = jlong_to_ptr(jCIFPtr);
-
-    closure_data_t *user_data = malloc(sizeof(closure_data_t));
-    user_data->jMethod = [[JNFJObjectWrapper alloc] initWithJObject:jMethod withEnv:env];
-    user_data->jCIF = [[JNFJObjectWrapper alloc] initWithJObject:jCIF withEnv:env];
-
-    ffi_closure *closure;;
-    if(!(closure = make_closure(cif, user_data))){
-        [user_data->jMethod release];
-        [user_data->jCIF release];
-        free(user_data);
-        return NO;
-    }
-
-    const Class objcClass = (Class)jlong_to_ptr(jClass);
-
-    const char *selName = (*env)->GetStringUTFChars(env, jSelName, JNI_FALSE);
-    const char *objCEncodedType = (*env)->GetStringUTFChars(env, jObjCEncodedType, JNI_FALSE);
-
-//    NSLog(@"Adding method '%s' :: '%s' to '%s' / %p",
-//        selName,
-//        objCEncodedType,
-//        class_getName(objcClass),
-//        objcClass);
-
-    BOOL ret = class_addMethod(objcClass, sel_registerName(selName), (IMP) closure, objCEncodedType);
-
-    (*env)->ReleaseStringUTFChars(env, jSelName, selName);
-    (*env)->ReleaseStringUTFChars(env, jObjCEncodedType, objCEncodedType);
-
-    if(!ret){
-        NSLog(@"class_addMethod failed");
-        munmap(closure, sizeof(ffi_closure));
-        [user_data->jMethod release];
-        [user_data->jCIF release];
-        free(user_data);
-        return NO;
-    }
-
-    return ret;
-}
-
-static void sel_closure_call(ffi_cif* cif, void* result, void** args, void* user_data)
-{
-    id obj = *(id*) args[0];
-//    SEL sel = *(SEL*) args[1];
-
-//    NSLog(@"Subclassing: sel_closure_call: %p %p", obj, sel);
-//    NSLog(@"Subclassing: sel_closure_call: obj class: %@  sel name: %s", object_getClass(obj), sel_getName(sel));
-
-    jobject jObj = getJObjectFromIVar(obj);
-
-    if(!jObj){
-        addJavaInstance(obj);
-        jObj = getJObjectFromIVar(obj);
-    }
-
-    closure_data_t *jmeta = user_data;
-    jobject jMethod = [jmeta->jMethod jObject];
-    jobject jCIF = [jmeta->jCIF jObject];
-
-    JNFThreadContext threadWasAttached = JNFThreadDetachOnThreadDeath;
-    JNIEnv *env = JNFObtainEnv(&threadWasAttached);
-
-    if((*env)->ExceptionOccurred(env)) goto bail;
-
-        static JNF_CLASS_CACHE(jc, "com/apple/jobjc/Subclassing");
-        static JNF_STATIC_MEMBER_CACHE(jm_invokeFromJNI, jc, "invokeFromJNI",
-        "(Lcom/apple/jobjc/ID;Ljava/lang/reflect/Method;Lcom/apple/jobjc/CIF;JJ)V");
-
-    JNFCallStaticVoidMethod(env, jm_invokeFromJNI,
-        jObj,
-        jMethod,
-        jCIF,
-        ptr_to_jlong(result),
-        ptr_to_jlong(args));
-
-bail:
-    JNFReleaseEnv(env, &threadWasAttached);
-
-    if((*env)->ExceptionOccurred(env)){
-        NSLog(@"Exception!");
-        (*env)->ExceptionDescribe(env);
-    }
-    JNFReleaseEnv(env, &threadWasAttached);
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/BootClassPathMinus.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-public class BootClassPathMinus {
-
-    /*
-     * return the default boot class path with all parts mentioned in arguments removed
-     */
-    public static void main(String[] args) {
-    String bootClassPath = System.getProperty("sun.boot.class.path");
-    StringBuffer newPath = new StringBuffer(bootClassPath.length());
-    String[] bootClassPathParts = bootClassPath.split(java.io.File.pathSeparator, 0);
-    for (String part : bootClassPathParts) {
-        boolean found = false;
-        for (String minus : args) {
-        if (part.endsWith(minus)) {
-            found = true;
-        }
-        }
-        if (!found) {
-        if (newPath.length() > 0) newPath.append(java.io.File.pathSeparatorChar);
-        newPath.append(part);
-        }
-    }
-    System.out.println(newPath.toString());
-    }
-
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/ClassConsolidator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.model.Category;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Framework;
-
-public class ClassConsolidator {
-    private static String[] PREFERRED_FRAMEWORKS = { "Foundation", "AppKit" };
-
-    static void consolidateClassesForFrameworks(final List<Framework> frameworks) throws Throwable {
-        System.out.println("--2-- Resolving duplicate classes:");
-        final Map<String, List<Clazz>> allClasses = new HashMap<String, List<Clazz>>();
-
-        for (final Framework framework : frameworks) {
-            for (final Clazz clazz : framework.classes) {
-                final List<Clazz> existingClazzList = allClasses.get(clazz.name);
-                if(existingClazzList != null)
-                    existingClazzList.add(clazz);
-                else
-                    allClasses.put(clazz.name, new ArrayList<Clazz>(Arrays.asList(clazz)));
-            }
-        }
-
-        final Map<String, Clazz> filteredClasses = new HashMap<String, Clazz>();
-        final List<List<Clazz>> dreggs = new ArrayList<List<Clazz>>();
-
-        final Collection<List<Clazz>> clazzLists = allClasses.values();
-        for (final List<Clazz> clazzList : clazzLists) {
-            if (clazzList.size() > 1) {
-                // add to the list for later analysis
-                dreggs.add(clazzList);
-                continue;
-            }
-
-            // if there is only one class definition, go with it!
-            final Clazz clazz = clazzList.get(0);
-            filteredClasses.put(clazz.name, clazz);
-        }
-
-        // figure out which class is the real class, and convert the rest to categories
-        for (final List<Clazz> dreg : dreggs)
-            deriveCategoriesFrom(dreg, filteredClasses);
-
-        // patch up the inheritance hierarchy
-        System.out.println("Determining super classes:");
-        for (final Framework framework : frameworks)
-            framework.resolveSuperClasses(filteredClasses);
-    }
-
-    private static void deriveCategoriesFrom(final List<Clazz> clazzes, final Map<String, Clazz> filteredClasses) {
-        final List<Clazz> clazzesToDerive = new ArrayList<Clazz>(clazzes);
-
-        for (final String preferredFrameworkName : PREFERRED_FRAMEWORKS) {
-            for (final Clazz clazz : clazzesToDerive) {
-                if (!preferredFrameworkName.equals(clazz.parent.name)) continue;
-
-                System.out.print("\t" + clazz.parent.name + " owns \"" + clazz.name + "\", ");
-                addCategoriesAndPatchClasses(clazzes, clazz);
-                filteredClasses.put(clazz.name, clazz);
-                return;
-            }
-        }
-
-        final List<String> frameworkNameList = new ArrayList<String>(clazzes.size());
-        for (final Clazz clazz : clazzes) frameworkNameList.add(clazz.parent.name);
-        throw new RuntimeException("Could not derived a preferred framework for: " + clazzes.get(0).name + ", from (" + Utils.joinWComma(frameworkNameList) + ")");
-    }
-
-    private static void addCategoriesAndPatchClasses(final List<Clazz> clazzes, final Clazz clazz) {
-        final List<String> fwNames = new ArrayList<String>(clazzes.size());
-
-        for (final Clazz cls : clazzes) {
-            if (cls == clazz) continue;
-            fwNames.add(cls.parent.name);
-            cls.parent.classes.remove(cls);
-            cls.parent.categories.add(new Category(cls, clazz));
-        }
-
-        System.out.println("creating categories in: " + Utils.joinWComma(fwNames));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/ClassGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.util.*;
-
-import com.apple.internal.jobjc.generator.classes.*;
-import com.apple.internal.jobjc.generator.model.Framework;
-
-public class ClassGenerator {
-    public static final String JOBJC_PACKAGE = "com.apple.jobjc";
-
-    public static List<OutputFile> generateClasses(final List<Framework> frameworks) {
-        final List<OutputFile> generatedClassFiles = new ArrayList<OutputFile>();
-
-        generatedClassFiles.add(new RootJObjCClass(frameworks));
-        for (final Framework f : frameworks) {
-            f.generateClasses(generatedClassFiles);
-        }
-
-        return generatedClassFiles;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/FileCopier.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.io.File;
-import java.util.*;
-
-import com.apple.internal.jobjc.generator.classes.*;
-
-public class FileCopier {
-    public static List<OutputFile> addSourceFilesFrom(final String srcPath) {
-        final List<OutputFile> outputFileList = new ArrayList<OutputFile>();
-
-        final List<File> fileList = getFileList(srcPath);
-        for (final File file : fileList) {
-            outputFileList.add(new CopiedFile(file, ClassGenerator.JOBJC_PACKAGE, file.getName().replace("\\.java", "")));
-        }
-
-        return outputFileList;
-    }
-
-    private static List<File> getFileList(final String srcPath) {
-        final File srcRoot = new File(srcPath);
-        if (!srcRoot.exists()) throw new RuntimeException("Source root " + srcRoot + " does not exist. Nowhere to copy base runtime objects from.");
-
-        final File targetDir = new File(srcRoot, ClassGenerator.JOBJC_PACKAGE.replaceAll("\\.", "\\/"));
-        if (!targetDir.exists() || !targetDir.isDirectory()) throw new RuntimeException("Base runtime object source directory " + targetDir + " does not exist. No runtime class files to copy.");
-
-        final List<File> fileList = new ArrayList<File>();
-        final File[] targetDirFileList = targetDir.listFiles();
-        for (final File file : targetDirFileList) {
-            if (!file.isFile()) continue;
-            if (!file.getName().endsWith(".java")) continue;
-            fileList.add(file);
-        }
-
-        return fileList;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/FrameworkGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.Framework.FrameworkDependency;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.internal.jobjc.generator.utils.StructOffsetResolverBigBang;
-import com.apple.jobjc.JObjCRuntime;
-
-public class FrameworkGenerator {
-    private static final String BRIDGESUPPORT_FILE_EXTENSION = "Full.bridgesupport";
-    private static final String FRAMEWORK_MATCH = "^.*Full\\.bridgesupport$";
-    private static final String FRAMEWORK_PRUNE = "^.*(PyObjC|/Versions|\\.lproj|/Headers|/PrivateHeaders).*$";
-
-    static List<File> findFrameworkFilesIn(final File file) throws IOException{
-        final List<File> bridgeSupportFiles = Utils.find(file, FRAMEWORK_MATCH, FRAMEWORK_PRUNE);
-        System.out.println("found " + bridgeSupportFiles.size() + " frameworks");
-        return bridgeSupportFiles;
-    }
-
-    static List<Framework> parseFrameworksFrom(final List<File> bridgeSupportFiles) {
-        final List<Framework> frameworks = new ArrayList<Framework>();
-
-        System.out.println("Parsing XML");
-        for (final File file : bridgeSupportFiles){
-            Framework f = new Framework(extractFrameworkNameFrom(file), file);
-            try{
-                f.load();
-                frameworks.add(f);
-                System.out.println("Generator@" + JObjCRuntime.ARCH + " loaded "
-                        + f.name + " (" + Fp.join(":", f.binaries) + ")");
-            }
-            catch(Exception x){
-                System.out.println("!! Generator@" + JObjCRuntime.ARCH + " failed to load "
-                        + f.name + " (" + Fp.join(":", f.binaries) + "). SKIPPING");
-            }
-        }
-
-        System.out.println("Parsing dependencies");
-        for (final Framework f : frameworks) f.parseDependencies(frameworks);
-
-        Set<String> alreadyWarnedDependency = new HashSet<String>();
-        for(final Framework f : frameworks)
-            for(final FrameworkDependency dep : f.dependencies)
-                if(dep.object == null && !alreadyWarnedDependency.contains(dep.name)){
-                    System.out.println(String.format("Warning: unresolved dependency: %1$30s -> %2$s", f.name, dep.name));
-                    alreadyWarnedDependency.add(dep.name);
-                }
-        if(alreadyWarnedDependency.size() > 0)
-            System.out.println("Unresolved dependencies lead to unresolved types.");
-
-        Utils.topologicalSort(frameworks);
-        List<Framework> cycle = Utils.getDependencyCycle(frameworks);
-        if(cycle != null)
-            System.out.println("Warning: cycle found in framework dependencies: " + Fp.join(" -> ", cycle));
-
-        System.out.println("Parsing types");
-        for (final Framework f : frameworks){
-            f.parseCFTypes();
-            f.parseOpaques();
-        }
-        for (final Framework f : frameworks) f.parseStructs();
-
-        new StructOffsetResolverBigBang().resolve(frameworks);
-
-        System.out.println("Parsing classes");
-        for (final Framework f : frameworks) f.parseClasses();
-
-        System.out.println("Parsing constants");
-        for (final Framework f : frameworks) f.parseConstants();
-
-        System.out.println("Parsing functions");
-        for (final Framework f : frameworks) f.parseFunctions();
-
-        return frameworks;
-    }
-
-    private static String extractFrameworkNameFrom(final File file) {
-        final String fileName = file.getName();
-        return fileName.substring(0, fileName.lastIndexOf(BRIDGESUPPORT_FILE_EXTENSION));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/FunctionGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.io.PrintStream;
-import java.io.StringWriter;
-
-import com.apple.internal.jobjc.generator.model.Arg;
-import com.apple.internal.jobjc.generator.model.Function;
-import com.apple.internal.jobjc.generator.model.Method;
-import com.apple.internal.jobjc.generator.model.types.JType;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLCall;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLField;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLMethod;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLTertiary;
-import com.apple.jobjc.Coder;
-import com.apple.jobjc.Invoke;
-import com.apple.jobjc.Invoke.FunCall;
-import com.apple.jobjc.Invoke.MsgSend;
-
-public class FunctionGenerator {
-    private final static String VARARGS_NAME = "varargs";
-
-    private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
-        final String identifier = makeInstanceName(fxn);
-
-        JLField field = new JLField("private static", type.getCanonicalName(), identifier);
-        // It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
-        JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
-
-        JLCall createIt = new JLCall("new " + type.getCanonicalName());
-        createIt.args.add(firstArg(fxn));
-        createIt.args.add("\"" + fxn.name + "\"");
-        createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
-        for (final Arg arg : fxn.args)
-            createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
-
-        getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
-
-        return field.toString() + getter.toString();
-    }
-
-    private static String createLocalForward(final Class<? extends Invoke> type, final Function fxn) {
-        final String identifier = makeInstanceName(fxn);
-        return new JLField("final", type.getCanonicalName(), identifier, new JLCall("get_" + identifier)).toString();
-    }
-
-    private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
-        final String identifier = makeInstanceName(fxn);
-        StringWriter out = new StringWriter();
-
-        out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
-
-        for(int i = 0; i < fxn.args.size(); i++)
-            out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
-
-        if(fxn.variadic){
-            out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
-            out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
-        }
-
-        out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
-                + fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
-
-        return out.toString();
-    }
-
-    private static final String CONTEXT_NAME = "nativeBuffer";
-
-    public static void writeOutFunction(final PrintStream out, final Class<? extends Invoke> type, final Function fxn, final String initWithObj) {
-        final String instName = makeInstanceName(fxn);
-        final JType returnJavaType = fxn.returnValue.type.getJType();
-
-        if(!fxn.variadic){
-            out.print(createFieldCache(type, fxn));
-            out.println();
-        }
-
-        JLMethod meth = new JLMethod("public", returnJavaType.getJavaReturnTypeName(), fxn.getJavaName());
-
-        for(Arg arg : fxn.args)
-            meth.args.add("final " + arg.type.getJType().getTypeNameAsParam() + " " + arg.javaName);
-
-        if(fxn.variadic)
-            meth.args.add("final Object... " + VARARGS_NAME);
-
-        if(fxn instanceof Method && ((Method)fxn).ignore){
-            String suggestion = ((Method)fxn).suggestion == null ? "" : (" Suggested work-around: " + ((Method)fxn).suggestion);
-            meth.jdoc.add("@deprecated The framework recommends that this method be ignored. (It may be deprecated.)" + suggestion);
-            meth.attrs.add("@Deprecated");
-        }
-
-        // type mismatch warning
-        {
-            {
-                String retMsg = fxn.returnValue.type.getJType().getCoderDescriptor().mismatchMessage();
-                if(retMsg != null){
-                    meth.jdoc.add("@deprecated Possible type mismatch: (return value) " + retMsg);
-                    meth.attrs.add("@Deprecated");
-                }
-            }
-
-            for(int i = 0; i < fxn.args.size(); i++){
-                final Arg arg = fxn.args.get(i);
-                String argMsg = arg.type.getJType().getCoderDescriptor().mismatchMessage();
-                if(argMsg != null){
-                    meth.jdoc.add("@deprecated Possible type mismatch: (arg" + i + ": " + arg.javaName + ") " + argMsg);
-                    meth.attrs.add("@Deprecated");
-                }
-            }
-        }
-
-        if(fxn.variadic)
-            meth.body.add(createLocalNew(coreType(fxn), fxn));
-        else
-            meth.body.add(createLocalForward(coreType(fxn), fxn));
-
-        meth.body.add(returnJavaType.createDeclareBuffer(CONTEXT_NAME));
-        meth.body.add(returnJavaType.createInit(CONTEXT_NAME, instName, initWithObj));
-
-        for(final Arg arg : fxn.args)
-            meth.body.add(arg.type.getJType().getCoderDescriptor().getPushStatementFor(CONTEXT_NAME, arg.javaName));
-
-        if(fxn.variadic){
-            meth.body.add(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)", fxn.args.size(), VARARGS_NAME));
-            meth.body.add(String.format("\targCoders[i].push(%1$s, %2$s[i - %3$d]);", CONTEXT_NAME, VARARGS_NAME, fxn.args.size()));
-        }
-
-        meth.body.add(returnJavaType.createInvoke(CONTEXT_NAME, instName));
-        meth.body.add(returnJavaType.createPop(CONTEXT_NAME));
-        meth.body.add(returnJavaType.createReturn());
-
-        out.print(meth.toString());
-        out.println();
-    }
-
-    private static Class<? extends Invoke> coreType(final Function fxn){
-        return fxn instanceof Method ? MsgSend.class : FunCall.class;
-    }
-
-    private static String firstArg(Function fxn){
-        return fxn instanceof Method ? "getRuntime()" : "this";
-    }
-
-    private static String makeInstanceName(Function fxn){
-        String ext;
-        if(fxn instanceof Method){
-            if(((Method) fxn).isClassMethod) ext = "CMetInst";
-            else                             ext = "IMetInst";
-        }
-        else
-            ext = "FxnInst";
-
-        return fxn.getJavaName() + "_" + ext;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/Generator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.classes.MixedPrimitiveCoderClassFile;
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.coders.ComplexCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.types.Type;
-import com.apple.internal.jobjc.generator.model.types.TypeCache;
-import com.apple.internal.jobjc.generator.utils.Fp.Pair;
-
-public class Generator {
-    private static final String DEFAULT_FRAMEWORKS_PATH = "/System/Library/Frameworks";
-    private static final String DEFAULT_OUTPUT_PATH = "/tmp/JObjC";
-
-    public static void main(final String...args) throws Throwable {
-        final Map<String, String> argMap = Utils.getArgs(args);
-
-        final String dst = get(argMap, "dst", DEFAULT_OUTPUT_PATH);
-        System.out.println("Cleaning up: " + dst);
-        final File dstLoc = new File(dst);
-        Utils.recDelete(dstLoc);
-        dstLoc.mkdirs();
-        System.out.println("Outputting classes to: " + dst);
-
-        final String frameworksPath = get(argMap, "frameworks", DEFAULT_FRAMEWORKS_PATH);
-        System.out.println("Searching for bridged frameworks in: " + frameworksPath);
-
-        final List<File> bridgeSupportFiles = FrameworkGenerator.findFrameworkFilesIn(new File(frameworksPath));
-        final List<Framework> frameworks = FrameworkGenerator.parseFrameworksFrom(bridgeSupportFiles);
-
-        System.out.println("--1-- Generator: consolidateClassesForFrameworks");
-        ClassConsolidator.consolidateClassesForFrameworks(frameworks);
-
-        System.out.println("--1-- Generator: TypeCache load");
-        TypeCache.inst().load(frameworks);
-
-        System.out.println("--1-- Generator: disambiguateMethodNames");
-        MethodDisambiguator.disambiguateMethodNames();
-
-        System.out.println("--1-- Generator: disambiguateFunctionsIn");
-        MethodDisambiguator.disambiguateFunctionsIn(frameworks);
-
-        System.out.println("--1-- Generator: generateClasses");
-        final List<OutputFile> sourceFiles = ClassGenerator.generateClasses(frameworks);
-        sourceFiles.add(new MixedPrimitiveCoderClassFile(ComplexCoderDescriptor.getMixedEncoders()));
-
-        System.out.println("--1-- Generator: writing " + sourceFiles.size() + " files");
-        for (final OutputFile sourceFile : sourceFiles) sourceFile.write(dstLoc);
-
-        System.out.println("I have " + TypeCache.inst().getUnknownTypes().size() + " unresolved types.");
-        for (final Type type : TypeCache.inst().getUnknownTypes())
-            System.out.println("[Warning] unknown type: " + type);
-
-        for(Type type : TypeCache.inst().typesByNTypes.values()){
-            if(!type.type32.getClass().equals(type.type64.getClass())){
-                System.out.format("Type with differing NTypes: %1$15s: %2$s\n", type.name, new Pair(type.type32, type.type64));
-            }
-        }
-    }
-
-    private static String get(final Map<String, String> defaults, final String key, final String defaultValue) {
-        final String value = defaults.get(key);
-        if (value != null) return value;
-        return defaultValue;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/MethodDisambiguator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.util.List;
-
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.Function;
-import com.apple.internal.jobjc.generator.model.types.TypeCache;
-
-public class MethodDisambiguator {
-    static void disambiguateMethodNames() {
-        // link all subclassers off their parents
-        for (final Clazz clazz : TypeCache.inst().getAllClasses()) {
-            final Clazz superClazz = clazz.superClass;
-            if (superClazz != null) superClazz.subClassers.add(clazz);
-        }
-
-        // recursively call all subclassers, starting from NSObject on down
-        disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSObject"));
-
-        // NSProxy does not appear to subclass from NSObject, but it is still a real full class...?
-        disambiguateMethodNamesFor(TypeCache.inst().getClassForName("NSProxy"));
-    }
-
-    static void disambiguateMethodNamesFor(final Clazz clazz) {
-        clazz.disambiguateMethods();
-        for (final Clazz subClazz : clazz.subClassers) {
-            disambiguateMethodNamesFor(subClazz);
-        }
-    }
-
-    public static void disambiguateFunctionsIn(final List<Framework> frameworks) {
-        for (final Framework framework : frameworks) {
-            disambiguateFunctionsInFramework(framework);
-        }
-    }
-
-    static void disambiguateFunctionsInFramework(final Framework framework) {
-        for (final Function fxn : framework.functions)
-            fxn.disambiguateArgs();
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/RestrictedKeywords.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-public class RestrictedKeywords {
-    static final String[] JAVA_KEYWORD_CONFLICTS = {
-        "wait", "null", "class", "new", "toString", "finalize", "boolean", "interface", "final", "static"
-    };
-
-    static final Set<String> originalRestrictedSet = new HashSet<String>(Arrays.asList(JAVA_KEYWORD_CONFLICTS));
-
-    public static Set<String> getNewRestrictedSet() {
-        return new HashSet<String>(originalRestrictedSet);
-    }
-
-    public static boolean isRestricted(String s){
-        return originalRestrictedSet.contains(s);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/Utils.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
-
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.Framework.FrameworkDependency;
-import com.apple.internal.jobjc.generator.utils.Fp;
-
-public class Utils {
-    public static boolean isLeopard = System.getProperty("os.version").startsWith("10.5");
-    public static boolean isSnowLeopard = System.getProperty("os.version").startsWith("10.6");
-
-    @SuppressWarnings("unchecked")
-    public static <T> List<T> list(final Object...args) {
-        final ArrayList<Object> list = new ArrayList<Object>(args.length);
-        for (final Object arg : args) list.add(arg);
-        return (List<T>)list;
-    }
-
-    /**
-     * A small implementation of UNIX find.
-     * @param matchRegex Only collect paths that match this regex.
-     * @param pruneRegex Don't recurse down a path that matches this regex. May be null.
-     * @throws IOException if File.getCanonicalPath() fails.
-     */
-    public static List<File> find(final File startpath, final String matchRegex, final String pruneRegex) throws IOException{
-        final Pattern matchPattern = Pattern.compile(matchRegex, Pattern.CASE_INSENSITIVE);
-        final Pattern prunePattern = pruneRegex == null ? null : Pattern.compile(pruneRegex, Pattern.CASE_INSENSITIVE);
-        final Set<String> visited = new HashSet<String>();
-        final List<File> found = new ArrayList<File>();
-        class Search{
-            void search(final File path) throws IOException{
-                if(prunePattern != null && prunePattern.matcher(path.getAbsolutePath()).matches()) return;
-                String cpath = path.getCanonicalPath();
-                if(!visited.add(cpath))  return;
-                if(matchPattern.matcher(path.getAbsolutePath()).matches())
-                    found.add(path);
-                if(path.isDirectory())
-                    for(File sub : path.listFiles())
-                        search(sub);
-            }
-        }
-        new Search().search(startpath);
-        return found;
-    }
-
-    public static String joinWComma(final List<?> list) { return Fp.join(", ", list); }
-    public static String joinWComma(final Object[] list) { return Fp.join(", ", Arrays.asList(list)); }
-
-    public static class Substituter {
-        String str;
-
-        public Substituter(final String str) {
-            this.str = str.replaceAll("\\#", "\t").replaceAll("\\~", "\n");
-        }
-
-        public void replace(final String key, final String value) {
-            str = str.replaceAll("\\$" + key, value);
-        }
-
-        /**
-         * Apply String.format first, and then pass through Substituter.
-         */
-        public static String format(String format, Object... args){
-            return new Substituter(String.format(format, args)).toString();
-        }
-
-        @Override public String toString() {
-            return str;
-        }
-    }
-
-    static Map<String, String> getArgs(final String...args) {
-        final Map<String, String> argMap = new HashMap<String, String>();
-        for (final String arg : args) {
-            final String[] splitArg = arg.split("\\=");
-            if (splitArg.length != 2) continue;
-            argMap.put(splitArg[0], splitArg[1]);
-        }
-        return argMap;
-    }
-
-    static void recDelete(final File file) {
-        if (!file.exists()) return;
-        if (file.isDirectory()) for (final File f : file.listFiles()) recDelete(f);
-        file.delete();
-    }
-
-    public static String capitalize(String s){
-        if(s.length() == 0) return s;
-        return Character.toString(Character.toUpperCase(s.charAt(0))) + s.substring(1);
-    }
-
-    /**
-     * Sort frameworks by dependencies. If A is a dependency of B,
-     * then A will come before B in the list.
-     */
-    public static void topologicalSort(final List<Framework> frameworks) {
-        final Set<Framework> visited = new TreeSet<Framework>();
-        final List<Framework> sorted = new ArrayList<Framework>(frameworks.size());
-        class Rec{
-            void visit(final Framework fw){
-                if(!visited.add(fw)) return;
-                for(FrameworkDependency dep : fw.dependencies)
-                    if(dep.object != null)
-                        visit(dep.object);
-                sorted.add(fw);
-            }
-        }
-        for(Framework fw : frameworks) new Rec().visit(fw);
-        frameworks.clear();
-        frameworks.addAll(sorted);
-    }
-
-    /**
-     * If there is a cycle it is returned. Otherwise null is returned.
-     */
-    public static List<Framework> getDependencyCycle(List<Framework> frameworks) {
-        @SuppressWarnings("serial")
-        class FoundCycle extends Throwable{
-            public final List<Framework> cycle;
-            public FoundCycle(List<Framework> cycle){
-                this.cycle = cycle;
-            }
-        };
-        class Rec{
-            void visit(final Framework fw, List<Framework> visited) throws FoundCycle{
-                visited = new LinkedList<Framework>(visited);
-                if(visited.contains(fw)){
-                    visited.add(fw);
-                    throw new FoundCycle(visited);
-                }
-                visited.add(fw);
-                for(FrameworkDependency dep : fw.dependencies)
-                    if(dep.object != null)
-                        visit(dep.object, visited);
-            }
-        }
-        try{ for(Framework fw : frameworks){ new Rec().visit(fw, new LinkedList<Framework>()); }}
-        catch(FoundCycle x){ return x.cycle; }
-        return null;
-    }
-
-    public static String getCanonicalPath(File file) throws RuntimeException{
-        try {
-            return file.getCanonicalPath();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/AbstractObjCClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import com.apple.internal.jobjc.generator.model.Clazz;
-
-public abstract class AbstractObjCClassFile extends GeneratedClassFile {
-    final Clazz clazz;
-
-    public AbstractObjCClassFile(final Clazz clazz, final String classname, final String genericArgs, final String superClass) {
-        super(clazz.getPackage(), classname, genericArgs, superClass);
-        this.clazz = clazz;
-    }
-
-    public AbstractObjCClassFile(final Clazz clazz, final String classname, final String superClass) {
-        super(clazz.getPackage(), classname, superClass);
-        this.clazz = clazz;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CFTypeClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-
-import com.apple.internal.jobjc.generator.model.CFType;
-import com.apple.jobjc.Pointer;
-
-public class CFTypeClassFile extends GeneratedClassFile {
-    final CFType cftype;
-
-    public CFTypeClassFile(final CFType cftype) {
-        super(cftype.parent.pkg, cftype.type.getJType().getJavaClassName(), com.apple.jobjc.CFType.class.getCanonicalName());
-        this.cftype = cftype;
-    }
-
-    @Override public void writeBeginning(PrintStream out){
-        out.println("\tpublic " + className + "(" + Pointer.class.getName() + "<?> ptr){");
-        out.println("\t\tsuper(ptr);");
-        out.println("\t}");
-        out.println("");
-        out.println("\tpublic " + className + "(long ptr){");
-        out.println("\t\tsuper(ptr);");
-        out.println("\t}");
-    }
-
-    @Override public void writeBody(PrintStream out){
-        if(cftype.getTypeIdFunc != null){
-            out.println("\tpublic static long getTypeId(){");
-            out.println("\t\treturn " + RootJObjCClass.runtimeFrameworkInst(cftype.parent.name) + "." + cftype.getTypeIdFunc + "();");
-            out.println("\t}");
-        }
-        else
-            out.println("\t// getTypeIdFunc not found");
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CategoryClassClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-import java.util.HashSet;
-import java.util.Set;
-
-import com.apple.internal.jobjc.generator.FunctionGenerator;
-import com.apple.internal.jobjc.generator.model.Category;
-import com.apple.internal.jobjc.generator.model.Method;
-import com.apple.jobjc.JObjCRuntime;
-import com.apple.jobjc.Invoke.MsgSend;
-
-public class CategoryClassClassFile extends AbstractObjCClassFile {
-    final Category category;
-
-    public CategoryClassClassFile(final Category category) {
-        super(category.category, category.category.name + "Class",
-                category.category.superClass.getFullPath() + "Class");
-        this.category = category;
-    }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        out.format(
-                "\t%1$s(%2$s runtime) {\n" +
-                "\t\tsuper(\"%3$s\", runtime);\n" +
-                "\t}\n",
-                className, JObjCRuntime.class.getCanonicalName(), category.category.superClass.name);
-    }
-
-    @Override public void writeBody(final PrintStream out) {
-        Set<String> written = new HashSet<String>();
-        for(final Method method : this.clazz.classMethods)
-            if(written.add(method.name))
-                FunctionGenerator.writeOutFunction(out, MsgSend.class, method, "this");
-            else
-                System.out.format("Duplicate method: %1$s %2$s -%3$s\n", clazz.parent.name, className, method.name);
-    }
-
-    @Override protected boolean isFinal(){ return true; }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CategoryClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-
-import com.apple.internal.jobjc.generator.model.Category;
-import com.apple.jobjc.JObjCRuntime;
-
-public class CategoryClassFile extends JObjCClassFile {
-    private final Category category;
-
-    public CategoryClassFile(final Category category) {
-        super(category.category);
-        this.category = category;
-    }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        String targetCls = category.category.superClass.getFullPath();
-        out.format("\tpublic %1$s(final %2$s obj, final %3$s runtime) {\n" +
-                "\t\tsuper(obj, runtime);\n" +
-                "\t}\n",
-            className, targetCls, JObjCRuntime.class.getCanonicalName());
-        super.writeBeginning(out);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/CopiedFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.*;
-
-public class CopiedFile extends OutputFile {
-    final File sourceFile;
-
-    public CopiedFile(final File sourceFile, final String pkg, final String filename) {
-        super(pkg, filename);
-        this.sourceFile = sourceFile;
-    }
-
-    @Override
-    public void write(final File parentDir) {
-        try {
-            final PrintStream out = open(parentDir);
-            final InputStream in = new FileInputStream(sourceFile);
-
-            copy(in, out);
-            close(out);
-        } catch (final IOException e) { throw new RuntimeException(e); }
-    }
-
-    private static void copy(final InputStream in, final PrintStream out) throws IOException {
-        int bit;
-        while (-1 != (bit = in.read())) {
-            out.write(bit);
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/FrameworkClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.TreeSet;
-
-import com.apple.internal.jobjc.generator.FunctionGenerator;
-import com.apple.internal.jobjc.generator.Utils;
-import com.apple.internal.jobjc.generator.model.Category;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Constant;
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.Function;
-import com.apple.internal.jobjc.generator.model.NativeEnum;
-import com.apple.internal.jobjc.generator.model.StringConstant;
-import com.apple.internal.jobjc.generator.model.Struct;
-import com.apple.internal.jobjc.generator.model.types.JType;
-import com.apple.internal.jobjc.generator.model.types.JType.JStruct;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.internal.jobjc.generator.utils.JavaLang;
-import com.apple.internal.jobjc.generator.utils.Fp.Map1;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLCall;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLField;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLMethod;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLReturn;
-import com.apple.jobjc.JObjCRuntime;
-import com.apple.jobjc.MacOSXFramework;
-import com.apple.jobjc.Invoke.FunCall;
-
-public class FrameworkClassFile extends GeneratedClassFile {
-    final Framework framework;
-
-    public FrameworkClassFile(final Framework framework) {
-        super(framework.pkg, framework.name + "Framework", MacOSXFramework.class.getName());
-        this.framework = framework;
-    }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        List<String> binPaths = Fp.map(new Map1<File,String>(){
-            public String apply(File a) { return "\"" + a.getAbsolutePath() + "\""; }},
-            framework.binaries);
-        out.println(new Utils.Substituter(
-                "#public " + className + "(" + JObjCRuntime.class.getName() + " runtime) {~" +
-                "##super(runtime, new String[]{" + Fp.join(", ", binPaths) + "});~" +
-                "#}~"
-        ));
-    }
-
-    @Override public void writeBody(final PrintStream out) {
-        for(final Struct struct : new ArrayList<Struct>(framework.structs)){
-            out.println("\tpublic " + struct.name + " make" + struct.name + "(){");
-            out.println("\t\treturn new " + struct.name + "(getRuntime());");
-            out.println("\t}");
-            out.println("\tpublic " + struct.name + " make" + struct.name + "(com.apple.jobjc.NativeBuffer base){");
-            out.println("\t\treturn new " + struct.name + "(getRuntime(), base);");
-            out.println("\t}");
-        }
-
-        for(final NativeEnum nenum : framework.enums){
-            if(nenum.ignore){
-                out.println("\t/**");
-                out.println("\t * @deprecated Suggestion: " + nenum.suggestion);
-                out.println("\t */");
-                out.println("\t@Deprecated");
-            }
-            out.println(String.format("\tpublic final %3$s %1$s(){ return %2$s; }",
-                    nenum.name, nenum.valueToString(), nenum.type.getJType().getJavaReturnTypeName()));
-        }
-
-        for(final Constant konst : framework.constants){
-            String cacheName = "_" + konst.name;
-            final JType jtype = konst.type.getJType();
-            final String cast = jtype.getReturnTypeCast() == null ? "" : "(" + jtype.getReturnTypeCast() + ")";
-            out.println();
-
-            out.print(new JLField("private", jtype.getJavaTypeName(), cacheName, jtype.getDefaultReturnValue()));
-
-            JLMethod reader = new JLMethod("public final", jtype.getJavaReturnTypeName(), konst.name);
-            reader.body.add("if(" + cacheName + " != " + jtype.getDefaultReturnValue() + ") return " + cast + cacheName + ";");
-
-            String contextName = jtype instanceof JStruct ? "returnValue" : "nativeBuffer";
-
-            if(jtype instanceof JStruct)
-                reader.body.add(((JStruct)jtype).createReturnValue());
-            else
-                reader.body.add(jtype.createDeclareBuffer(contextName));
-
-            reader.body.add("getConstant(\"" + konst.name + "\", " + contextName + ", " + jtype.getCoderDescriptor().getCoderInstanceName() + ".sizeof());");
-
-            reader.body.add(jtype.createPop(contextName));
-            reader.body.add(cacheName + " = returnValue;");
-            reader.body.add(jtype.createReturn());
-
-            out.print(reader);
-        }
-
-        for(final StringConstant konst : framework.stringConstants){
-            if(Fp.any(new Map1<Constant,Boolean>(){ public Boolean apply(Constant a) {
-                return a.name.equals(konst.name);
-                }}, new ArrayList<Constant>(framework.constants))){
-                System.out.println("Warning: [" + framework.name + "] String constant " + konst.name + " is already defined in constants. Skipping.");
-            }
-            else{
-                out.println("\tpublic final String " + konst.name + "(){ return \"" + escapeQuotes(konst.value) + "\"; }");
-            }
-        }
-
-        /**
-         * Order classes to get stable output
-         */
-        TreeSet<Clazz> sortedClasses = new TreeSet<Clazz>(framework.classes);
-        for (final Clazz clazz : sortedClasses) {
-            final String classClassName = clazz.name + "Class";
-            out.println(JavaLang.makeSingleton("_" + classClassName, clazz.name, classClassName, "getRuntime()"));
-        }
-
-        for (final Category cat : framework.categories) {
-            final String classClassName = cat.category.name + "Class";
-            out.println(JavaLang.makeSingleton("_" + classClassName, cat.category.name, classClassName, "getRuntime()"));
-
-            JLMethod jlm = new JLMethod("public", cat.category.name, cat.category.name, "final " + cat.category.superClass.getFullPath() + " obj");
-            jlm.body.add(new JLReturn(new JLCall("new " + cat.category.name, "obj", "getRuntime()")));
-            out.println(jlm);
-        }
-
-        for (final Function fxn : framework.functions){
-            FunctionGenerator.writeOutFunction(out, FunCall.class, fxn, null);
-        }
-    }
-
-    private String escapeQuotes(String s){
-        return s.replace("\"", "\\\"");
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/GeneratedClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-
-public class GeneratedClassFile extends OutputFile {
-    protected final String className;
-    protected final String genericArgs;
-    protected final String superClass;
-
-    public GeneratedClassFile(final String pkg, final String classname, final String superClass) {
-        this(pkg, classname, null, superClass);
-    }
-
-    public GeneratedClassFile(final String pkg, final String classname, final String genericArgs, final String superClass) {
-        super(pkg, classname + ".java");
-        this.className = classname;
-        this.genericArgs = genericArgs;
-        this.superClass = superClass;
-    }
-
-    @Override
-    public void write(final File parentDir) {
-        try {
-            final PrintStream out = open(parentDir);
-            out.println("package " + pkg + ";");
-            out.println();
-            out.print("public " + (isFinal() ? "final" : "") + " class " + className);
-            if(genericArgs != null) out.print("<" + genericArgs + ">");
-            if (superClass != null) out.print(" extends " + superClass);
-            out.println(" {");
-            writeBeginning(out);
-            writeBody(out);
-            writeEnd(out);
-            out.println("}");
-            close(out);
-        } catch (final IOException e) { throw new RuntimeException(e); }
-    }
-
-    public void writeBeginning(final PrintStream out) {
-
-    }
-
-    public void writeBody(final PrintStream out) {
-
-    }
-
-    public void writeEnd(final PrintStream out) {
-
-    }
-
-    protected boolean isFinal(){ return false; }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/JObjCClassClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-import java.util.HashSet;
-import java.util.Set;
-
-import com.apple.internal.jobjc.generator.ClassGenerator;
-import com.apple.internal.jobjc.generator.FunctionGenerator;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Method;
-import com.apple.jobjc.JObjCRuntime;
-import com.apple.jobjc.Invoke.MsgSend;
-
-public class JObjCClassClassFile extends AbstractObjCClassFile {
-    public JObjCClassClassFile(final Clazz clazz) {
-        super(clazz, clazz.name + "Class", clazz.superClass != null ? clazz.superClass.getFullPath() + "Class" : ClassGenerator.JOBJC_PACKAGE + ".NSClass<" + clazz.name + ">");
-    }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        out.format(
-                "\tpublic %1$s(%2$s runtime) {\n" +
-                "\t\tsuper(runtime);\n" +
-                "\t}\n",
-                className, JObjCRuntime.class.getCanonicalName());
-        out.format(
-                "\tpublic %1$s(String name, %2$s runtime) {\n" +
-                "\t\tsuper(name, runtime);\n" +
-                "\t}\n",
-                className, JObjCRuntime.class.getCanonicalName());
-        out.format(
-                "\tpublic %1$s(long ptr, %2$s runtime) {\n" +
-                "\t\tsuper(ptr, runtime);\n" +
-                "\t}\n",
-                className, JObjCRuntime.class.getCanonicalName());
-    }
-
-    @Override public void writeBody(final PrintStream out) {
-        Set<String> written = new HashSet<String>();
-        for(final Method method : this.clazz.classMethods)
-            if(written.add(method.name))
-                FunctionGenerator.writeOutFunction(out, MsgSend.class, method, "this");
-            else
-                System.out.format("Duplicate method: %1$s %2$s -%3$s\n", clazz.parent.name, className, method.name);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/JObjCClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-import com.apple.internal.jobjc.generator.FunctionGenerator;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Method;
-import com.apple.jobjc.JObjCRuntime;
-import com.apple.jobjc.NativeObjectLifecycleManager;
-import com.apple.jobjc.Invoke.MsgSend;
-
-public class JObjCClassFile extends AbstractObjCClassFile {
-    public JObjCClassFile(final Clazz clazz) {
-        super(clazz, clazz.name,
-                clazz.superClass == null ? "com.apple.jobjc.ID"
-                        : clazz.superClass.getFullPath());
-    }
-
-    private static Map<String, NativeObjectLifecycleManager> nolmForClass =
-        new TreeMap<String, NativeObjectLifecycleManager>();
-    static{
-        nolmForClass.put("NSAutoreleasePool", NativeObjectLifecycleManager.Nothing.INST);
-    }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        out.format("\tpublic %1$s(final long objPtr, final %2$s runtime) {\n" +
-                "\t\tsuper(objPtr, runtime);\n" +
-                "\t}\n",
-            className, JObjCRuntime.class.getCanonicalName());
-
-        out.format("\tpublic %1$s(final %1$s obj, final %2$s runtime) {\n" +
-                "\t\tsuper(obj, runtime);\n" +
-                "\t}\n",
-            className, JObjCRuntime.class.getCanonicalName());
-
-        NativeObjectLifecycleManager nolm = nolmForClass.get(clazz.name);
-        if(nolm != null)
-            out.format("\t@Override\n"+
-                    "\tprotected %1$s getNativeObjectLifecycleManager() {\n" +
-                    "\t\treturn %2$s.INST;\n" +
-                    "\t}\n",
-                    NativeObjectLifecycleManager.class.getCanonicalName(), nolm.getClass().getCanonicalName());
-    }
-
-    @Override public void writeBody(final PrintStream out) {
-        Set<String> written = new HashSet<String>();
-        for(final Method method : this.clazz.instanceMethods)
-            if(written.add(method.name))
-                FunctionGenerator.writeOutFunction(out, MsgSend.class, method, "this");
-            else
-                System.out.format("Duplicate method: %1$s %2$s -%3$s\n", clazz.parent.name, className, method.name);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/MixedPrimitiveCoderClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-import java.util.Collection;
-
-import com.apple.internal.jobjc.generator.ClassGenerator;
-import com.apple.internal.jobjc.generator.model.coders.ComplexCoderDescriptor.MixedEncodingDescriptor;
-import com.apple.jobjc.PrimitiveCoder;
-
-public class MixedPrimitiveCoderClassFile extends GeneratedClassFile {
-    private static final String MULTI_CODER_CLASSNAME = "MixedPrimitiveCoder";
-    public static final String FULL_MULTI_CODER_CLASSNAME = ClassGenerator.JOBJC_PACKAGE + "." + MULTI_CODER_CLASSNAME;
-
-    final Collection<MixedEncodingDescriptor> coderDescs;
-
-    public MixedPrimitiveCoderClassFile(final Collection<MixedEncodingDescriptor> coderDescs) {
-        super(ClassGenerator.JOBJC_PACKAGE, MULTI_CODER_CLASSNAME, "java.lang.Object");
-        this.coderDescs = coderDescs;
-    }
-
-    @Override
-    public void writeBody(final PrintStream out) {
-        for (final MixedEncodingDescriptor desc : coderDescs) {
-            out.println("\tpublic static final " + PrimitiveCoder.class.getCanonicalName() + " " + desc.getMixedName() + " = " + desc.getDefinition() + ";");
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/OpaqueClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-
-import com.apple.internal.jobjc.generator.model.Opaque;
-import com.apple.jobjc.Pointer;
-
-public class OpaqueClassFile extends GeneratedClassFile {
-    final Opaque opaque;
-
-    public OpaqueClassFile(final Opaque opaque) {
-        super(opaque.parent.pkg, opaque.type.getJType().getJavaClassName(), com.apple.jobjc.Opaque.class.getCanonicalName());
-        this.opaque = opaque;
-    }
-
-    @Override public void writeBeginning(PrintStream out){
-        out.println("\t// " + opaque.type);
-        out.println("\t// " + opaque.type.getJType());
-        out.println("");
-        out.println("\tpublic " + className + "(" + Pointer.class.getName() + "<?> ptr){");
-        out.println("\t\tsuper(ptr);");
-        out.println("\t}");
-        out.println("");
-        out.println("\tpublic " + className + "(long ptr){");
-        out.println("\t\tsuper(ptr);");
-        out.println("\t}");
-    }
-
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/OutputFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.*;
-
-public abstract class OutputFile {
-    final String pkg;
-    final String fileName;
-
-    public OutputFile(final String pkg, final String filename) {
-        this.pkg = pkg;
-        this.fileName = filename;
-    }
-
-    public PrintStream open(final File parentDir) throws IOException {
-        final File pkgDir = new File(parentDir, pkg.replace('.', '/'));
-        pkgDir.mkdirs();
-        final File classFile = new File(pkgDir, fileName);
-        classFile.createNewFile();
-        return new PrintStream(classFile);
-    }
-
-    public void close(final PrintStream out) {
-        out.close();
-    }
-
-    public abstract void write(final File parentDir);
-
-    public boolean isClass(final Class<?> clazz) {
-        final String pkgName = clazz.getPackage().getName();
-        if (!pkgName.equals(pkg)) return false;
-
-        return fileName.contains(clazz.getSimpleName());
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/RootJObjCClass.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-import java.util.List;
-
-import com.apple.internal.jobjc.generator.ClassGenerator;
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.utils.JavaLang;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLCtor;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLField;
-import com.apple.internal.jobjc.generator.utils.JavaLang.JLMethod;
-import com.apple.jobjc.JObjCRuntime;
-
-public class RootJObjCClass extends GeneratedClassFile {
-    private static final String JOBJC_CLASSNAME = "JObjC";
-    public static final String FULL_JOBJC_CLASSNAME = ClassGenerator.JOBJC_PACKAGE + "." + JOBJC_CLASSNAME;
-    public static final String JOBJC_RUNTIME_INST = FULL_JOBJC_CLASSNAME + ".getInstance()";
-    public static final String JOBJC_RUNTIME_INST_R = FULL_JOBJC_CLASSNAME + ".getInstance(getRuntime())";
-
-    public static final String runtimeFrameworkInst(String fwname){
-        return JOBJC_RUNTIME_INST + "." + fwname + "()";
-    }
-
-    public static final String runtimeFrameworkInstR(String fwname){
-        return JOBJC_RUNTIME_INST_R + "." + fwname + "()";
-    }
-
-    final List<Framework> frameworks;
-
-    public RootJObjCClass(final List<Framework> frameworks) {
-        super(ClassGenerator.JOBJC_PACKAGE, JOBJC_CLASSNAME, "java.lang.Object");
-        this.frameworks = frameworks;
-    }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
-        out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));
-
-        JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
-        getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
-        getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
-        getInstR.body.add("return instance;");
-        out.print(getInstR);
-
-        JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
-        getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
-        out.print(getInst);
-
-        JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
-        ctor.body.add("this.runtime = runtime;");
-        for (final Framework f : frameworks)
-            ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
-        out.print(ctor);
-    }
-
-    @Override public void writeBody(final PrintStream out) {
-        for (final Framework f : frameworks)
-            out.println(JavaLang.makeSingleton("_" + f.name, f.name, f.pkg + "." + f.name + "Framework", "runtime"));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/StructClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.classes;
-
-import java.io.PrintStream;
-
-import com.apple.internal.jobjc.generator.model.Struct;
-import com.apple.internal.jobjc.generator.model.Struct.Field;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor;
-import com.apple.internal.jobjc.generator.model.types.JType;
-import com.apple.internal.jobjc.generator.model.types.JType.JStruct;
-import com.apple.internal.jobjc.generator.model.types.NType.NBitfield;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.internal.jobjc.generator.utils.Fp.Map1;
-import com.apple.jobjc.JObjCRuntime;
-import com.apple.jobjc.Coder.StructCoder;
-
-public class StructClassFile extends GeneratedClassFile {
-    final Struct struct;
-
-    public StructClassFile(final Struct struct) {
-        super(struct.parent.pkg, struct.name, com.apple.jobjc.Struct.class.getName());
-        this.struct = struct;
-    }
-
-    @Override public boolean isFinal(){ return true; }
-
-    @Override public void writeBeginning(final PrintStream out) {
-        out.println();
-        out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
-                + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
-        out.println();
-        out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
-        out.format("\t@Override public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
-        out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
-                (struct.fields.size() > 0 ? ",\n\t\t" : ""),
-                Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
-                    public String apply(Field a) {
-                        return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
-                    }}, struct.fields)));
-        out.format("\t\t@Override protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
-                struct.name,
-                JObjCRuntime.class.getCanonicalName());
-        out.println("\t};");
-        out.println();
-        out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
-        out.println("\t\tsuper(runtime, SIZEOF);");
-        out.println("\t}");
-        out.println();
-        out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
-        out.println("\t\tsuper(runtime, buffer, SIZEOF);");
-        out.println("\t}");
-    }
-
-    @Override public void writeBody(final PrintStream out) {
-        for(Struct.Field field : struct.fields){
-            if(field.type.type64 instanceof NStruct && field.type.type32 instanceof NStruct)
-                writeStructField(field, out);
-            else
-                writeField(field, out);
-        }
-    }
-
-    private void writeField(final Struct.Field field, final PrintStream out){
-        if(field.type.type32 instanceof NBitfield){
-            out.format("\t// Skipping bitfield '%1$s'\n", field.name);
-            return;
-        }
-        String privName = field.name + "__";
-        String offsetName = field.name.toUpperCase() + "_OFFSET";
-        JType jtype = field.type.getJType();
-        String retType = jtype.getJavaReturnTypeName();
-        CoderDescriptor cdesc = jtype.getCoderDescriptor();
-        out.println();
-        out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
-                + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");
-
-        out.println("\t//" + cdesc.getClass().toString());
-        out.println("\tpublic " + retType + " " + getterName(field) + "(){");
-        out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
-        out.println(jtype.createReturn());
-        out.println("\t}");
-        out.println();
-        out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
-        out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
-        out.println("\t}");
-    }
-
-    private void writeStructField(final Struct.Field field, final PrintStream out){
-        if(field.type.getJType() == null || !(field.type.getJType() instanceof JStruct)){
-            out.println("\t// Found bad JavaType (" + field.type.getJType() + ") for field (" + field.name + ") of type (" + field.type + ")");
-            return;
-        }
-        String privName = field.name + "__";
-        String offsetName = field.name.toUpperCase() + "_OFFSET";
-        JStruct jstype = (JStruct) field.type.getJType();
-        String retTypeName = jstype.getJavaReturnTypeName();
-        out.println();
-        out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName() + ".IS64"
-                + " ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");
-
-        out.println("\tprivate " + retTypeName + " " + privName + " = null;");
-        out.println("\tpublic " + retTypeName + " " + getterName(field) + "(){");
-        out.println("\t\tif(null==" + privName + "){");
-        out.println("\t\t\tthis.raw.position(" + offsetName + ");");
-        out.println("\t\t\t" + privName + " = " + RootJObjCClass.runtimeFrameworkInstR(struct.parent.name) + ".make" + jstype.struct.name + "(this.raw.slice());");
-        out.println("\t\t}");
-        out.println("\t\treturn " + privName + ";");
-        out.println("\t}");
-    }
-
-    private String getterName(Struct.Field field) {
-        if(com.apple.internal.jobjc.generator.RestrictedKeywords.isRestricted(field.name))
-            return field.name + field.type.getJType().getAppendableDescription();
-        return field.name;
-    }
-
-    private String setterName(String name) {
-        return "set" + name.substring(0, 1).toUpperCase() + name.substring(1);
-    }
-
-    @Override public void writeEnd(final PrintStream out) {
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Arg.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-public class Arg extends ElementWType<Function>{
-    public String javaName;
-
-    public Arg(final Node node, final Function parent) {
-        super(node, parent);
-        javaName = name;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/CFType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.List;
-
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.classes.CFTypeClassFile;
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-
-public class CFType extends TypeElement<Framework> implements OutputFileGenerator {
-    public final String getTypeIdFunc;
-    public final String tollfree;
-
-    public CFType(final Node node, final Framework parent) {
-        super(node, getAttr(node, "name"), parent);
-        getTypeIdFunc = getAttr(node, "gettypeid_func");
-        tollfree = getAttr(node, "tollfree");
-    }
-
-    public void generateClasses(final List<OutputFile> generatedClassFiles) {
-        generatedClassFiles.add(new CFTypeClassFile(this));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Category.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.List;
-
-import com.apple.internal.jobjc.generator.classes.CategoryClassClassFile;
-import com.apple.internal.jobjc.generator.classes.CategoryClassFile;
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-
-public class Category implements OutputFileGenerator{
-    public final Clazz category;
-
-    public Category(Clazz fromClass, Clazz target) {
-        this.category = new Clazz(fromClass.name + "Category", fromClass.classMethods, fromClass.instanceMethods, target, fromClass.parent);
-    }
-
-    public void generateClasses(List<OutputFile> generatedClassFiles) {
-        generatedClassFiles.add(new CategoryClassFile(this));
-        generatedClassFiles.add(new CategoryClassClassFile(this));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Clazz.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.apple.internal.jobjc.generator.RestrictedKeywords;
-import com.apple.internal.jobjc.generator.classes.JObjCClassClassFile;
-import com.apple.internal.jobjc.generator.classes.JObjCClassFile;
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-import com.apple.jobjc.MacOSXFramework;
-import com.apple.jobjc.SuperClassExtractor;
-import com.apple.jobjc.UnsafeRuntimeAccess;
-import com.apple.jobjc.NSClass.NSClassNotFoundException;
-import com.apple.jobjc.SEL;
-
-public class Clazz extends Element<Framework> implements OutputFileGenerator {
-    private final Map<String, Method> instanceMethodsByName = new HashMap<String, Method>();
-    private final Map<String, Method> classMethodsByName = new HashMap<String, Method>();
-
-    public final List<Method> classMethods;
-    public final List<Method> instanceMethods;
-
-    public final List<Clazz> subClassers = new ArrayList<Clazz>(0);
-    public Clazz superClass;
-
-    public Clazz(String name, List<Method> classMethods, List<Method> instanceMethods, Clazz superClass, Framework parent){
-        super(name, parent);
-        this.classMethods = classMethods;
-        this.instanceMethods = instanceMethods;
-        this.superClass = superClass;
-    }
-
-    public Clazz(final Node classNode, final Framework parent) {
-        super(classNode, parent);
-        this.classMethods = new ArrayList<Method>();
-        this.instanceMethods = new ArrayList<Method>();
-
-        final NodeList methodNodes = classNode.getChildNodes();
-        for (int i = 0; i < methodNodes.getLength(); i++) {
-            final Node node = methodNodes.item(i);
-            if (!"method".equals(node.getLocalName())) continue;
-
-            final String selName = Element.getAttr(node, "selector");
-            if(selName == null || !SEL.validName(selName)){
-                System.err.format("Warning: Discarding method %1$s:%2$s:%3$s"
-                        + " -- Invalid selector name. Verify.\n",
-                        parent.name, name, selName);
-                continue;
-            }
-
-            final Method method = new Method(node, parent);
-            if (method.isClassMethod) {
-                classMethods.add(method);
-            } else {
-                instanceMethods.add(method);
-            }
-        }
-    }
-
-    public String getPackage() {
-        return parent.pkg;
-    }
-
-    public String getFullPath(){
-        return parent.pkg + "." + name;
-    }
-
-    @Override
-    public String toString() {
-        return super.toString() + " " + classMethods + " " + instanceMethods;
-    }
-
-    public boolean doesActuallyExist(){
-        try{
-            UnsafeRuntimeAccess.getNSClass(parent.load(), name);
-        }catch(NSClassNotFoundException x){
-            return false;
-        }
-        return true;
-    }
-
-    void resolveSuperClass(final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
-        superClass = SuperClassExtractor.getSuperClassFor(name, nativeFramework, allClasses);
-    }
-
-    public void disambiguateMethods() {
-        disambiguateMethods(instanceMethods, instanceMethodsByName);
-        disambiguateMethods(classMethods, classMethodsByName);
-    }
-
-    private void disambiguateMethods(final List<Method> methods, final Map<String, Method> methodMap) {
-        final Set<String> existingMethodNames = RestrictedKeywords.getNewRestrictedSet();
-        for (final Method method : methods) {
-            method.disambiguateNameAndArgs(this, existingMethodNames);
-            methodMap.put(method.javaName, method);
-        }
-    }
-
-    public void generateClasses(final List<OutputFile> generatedClassFiles) {
-        generatedClassFiles.add(new JObjCClassClassFile(this));
-        generatedClassFiles.add(new JObjCClassFile(this));
-    }
-
-    Method getParentMethodMatchingName(final String methodName) {
-        if(superClass == null) return null;
-        Method m = superClass.getMethodNamed(methodName);
-        if(m != null) return m;
-        return superClass.getParentMethodMatchingName(methodName);
-    }
-
-    private Method getMethodNamed(final String methodName) {
-        final Method instanceMethod = instanceMethodsByName.get(methodName);
-        if (instanceMethod != null) return instanceMethod;
-
-        final Method classMethod = classMethodsByName.get(methodName);
-        if (classMethod != null) return classMethod;
-
-        return null;
-    }
-
-    int compareTo(Clazz o) {
-      return toString().compareTo(o.toString());
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Constant.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-public class Constant extends ElementWType<Framework> {
-    public Constant(final Node node, final Framework parent) {
-        super(node, parent);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Element.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.apple.internal.jobjc.generator.model.types.Type;
-import com.apple.internal.jobjc.generator.utils.ObjectInspector;
-
-/**
- * Subclasses must implement ctor(Node, P)
- */
-public class Element <P extends Element<?>> implements Comparable<Element<?>>{
-    public final String name;
-    public final P parent;
-
-    public Element(final String name, final P parent) {
-        this.name = Type.cleanName(name);
-        this.parent = parent;
-    }
-
-    public Element(final Node node, final P parent) {
-        this(getAttr(node, "name"), parent);
-    }
-
-    public static String getAttr(final Node node, final String key) {
-        final NamedNodeMap attrs = node.getAttributes();
-        if (attrs == null) return null;
-        final Node name = attrs.getNamedItem(key);
-        if (name == null) return null;
-        return name.getNodeValue();
-    }
-
-    static <P extends Element<?>, T extends Element<P>> List<T> getNodesFor(final Node parentNode, final String selection, final Class<T> clazz, final P parent) {
-        Constructor<T> ctor;
-        try {
-            ctor = clazz.getConstructor(new Class[] { Node.class, parent.getClass() });
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-        final NodeList childNodes = parentNode.getChildNodes();
-        final List<T> nodes = new ArrayList<T>();
-        for (int i = 0; i < childNodes.getLength(); i++) {
-            final Node node = childNodes.item(i);
-            if (!selection.equals(node.getLocalName())) continue;
-
-            T obj;
-            try {
-                obj = ctor.newInstance(new Object[] { node, parent });
-            } catch (InvocationTargetException e) {
-                throw new RuntimeException(e.getCause());
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-            nodes.add(obj);
-        }
-
-        return nodes;
-    }
-
-    @Override public String toString() {
-        return name;
-    }
-
-    public String reflectOnMySelf() {
-        return ObjectInspector.inspect(this);
-    }
-
-    public int compareTo(Element<?> o) {
-        return name.compareTo(o.name);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/ElementWType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import com.apple.internal.jobjc.generator.model.types.NType;
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.model.types.Type;
-import com.apple.internal.jobjc.generator.utils.NTypeParser;
-
-/**
- * An ElementWType has a type but does not necessarily represent a type. Examples are constants, enums, arguments, return values.
- */
-public class ElementWType<P extends Element<?>> extends Element<P> {
-    public final Type type;
-
-    public ElementWType(final String name, final Type t, final P parent) {
-        super(name, parent);
-        this.type = t;
-    }
-
-    public ElementWType(final Node node, final Type t, final P parent) {
-        super(node, parent);
-        this.type = t;
-    }
-
-    public ElementWType(final Node node, final String declType, final P parent) {
-        super(node, parent);
-        final String type32 = getAttr(node, "type");
-        final String type64 = getAttr(node, "type64");
-        this.type = Type.getType(declType,
-                        type32 == null ? NType.NUnknown.inst() : NTypeParser.parseFrom(type32),
-                        type64 == null ? null : NTypeParser.parseFrom(type64));
-    }
-
-    public ElementWType(final Node node, final P parent){
-        this(node, getAttr(node, "declared_type"), parent);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Framework.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-import com.apple.internal.jobjc.generator.ClassGenerator;
-import com.apple.internal.jobjc.generator.Utils;
-import com.apple.internal.jobjc.generator.classes.FrameworkClassFile;
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.internal.jobjc.generator.utils.Fp.Map1;
-import com.apple.jobjc.MacOSXFramework;
-import com.apple.jobjc.UnsafeRuntimeAccess;
-
-public class Framework extends Element<Element<?>> implements OutputFileGenerator {
-    public final String path;
-    public final String pkg;
-    public final List<File> binaries;
-    public MacOSXFramework nativeFramework;
-
-    public MacOSXFramework load(){
-        if(nativeFramework == null){
-            String[] bins = new String[binaries.size()];
-            for(int i = 0; i < binaries.size(); ++i)
-                bins[i] = Utils.getCanonicalPath(binaries.get(i));
-            nativeFramework = UnsafeRuntimeAccess.getFramework(bins);
-        }
-        return nativeFramework;
-    }
-
-    public File getMainFrameworkBinary(){ return binaries.get(0); }
-
-    final Node rootNode;
-
-    public Set<Clazz> classes;
-    public List<Struct> structs;
-    public List<CFType> cfTypes;
-    public List<Opaque> opaques;
-    public List<Constant> constants;
-    public List<StringConstant> stringConstants;
-    public List<NativeEnum> enums;
-    public List<Function> functions;
-    public List<FunctionAlias> functionAliases;
-    public List<InformalProtocol> informalProtocols;
-    public List<Protocol> protocols;
-    public List<Category> categories;
-    public List<FrameworkDependency> dependencies;
-
-    public static class FrameworkDependency extends Element<Framework>{
-        final String path;
-        public Framework object = null;
-
-        public FrameworkDependency(final Node node, final Framework parent) {
-            super(getAttr(node, "path").replaceFirst("^.*/([^/]+)\\.framework$", "$1"), parent);
-            this.path = getAttr(node, "path");
-        }
-    }
-
-    public static final XPath XPATH = XPathFactory.newInstance().newXPath();
-    public Framework(final String name, final File bsFile) {
-        super(name, null);
-        try {
-            final File pathf = bsFile.getCanonicalFile().getParentFile().getParentFile().getParentFile();
-            path = pathf.getParentFile().getParentFile().getCanonicalPath();
-        } catch (IOException x) {
-            throw new RuntimeException(x);
-        }
-        binaries = findBinaries(path, name);
-
-        pkg = ClassGenerator.JOBJC_PACKAGE + "." + name.toLowerCase();
-        try {
-            rootNode = (Node)XPATH.evaluate("signatures", new InputSource(bsFile.getAbsolutePath()), XPathConstants.NODE);
-        } catch (final XPathExpressionException e) { throw new RuntimeException(e); }
-        protocols = new ArrayList<Protocol>();
-        categories = new ArrayList<Category>();
-    }
-
-    private static List<File> findBinaries(final String rootPath, final String name){
-        List<File> bins = new ArrayList<File>(2);
-
-        File mainBin = new File(rootPath, name);
-        if(mainBin.exists()) bins.add(mainBin);
-
-        File bsBin = new File(rootPath, "Resources/BridgeSupport/" + name + ".dylib");
-        if(bsBin.exists()) bins.add(bsBin);
-
-        return bins;
-    }
-
-    public void parseDependencies(final Collection<Framework> frameworks) {
-        // Parse
-        dependencies = getNodesFor(rootNode, "depends_on", FrameworkDependency.class, this);
-        // Resolve
-        for(final FrameworkDependency dep : dependencies)
-            dep.object = Fp.find(new Map1<Framework,Boolean>(){
-                public Boolean apply(Framework f) {
-                    return f.path.equals(dep.path);
-                }}, frameworks);
-    }
-
-    public void parseStructs() {
-        structs = getNodesFor(rootNode, "struct", Struct.class, this);
-
-        // HACK BS bug #6100313
-        if(Utils.isSnowLeopard && name.equals("IOBluetooth"))
-            structs.remove(getStructByName("BluetoothHCIRequestNotificationInfo"));
-
-        // GLIFunctionDispatch is frequently out of sync in BS / system
-        if(name.equals("OpenGL"))
-            structs.remove(getStructByName("GLIFunctionDispatch"));
-    }
-
-    public void parseCFTypes() {
-        cfTypes = getNodesFor(rootNode, "cftype", CFType.class, this);
-    }
-
-    public void parseOpaques() {
-        opaques = getNodesFor(rootNode, "opaque", Opaque.class, this);
-    }
-
-    public void parseConstants() {
-        constants = getNodesFor(rootNode, "constant", Constant.class, this);
-        stringConstants = getNodesFor(rootNode, "string_constant", StringConstant.class, this);
-        enums = getNodesFor(rootNode, "enum", NativeEnum.class, this);
-    }
-
-    public void parseFunctions() {
-        functions = getNodesFor(rootNode, "function", Function.class, this);
-        functionAliases = getNodesFor(rootNode, "function_alias", FunctionAlias.class, this);
-    }
-
-    public void parseClasses() {
-        classes = new HashSet<Clazz>(getNodesFor(rootNode, "class", Clazz.class, this));
-        classes = Fp.filterSet(new Map1<Clazz,Boolean>(){
-            public Boolean apply(Clazz a) {
-                if(a.doesActuallyExist())
-                    return true;
-                else{
-                    System.out.println("Could not find class " + name + ":" + a.name + " in runtime. Discarding.");
-                    return false;
-                }
-            }}, classes);
-        informalProtocols = getNodesFor(rootNode, "informal_protocol", InformalProtocol.class, this);
-    }
-
-    public void resolveSuperClasses(final Map<String, Clazz> allClasses) throws Throwable {
-        load();
-        for (final Clazz clazz : classes)
-            clazz.resolveSuperClass(nativeFramework, allClasses);
-    }
-
-    public void generateClasses(final List<OutputFile> generatedClassFiles) {
-        generatedClassFiles.add(new FrameworkClassFile(this));
-
-        final List<List<OutputFileGenerator>> generatorLists =
-                  Utils.list(new ArrayList<Clazz>(classes), structs, cfTypes, opaques, categories);
-        for (final List<OutputFileGenerator> generators : generatorLists) {
-            for (final OutputFileGenerator generator : generators)
-                generator.generateClasses(generatedClassFiles);
-        }
-    }
-
-    @Override public String toString() { return reflectOnMySelf(); }
-
-    public Struct getStructByName(final String stname) {
-        return Fp.find(new Fp.Map1<Struct,Boolean>(){
-            public Boolean apply(Struct a) {
-                return stname.equals(a.name);
-            }}, structs);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Function.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.*;
-
-import org.w3c.dom.*;
-
-import com.apple.internal.jobjc.generator.RestrictedKeywords;
-
-public class Function extends Element<Framework> {
-    public final boolean variadic;
-    public final List<Arg> args;
-    public final ReturnValue returnValue;
-
-    public Function(final Node node, final Framework parent) {
-        this(node, getAttr(node, "name"), parent);
-    }
-
-    public Function(final Node node, final String name, final Framework parent) {
-        super(name, parent);
-
-        this.variadic = "true".equals(getAttr(node, "variadic"));
-        this.args = new ArrayList<Arg>();
-
-        ReturnValue returnValue = null;
-
-        final NodeList children = node.getChildNodes();
-        for (int i = 0; i < children.getLength(); i++) {
-            final Node child = children.item(i);
-            final String childName = child.getLocalName();
-
-            if ("retval".equals(childName)) {
-                returnValue = new ReturnValue(child, this);
-            }
-
-            if ("arg".equals(childName)) {
-                final Arg arg = new Arg(child, this);
-                if (arg.name == null || "".equals(arg.name)) {
-                    arg.javaName = "arg" + i;
-                }
-                args.add(arg);
-            }
-        }
-
-        if (returnValue == null) returnValue = ReturnValue.VOID;
-        this.returnValue = returnValue;
-    }
-
-    public String getJavaName(){ return name; }
-
-    public void disambiguateArgs() {
-        final Set<String> priorArgs = RestrictedKeywords.getNewRestrictedSet();
-        for (int i = 0; i < args.size(); i++) {
-            final Arg arg = args.get(i);
-            if (priorArgs.contains(arg.name)) arg.javaName = arg.javaName + i;
-            priorArgs.add(arg.javaName);
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/FunctionAlias.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-public class FunctionAlias extends Element<Framework> {
-    public FunctionAlias(final Node node, final Framework parent) {
-        super(node, parent);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/InformalProtocol.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-public class InformalProtocol extends Element<Framework> {
-    public InformalProtocol(final Node node, final Framework parent) {
-        super(node, parent);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Method.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.Set;
-import org.w3c.dom.Node;
-import com.apple.jobjc.SEL;
-import com.apple.internal.jobjc.generator.Utils;
-
-public class Method extends Function {
-    public final boolean isClassMethod;
-
-    public String javaName;
-
-    public boolean ignore;
-    public String suggestion;
-
-    public Method(final Node node, final Framework fw) {
-        super(node, getAttr(node, "selector"), fw);
-        this.javaName = SEL.jMethodName(name);
-        this.isClassMethod = "true".equals(getAttr(node, "class_method"));
-        this.ignore = "true".equals(getAttr(node, "ignore"));
-        this.suggestion = getAttr(node, "suggestion");
-    }
-
-    @Override public String getJavaName(){ return javaName; }
-
-    @Override public String toString() {
-        return returnValue + " " + super.toString() + args;
-    }
-
-    public boolean returnTypeEquals(final ReturnValue returnValueIn) {
-        return returnValue.type.getJType().getJavaReturnTypeName().equals(returnValueIn.type.getJType().getJavaReturnTypeName());
-    }
-
-    public void disambiguateNameAndArgs(final Clazz parentClazz, final Set<String> existingMethodNames) {
-        javaName = getDisambiguatedNameFor(parentClazz, javaName, existingMethodNames);
-        disambiguateArgs();
-    }
-
-    private String getDisambiguatedNameFor(final Clazz parentClazz, final String proposedName, final Set<String> existingNames) {
-        // Does this method override a parent class method and change the return type? Example: IOBlueToothSDPUUID length
-        {
-            final Method superClassMethod = parentClazz.getParentMethodMatchingName(proposedName);
-            if (superClassMethod != null && !superClassMethod.returnValue.equals(returnValue)) {
-                final String usingReturnType = createMethodNameAppendingReturnType(proposedName);
-                if(existingNames.add(usingReturnType))
-                    return usingReturnType;
-            }
-        }
-
-        if(existingNames.add(proposedName))
-            return proposedName;
-
-        final String usingReturnType = createMethodNameAppendingReturnType(proposedName);
-        if(existingNames.add(usingReturnType))
-            return usingReturnType;
-
-        throw new RuntimeException("Unable to disambiguate method: " + this);
-    }
-
-    private String createMethodNameAppendingReturnType(final String proposedName) {
-        return proposedName + Utils.capitalize(returnValue.type.getJType().getAppendableDescription().replaceAll(".+\\.", ""));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/NativeEnum.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.Arrays;
-
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.model.types.Type;
-import com.apple.internal.jobjc.generator.model.types.JType.JPrimitive;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.jobjc.JObjCRuntime;
-
-public class NativeEnum extends ElementWType<Framework> {
-    public final String value, value64, le_value, be_value;
-    public boolean ignore;
-    public String suggestion;
-    public NativeEnum(final Node node, final Framework parent) {
-        super(node, typeForEnum(getAttr(node, "name"),
-                getAttr(node, "value"), getAttr(node, "value64"),
-                getAttr(node, "le_value"), getAttr(node, "be_value"),
-                getAttr(node, "ignore")), parent);
-        this.value = getAttr(node, "value");
-        this.value64 = getAttr(node, "value64");
-        this.le_value = getAttr(node, "le_value");
-        this.be_value = getAttr(node, "be_value");
-        String ignoreS = getAttr(node, "ignore");
-        this.ignore = ignoreS == null ? false : Boolean.parseBoolean(ignoreS);
-        this.suggestion = getAttr(node, "suggestion");
-        assert valueToString() != null;
-    }
-
-    private static Type typeForEnum(String name, String value32, String value64, String le_value, String be_value, String ignore){
-        if("true".equals(ignore)) return Type.getType(null, NPrimitive.inst('i'), null);
-
-        NumTest[] tests = new NumTest[]{new IntTest(), new LongTest(), new FloatTest(), new DoubleTest()};
-        for(NumTest t : tests)
-            if(t.confirm(value32, value64, le_value, be_value))
-                return t.getType();
-
-        throw new NumberFormatException(String.format("Failed to parse type for enum: %1$s = 32: %2$s / 64: %3$s / le: %4$s / be: %5$s\n",
-                name, value32, value64, le_value, be_value));
-    }
-
-    public String valueToString(){
-        if(ignore == true) return "0";
-        JPrimitive jprim = (JPrimitive) type.getJType();
-        if(le_value == null && be_value == null){
-            if(value == null && value64 != null)
-                return value64 + jprim.getLiteralSuffix();
-            else if(value != null && value64 == null)
-                return value + jprim.getLiteralSuffix();
-            else
-                return String.format("(%1$s.IS64 ? %2$s%4$s : %3$s%4$s)", JObjCRuntime.class.getName(),
-                        value64, value, jprim.getLiteralSuffix());
-        }
-        else if(value == null && value64 == null){
-            return String.format("(%1$s.IS_BIG_ENDIAN ? %2$s%4$s : %3$s%4$s)",
-                    JObjCRuntime.class.getName(), be_value, le_value, jprim.getLiteralSuffix());
-        }
-
-        throw new RuntimeException("Unable to produce a value for enum " + name);
-    }
-
-    // Used to find the best type to use for the enum.
-
-    static abstract class NumTest{
-        public boolean confirm(String... values){
-            return Fp.all(new Fp.Map1<String,Boolean>(){
-                public Boolean apply(String a) {
-                    try{ return a == null || confirm(a); }
-                    catch(Exception x){ return false; }
-                }},
-                Arrays.asList(values));
-        }
-
-        public abstract boolean confirm(String v);
-        public abstract Type getType();
-    }
-
-    static class IntTest extends NumTest{
-        @Override public boolean confirm(String v) {
-            Integer.parseInt(v);
-            return true;
-        }
-
-        @Override public Type getType() { return Type.getType(null, NPrimitive.inst('i'), null); }
-    }
-
-    static class LongTest extends NumTest{
-        @Override public boolean confirm(String v) {
-            Long.parseLong(v);
-            return true;
-        }
-
-        @Override public Type getType() { return Type.getType(null, NPrimitive.inst('l'), null); }
-    }
-
-    static class FloatTest extends NumTest{
-        @Override public boolean confirm(String v) {
-            return Float.parseFloat(v) == Double.parseDouble(v);
-        }
-
-        @Override public Type getType() { return Type.getType(null, NPrimitive.inst('f'), null); }
-    }
-
-    static class DoubleTest extends NumTest{
-        @Override public boolean confirm(String v) {
-            double d = Double.parseDouble(v);
-            return !Double.isInfinite(d) && !Double.isNaN(d);
-        }
-
-        @Override public Type getType() { return Type.getType(null, NPrimitive.inst('d'), null); }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Opaque.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.List;
-
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.classes.OpaqueClassFile;
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-
-public class Opaque extends TypeElement<Framework> implements OutputFileGenerator {
-    public Opaque(final Node node, final Framework parent) {
-        super(node, getAttr(node, "name"), parent);
-    }
-
-    public void generateClasses(final List<OutputFile> generatedClassFiles) {
-        generatedClassFiles.add(new OpaqueClassFile(this));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/OutputFileGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.List;
-
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-
-public interface OutputFileGenerator {
-    public void generateClasses(final List<OutputFile> generatedClassFiles);
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Protocol.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-public class Protocol {
-
-    public Protocol(final Clazz protocol) {
-
-    }
-
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/ReturnValue.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.model.types.Type;
-
-public class ReturnValue extends ElementWType<Function>{
-    public static ReturnValue VOID = new ReturnValue(Type.VOID);
-
-    public ReturnValue(final Node node, final Function parent) {
-        super(node, parent);
-    }
-
-    public ReturnValue(Type type) {
-        super("return value", type, null); // TODO bad style, the null might lead to trouble
-    }
-
-    @Override public boolean equals(Object o){
-        return o instanceof ReturnValue && type.equals(((ReturnValue)o).type);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/StringConstant.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-public class StringConstant extends Element<Framework> {
-    public final String value;
-
-    public StringConstant(final Node node, final Framework parent) {
-        super(node, parent);
-        this.value = getAttr(node, "value");
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Struct.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import java.util.List;
-
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.classes.OutputFile;
-import com.apple.internal.jobjc.generator.classes.StructClassFile;
-import com.apple.internal.jobjc.generator.model.types.Type;
-import com.apple.internal.jobjc.generator.model.types.NType.NField;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.internal.jobjc.generator.utils.QA;
-import com.apple.internal.jobjc.generator.utils.Fp.Map2;
-
-/**
- * A struct has the following restrictions:
- *
- *    - type32.fields.count == type64.fields.count
- *    - forAll i: type32.field[i].name == type64.field[i].name
- *    - forAll i: type32.field[i].class == type64.field[i].class
- */
-public class Struct extends TypeElement<Framework> implements OutputFileGenerator {
-    public final List<Field> fields;
-    public static class Field{
-        public final String name;
-        public final Type type;
-        public final NField field32, field64;
-        public Field(String name, NField field32, NField field64) {
-            QA.nonNull(name);
-            this.name = name;
-            // TODO <field> really should have a declared_type attr. See if BS patch is possible.
-            this.type = Type.getType(null, field32.type, field64.type);
-            this.field32 = field32;
-            this.field64 = field64;
-        }
-    }
-
-    public Struct(final Node node, final Framework parent) throws Throwable {
-        super(node, getAttr(node, "name"), parent);
-        NStruct nstruct32 = (NStruct) type.type32;
-        NStruct nstruct64 = (NStruct) type.type64;
-        this.fields = Fp.map2(new Map2<NField,NField,Field>(){
-            public Field apply(NField f32, NField f64) {
-                assert f32.name.equals(f64.name);
-                return new Field(f32.name, f32, f64);
-            }
-        }, nstruct32.fields, nstruct64.fields);
-    }
-
-    public void generateClasses(final List<OutputFile> generatedClassFiles) {
-        generatedClassFiles.add(new StructClassFile(this));
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/TypeElement.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model;
-
-import org.w3c.dom.Node;
-
-import com.apple.internal.jobjc.generator.model.types.Type;
-
-/**
- * A TypeElement represents a Type, such as a struct or cftype.
- */
-public abstract class TypeElement<P extends Element<?>> extends ElementWType<P> {
-    public TypeElement(String name, Type type, final P parent) {
-        super(name, type, parent);
-    }
-
-    public TypeElement(final Node node, final String declType, final P parent) {
-        super(node, declType, parent);
-    }
-
-    public TypeElement(final Node node, final P parent) {
-        super(node, parent);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/CoderDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.coders;
-
-import com.apple.internal.jobjc.generator.model.types.JType.JStruct;
-import com.apple.jobjc.Coder;
-import com.apple.jobjc.Coder.IDCoder;
-import com.apple.jobjc.Coder.NSClassCoder;
-import com.apple.jobjc.Coder.PointerCoder;
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-import com.apple.jobjc.Coder.SELCoder;
-import com.apple.jobjc.Coder.UnknownCoder;
-import com.apple.jobjc.Coder.VoidCoder;
-
-public class CoderDescriptor {
-    public static final CoderDescriptor VOID_DESC = new CoderDescriptor(VoidCoder.INST, null, null);
-
-    final Coder coder;
-    private final String coderInstanceName;
-    final String pushName;
-    final String popName;
-
-    public String mismatchMessage(){ return null; }
-
-    public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
-        this.coder = coder;
-        this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
-        if (coderInstanceName == null) throw new NullPointerException();
-
-        this.pushName = pushName;
-        this.popName = popName;
-    }
-
-    public CoderDescriptor(final String pushName, final String popName) {
-        this.coder = null;
-        this.coderInstanceName = null;
-        this.pushName = pushName;
-        this.popName = popName;
-    }
-
-    public CoderDescriptor(final Coder coder) { this(coder, "push", "pop"); }
-    public CoderDescriptor(){ this("push", "pop"); }
-
-    public String getPopStatementFor(final String contextName, final String returnValueType, final String returnValueName, final String transform) {
-        return "final " + returnValueType + " " + returnValueName + " = " + "(" + returnValueType + ") " + (transform == null ? "" : transform)
-        + "(" + getCoderInstanceName() + "." + popName + "(" + contextName + "));";
-    }
-
-    public final String getPushStatementFor(final String contextName, final String argumentName) {
-        return getCoderInstanceName() + "." + pushName + "(" + contextName + ", " + argumentName + ");";
-    }
-
-    public String getPopAddrStatementFor(final String runtime, final String addr, final String returnValueType, final String returnValueName, final String transform) {
-        return "final " + returnValueType + " " + returnValueName + " = " + "(" + returnValueType + ") " + (transform == null ? "" : transform)
-        + "(" + getCoderInstanceName() + "." + popName + "(" + runtime + ", " + addr + "));";
-    }
-
-    public final String getPushAddrStatementFor(final String runtime, final String addr, final String argumentName) {
-        return getCoderInstanceName() + "." + pushName + "(" + runtime + ", " + addr + ", " + argumentName + ");";
-    }
-
-    public String getCoderInstanceName() { return coderInstanceName; }
-    public Coder getCoder() { return coder; }
-    public String getDefaultReturnValue() { return "null"; }
-
-    //
-    // Specialized
-    //
-
-    static public class UnknownCoderDescriptor extends CoderDescriptor {
-        public static final CoderDescriptor UNKNOWN_DESC = new UnknownCoderDescriptor();
-        public UnknownCoderDescriptor() { super(UnknownCoder.INST); }
-    }
-
-    static public class PrimitivePointerCoderDescriptor extends CoderDescriptor {
-        public static final PrimitivePointerCoderDescriptor POINTER_DESC = new PrimitivePointerCoderDescriptor();
-        public PrimitivePointerCoderDescriptor() { super(PrimitivePointerCoder.INST, "push", "popPtr"); }
-    }
-
-    static public class PointerCoderDescriptor extends CoderDescriptor {
-        public static final PointerCoderDescriptor INST = new PointerCoderDescriptor();
-        public PointerCoderDescriptor() { super(PointerCoder.INST); }
-    }
-
-    static public class SELCoderDescriptor extends CoderDescriptor {
-        public static final SELCoderDescriptor INST = new SELCoderDescriptor();
-        public SELCoderDescriptor() { super(SELCoder.INST); }
-    }
-
-    static public class IDCoderDescriptor extends CoderDescriptor {
-        public static final IDCoderDescriptor INST = new IDCoderDescriptor();
-        public IDCoderDescriptor() { super(IDCoder.INST); }
-    }
-
-    static public class NSClassCoderDescriptor extends CoderDescriptor {
-        public static final NSClassCoderDescriptor INST = new NSClassCoderDescriptor();
-        public NSClassCoderDescriptor() { super(NSClassCoder.INST); }
-    }
-
-    static public class StructCoderDescriptor extends CoderDescriptor {
-        public final JStruct jstruct;
-        public StructCoderDescriptor(JStruct jst) { this.jstruct = jst; }
-        @Override public String getCoderInstanceName(){ return jstruct.getJavaTypeName() + ".getStructCoder()"; }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/ComplexCoderDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.coders;
-
-import java.util.HashMap;
-import java.util.TreeSet;
-import java.util.Map;
-import java.util.Set;
-
-import com.apple.internal.jobjc.generator.classes.MixedPrimitiveCoderClassFile;
-import com.apple.internal.jobjc.generator.model.types.NType;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.utils.Fp.Pair;
-import com.apple.jobjc.JObjCRuntime;
-
-/**
- * Used to code two primitives of different 32/64 types.
- */
-public class ComplexCoderDescriptor extends CoderDescriptor {
-    static Map<Pair<NType,NType>, ComplexCoderDescriptor> cache = new HashMap<Pair<NType,NType>, ComplexCoderDescriptor>();
-    static Set<MixedEncodingDescriptor> mixedEncodingDescriptors = new TreeSet<MixedEncodingDescriptor>();
-
-    public static Set<MixedEncodingDescriptor> getMixedEncoders() { return mixedEncodingDescriptors; }
-
-    public static ComplexCoderDescriptor getCoderDescriptorFor(final NType nt32, final NType nt64) {
-        Pair<NType,NType> cacheKey = new Pair(nt32, nt64);
-        if(cache.containsKey(cacheKey)) return cache.get(cacheKey);
-
-        final PrimitiveCoderDescriptor desc32 = PrimitiveCoderDescriptor.getCoderDescriptorFor((NPrimitive) nt32);
-        final PrimitiveCoderDescriptor desc64 = PrimitiveCoderDescriptor.getCoderDescriptorFor((NPrimitive) nt64);
-
-        final ComplexCoderDescriptor newDesc = nt32.equals(nt64) ? new ComplexCoderDescriptor(desc64) : new MixedEncodingDescriptor(desc32, desc64);
-        cache.put(cacheKey, newDesc);
-        if(newDesc instanceof MixedEncodingDescriptor)
-            mixedEncodingDescriptors.add((MixedEncodingDescriptor) newDesc);
-
-        return newDesc;
-    }
-
-    protected final PrimitiveCoderDescriptor desc64;
-
-    public ComplexCoderDescriptor(final PrimitiveCoderDescriptor desc64) {
-        super(desc64.coder, desc64.pushName, desc64.popName);
-        this.desc64 = desc64;
-    }
-
-    public String getName() { return desc64.javaPrimitiveClazz.getName(); }
-    @Override public String getDefaultReturnValue() { return desc64.defaultReturnValue; }
-    public String getJavaObjectClass() { return desc64.javaObjectClazz.getName(); }
-    public String getDefinition() { return get64CoderName(); }
-    public String getCoderAccessor() { return get64CoderName(); }
-    String get64CoderName() { return desc64.getCoderInstanceName(); }
-
-    // ** Subclasses
-    // -------------
-
-    public static class MixedEncodingDescriptor extends ComplexCoderDescriptor implements java.lang.Comparable {
-        protected final PrimitiveCoderDescriptor desc32;
-
-        public MixedEncodingDescriptor(final PrimitiveCoderDescriptor desc32, final PrimitiveCoderDescriptor desc64) {
-            super(desc64);
-            this.desc32 = desc32;
-        }
-
-        @Override public String getDefinition() { return JObjCRuntime.class.getName() + ".IS64 ? " + get64CoderName() + " : " + get32CoderName(); }
-        @Override public String getCoderAccessor() { return MixedPrimitiveCoderClassFile.FULL_MULTI_CODER_CLASSNAME + "." + getMixedName(); }
-        String get32CoderName() { return desc32.getCoderInstanceName(); }
-        @Override public String getCoderInstanceName(){ return getCoderAccessor(); }
-        @Override public String toString() { return getMixedName(); }
-
-        public String getMixedName() {
-            final String coder32Name = getBaseNameOfCoder(desc32.primitiveCoderName);
-            final String coder64Name = getBaseNameOfCoder(desc64.primitiveCoderName);
-            return coder32Name + coder64Name + "Coder";
-        }
-
-        static String getBaseNameOfCoder(final String coderName) { return coderName.substring(0, coderName.indexOf("Coder")); }
-        public int compareTo(Object _o) { MixedEncodingDescriptor o = (MixedEncodingDescriptor)_o; return getMixedName().compareTo(o.getMixedName()); }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/PrimitiveCoderDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.coders;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.jobjc.Coder;
-import com.apple.jobjc.PrimitiveCoder;
-import com.apple.jobjc.PrimitiveCoder.BoolCoder;
-import com.apple.jobjc.PrimitiveCoder.SCharCoder;
-import com.apple.jobjc.PrimitiveCoder.SIntCoder;
-import com.apple.jobjc.PrimitiveCoder.SLongCoder;
-import com.apple.jobjc.PrimitiveCoder.SLongLongCoder;
-import com.apple.jobjc.PrimitiveCoder.SShortCoder;
-import com.apple.jobjc.PrimitiveCoder.UCharCoder;
-import com.apple.jobjc.PrimitiveCoder.UIntCoder;
-import com.apple.jobjc.PrimitiveCoder.ULongCoder;
-import com.apple.jobjc.PrimitiveCoder.ULongLongCoder;
-import com.apple.jobjc.PrimitiveCoder.UShortCoder;
-import com.apple.internal.jobjc.generator.Utils;
-
-public class PrimitiveCoderDescriptor extends CoderDescriptor {
-    static Map<Character, PrimitiveCoderDescriptor> descriptors = new HashMap<Character, PrimitiveCoderDescriptor>();
-
-    public static PrimitiveCoderDescriptor getCoderDescriptorFor(NPrimitive nt) {
-        return getCoderDescriptorFor(nt.type);
-    }
-
-    public static PrimitiveCoderDescriptor getCoderDescriptorFor(char c) {
-        final PrimitiveCoderDescriptor desc = descriptors.get(c);
-        if (desc != null) return desc;
-        final PrimitiveCoderDescriptor newDesc = createCoderDescriptorFor(c);
-        descriptors.put(c, newDesc);
-        return newDesc;
-    }
-
-    public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) {
-        switch(encoding) {
-            case 'B': return new PrimitiveCoderDescriptor(BoolCoder.INST, "false");
-
-            case 'c': return new PrimitiveCoderDescriptor(SCharCoder.INST, "0");
-            case 'C': return new PrimitiveCoderDescriptor(UCharCoder.INST, "0");
-
-            case 's': return new PrimitiveCoderDescriptor(SShortCoder.INST, "0");
-            case 'S': return new PrimitiveCoderDescriptor(UShortCoder.INST, "0");
-
-            case 'i': return new PrimitiveCoderDescriptor(SIntCoder.INST, "0");
-            case 'I': return new PrimitiveCoderDescriptor(UIntCoder.INST, "0");
-
-            case 'l': return new PrimitiveCoderDescriptor(SLongCoder.INST, "0");
-            case 'L': return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long.");
-            case 'q': return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0");
-            case 'Q': return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long.");
-
-            case 'f': return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0");
-            case 'd': return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0");
-            default: throw new RuntimeException("unknown encoding: " + encoding);
-        }
-    }
-
-    public final Class<?> javaPrimitiveClazz;
-    final Class<?> javaObjectClazz;
-    final String defaultReturnValue;
-    final String primitiveCoderName;
-    final String _mismatchMessage;
-
-    public PrimitiveCoderDescriptor(final Coder coder, final String defaultRetVal) {
-        this(coder, defaultRetVal, null);
-    }
-
-    public PrimitiveCoderDescriptor(final Coder coder,
-            final String defaultReturnValue, final String mismatchMessage) {
-        super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
-        this.javaPrimitiveClazz = coder.getJavaPrimitive();
-        this.javaObjectClazz = coder.getJavaClass();
-        this.defaultReturnValue = defaultReturnValue;
-        this.primitiveCoderName = coder.getClass().getSimpleName();
-        this._mismatchMessage = mismatchMessage;
-    }
-
-    @Override public PrimitiveCoder getCoder(){ return (PrimitiveCoder) super.getCoder(); }
-    @Override public String mismatchMessage(){ return _mismatchMessage; }
-    @Override public String getDefaultReturnValue() { return defaultReturnValue; }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/JType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.types;
-
-import com.apple.internal.jobjc.generator.classes.RootJObjCClass;
-import com.apple.internal.jobjc.generator.model.CFType;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Opaque;
-import com.apple.internal.jobjc.generator.model.Struct;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.ComplexCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor.IDCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor.NSClassCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor.PointerCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor.SELCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor.StructCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.coders.CoderDescriptor.UnknownCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.jobjc.ID;
-import com.apple.jobjc.NSClass;
-import com.apple.jobjc.NativeArgumentBuffer;
-import com.apple.jobjc.Pointer;
-import com.apple.jobjc.SEL;
-
-public abstract class JType {
-    public abstract String getJavaTypeName();
-    public String getJavaClassName() { return getJavaTypeName().substring(getJavaTypeName().lastIndexOf('.') + 1); }
-    public String getJavaReturnTypeName() { return getJavaTypeName(); }
-    public String getReturnTypeCast() { return null; }
-    public String getTypeNameAsParam() { return getJavaTypeName(); }
-
-    public abstract CoderDescriptor getCoderDescriptor();
-    public String getDefaultReturnValue() { return "null"; }
-    public String getAppendableDescription() { return getJavaTypeName().substring(getJavaTypeName().lastIndexOf('.') + 1); }
-
-    /**
-     * Used for primitive types (like int) that can't be used as generic arguments. This returns an appropriate Java class (like Integer).
-     */
-    public JType getParameterizableType() { return this; }
-
-    //
-    // Writer ops
-    //
-
-    public String createDeclareBuffer(String contextName) {
-        return "final " + NativeArgumentBuffer.class.getName() + " " + contextName + " = getRuntime().getThreadLocalState();";
-    }
-
-    public String createInit(final String contextName, final String functionIdentifier, final String initWithObj) {
-        return functionIdentifier + ".init(" + contextName + (initWithObj != null ? ", " + initWithObj : "") + ");";
-    }
-
-    public String createInvoke(final String contextName, final String functionIdentifier) {
-        return functionIdentifier + ".invoke(" + contextName + ");";
-    }
-
-    public String createPop(final String contextName) {
-        return getCoderDescriptor().getPopStatementFor(contextName, getJavaTypeName(), "returnValue", null);
-    }
-
-    public String createPopAddr(final String runtime, final String addr) {
-        return getCoderDescriptor().getPopAddrStatementFor(runtime, addr, getJavaTypeName(), "returnValue", null);
-    }
-
-    public String createReturn() {
-        final String preCast = getReturnTypeCast();
-        return "return " + (preCast == null ? "" : "(" + preCast + ")") + "returnValue;";
-    }
-
-    //
-    // Specialized
-    //
-
-    static public class JUnknown extends JType {
-        final Type type;
-        protected JUnknown(final Type type) {
-            this.type = type;
-            TypeCache.inst().getUnknownTypes().add(type);
-        }
-        @Override public String getJavaTypeName() { return "Object /* " + type + " */"; }
-        @Override public String getAppendableDescription() { return "Unknown"; }
-        @Override public CoderDescriptor getCoderDescriptor() { return UnknownCoderDescriptor.UNKNOWN_DESC; }
-    }
-
-    static class JVoid extends JType {
-        public static JVoid INST = new JVoid();
-        @Override public String getJavaTypeName() { return "Void"; }
-        @Override public String getJavaReturnTypeName() { return "void"; }
-        @Override public CoderDescriptor getCoderDescriptor(){ return CoderDescriptor.VOID_DESC; }
-        @Override public String createPop(final String contextName){ return ""; }
-        @Override public String createReturn(){ return ""; }
-    };
-
-    static class JSelector extends JType {
-        public static JSelector INST = new JSelector();
-        @Override public String getJavaTypeName() { return SEL.class.getName(); }
-        @Override public CoderDescriptor getCoderDescriptor() { return SELCoderDescriptor.INST; }
-    };
-
-    static class JCFType extends JType{
-        final CFType cfType;
-        public JCFType(final CFType cfType){ this.cfType = cfType; }
-        @Override public String getJavaTypeName() { return cfType.parent.pkg + "." + cfType.name + "CFType"; }
-        @Override public CoderDescriptor getCoderDescriptor() { return PointerCoderDescriptor.INST; }
-        @Override public String createPop(final String contextName) {
-            return "\t\t" + getCoderDescriptor().getPopStatementFor(contextName, getJavaReturnTypeName(), "returnValue", "new " + getJavaTypeName());
-        }
-    }
-
-    static class JOpaque extends JType{
-        final Opaque opaque;
-        public JOpaque(final Opaque opaque){ this.opaque = opaque; }
-        @Override public String getJavaTypeName() { return opaque.parent.pkg + "." + opaque.name + "Opaque"; }
-        @Override public CoderDescriptor getCoderDescriptor() { return PointerCoderDescriptor.INST; }
-        @Override public String createPop(final String contextName) {
-            return "\t\t" + getCoderDescriptor().getPopStatementFor(contextName, getJavaReturnTypeName(), "returnValue", "new " + getJavaTypeName());
-        }
-    }
-
-    static class JPointer extends JType {
-        static JType VOID_PTR = new JPointer(JVoid.INST);
-
-        final JType subject;
-        protected JPointer(final JType javaType) { this.subject = javaType; }
-
-        @Override public String getJavaTypeName() { return Pointer.class.getName() + "<" + subject.getParameterizableType().getJavaTypeName() + ">"; }
-        @Override public String getAppendableDescription() { return "PointerTo" + subject.getAppendableDescription(); }
-        @Override public CoderDescriptor getCoderDescriptor() { return PointerCoderDescriptor.INST; }
-    }
-
-    static class JObject extends JType {
-        public static JType ID_TYPE = new JType() {
-            @Override public String getJavaTypeName() { return ID.class.getName(); }
-            @Override public String getJavaReturnTypeName() { return "<T extends " + getJavaTypeName() + "> T"; }
-            @Override public String getReturnTypeCast() { return "T"; }
-            @Override public CoderDescriptor getCoderDescriptor() { return IDCoderDescriptor.INST; }
-        };
-
-        final Type type;
-        final Clazz clazz;
-
-        public JObject(final Type type, final Clazz clazz) {
-            this.type = type;
-            this.clazz = clazz;
-        }
-
-        @Override public String getJavaTypeName() { return clazz.getFullPath();}
-        @Override public CoderDescriptor getCoderDescriptor() { return IDCoderDescriptor.INST; }
-    }
-
-    static class JClass extends JType {
-        public static JClass INST = new JClass();
-        @Override public String getJavaTypeName() { return NSClass.class.getName(); }
-        @Override public String getJavaReturnTypeName() { return "<T extends " + super.getJavaReturnTypeName() + "> T"; }
-        @Override public String getTypeNameAsParam() { return super.getTypeNameAsParam(); }
-        @Override public String getReturnTypeCast() { return "T"; }
-        @Override public CoderDescriptor getCoderDescriptor() { return NSClassCoderDescriptor.INST; }
-    };
-
-    public static class JStruct extends JType {
-        public final Struct struct;
-        public JStruct(final Struct struct) { this.struct = struct; }
-
-        @Override public String getJavaTypeName() { return struct.parent.pkg + "." + struct.name; }
-        @Override public String getJavaReturnTypeName() { return getJavaTypeName(); }
-
-        StructCoderDescriptor coderDescriptor = new StructCoderDescriptor(this);
-        @Override public CoderDescriptor getCoderDescriptor() { return coderDescriptor; }
-
-        public String createReturnValue() {
-            return "\t\t" + getJavaReturnTypeName() + " returnValue = " + RootJObjCClass.runtimeFrameworkInstR(struct.parent.name)
-            + ".make" + struct.name + "();";
-        }
-
-        @Override public String createInvoke(final String contextName, final String functionIdentifier) {
-            return createReturnValue() + "\n\t\t" + functionIdentifier + ".invoke(" + contextName + ", returnValue);";
-        }
-
-        @Override public String createPop(final String contextName){ return ""; }
-    }
-
-    public static class JPrimitive extends JType {
-        final Type type;
-        final ComplexCoderDescriptor coderDescriptor;
-        final JType parameterizable;
-
-        public JPrimitive(final Type type, final ComplexCoderDescriptor coderDesc) {
-            this.type = type;
-            this.coderDescriptor = coderDesc;
-
-            this.parameterizable = new JType() {
-                @Override public String getJavaTypeName() { return coderDescriptor.getJavaObjectClass(); }
-                @Override public CoderDescriptor getCoderDescriptor() { throw new RuntimeException(); }
-            };
-        }
-
-        @Override public String getJavaTypeName() { return coderDescriptor.getName(); }
-        @Override public String getDefaultReturnValue() { return coderDescriptor.getDefaultReturnValue(); }
-        @Override public JType getParameterizableType() { return parameterizable; }
-        @Override public CoderDescriptor getCoderDescriptor() { return coderDescriptor; }
-
-        /**
-         * Return the suffix placed on java literals to indicate the type. If none applies, return ' '.
-         */
-        public char getLiteralSuffix() {
-            char t = ((NPrimitive)type.type64).type;
-            switch(t){
-                case 'l': case 'L': case 'f': case 'd': return t;
-                case 'q': case 'Q': return 'L';
-            }
-            return ' ';
-        }
-    }
-
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/NType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.types;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.Utils;
-import com.apple.internal.jobjc.generator.model.coders.PrimitiveCoderDescriptor;
-import com.apple.internal.jobjc.generator.utils.Fp;
-import com.apple.internal.jobjc.generator.utils.NTypePrinter;
-import com.apple.internal.jobjc.generator.utils.QA;
-import com.apple.jobjc.JObjCRuntime.Width;
-
-/**
- * NType (Native Type) bridges the type and type64 attributes in BridgeSupport.
- *
- * For example:
- *
- * <pre>
- *   type="c"                 // BridgeSupport attribute
- *   (NPrimitive type: 'c')   // Java object (in sexp form here, for readability)
- *
- *   type="^v"
- *   (NPointer subject: (NVoid))
- *
- *   type="{foo_t="a"c"b"b8"c"[32^v]}"
- *   (NStruct
- *     name: "foo_t"
- *     fields:
- *       (List<NField>
- *         0: (NField name:"a" type: (NPrimitive type: 'c'))
- *         1: (NField name:"b" type: (NBitfield size: 8))
- *         2: (NField name:"c" type:
- *              (NArray size: 32
- *                      type: (NPointer subject: (NVoid))))))
- * </pre>
- */
-public abstract class NType implements Comparable<NType>{
-    public final Map<Width, Integer> sizeof;
-
-    public NType(Map<Width, Integer> sizeof) {
-        this.sizeof = sizeof;
-    }
-
-    public NType(){
-        this(new HashMap<Width, Integer>());
-    }
-
-    public NType(int sz32, int sz64){
-        this();
-        this.sizeof.put(Width.W32, sz32);
-        this.sizeof.put(Width.W64, sz32);
-    }
-
-    public int sizeof32(){ return sizeof.get(Width.W32); }
-    public int sizeof64(){ return sizeof.get(Width.W64); }
-
-    protected abstract boolean equals2(NType nt);
-
-    private String _toString;
-    @Override public String toString(){ return _toString != null ? _toString : (_toString = NTypePrinter.inst().print(this)); }
-    @Override public boolean equals(Object o) {
-        return o!=null && (o==this || (getClass().isInstance(o)
-                && this.sizeof.equals(((NType) o).sizeof)
-                && equals2((NType) o)));
-    }
-    public int compareTo(NType o){ return toString().compareTo(o.toString()); }
-
-    // ** NType subclasses
-    // -------------------
-
-    public static class NBitfield extends NType{
-        public final int length;
-
-        public NBitfield(int length){
-            super(-1, -1);
-            this.length = length;
-        }
-
-        @Override protected boolean equals2(NType nt) { return ((NBitfield) nt).length == length; }
-        @Override public int hashCode() { return Integer.valueOf(length).hashCode(); }
-    }
-
-    public static class NPrimitive extends NType{
-        public static Collection<Character> CODES = Arrays.asList(
-                'B', 'c', 'C', 's', 'S', 'i', 'I', 'l', 'L', 'q', 'Q', 'f', 'd');
-
-        public final char type;
-
-        protected NPrimitive(char c){
-            super(PrimitiveCoderDescriptor.createCoderDescriptorFor(c).getCoder().sizeof(Width.W32),
-                    PrimitiveCoderDescriptor.createCoderDescriptorFor(c).getCoder().sizeof(Width.W64));
-            type = c;
-        }
-        private static final Map<Character, NPrimitive> cache = new HashMap<Character, NPrimitive>();
-        public static final NPrimitive inst(final char c){
-            if(!cache.containsKey(c)) cache.put(c, new NPrimitive(c));
-            return cache.get(c);
-        }
-
-        @Override protected boolean equals2(NType nt) { return ((NPrimitive)nt).type == type; }
-        @Override public int hashCode() { return Character.valueOf(type).hashCode(); }
-    }
-
-    public static class NVoid extends NType{
-        protected NVoid(){ super(); }
-        private final static NVoid INST = new NVoid();
-        public static NVoid inst() { return INST; }
-
-        @Override protected boolean equals2(NType nt) { return true; }
-    }
-
-    public static class NPointer extends NType{
-        public final NType subject;
-
-        public NPointer(NType subject){
-            super(4, 8);
-            QA.nonNull(subject);
-            this.subject = subject;
-        }
-
-        @Override protected boolean equals2(NType nt) { return ((NPointer)nt).subject.equals(subject); }
-        @Override public int hashCode() { return subject.hashCode(); }
-    }
-
-    public static class NObject extends NType{
-        protected NObject(){ super(4, 8); }
-        private final static NObject INST = new NObject();
-        public static NObject inst() { return INST; }
-
-        @Override protected boolean equals2(NType nt) { return true; }
-    }
-
-    public static class NClass extends NType{
-        protected NClass(){ super(4, 8); }
-        private final static NClass INST = new NClass();
-        public static NClass inst() { return INST; }
-
-        @Override protected boolean equals2(NType nt) { return true; }
-    }
-
-    public static class NSelector extends NType{
-        protected NSelector(){ super(4, 8); }
-        private final static NSelector INST = new NSelector();
-        public static NSelector inst() { return INST; }
-
-        @Override protected boolean equals2(NType nt) { return true;}
-    }
-
-    public static class NField{
-        public final Map<Width,Integer> offset;
-        public final String name;
-        public final NType type;
-
-        public NField(String name, NType type, Map<Width,Integer> offset) {
-            QA.nonNull(name, type, offset);
-            this.name = name;
-            this.type = type;
-            this.offset = offset;
-        }
-
-        public NField(String name, NType type) {
-            this(name, type, new HashMap());
-        }
-
-        public int offset32(){ return offset.get(Width.W32); }
-        public int offset64(){ return offset.get(Width.W64); }
-
-        @Override public int hashCode() { return name.hashCode() + type.hashCode(); }
-        @Override public boolean equals(Object o) {
-            return o!=null && (o==this ||
-                    (o instanceof NField
-                            && this.offset.equals(((NField) o).offset)
-                            && ((NField) o).name.equals(this.name)
-                            && ((NField) o).type.equals(this.type)));
-        }
-    }
-
-    public static class NStruct extends NType{
-        public final String name;
-        public final List<NField> fields;
-
-        public NStruct(String name, List<NField> fields, Map<Width,Integer> sizeof){
-            super(sizeof);
-            QA.nonNull(name, fields);
-            this.name = name;
-            this.fields = fields;
-        }
-
-        public NStruct(String name, List<NField> fields){
-            super();
-            QA.nonNull(name, fields);
-            this.name = name;
-            this.fields = fields;
-        }
-
-        @Override protected boolean equals2(NType nt) {
-            return ((NStruct)nt).name.equals(name) && ((NStruct)nt).fields.equals(fields);
-        }
-
-        @Override public int hashCode() { return name.hashCode() + fields.hashCode(); }
-    }
-
-    // A Union is like a Struct, but the offset of every field is 0.
-    public static class NUnion extends NStruct{
-        public NUnion(String concreteName, List<NField> fields){
-            super(concreteName, fields);
-            assert Fp.all(hasZeroOffsets, fields) : Utils.joinWComma(fields);
-        }
-
-        public NUnion(String name, List<NField> fields, Map<Width,Integer> sizeof) {
-            super(name, fields, sizeof);
-            assert Fp.all(hasZeroOffsets, fields) : Utils.joinWComma(fields);
-        }
-
-        public static final Fp.Map1<NField,Boolean> hasZeroOffsets = new Fp.Map1<NField,Boolean>(){
-            public Boolean apply(NField a) {
-                for(int i : a.offset.values())
-                    if(i != 0)
-                        return false;
-                return true;
-            }};
-        public static final Fp.Map1<NField,NField> zeroOffsets = new Fp.Map1<NField,NField>(){
-            public NField apply(NField a) {
-                Map<Width,Integer> off = new HashMap();
-                for(Width w : a.offset.keySet())
-                    off.put(w, 0);
-                return new NField(a.name, a.type, off);
-            }};
-    }
-
-    public static class NArray extends NType{
-        public final int length;
-        public final NType type;
-
-        public NArray(int length, NType type){
-            QA.nonNull(type);
-            this.length = length;
-            this.type = type;
-        }
-
-        @Override protected boolean equals2(NType nt) { return ((NArray)nt).length == length && ((NArray)nt).type.equals(type); }
-        @Override public int hashCode(){ return Long.valueOf(length).hashCode() + type.hashCode(); }
-    }
-
-    // Seems to be used for callbacks
-    public static class NUnknown extends NType{
-        protected NUnknown(){ super(); }
-        private final static NUnknown INST = new NUnknown();
-        public static NUnknown inst() { return INST; }
-
-        @Override protected boolean equals2(NType nt) { return true;}
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/Type.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.types;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.model.types.NType.NObject;
-import com.apple.internal.jobjc.generator.model.types.NType.NPointer;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.model.types.NType.NVoid;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.model.types.NType.NField;
-import com.apple.internal.jobjc.generator.utils.NTypeMerger;
-import com.apple.internal.jobjc.generator.utils.QA;
-import com.apple.internal.jobjc.generator.utils.Fp.Pair;
-import com.apple.internal.jobjc.generator.utils.NTypeMerger.MergeFailed;
-
-public class Type implements Comparable<Type>{
-    public static Type VOID = Type.getType("void", NVoid.inst(), null);
-    public static Type VOID_PTR = Type.getType("void*", new NPointer(NVoid.inst()), null);
-
-    final public String name;
-    final public NType type32;
-    final public NType type64;
-
-    // HACK BS bug where some types have inconsistent definitions in the metadata,
-    // e.g. (l / i) in some places and just (l) (and thus (l / l)) in others.
-    // This is a mapping from the type name to a Type object with the correct definition.
-    private static final Map<String, Type> exceptions;
-    static {
-        exceptions = new HashMap<String, Type>();
-        exceptions.put("OSStatus", getType("OSStatus", new NPrimitive('l'), new NPrimitive('i'))); // (l / i) vs. (l)
-        exceptions.put("CGFloat", getType("CGFloat", new NPrimitive('f'), new NPrimitive('d'))); // (f / d) vs. (f)
-        exceptions.put("NSRect", getType("NSRect", getNSRectType(), getCGRectType())); // ({{_NSPoint}{_NSSize}} / {{CGPoint}{CGSize}}) vs. ({{_NSPoint}{_NSSize}})
-        exceptions.put("NSPoint", getType("NSPoint", getNSPointType(), getCGPointType())); // (_NSPoint / CGPoint) vs. (_NSPoint)
-        exceptions.put("NSSize", getType("NSSize", getNSSizeType(), getCGSizeType())); // (_NSSize / CGSize) vs. (_NSSize)
-        exceptions.put("NSInteger", getType("NSInteger", new NPrimitive('i'), new NPrimitive('q'))); // (i / q) vs. (i)
-        exceptions.put("NSPointArray", getType("NSPointArray", new NPointer(getNSPointType()), new NPointer(getCGPointType()))); // (^_NSPoint / ^CGPoint) vs. (^_NSPoint)
-        exceptions.put("NSMultibyteGlyphPacking", getType("NSMultibyteGlyphPacking", new NPrimitive('I'), new NPrimitive('Q'))); // (I / Q) vs. (I)
-        exceptions.put("CFTypeRef", getType("CFTypeRef", new NPointer(NVoid.inst()), new NPointer(NVoid.inst()))); // (^v, ^v) vs. (@, @)
-    }
-
-    public static Type getType(final String name, final NType t32, final NType t64){
-        return TypeCache.inst().pingType(new Type(name, t32, t64));
-    }
-
-    private Type(final String name, final NType t32, final NType t64) {
-        QA.nonNull(t32);
-        this.name = cleanName(name);
-        this.type32 = t32;
-        this.type64 = t64 == null || t32.equals(t64) ? t32 : t64;
-    }
-
-    private JType _getJType;
-    public JType getJType() {
-        return _getJType!=null ? _getJType : (_getJType = TypeToJType.inst().getJTypeFor(TypeCache.inst().pingType(this)));
-    }
-
-    private String _toString;
-    @Override public String toString() {
-        return _toString != null ? _toString : (_toString = name + " " + new Pair(type32, type64).toString());
-    }
-
-    @Override public boolean equals(Object o){
-        if(o==null || !(o instanceof Type)) return false;
-        Type t = (Type) o;
-        return QA.bothNullOrEquals(t.name, this.name)
-        && t.type32.equals(this.type32)
-        && t.type64.equals(this.type64);
-    }
-
-    @Override public int hashCode(){
-        return (name == null ? 0 : name.hashCode())
-        + type32.hashCode() + type64.hashCode();
-    }
-
-    public int compareTo(Type o) { return toString().compareTo(o.toString()); }
-
-    public static Type merge(Type a, Type b) throws MergeFailed{
-        if(a!=null && b==null) return a;
-        if(a==null && b!=null) return b;
-        if(QA.bothNullOrEquals(a, b)) return a;
-        if (exceptions.containsKey(a.name)) return exceptions.get(a.name); // HACK BS bug
-        if(a.name != null && b.name != null && !a.name.equals(b.name)){
-            System.out.println("Merging:");
-            System.out.println("\ta.....: " + a.toString());
-            System.out.println("\tb.....: " + b.toString());
-        }
-        final Type merged = new Type(NTypeMerger.inst().mergeName(a.name, b.name),
-                NTypeMerger.inst().merge(a.type32, b.type32),
-                NTypeMerger.inst().merge(a.type64, b.type64));
-        if(a.name != null && b.name != null && !a.name.equals(b.name)){
-            System.out.println("\tmerged: " + merged.toString());
-        }
-        return merged;
-    }
-
-    // HACK BS bug where sometimes the name is declared as "id <A, B..." and sometimes it's "id<A,B..."
-    public static String cleanName(String name){ return name == null ? null : name.replaceAll("\\s+", ""); }
-
-    // HACK BS bug where NSRect has inconsistent definitions in the metadata
-    // Methods return NTypes created according to the correct definitions below:
-    //
-    // {_NSRect="origin"{_NSPoint="x"f"y"f}"size"{_NSSize="width"f"height"f}} *** 32-bit
-    // {CGRect="origin"{CGPoint="x"d"y"d}"size"{CGSize="width"d"height"d}} *** 64-bit
-
-    private static NType getCGRectType() {
-        List<NField> fields = new ArrayList<NField>();
-        fields.add(new NField("origin", getCGPointType()));
-        fields.add(new NField("size", getCGSizeType()));
-        return new NStruct("CGRect", fields);
-    }
-
-    private static NType getNSRectType() {
-        List<NField> fields = new ArrayList<NField>();
-        fields.add(new NField("origin", getNSPointType()));
-        fields.add(new NField("size", getNSSizeType()));
-        return new NStruct("_NSRect", fields);
-    }
-
-    private static NType getCGPointType() {
-        List<NField> fields = new ArrayList<NField>();
-        fields.add(new NField("x", new NPrimitive('d')));
-        fields.add(new NField("y", new NPrimitive('d')));
-        return new NStruct("CGPoint", fields);
-    }
-
-    private static NType getNSPointType() {
-        List<NField> fields = new ArrayList<NField>();
-        fields.add(new NField("x", new NPrimitive('f')));
-        fields.add(new NField("y", new NPrimitive('f')));
-        return new NStruct("_NSPoint", fields);
-    }
-
-    private static NType getCGSizeType() {
-        List<NField> fields = new ArrayList<NField>();
-        fields.add(new NField("width", new NPrimitive('d')));
-        fields.add(new NField("height", new NPrimitive('d')));
-        return new NStruct("CGSize", fields);
-    }
-
-    private static NType getNSSizeType() {
-        List<NField> fields = new ArrayList<NField>();
-        fields.add(new NField("width", new NPrimitive('f')));
-        fields.add(new NField("height", new NPrimitive('f')));
-        return new NStruct("_NSSize", fields);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/TypeCache.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.types;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import com.apple.internal.jobjc.generator.model.CFType;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.Opaque;
-import com.apple.internal.jobjc.generator.model.Struct;
-import com.apple.internal.jobjc.generator.utils.Fp.Pair;
-
-/**
- * Central store for types found in the frameworks.
- */
-public class TypeCache {
-    private static TypeCache INST = new TypeCache();
-    public static TypeCache inst(){ return INST; }
-    protected TypeCache(){}
-
-    /**
-     * When a new Type is discovered, pass it through here to
-     * hit the cache, potentially merge with other types, etc.
-     *
-     * Always do:
-     *
-     *   Type type = TypeCache.inst().pingType(new Type(a,b,c));
-     *
-     * because this should return a better merge for you.
-     */
-    public Type pingType(final Type type_){
-        Type typex = type_;
-
-        // XXX Exception for void* clashes: void* (^{OpaqueCMProfileRef}), void* (^{X}), etc
-        if("void*".equals(typex.name) && getTypeByName(typex.name)!=null)
-            return getTypeByName(typex.name);
-
-        if(typex.name != null)
-            typex = Type.merge(typex, getTypeByName(typex.name));
-        else // type.name == null
-            typex = Type.merge(typex, getTypeByNTypes(new Pair(typex.type32, typex.type64)));
-        putTypeByName(typex.name, typex);
-        putTypeByNTypes(new Pair(typex.type32, typex.type64), typex);
-        return typex;
-    }
-
-    public final Map<String, Type> typesByName = new HashMap<String, Type>();
-    public Type getTypeByName(final String name) { return typesByName.get(Type.cleanName(name)); }
-    public void putTypeByName(String name, Type type) { if(name!=null) typesByName.put(name, type);    }
-
-    public final Map<Pair<NType,NType>, Type> typesByNTypes = new HashMap<Pair<NType,NType>, Type>();
-    public Type getTypeByNTypes(Pair<NType,NType> pair) { return typesByNTypes.get(pair); }
-    public void putTypeByNTypes(Pair<NType,NType> pair, Type type) { if(pair!=null) typesByNTypes.put(pair, type); }
-
-    private final Map<String, Clazz> classesByName = new HashMap<String, Clazz>();
-    private final Map<String, Struct> structsByName = new HashMap<String, Struct>();
-    private final Map<String, CFType> cfTypesByName = new HashMap<String, CFType>();
-    private final Map<String, Opaque> opaquesByName = new HashMap<String, Opaque>();
-
-    public void load(final List<Framework> frameworks) {
-        for (final Framework framework : frameworks) {
-            for (final Clazz obj : framework.classes) {
-                final Clazz previous = classesByName.put(obj.name, obj);
-                if(previous != null)
-                    throw new RuntimeException(String.format(
-                            "TypeCache: naming collision: class name: %1$-10s -- framework1: %2$-10s -- framework2: %3$-10s \n",
-                            obj.name, obj.parent.name, previous.parent.name));
-            }
-
-            for (final Struct obj : framework.structs) {
-                final Struct previous = structsByName.put(obj.name, obj);
-                if(previous != null)
-                    throw new RuntimeException(String.format(
-                            "TypeCache: naming collision: name: %1$-10s -- type1: %2$-10s -- type2: %3$-10s \n",
-                            obj.name, obj.type, previous.type));
-            }
-
-            for (final CFType obj : framework.cfTypes) {
-                final CFType previous = cfTypesByName.put(obj.name, obj);
-                if(previous != null)
-                    throw new RuntimeException(String.format(
-                            "TypeCache: naming collision: name: %1$-10s -- type1: %2$-10s -- type2: %3$-10s \n",
-                            obj.name, obj.type, previous.type));
-            }
-
-            for (final Opaque obj : framework.opaques) {
-                final Opaque previous = opaquesByName.put(obj.name, obj);
-                if(previous != null)
-                    throw new RuntimeException(String.format(
-                            "TypeCache: naming collision: name: %1$-10s -- type1: %2$-10s -- type2: %3$-10s \n",
-                            obj.name, obj.type, previous.type));
-            }
-        }
-    }
-
-    public Collection<Clazz> getAllClasses() { return classesByName.values(); }
-    public Clazz getClassForName(final String className) { return classesByName.get(className); }
-    public Struct getStructForName(final String declaredType) { return structsByName.get(declaredType); }
-    public CFType getCFTypeForName(final String declaredType) { return cfTypesByName.get(declaredType); }
-    public Opaque getOpaqueForName(final String declaredType) { return opaquesByName.get(declaredType); }
-
-    final Set<Type> unknownTypes = new TreeSet<Type>();
-    public Set<Type> getUnknownTypes() { return unknownTypes; }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/types/TypeToJType.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.model.types;
-
-import com.apple.internal.jobjc.generator.model.CFType;
-import com.apple.internal.jobjc.generator.model.Clazz;
-import com.apple.internal.jobjc.generator.model.Opaque;
-import com.apple.internal.jobjc.generator.model.Struct;
-import com.apple.internal.jobjc.generator.model.coders.ComplexCoderDescriptor;
-import com.apple.internal.jobjc.generator.model.types.JType.JCFType;
-import com.apple.internal.jobjc.generator.model.types.JType.JClass;
-import com.apple.internal.jobjc.generator.model.types.JType.JObject;
-import com.apple.internal.jobjc.generator.model.types.JType.JOpaque;
-import com.apple.internal.jobjc.generator.model.types.JType.JPointer;
-import com.apple.internal.jobjc.generator.model.types.JType.JPrimitive;
-import com.apple.internal.jobjc.generator.model.types.JType.JSelector;
-import com.apple.internal.jobjc.generator.model.types.JType.JStruct;
-import com.apple.internal.jobjc.generator.model.types.JType.JUnknown;
-import com.apple.internal.jobjc.generator.model.types.JType.JVoid;
-import com.apple.internal.jobjc.generator.model.types.NType.NClass;
-import com.apple.internal.jobjc.generator.model.types.NType.NObject;
-import com.apple.internal.jobjc.generator.model.types.NType.NPointer;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.model.types.NType.NSelector;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.model.types.NType.NVoid;
-import com.apple.internal.jobjc.generator.utils.Fp.CacheMap;
-import com.apple.internal.jobjc.generator.utils.Fp.Dispatcher;
-import com.apple.internal.jobjc.generator.utils.Fp.Map0;
-
-public class TypeToJType {
-    private static TypeToJType INST = new TypeToJType();
-    public static TypeToJType inst(){ return INST; }
-
-    private CacheMap<Type,JType> cache = new CacheMap<Type,JType>();
-    public JType getJTypeFor(final Type type){
-        return cache.get(type, new Map0<JType>(){
-            public JType apply() {
-                try {
-                    return Dispatcher.dispatch(TypeToJType.this.getClass(), TypeToJType.this, "accept", type, type.type32, type.type64);
-                } catch (NoSuchMethodException e) {
-                    return new JUnknown(type);
-                }
-            }});
-    }
-
-    protected JType accept(Type type, NObject nt32, NObject nt64){
-        if ("id".equals(type.name)) return JObject.ID_TYPE;
-
-        final String className = type.name.replaceAll("\\*$", "");
-        assert !className.endsWith("*");
-
-        final Clazz clazz = TypeCache.inst().getClassForName(className);
-        if (clazz == null) return new JUnknown(type);
-        // TODO Instead of JUnknown, ID_TYPE might be more appropriate. Investigate.
-
-        return new JObject(type, clazz);
-    }
-
-    protected JType accept(Type type, NPointer nt32, NPointer nt64){
-        final CFType cfType = TypeCache.inst().getCFTypeForName(type.name);
-        if(cfType != null) return new JCFType(cfType);
-
-        final Opaque opaque = TypeCache.inst().getOpaqueForName(type.name);
-        if(opaque != null) return new JOpaque(opaque);
-
-        if("void*".equals(type.name)) return JPointer.VOID_PTR;
-
-        if(type.name != null && type.name.endsWith("*")){
-            final String subDeclaredType = type.name.substring(0, type.name.length() - 1);
-            final Type subType = TypeCache.inst().getTypeByName(subDeclaredType);
-            if (subType == null) return new JUnknown(type);
-            // TODO Instead of JUnknown, VOID_PTR might be a good fallback. Investigate.
-
-            final JType javaType = TypeToJType.inst().getJTypeFor(subType).getParameterizableType();
-
-            final JPointer pointer = new JPointer(javaType);
-            return pointer;
-        }
-
-        return new JUnknown(type);
-    }
-
-    protected JType accept(Type type, NPrimitive nt32, NPrimitive nt64){
-        final ComplexCoderDescriptor coderDesc = ComplexCoderDescriptor.getCoderDescriptorFor(type.type32, type.type64);
-        if (coderDesc == null) return null;
-        return new JPrimitive(type, coderDesc);
-    }
-
-    protected JType accept(Type type, NVoid nt32, NVoid nt64){
-        return JVoid.INST;
-    }
-
-    protected JType accept(Type type, NSelector nt32, NSelector nt64){
-        return JSelector.INST;
-    }
-
-    protected JType accept(Type type, NClass nt32, NClass nt64){
-        return JClass.INST;
-    }
-
-    protected JType accept(Type type, NStruct nt32, NStruct nt64){
-        Struct st = TypeCache.inst().getStructForName(type.name);
-        return st != null ? new JStruct(st) : new JUnknown(type);
-        // TODO We could probably generate a struct here based on the type. But we need access to its parent framework.
-        // Maybe we could use a fallback anonymous struct, but we need the SIZEOF.
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/Fp.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-/**
- * Functional programming constructs and utilities. Java for Lisp and Haskell nerds.
- */
-public abstract class Fp {
-    /**
-     * Multiple dynamic dispatch (multi-methods) for Java.
-     *
-     * This is implemented with Java reflection:
-     * Class.getDeclaredMethod and Method.invoke.
-     * It is about 20-40 times slower than chains of
-     * "if instanceof" statements.
-     */
-    public static abstract class Dispatcher{
-        /**
-         * Shorthand, works only if no arg is null.
-         */
-        public static final <R> R dispatch(Class clazz, Object instance, String method, Object... args) throws NoSuchMethodException{
-            Class[] types = new Class[args.length];
-            for(int i = 0; i < args.length; i++) types[i] = args[i].getClass();
-            return (R) dispatch(clazz, instance, method, args, types);
-        }
-
-        /**
-         * Dispatch `args` of `types` to `method` on `clazz` for `instance`. If `method` is static, `instance` should be null.
-         */
-        public static final <R> R dispatch(Class clazz, Object instance, String method, Object[] args, Class[] types) throws NoSuchMethodException{
-            try{
-                java.lang.reflect.Method m = clazz.getDeclaredMethod(method, types);
-                m.setAccessible(true);
-                return (R) m.invoke(instance, args);
-            }
-            catch(NoSuchMethodException x){
-                if(clazz.getSuperclass() != null)  return (R) dispatch(clazz.getSuperclass(), instance, method, args, types);
-                else                               throw x;
-            }
-            catch(Exception x){
-                throw new RuntimeException(x);
-            }
-        }
-    }
-
-    /**
-     * The "Maybe" type encapsulates an optional value. A value of type
-     * "Maybe a" either contains a value of type "a" (represented as "Just a"),
-     * or it is empty (represented as "Nothing").
-     *
-     * http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html
-     */
-    public static abstract class Maybe<A>{
-        public abstract boolean isJust();
-        public abstract boolean isNothing();
-        public abstract A fromJust() throws ClassCastException;
-        public abstract A fromMaybe(final A fallback);
-
-        public static class Nothing<A> extends Maybe<A>{
-            @Override public A fromJust() throws ClassCastException { throw new ClassCastException("Cannot extract value from Nothing."); }
-            @Override public A fromMaybe(A fallback) { return fallback; }
-            @Override public boolean isJust() { return false; }
-            @Override public boolean isNothing() { return true; }
-        }
-        public static class Just<A> extends Maybe<A>{
-            public final A a;
-            public Just(A a){ this.a = a; }
-            @Override public A fromJust(){ return a; }
-            @Override public A fromMaybe(A fallback) { return a; }
-            @Override public boolean isJust() { return true; }
-            @Override public boolean isNothing() { return false; }
-        }
-    }
-
-    public static class NonNull<A>{
-        public final A obj;
-        public NonNull(A o){
-            if(o==null) throw new RuntimeException("o may not be null.");
-            this.obj = o;
-        }
-    }
-
-    // Closures
-    public static interface Map0<A>{ A apply(); }
-    public static interface Map1<A,B>{ B apply(final A a); }
-    public static interface Map2<A,B,C>{ C apply(final A a, final B b); }
-
-    public static class CacheMap<K extends Comparable<K>,V>{
-        private Map<K,V> cache = new TreeMap<K,V>();
-        public V get(K key, Map0<V> create){
-            if(cache.containsKey(key)) return cache.get(key);
-            V value = create.apply();
-            cache.put(key, value);
-            return value;
-        }
-    }
-
-    public static class Curry2to1<A,B,C> implements Map1<B,C>{
-        private Map2<A,B,C> target; private A a;
-        public Curry2to1(Map2<A, B, C> targett, A aa) { target = targett; a = aa; }
-        public C apply(B b) { return target.apply(a, b); }
-    }
-
-    // Tuple
-    public static class Pair <A,B> implements Comparable<Pair<A,B>>{
-        public final A a; public final B b;
-        public Pair(final A aa, final B bb){ a=aa; b=bb; }
-        @Override public int hashCode(){ return (a==null ? 0 : a.hashCode()) + (b==null ? 0 : b.hashCode()); }
-        @Override public boolean equals(Object o){
-            if(!(o instanceof Pair)) return false;
-            Pair<?,?> p = (Pair<?,?>) o;
-            return QA.bothNullOrEquals(a, p.a) && QA.bothNullOrEquals(b, p.b);
-        }
-        @Override public String toString(){ return "(" + a + ", " + b + ")"; }
-        public int compareTo(Pair<A, B> o){ return toString().compareTo(o.toString()); }
-    }
-
-    /**
-     * @return [fn(x) | x <- items]
-     */
-    public static <A,B> List<B> map(Map1<A,B> fn, final Collection<A> xs){
-        ArrayList<B> rs = new ArrayList<B>(xs.size());
-        for(A x : xs) rs.add(fn.apply(x));
-        return rs;
-    }
-
-    public static <A,B,C> List<C> map2(Map2<A,B,C> fn, final Collection<A> as, final Collection<B> bs){
-        assert as.size() == bs.size();
-        ArrayList<C> cs = new ArrayList<C>(as.size());
-        Iterator<A> aiter = as.iterator();
-        Iterator<B> biter = bs.iterator();
-        while(aiter.hasNext() && biter.hasNext())
-            cs.add(fn.apply(aiter.next(), biter.next()));
-        return cs;
-    }
-
-    /**
-     * Same as map, but does not retain results.
-     */
-    public static <A> void each(Map1<A,?> fn, final Collection<A> xs){
-        for(A x : xs) fn.apply(x);
-    }
-
-    /**
-     * @return [x | x <- items, take(x)]
-     */
-    public static <A> List<A> filter(Map1<A,Boolean> take, final Collection<A> xs){
-        List<A> rs = new ArrayList<A>(xs.size());
-        for(A x : xs) if(take.apply(x)) rs.add(x);
-        return rs;
-    }
-
-    /**
-     * @return [x | x <- items, take(x)]
-     */
-    public static <A> Set<A> filterSet(Map1<A,Boolean> take, final Collection<A> xs){
-        Set<A> rs = new HashSet<A>(xs.size());
-        for(A x : xs) if(take.apply(x)) rs.add(x);
-        return rs;
-    }
-
-    /**
-     * @return the first x in items that satisfies take(x), or null if none
-     */
-    public static <X> X find(Map1<X,Boolean> take, final Collection<X> xs){
-        for(X x : xs) if(take.apply(x)) return x;
-        return null;
-    }
-
-    public static <A,B> A foldl(final Map2<A,B,A> f, A a, final Collection<B> xs){
-        for(B b : xs) a = f.apply(a, b);
-        return a;
-    }
-
-    /**
-     * @return All x : p(x) == true
-     */
-    public static <A> boolean all(Map1<A,Boolean> p, Collection<A> xs) {
-        for(A x : xs) if(!p.apply(x)) return false;
-        return true;
-    }
-
-    /**
-     * @return Any x : p(x) == true
-     */
-    public static <A> boolean any(Map1<A,Boolean> p, Collection<A> xs) {
-        for(A x : xs) if(p.apply(x)) return true;
-        return false;
-    }
-
-    public static <A> String join(final String sep, final Collection<A> xs) {
-        if(xs.size() == 0) return "";
-        if(xs.size() == 1) return xs.iterator().next().toString();
-        return Fp.foldl(new Fp.Map2<String, A, String>(){
-            public String apply(String a, A b) {
-                String sb = b==null? "null" : b.toString();
-                return a == null ? sb : a + sep + sb;
-            }}, null, xs);
-    }
-
-    public static Map2<Integer,Integer,Integer> operatorPlus = new Map2<Integer, Integer, Integer>(){
-        public Integer apply(Integer a, Integer b) { return (int)a + (int)b;}
-    };
-
-    public static int sum(Collection<Integer> xs){ return foldl(operatorPlus, 0, xs); }
-
-    public static <A> List<A> append(Collection<A> xs, Collection<A> ys) {
-        List<A> rs = new ArrayList<A>(xs.size() + ys.size());
-        rs.addAll(xs);
-        rs.addAll(ys);
-        return rs;
-    }
-
-    public static <A> Set<A> appendSet(Collection<A> xs, Collection<A> ys) {
-        Set<A> rs = new HashSet<A>(xs.size() + ys.size());
-        rs.addAll(xs);
-        rs.addAll(ys);
-        return rs;
-    }
-
-    public static <K,V> Map<K,V> litMap(K key, V value, Object... pairs){
-        Map ret = new HashMap(1 + pairs.length/2);
-        ret.put(key, value);
-        for(int i = 0; i < pairs.length; i += 2)
-            ret.put(pairs[i], pairs[i+1]);
-        return ret;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/JavaLang.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import com.apple.internal.jobjc.generator.Utils;
-import com.apple.internal.jobjc.generator.Utils.Substituter;
-
-/**
- * Utility for generating Java source code.
- */
-public abstract class JavaLang {
-
-    public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
-        return generateSingleton(new Substituter(
-            "#private $CLASS $IVAR = null;~" +
-            "#public $CLASS $METHOD() {~" +
-            "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
-            "#}~"),
-        instanceVariable, methodName, className, constructorArgs);
-    }
-
-    public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
-        return generateSingleton(new Substituter(
-            "#private static $CLASS $IVAR = null;~" +
-            "#public static $CLASS $METHOD() {~" +
-            "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
-            "#}~"),
-        instanceVariable, methodName, className, constructorArgs);
-    }
-
-    private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
-        singleton.replace("IVAR", instanceVariable);
-        singleton.replace("METHOD", methodName);
-        singleton.replace("CLASS", className);
-        singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
-        return singleton.toString();
-    }
-
-    ///
-
-    public static class JLTertiary{
-        public Object cond, tExp, fExp;
-        public JLTertiary(){}
-        public JLTertiary(Object cond, Object tExp, Object fExp){
-            this.cond = cond;
-            this.tExp = tExp;
-            this.fExp = fExp;
-        }
-        @Override public String toString() {
-            return "((" + cond + ")\n\t? (" + tExp + ")\n\t: (" + fExp + "))";
-        }
-    }
-
-    public static class JLCall{
-        public String fun;
-        public List<Object> args = new ArrayList<Object>();
-        public JLCall(String fun, Object... args){
-            this.fun = fun;
-            this.args.addAll(Arrays.asList(args));
-        }
-        @Override public String toString(){
-            return fun + "(" + Fp.join(", ", args) + ")";
-        }
-    }
-
-    public static class JLField{
-        public Set<String> mods = new TreeSet<String>();
-        public String type;
-        public String name;
-        public Object value;
-
-        public JLField(String mods, String type, String name){
-            this(mods, type, name, null);
-        }
-
-        public JLField(String mods, String type, String name, Object value){
-            this.mods.addAll(Arrays.asList(mods.split("\\s")));
-            this.type = type;
-            this.name = name;
-            this.value = value;
-        }
-
-        @Override public String toString(){
-            return "\t" + Fp.join(" ", mods) + " " + type + " " + name + (value==null ? "" : " = " + value) + ";\n";
-        }
-    }
-
-    public static class JLCtor extends JLMethod{
-        public JLCtor(String mods, String name, Object... args) {
-            super(mods, "", name, args);
-        }
-
-        @Override public String toString(){
-            this.type = "";
-            return super.toString();
-        }
-    }
-
-    public static class JLReturn{
-        public Object target;
-        public JLReturn(Object target){
-            this.target = target;
-        }
-        @Override public String toString(){
-            return "return " + target + ";";
-        }
-    }
-
-    public static class JLMethod{
-        public List<String> jdoc = new ArrayList<String>();
-        public Set<String> attrs = new TreeSet<String>();
-        public Set<String> mods = new TreeSet<String>();
-        public String type;
-        public String name;
-        public List<Object> args = new ArrayList<Object>();
-        public List<Object> body = new ArrayList<Object>();
-
-        public JLMethod(){}
-        public JLMethod(String mods, String type, String name, Object... args) {
-            this.mods.addAll(Arrays.asList(mods.split("\\s")));
-            this.type = type;
-            this.name = name;
-            this.args.addAll(Arrays.asList(args));
-        }
-
-        @Override public String toString(){
-            StringWriter out = new StringWriter();
-            if(jdoc.size() > 0){
-                out.append("\t/**\n");
-                out.append("\t * " + Fp.join("\n\t * ", jdoc));
-                out.append("\t */\n");
-            }
-            out.append("\t" + Fp.join(" ", attrs) + " " + Fp.join(" ", mods) + " " + type + " " + name + "(" + Fp.join(", ", args) + "){\n");
-            out.append("\t\t" + Fp.join("\n\t\t", body) + "\n");
-            out.append("\t}\n");
-            return out.toString();
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/NTypeMerger.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.apple.internal.jobjc.generator.model.types.NType;
-import com.apple.internal.jobjc.generator.model.types.NType.NArray;
-import com.apple.internal.jobjc.generator.model.types.NType.NBitfield;
-import com.apple.internal.jobjc.generator.model.types.NType.NClass;
-import com.apple.internal.jobjc.generator.model.types.NType.NField;
-import com.apple.internal.jobjc.generator.model.types.NType.NObject;
-import com.apple.internal.jobjc.generator.model.types.NType.NPointer;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.model.types.NType.NSelector;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.model.types.NType.NUnion;
-import com.apple.internal.jobjc.generator.model.types.NType.NUnknown;
-import com.apple.internal.jobjc.generator.model.types.NType.NVoid;
-import com.apple.internal.jobjc.generator.utils.Fp.Dispatcher;
-import com.apple.internal.jobjc.generator.utils.Fp.Map2;
-import com.apple.jobjc.JObjCRuntime.Width;
-
-/**
- * Merges two NTypes. All merge does is fill out missing information. It doesn't choose the larger primitive when there's a conflict or anything like that.
- *
- * Example:
- *<pre>
- * a: {_NSRect={_NSPoint="x"f"y"f}"size"{_NSSize=ff}}
- * b: {_NSRect="origin"{_NSPoint=ff}{_NSSize="width"f"height"f}}
- * c: {_NSRect="origin"{_NSPoint="x"f"y"f}"size"{_NSSize="width"f"height"f}}
- *</pre>
- */
-public class NTypeMerger {
-    public static class MergeFailed extends RuntimeException{
-        public MergeFailed(String reason, Object a, Object b){
-            super(reason
-                    + " -- (" + a.getClass().getSimpleName() + ") a: " + a
-                    + " -- (" + b.getClass().getSimpleName() + ") b: " + b);
-        }
-    }
-
-    private static NTypeMerger INST = new NTypeMerger();
-    public static NTypeMerger inst(){ return INST; }
-
-    /**
-     * Merge a and b.
-     */
-    public NType merge(NType a, NType b) throws MergeFailed{
-        if(a!=null && b==null) return a;
-        if(a==null && b!=null) return b;
-        if(a==null && b==null) return null;
-        if(a.equals(b)) return a;
-        try {
-            return Dispatcher.dispatch(getClass(), this, "accept", a, b);
-        } catch (NoSuchMethodException e) {
-            throw new MergeFailed("a and b are of different NType", a, b);
-        }
-    }
-
-    private static Collection<String> emptyNames = Arrays.asList(null, "", "?");
-    /**
-     * Merge two identifiers:
-     *  - If they're equal, return one.
-     *  - If one is null, "", "?", return the other one.
-     *  - else throw MergeFailed
-     *
-     *  Exception: Due to a bug in BridgeSupport, this will return
-     *  a (the first arg) instead of throwing MergeFailed.
-     */
-    public String mergeName(String a, String b) throws MergeFailed{
-        if(QA.bothNullOrEquals(a, b)) return a;
-        if(emptyNames.contains(a) && !emptyNames.contains(b)) return b;
-        if(emptyNames.contains(b) && !emptyNames.contains(a)) return a;
-        return a; // HACK BS bug #5954843
-//        throw new MergeFailed("a and b have different names");
-    }
-
-    private Map mergeMap(Map a, Map b) throws MergeFailed{
-        if(a.equals(b)) return a;
-        Map ret = new HashMap();
-        Set keys = new HashSet(Fp.append(a.keySet(), b.keySet()));
-        for(Object key : keys){
-            Object ai = a.get(key);
-            Object bi = b.get(key);
-            if(ai != null && bi == null) ret.put(key, ai);
-            else if(ai == null && bi != null) ret.put(key, bi);
-            else if(ai.equals(bi)) ret.put(key, ai);
-            else throw new MergeFailed("a and b are different", ai, bi);
-        }
-        return ret;
-    }
-
-    public Map<Width,Integer> mergeSizeOf(Map<Width,Integer> a, Map<Width,Integer> b) throws MergeFailed{
-        return mergeMap(a, b);
-    }
-
-    public Map<Width,Integer> mergeOffset(Map<Width,Integer> a, Map<Width,Integer> b) throws MergeFailed{
-        return mergeMap(a, b);
-    }
-
-    //
-
-    private void mustEqual(NType a, NType b){
-        if(!a.equals(b)) throw new MergeFailed("a must equal b", a, b);
-    }
-
-    protected NType accept(NBitfield a, NBitfield b) {
-        mustEqual(a, b);
-        return a;
-    }
-
-    protected NType accept(NPrimitive a, NPrimitive b) {
-        mustEqual(a, b);
-        return a;
-    }
-
-    protected NType accept(NPointer a, NPointer b) {
-        return new NPointer(NTypeMerger.inst().merge(a.subject, b.subject));
-    }
-
-    // Merge structs
-
-    protected NField mergeNFields(NField a, NField b) {
-        return new NField(mergeName(a.name, b.name),
-                NTypeMerger.inst().merge(a.type, b.type),
-                mergeOffset(a.offset, b.offset));
-    }
-
-    protected NStruct mergeStructs(NStruct a, NStruct b){
-        if(a.fields.size() != b.fields.size())
-            throw new MergeFailed("a and b have different numbers of fields", a, b);
-
-        List<NField> fields = Fp.map2(new Map2<NField,NField,NField>(){
-            public NField apply(NField f32, NField f64) { return mergeNFields(f32, f64); }
-        }, a.fields, b.fields);
-
-        return new NStruct(mergeName(a.name, b.name),
-                fields, mergeSizeOf(a.sizeof, b.sizeof));
-    }
-
-    protected NType accept(NStruct a, NStruct b) {
-        return mergeStructs(a, b);
-    }
-
-    protected NType accept(NUnion a, NUnion b) {
-        NStruct nst = mergeStructs(a, b);
-        return new NUnion(nst.name, Fp.map(NUnion.zeroOffsets, nst.fields), nst.sizeof);
-    }
-
-    protected NType accept(NArray a, NArray b) {
-        if(a.length != b.length)
-            throw new MergeFailed("a and b are of different sizes", a, b);
-        return new NArray(a.length, NTypeMerger.inst().merge(a.type, b.type));
-    }
-
-    protected NType accept(NVoid a, NVoid b) { return NVoid.inst(); }
-    protected NType accept(NObject a, NObject b) { return NObject.inst(); }
-    protected NType accept(NClass a, NClass b) { return NClass.inst(); }
-    protected NType accept(NSelector a, NSelector b) { return NSelector.inst(); }
-    protected NType accept(NUnknown a, NUnknown b) { return NUnknown.inst(); }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/NTypeParser.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,273 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.model.types.NType;
-import com.apple.internal.jobjc.generator.model.types.NType.NArray;
-import com.apple.internal.jobjc.generator.model.types.NType.NBitfield;
-import com.apple.internal.jobjc.generator.model.types.NType.NClass;
-import com.apple.internal.jobjc.generator.model.types.NType.NObject;
-import com.apple.internal.jobjc.generator.model.types.NType.NPointer;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.model.types.NType.NSelector;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.model.types.NType.NUnion;
-import com.apple.internal.jobjc.generator.model.types.NType.NUnknown;
-import com.apple.internal.jobjc.generator.model.types.NType.NVoid;
-
-/**
- * NTypeParser (Native Type Parser) parses type & type64 attributes from BridgeSupport.
- *
- * See Obj-C Language: Type Encodings
- */
-public abstract class NTypeParser {
-    // ** Parser entry point
-
-    private static Map<String, NType> cached = new HashMap<String, NType>();
-    public static NType parseFrom(String s) {
-        if(!cached.containsKey(s)) cached.put(s, parseFrom(new StringStream(s)));
-        return cached.get(s);
-    }
-
-    // ** Parser driver
-
-    private static List<NTypeParser> PARSERS = new ArrayList<NTypeParser>(
-            Arrays.asList(new NBitfieldParser(), new NPrimitiveParser(), new NVoidParser(),
-            new NPointerParser(), new NStructParser(), new NUnionParser(),
-            new NObjectParser(), new NClassParser(), new NSelectorParser(),
-            new NArrayParser(), new NUnknownParser(), new NSpecifierParser()));
-
-    protected static NType parseFrom(StringStream ss) {
-        if(ss.left() == 0)
-            return null;
-        try{
-            for(NTypeParser nt : PARSERS)
-                if(nt.parsePossible(ss))
-                    return nt.parse(ss);
-        }
-        catch(RuntimeException x){
-            throw new RuntimeException("Exception while parsing '" + ss.remainingToString()
-                    + "' from '" + ss.toString() + "'", x);
-        }
-        throw new RuntimeException("Found no parser for '" + ss.remainingToString()
-                + "' from '" + ss.toString() + "'");
-    }
-
-    // ** Methods for parsers
-
-    protected abstract boolean parsePossible(StringStream ss);
-    protected abstract NType parse(StringStream ss);
-
-    // ** Individual parsers
-
-    public static class NBitfieldParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.left() >= 2 && ss.peekAt(0) == 'b' && Character.isDigit(ss.peekAt(1));
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            assert parsePossible(ss);
-            ss.eat('b');
-            return new NBitfield(Integer.parseInt(ss.readWhileDigits()));
-        }
-    }
-
-    public static class NPrimitiveParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return NPrimitive.CODES.contains(ss.peek());
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            assert parsePossible(ss);
-            return NPrimitive.inst(ss.read());
-        }
-    }
-
-    public static class NVoidParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.peek() == 'v';
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            ss.eat('v');
-            return NVoid.inst();
-        }
-    }
-
-    public static class NPointerParser extends NTypeParser{
-        private static NPointer CHAR_PTR = new NPointer(NPrimitive.inst('C'));
-
-        @Override protected boolean parsePossible(StringStream ss) {
-            return (ss.left() >= 2 && ss.peek() == '^') || (ss.peek() == '*');
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            if(ss.peek() == '*'){
-                ss.eat('*');
-                return CHAR_PTR;
-            }
-            else{
-                ss.eat('^');
-                return new NPointer(NTypeParser.parseFrom(ss));
-            }
-        }
-    }
-
-    public static class NStructParser extends NTypeParser{
-        protected char getOpen(){ return '{'; };
-        protected char getClose(){ return '}'; };
-
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.left() >= 2 && ss.peek() == getOpen();
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            assert parsePossible(ss);
-            // {_NSRect=
-            //   "origin"{_NSPoint="x"f"y"f}
-            //   "size"{_NSSize="width"f"height"f}}
-            ss.eat(getOpen());
-            String cname = ss.readUntilEither("=" + getClose());
-            List<NStruct.NField> fields = new ArrayList<NStruct.NField>();
-            if(ss.peek() == '='){
-                ss.eat('=');
-                while(ss.peek() != getClose()){
-                    String fname = "";
-                    if(ss.peek() == '"'){
-                        ss.eat('"');
-                        fname = ss.readUntil('"');
-                        ss.eat('"');
-                    }
-                    NType type = NTypeParser.parseFrom(ss);
-                    fields.add(new NStruct.NField(fname, type));
-                }
-            }
-            ss.eat(getClose());
-            return getNew(cname, fields);
-        }
-
-        protected NType getNew(String cname, List<NStruct.NField> fields){
-            return new NStruct(cname, fields);
-        }
-    }
-
-    // A Union is very much like a Struct.
-    public static class NUnionParser extends NStructParser{
-        @Override protected char getOpen(){ return '('; };
-
-        @Override protected char getClose(){ return ')'; };
-
-        @Override protected NType getNew(String cname, List<NStruct.NField> fields){
-            return new NUnion(cname, Fp.map(NUnion.zeroOffsets, fields));
-        }
-    }
-
-    public static class NArrayParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.peek() == '[';
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            ss.eat('[');
-            int size = Integer.parseInt(ss.readWhileDigits());
-            NType type = NTypeParser.parseFrom(ss);
-            ss.eat(']');
-            return new NArray(size, type);
-        }
-    }
-
-    public static class NObjectParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.peek() == '@';
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            ss.eat('@');
-            return NObject.inst();
-        }
-    }
-
-    public static class NClassParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.peek() == '#';
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            ss.eat('#');
-            return NClass.inst();
-        }
-    }
-
-    public static class NSelectorParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.peek() == ':';
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            ss.eat(':');
-            return NSelector.inst();
-        }
-    }
-
-    public static class NUnknownParser extends NTypeParser{
-        @Override protected boolean parsePossible(StringStream ss) {
-            return ss.peek() == '?';
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            ss.eat('?');
-            return NUnknown.inst();
-        }
-    }
-
-    /**
-     * Specifier     Encoding
-     * const         r
-     * in             n
-     * inout         N
-     * out             o
-     * bycopy         O
-     * oneway         V
-     */
-    public static class NSpecifierParser extends NTypeParser{
-        private static Collection<Character> SPECS = Arrays.asList('r', 'n', 'N', 'o', 'O', 'V');
-        @Override protected boolean parsePossible(StringStream ss) {
-            return SPECS.contains(ss.peek());
-        }
-
-        @Override protected NType parse(StringStream ss) {
-            assert parsePossible(ss);
-            ss.seek(); // XXX Just ignore specs for now and return the affected type.
-            return NTypeParser.parseFrom(ss);
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/NTypePrinter.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.io.StringWriter;
-
-import com.apple.internal.jobjc.generator.model.types.NType;
-import com.apple.internal.jobjc.generator.model.types.NType.NArray;
-import com.apple.internal.jobjc.generator.model.types.NType.NBitfield;
-import com.apple.internal.jobjc.generator.model.types.NType.NClass;
-import com.apple.internal.jobjc.generator.model.types.NType.NField;
-import com.apple.internal.jobjc.generator.model.types.NType.NObject;
-import com.apple.internal.jobjc.generator.model.types.NType.NPointer;
-import com.apple.internal.jobjc.generator.model.types.NType.NPrimitive;
-import com.apple.internal.jobjc.generator.model.types.NType.NSelector;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.model.types.NType.NUnion;
-import com.apple.internal.jobjc.generator.model.types.NType.NUnknown;
-import com.apple.internal.jobjc.generator.model.types.NType.NVoid;
-import com.apple.internal.jobjc.generator.utils.Fp.Dispatcher;
-
-/**
- * Print an NType to the BridgeSupport encoding.
- */
-public class NTypePrinter{
-    private static NTypePrinter INST = new NTypePrinter();
-    public static NTypePrinter inst(){ return INST; }
-
-    public String print(NType nt){
-        try {
-            return Dispatcher.dispatch(getClass(), this, "accept", nt);
-        } catch (NoSuchMethodException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    protected String accept(NBitfield nt) {
-        return "b" + nt.length;
-    }
-
-    protected String accept(NPrimitive nt) {
-        return Character.toString(nt.type);
-    }
-
-    protected String accept(NPointer nt) {
-        if(nt.subject instanceof NPrimitive && ((NPrimitive) nt.subject).type == 'C')
-            return "*";
-        else
-            return "^" + print(nt.subject);
-    }
-
-    protected String printStruct(NStruct nt, char open, char close){
-        StringWriter sw = new StringWriter();
-        sw.append(open);
-        sw.append(nt.name);
-        if(nt.fields.size() > 0){
-            sw.append('=');
-            for(NField f : nt.fields){
-                if(f.name != null && f.name.length() > 0)
-                    sw.append("\"" + f.name + "\"");
-                sw.append(print(f.type));
-            }
-        }
-        sw.append(close);
-        return sw.toString();
-    }
-
-    protected String accept(NStruct nt) {
-        return printStruct(nt, '{', '}');
-    }
-
-    protected String accept(NUnion nt) {
-        return printStruct(nt, '(', ')');
-    }
-
-    protected String accept(NArray nt) {
-        return "[" + nt.length + print(nt.type) + "]";
-    }
-
-    protected String accept(NObject nt) { return "@"; }
-    protected String accept(NVoid nt) { return "v"; }
-    protected String accept(NClass nt) { return "#"; }
-    protected String accept(NSelector nt) { return ":"; }
-    protected String accept(NUnknown nt) { return "?"; }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/ObjectInspector.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-
-public abstract class ObjectInspector {
-    /**
-     * @return  a string representation of object internals.
-     */
-    public static String inspect(Object obj) {
-        StringWriter sw = new StringWriter();
-        inspectForClass(obj, obj.getClass(), sw);
-        return sw.toString();
-    }
-
-    private static void inspectForClass(Object instance, Class clazz, StringWriter sw){
-        boolean willGoSuper = clazz.getSuperclass() != null && !clazz.getSuperclass().getName().equals("java.lang.Object");
-
-        sw.append(clazz.getSimpleName());
-        sw.append("{");
-        Field[] fs = clazz.getDeclaredFields();
-        for(int i = 0; i < fs.length; i++){
-            Field f = fs[i];
-            f.setAccessible(true);
-            sw.append(f.getName());
-            sw.append(": ");
-            try {
-                Object o = f.get(instance);
-                sw.append(o == null ? "null" : o.toString());
-            } catch (IllegalArgumentException ex) {
-                throw new RuntimeException(ex);
-            } catch (IllegalAccessException ex) {
-                throw new RuntimeException(ex);
-            }
-            if(i < fs.length - 1 || willGoSuper)
-                sw.append(", ");
-        }
-
-        if(willGoSuper){
-            sw.append("super: ");
-            inspectForClass(instance, clazz.getSuperclass(), sw);
-        }
-
-        sw.append("}");
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/QA.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import com.apple.internal.jobjc.generator.Utils;
-
-public class QA {
-    public static void nonNull(Object... os){
-        for(Object o : os) if(o == null) throw new NullPointerException(Utils.joinWComma(os));
-    }
-
-    public static boolean bothNullOrEquals(Object a, Object b) {
-        if(a == null && b == null) return true;
-        if(a == null || b == null) return false;
-        return a.equals(b);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/StringStream.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.io.StringWriter;
-
-/**
- * Stream-like class backed by a string. Useful for parsers.
- */
-public class StringStream{
-    private String data;
-    private int pos;
-
-    public StringStream(String s){
-        QA.nonNull(s);
-        this.data = s;
-        this.pos = 0;
-    }
-
-    /**
-     * Number of characters left.
-     */
-    public int left(){ return data.length() - pos; }
-
-    /**
-     * Are there any characters left?
-     */
-    public boolean atEOF(){ return left() <= 0; }
-
-    /**
-     * Read next character.
-     */
-    public char read(){ return data.charAt(pos++); }
-
-    /**
-     * Read n characters and return string.
-     */
-    public String readN(int n){
-        String s = data.substring(pos, pos + n);
-        pos += n;
-        return s;
-    }
-
-    /**
-     * Read until the next char is c, and return the string.
-     */
-    public String readUntil(char c){
-        int ix = data.indexOf(c, pos);
-        if(ix == -1) throw new RuntimeException("readUntil did not find character '" + c + "'");
-        return readN(data.indexOf(c, pos) - pos);
-    }
-
-    /**
-     * Read until the next char is one in s, and return the string.
-     */
-    public String readUntilEither(String s) {
-        int ix = Integer.MAX_VALUE;
-
-        for(char c : s.toCharArray()){
-            int ixx = data.indexOf(c, pos);
-            if(ixx >= 0 && ixx < ix)
-                ix = ixx;
-        }
-
-        if(ix == -1) throw new RuntimeException("readUntilEither did not find any character in '" + s + "'");
-        return readN(ix - pos);
-    }
-
-    public String readWhile(String s) {
-        StringWriter sw = new StringWriter();
-        while(s.indexOf(peek()) != -1)
-            sw.append(read());
-        return sw.toString();
-    }
-
-    public String readWhileDigits() {
-        return readWhile("0123456789");
-    }
-
-    /**
-     * @return the nth char from the current position.
-     */
-    public char peekAt(int n){ return data.charAt(pos + n); }
-
-    /**
-     * @return the next n chars.
-     */
-    public String peekN(int n){ return data.substring(pos, pos + n); }
-
-    /**
-     * @return the next char.
-     */
-    public char peek(){ return peekAt(0); }
-
-    /**
-     * Skip n chars ahead.
-     */
-    public void seekN(int n){ pos += n; }
-
-    /**
-     * Skip 1 char ahead.
-     */
-    public void seek(){ seekN(1); }
-
-    /**
-     * If the next character is c, seek over it. Otherwise throw RuntimeException.
-     */
-    public void eat(char c) {
-        if(peek() != c) throw new RuntimeException("Parser expected '" + c + "' but got '" + peek() + "'.");
-        seek();
-    }
-
-    /**
-     * If the next characters are the same as those in s, seek over them. Otherwise throw RuntimeException.
-     */
-    public void eat(String s) {
-        String pn = peekN(s.length());
-        if(!pn.equals(s)) throw new RuntimeException("Parser expected '" + s + "' but got '" + pn + "'.");
-        seekN(s.length());
-    }
-
-    @Override
-    public String toString(){
-        return data;
-    }
-
-    /**
-     * @return the remaining characters as a String.
-     */
-    public String remainingToString() {
-        return data.substring(pos);
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/StructOffsetResolver.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import com.apple.internal.jobjc.generator.Utils;
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.model.Struct;
-import com.apple.internal.jobjc.generator.model.types.NType;
-import com.apple.internal.jobjc.generator.model.types.TypeCache;
-import com.apple.internal.jobjc.generator.model.types.NType.NField;
-import com.apple.internal.jobjc.generator.model.types.NType.NStruct;
-import com.apple.internal.jobjc.generator.utils.Fp.Map1;
-import com.apple.jobjc.JObjCRuntime.Width;
-import java.util.Date;
-
-/**
- * Takes a framework, compiles a native source file with all its structs,
- * and figures out their sizes and field offsets.
- */
-public class StructOffsetResolver {
-    public void resolve(Collection<Framework> fws){
-        try {
-            _resolve(fws);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    protected void _resolve(final Collection<Framework> fws) throws Exception{
-        for(final Framework fw : fws){
-            for(final Width width : Width.values()){
-                System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
-                String nativeSrc = generateFileForFramework(fw, width);
-                String executable = compileObjC(nativeSrc, width);
-                execute(executable, new Map1<String,Object>(){
-                    public Object apply(String ln) {
-                        try {
-                            processLine(ln, fws, width);
-                            return null;
-                        } catch (Exception e) {
-                            throw new RuntimeException(e);
-                        }
-                    }
-                });
-            }
-        }
-    }
-
-    static Set<String> alwaysHeaders_shared = new TreeSet<String>(Arrays.asList(
-            "<Cocoa/Cocoa.h>",
-    "\"/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/HIToolbox.h\""));
-    static Map<Width,Set<String>> alwaysHeaders = Fp.litMap(
-            Width.W32, alwaysHeaders_shared,
-            Width.W64, alwaysHeaders_shared);
-
-    static Set<String> bannedHeaders_shared = new TreeSet<String>(Arrays.asList(
-            "NSJavaSetup.h", "IMKInputController.h", "NSSimpleHorizontalTypesetter.h", "NSSpellServer.h", "IMKServer.h", "IKImageBrowserCell.h"));
-    static Map<Width,Set<String>> bannedHeaders = Fp.litMap(
-            Width.W32, bannedHeaders_shared,
-            Width.W64, Fp.appendSet(bannedHeaders_shared,
-                    Arrays.asList("npapi.h", "npruntime.h", "npfunctions.h")));
-
-    // We can cache the last accessed framework because, 99% of the time,
-    // the caller will ask for the same one, over and over again.
-    protected Framework cachedFw;
-    protected Framework findFrameworkByName(Collection<Framework> fws, String name){
-        if(cachedFw != null && cachedFw.name.equals(name))
-            return cachedFw;
-        cachedFw = null;
-        for(Framework fw : fws)
-            if(fw.name.equals(name)){
-                cachedFw = fw;
-                break;
-            }
-        return cachedFw;
-    }
-
-    protected void processLine(String ln, Collection<Framework> fws, Width arch) throws Exception{
-        System.out.println("\tSOR '" + ln + "'");
-        if(ln.trim().length() == 0) return;
-        Pattern stinfo = Pattern.compile("^(.*) (.*):(\\d+).*$");
-        Matcher m = stinfo.matcher(ln);
-        if(!m.matches()) throw new RuntimeException("Failed to parse line from exec: " + ln);
-        String fwname = m.group(1);
-        String stname = m.group(2);
-        int stsize = Integer.parseInt(m.group(3));
-
-        Framework fw = findFrameworkByName(fws, fwname);
-
-        Struct st = fw.getStructByName(stname);
-        NStruct nst = wget(arch, st.type.type32, st.type.type64);
-        nst.sizeof.put(arch, stsize);
-
-//        System.out.println(st.name + " : " + stsize);
-
-        Pattern finfo = Pattern.compile(" (-?\\d+)");
-        Matcher fm = finfo.matcher(ln);
-        int fi = 0;
-        while(fm.find()){
-            NField sf = nst.fields.get(fi++);
-            sf.offset.put(arch, Integer.parseInt(fm.group(1)));
-//            System.out.println("\t" + sf.name + " : " + off);
-        }
-
-        TypeCache.inst().pingType(st.type);
-    }
-
-    /**
-     * Generates Objective-C file and returns absolute path name.
-     */
-    private String generateFileForFramework(Framework fw, Width arch) throws Exception{
-        File tempfile = File.createTempFile("JObjC-SOR-" + fw.name + "-" + arch + "-", ".mm");
-        PrintWriter out = new PrintWriter(new FileWriter(tempfile));
-        out.println("#include<iostream>");
-        printHeaderLines(fw, arch, out);
-        out.println("");
-        out.println("int main(int argc, char** argv){");
-        printStructInfos(fw, arch, out);
-        out.println("\treturn 0;");
-        out.println("}");
-        out.close();
-        return tempfile.getAbsolutePath();
-    }
-
-    protected void execute(String executable, Fp.Map1<String,Object> lineProcessor) throws Exception {
-//        System.out.println(">>>> Executing " + new Date().toString());
-        Process p = Runtime.getRuntime().exec(new String[]{executable});
-
-        if(lineProcessor != null){
-            BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));
-            String line;
-            while ((line = stdout.readLine()) != null)
-                lineProcessor.apply(line);
-            stdout.close();
-        }
-        p.waitFor();
-        if(p.exitValue() != 0)
-            throw new RuntimeException(executable + " did not execute successfully: " + p.exitValue());
-    }
-
-    private static Map<Width,String> gccFlag = Fp.litMap(Width.W32, "-m32", Width.W64, "-m64");
-
-    static boolean isDone(Process p){
-        try{
-            p.exitValue();
-            return true;
-        }
-        catch(Exception x){
-            return false;
-        }
-    }
-
-    protected static String compileObjC(String nativeSrc, Width arch) throws Exception {
-        String execPath = nativeSrc.replace(".mm", "");
-        Process p = Runtime.getRuntime().exec(new String[]{
-                "llvm-g++", "-Wall", gccFlag.get(arch), "-ObjC++", "-framework", "Foundation", "-o", execPath, nativeSrc
-        });
-        BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));
-        BufferedReader stderr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
-        while(!isDone(p)){
-            while(stdout.ready()) System.out.println(stdout.readLine());
-            while(stderr.ready()) System.out.println(stderr.readLine());
-        }
-        p.waitFor();
-        while(stdout.ready() || stderr.ready()){
-            if(stdout.ready()) System.out.println(stdout.readLine());
-            if(stderr.ready()) System.out.println(stderr.readLine());
-        }
-        if(p.exitValue() != 0)
-            throw new RuntimeException("gcc did not compile '" + nativeSrc + "' successfully: " + p.exitValue());
-        return execPath;
-    }
-
-    static void printStructInfos(Framework fw, Width arch, PrintWriter out){
-        for(Struct st : fw.structs){
-            NStruct nst = wget(arch, st.type.type32, st.type.type64);
-            out.println("std::cout << \"" + fw.name + " " + st.name + "\" << ':' << sizeof("+st.name+")");
-            for(NField sf : nst.fields){
-                out.print("\t<< ' ' << ");
-                out.println(sf.type instanceof NType.NBitfield
-                          ? "-1"
-                          : "offsetof("+st.name+","+sf.name+")");
-            }
-            out.println("\t<< std::endl;");
-        }
-    }
-
-    static void printHeaderLines(Framework fw, Width arch, PrintWriter out) throws Exception {
-        Collection<String> always = alwaysHeaders.get(arch);
-        Collection<String> banned = bannedHeaders.get(arch);
-        out.println("#define COREFOUNDATION_CFPLUGINCOM_SEPARATE 0");
-        for(String header : always)
-            out.println("#import " + header);
-
-        out.println("#undef COREFOUNDATION_CFPLUGINCOM_SEPARATE");
-        String umbrella = fw.path + "/Headers/" + fw.name;
-        if(new File(umbrella).exists())
-            out.println("#import \"" + umbrella + "\"");
-
-        for(File header : getHeaders(fw))
-            if(!banned.contains(header.getName()))
-                out.println("#import \"" + header.getAbsolutePath() + "\"");
-    }
-
-    static <A,B> A wget(Width arch, B x32, B x64){
-        switch(arch){
-        case W32: return (A) x32;
-        case W64: return (A) x64;
-        default: throw new RuntimeException();
-        }
-    }
-
-    /**
-     * Gets the absolute path to every header in FOO.framework/Headers
-     */
-    static Collection<File> getHeaders(Framework fw) throws Exception {
-        String hpath = fw.path + "/Headers";
-        return Utils.find(new File(hpath), "^.*\\.h$", "");
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/utils/StructOffsetResolverBigBang.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.internal.jobjc.generator.utils;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.util.Collection;
-
-import com.apple.internal.jobjc.generator.model.Framework;
-import com.apple.internal.jobjc.generator.utils.Fp.Map1;
-import com.apple.jobjc.JObjCRuntime.Width;
-
-/**
- * Takes a framework, compiles a native source file with all its structs,
- * and figures out their sizes and field offsets.
- *
- * BigBang significantly speeds up the process by
- * compiling all frameworks as one big Objective-C file.
- */
-public class StructOffsetResolverBigBang extends StructOffsetResolver{
-
-    @Override protected void _resolve(final Collection<Framework> fws) throws Exception{
-        for(final Width arch : Width.values()){
-            System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
-            String nativeSrc = generateFileForFrameworks(fws, arch);
-            String executable = compileObjC(nativeSrc, arch);
-            execute(executable, new Map1<String,Object>(){
-                public Object apply(String ln) {
-                    try {
-                        processLine(ln, fws, arch);
-                        return null;
-                    } catch (Exception e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Generates Objective-C file and returns absolute path name.
-     */
-    protected String generateFileForFrameworks(final Collection<Framework> fws, final Width arch) throws Exception{
-        File tempfile = File.createTempFile("JObjC-SORBB-" + arch + "-", ".mm");
-        PrintWriter out = new PrintWriter(new FileWriter(tempfile));
-
-        out.println("#include<iostream>");
-        for(Framework fw : fws) printHeaderLines(fw, arch, out);
-        out.println("int main(int argc, char** argv){");
-        for(Framework fw : fws) printStructInfos(fw, arch, out);
-        out.println("\treturn 0;");
-        out.println("}");
-
-        out.close();
-        return tempfile.getAbsolutePath();
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/jobjc/SuperClassExtractor.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.util.Map;
-
-import com.apple.internal.jobjc.generator.model.Clazz;
-
-/*
- * Isolating all the reflection trickery to hijack the runtime into giving up its secrets
- * without actually having a full working version of JObjC. Below is a bunch of evil reflection,
- * but it allows the generated output to have a cleaner design.
- */
-public class SuperClassExtractor {
-    public static Clazz getSuperClassFor(final String className, final MacOSXFramework nativeFramework, final Map<String, Clazz> allClasses) throws Throwable {
-        final NSClass<ID> nativeClass = new NSClass<ID>(className, nativeFramework.getRuntime());
-        final NSClass<? extends ID> nativeSuperClass = UnsafeRuntimeAccess.getSuperClass(nativeClass);
-        final String superClassName = UnsafeRuntimeAccess.getClassNameFor(nativeSuperClass);
-        if ("nil".equals(superClassName)) return null;
-
-        final Clazz superClazz = allClasses.get(superClassName);
-        if (superClazz != null) return superClazz;
-
-        final Clazz superClazzX = getSuperClassFor(superClassName, nativeFramework, allClasses);
-        System.out.print("[Warning] class \"" + superClassName + "\" not found in bridge support files, ");
-        System.out.println("using \"" + superClazzX.name + "\" as superclass for \"" + className + "\"");
-        return superClazzX;
-    }
-}
--- a/src/macosx/native/jobjc/src/generator/java/com/apple/jobjc/UnsafeRuntimeAccess.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Invoke.FunCall;
-import com.apple.jobjc.Invoke.MsgSend;
-
-public class UnsafeRuntimeAccess {
-    public static NativeArgumentBuffer getNativeBuffer() {
-        return NativeArgumentBuffer.getThreadLocalBuffer(JObjCRuntime.getInstance());
-    }
-
-    public static String getClassNameFor(final long obj) {
-        return NSClass.getClassNameOfClass(obj);
-    }
-
-    public static String getClassNameFor(final NSClass cls) {
-        return NSClass.getClassNameOfClass(cls.ptr);
-    }
-
-    public static NSClass<?> getSuperClass(final NSClass<? extends ID> clazz) {
-        return clazz.getSuperClass();
-    }
-
-    public static String getDescriptionForPtr(final long objPtr) {
-        return ID.getNativeDescription(objPtr);
-    }
-
-    public static MacOSXFramework getFramework(final String[] frameworkLibs) {
-        return new MacOSXFramework(JObjCRuntime.getInstance(), frameworkLibs);
-    }
-
-    public static FunCall createFunCall(final MacOSXFramework framework, final String fxnName, final Coder returnCoder, final Coder ... argCoders) {
-        return new FunCall(framework, fxnName, returnCoder, argCoders);
-    }
-
-    public static MsgSend createMsgSend(final NSClass<?> clazz, final String selName, final Coder returnCoder, final Coder ... argCoders) {
-        return new MsgSend(clazz.getRuntime(), selName, returnCoder, argCoders);
-    }
-
-    public static NSClass<ID> getNSClass(final MacOSXFramework framework, final String name) {
-        return new NSClass<ID>(name, framework.getRuntime());
-    }
-
-    public static long getObjPtr(final ID obj) {
-        return obj.ptr;
-    }
-}
--- a/src/macosx/native/jobjc/src/runtime-additions/java/com/apple/jobjc/Utils.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.util.concurrent.Callable;
-
-import com.apple.jobjc.foundation.NSNumber;
-import com.apple.jobjc.foundation.NSString;
-
-public class Utils {
-    JObjCRuntime runtime;
-    Utils(JObjCRuntime runtime){ this.runtime = runtime; }
-
-    private static Utils utils;
-    public static Utils get() {
-        JObjCRuntime runtime = JObjCRuntime.getInstance(); // enforce security check
-        return utils != null ? utils : (utils = new Utils(runtime));
-    }
-
-    private Strings strings_;
-    public Strings strings() {
-        return strings_ != null ? strings_ : (strings_ = new Strings(runtime));
-    }
-
-    private Numbers numbers_;
-    public Numbers numbers() {
-        return numbers_ != null ? numbers_ : (numbers_ = new Numbers(runtime));
-    }
-
-    private Threads threads_;
-    public Threads threads() {
-        return threads_ != null ? threads_ : (threads_ = new Threads(runtime));
-    }
-
-    public static class Strings {
-        private static native long getNativeNSStringForJavaString(final String javaString);
-        private static native String getNativeJavaStringForNSString(final long nsString);
-
-        JObjCRuntime runtime;
-        Strings(JObjCRuntime runtime) { this.runtime = runtime; }
-
-        public NSString nsString(final String str) {
-            if (str == null) return null;
-            final long nsString = getNativeNSStringForJavaString(str);
-            return ID.createNewObjCObjectForClass(NSString.class, nsString, runtime);
-        }
-
-        public String javaString(final NSString str) {
-            if (str == null) return null;
-            return getNativeJavaStringForNSString(((ID)str).ptr);
-        }
-
-//        static public CString cStringForJavaString(final String str) {
-//            return null;
-//        }
-    }
-
-    public static class Numbers {
-        private static native long getNativeNSNumberForJavaNumber(final Number num);
-        private static native Number getNativeJavaNumberForNSNumber(final long num);
-
-        JObjCRuntime runtime;
-        Numbers(JObjCRuntime runtime) { this.runtime = runtime; }
-
-        public NSNumber nsNumber(final Number num) {
-            if (num == null) return null;
-            final long nsNumber = getNativeNSNumberForJavaNumber(num);
-            return ID.createNewObjCObjectForClass(NSNumber.class, nsNumber, runtime);
-        }
-
-        public Number javaNumber(final NSNumber num) {
-            if (num == null) return null;
-            return getNativeJavaNumberForNSNumber(((ID)num).ptr);
-        }
-    }
-
-    public static class Threads {
-        private static native void performRunnableOnMainThread(final Runnable runnable, final boolean wait);
-        private static native <V> V performCallableOnMainThread(final Callable<V> callable) throws Exception;
-
-        JObjCRuntime runtime;
-        Threads(JObjCRuntime runtime) { this.runtime = runtime; }
-
-        /**
-         * Perform callable on main thread. Exceptions that are thrown on the main thread are ignored.
-         */
-        public void performOnMainThread(final Runnable runnable, final boolean wait) {
-            performRunnableOnMainThread(runnable, wait);
-        }
-
-        /**
-         * Perform callable on main thread, block until done, and return the result.
-         * This also catches any exceptions on the main thread, brings them back and throws them to the caller.
-         */
-        public <V> V performOnMainThread(final Callable<V> callable) throws Exception{
-            return performCallableOnMainThread(callable);
-        }
-    }
-}
--- a/src/macosx/native/jobjc/src/runtime-additions/native/NativeNumber.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Utils_Numbers.h"
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-/*
- * Class:     com_apple_jobjc_Utils_Numbers
- * Method:    getNativeNSNumberForJavaNumber
- * Signature: (Ljava/lang/Number;)J
- */
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_Utils_00024Numbers_getNativeNSNumberForJavaNumber
-(JNIEnv *env, jclass clazz, jobject javaNumber)
-{
-    return ptr_to_jlong(JNFJavaToNSNumber(env, javaNumber));
-}
-
-/*
- * Class:     com_apple_jobjc_Utils_Numbers
- * Method:    getNativeJavaNumberForNSNumber
- * Signature: (J)Ljava/lang/Number;
- */
-JNIEXPORT jobject JNICALL Java_com_apple_jobjc_Utils_00024Numbers_getNativeJavaNumberForNSNumber
-(JNIEnv *env, jclass clazz, jlong nativeNumber)
-{
-    return JNFNSToJavaNumber(env, (NSNumber *)jlong_to_ptr(nativeNumber));
-}
--- a/src/macosx/native/jobjc/src/runtime-additions/native/NativeString.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Utils_Strings.h"
-
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-
-/*
- * Class:     com_apple_jobjc_Utils_Strings
- * Method:    getNativeNSStringForJavaString
- * Signature: (Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_Utils_00024Strings_getNativeNSStringForJavaString
-(JNIEnv *env, jclass clazz, jstring javaString)
-{
-    return ptr_to_jlong(JNFJavaToNSString(env, javaString));
-}
-
-/*
- * Class:     com_apple_jobjc_Utils_Strings
- * Method:    getNativeJavaStringForNSString
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_apple_jobjc_Utils_00024Strings_getNativeJavaStringForNSString
-(JNIEnv *env, jclass clazz, jlong nativeString)
-{
-    return JNFNSToJavaString(env, (NSString *)jlong_to_ptr(nativeString));
-}
--- a/src/macosx/native/jobjc/src/runtime-additions/native/NativeThread.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "com_apple_jobjc_Utils_Threads.h"
-
-#import <AppKit/AppKit.h>
-#import <JavaNativeFoundation/JavaNativeFoundation.h>
-
-
-@interface JObjCCallable : NSObject {
-    @public jobject returnValue;
-    @public jthrowable exception;
-}
-@property jobject returnValue;
-@property jthrowable exception;
-- (void) performCallable:(JNFJObjectWrapper *)callableWrapper;
-@end
-
-/*
- * Class:     com_apple_jobjc_Utils_Threads
- * Method:    performRunnableOnMainThreadNative
- * Signature: (Ljava/lang/Runnable;Z)V
- */
-JNIEXPORT void JNICALL Java_com_apple_jobjc_Utils_00024Threads_performRunnableOnMainThread
-(JNIEnv *env, jclass clazz, jobject runnable, jboolean jWaitUntilDone)
-{
-JNF_COCOA_ENTER(env);
-    [JNFRunLoop performOnMainThreadWaiting:jWaitUntilDone
-                                 withBlock:[JNFRunnable blockWithRunnable:runnable
-                                                                  withEnv:env]];
-JNF_COCOA_EXIT(env);
-}
-
-/*
- * Class:     com_apple_jobjc_Utils_Threads
- * Method:    performCallableOnMainThreadNative
- * Signature: (Ljava/util/concurrent/Callable;)Ljava/lang/Object;
- */
-JNIEXPORT jobject JNICALL Java_com_apple_jobjc_Utils_00024Threads_performCallableOnMainThread
-(JNIEnv *env, jclass clazz, jobject callable)
-{
-    jobject returnValue = NULL;
-
-JNF_COCOA_ENTER(env);
-    JNFJObjectWrapper *callableWrapper = [[JNFJObjectWrapper alloc] initWithJObject:callable withEnv:env];
-    JObjCCallable *ncallable = [JObjCCallable alloc];
-
-    [ncallable performSelectorOnMainThread:@selector(performCallable:)
-                                withObject:callableWrapper
-                             waitUntilDone:true];
-
-    returnValue = ncallable.returnValue;
-    jthrowable exception = ncallable.exception;
-
-    [ncallable release];
-    if(exception) (*env)->Throw(env, exception);
-
-JNF_COCOA_EXIT(env);
-
-    return returnValue;
-}
-
-
-@implementation JObjCCallable
-@synthesize returnValue;
-@synthesize exception;
-
-- (void) performCallable:(JNFJObjectWrapper *)callableWrapper {
-    static JNF_CLASS_CACHE(jc_Callable, "java/util/concurrent/Callable");
-    static JNF_MEMBER_CACHE(jm_Callable_call, jc_Callable, "call", "()Ljava/lang/Object;");
-
-    JNFThreadContext threadWasAttached = JNFThreadDetachOnThreadDeath;
-    JNIEnv *env = JNFObtainEnv(&threadWasAttached);
-    jobject callable = [callableWrapper jObject];
-
-    @try{
-        self.returnValue = JNFCallObjectMethod(env, callable, jm_Callable_call);
-    } @catch (JNFException *x) {
-        [x raiseToJava:env];
-    }
-
-    self.exception = (*env)->ExceptionOccurred(env);
-    (*env)->ExceptionClear(env);
-
-    [callableWrapper release];
-    JNFReleaseEnv(env, &threadWasAttached);
-}
-
-@end
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BaseBench.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import sun.misc.Unsafe;
-
-public class BaseBench extends PooledTestCase {
-    protected final static JObjCRuntime RUNTIME = JObjCRuntime.getInstance();
-    protected final static JObjC JOBJC = JObjC.getInstance();
-    protected final static Unsafe UNSAFE = JObjCRuntime.getInstance().unsafe;
-    protected final static NativeArgumentBuffer ARGS = JObjCRuntime.getInstance().getThreadLocalState();
-
-    public abstract static class Task{
-        final String name;
-        public Task(String name){ this.name = name; }
-        public abstract void run();
-    }
-
-    public void bench(final String title, final long warmup, final long runs, final long iterations, final Task... tasks){
-        final long[] runtimes = new long[tasks.length];
-
-        for(int t = 0; t < tasks.length; ++t){
-            long runtime = 0;
-            for(int i = 0; i < warmup; ++i)
-                singleBench(iterations, tasks[t]);
-            for(int i = 0; i < runs; ++i)
-                runtime = runtime + singleBench(iterations, tasks[t]);
-            runtimes[t] = runtime;
-        }
-
-        final float[] relatives = new float[tasks.length];
-
-        for(int t = 0; t < tasks.length; ++t)
-            relatives[t] = ((float) runtimes[t] / (float) runs);
-
-        float min = relatives[0];
-        for(float t : relatives)
-            if(t < min)
-                min = t;
-
-        for(int t = 0; t < tasks.length; ++t)
-            relatives[t] = relatives[t] / min;
-
-        System.out.format("\n* %1$s\n", title);
-        for(int t = 0; t < tasks.length; ++t)
-            System.out.format("%1$60s : %2$.1f\n", tasks[t].name, relatives[t]);
-    }
-
-    public long singleBench(final long iterations, final Task task){
-        long start = System.currentTimeMillis();
-        for(long i = 0; i < iterations; ++i)
-            task.run();
-        long end = System.currentTimeMillis();
-        return end - start;
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchFunCall.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Invoke.FunCall;
-import com.apple.jobjc.PrimitiveCoder.DoubleCoder;
-
-public final class BenchFunCall extends BaseBench{
-    final static int ITERS  = 1000;
-    final static FunCall fc = new FunCall(JObjCRuntime.getInstance(), "sin", DoubleCoder.INST, DoubleCoder.INST);
-    final static double ARG = 3.14159265 / 2.0;
-    final static double RET = 1.0;
-
-    private static native double jniSin(double arg);
-
-    public void testBench(){
-        this.bench("Calling functions", 5, 3, 10000L,
-
-                new Task("JNI Invoke"){
-            @Override public void run() {
-                for(int i = 0; i < ITERS; ++i)
-                    jniSin(ARG);
-            }},
-
-            new Task("JObjC FunCall"){
-                @Override public void run() {
-                    for(int i = 0; i < ITERS; ++i){
-                        fc.init(ARGS);
-                        DoubleCoder.INST.push(ARGS, ARG);
-                        fc.invoke(ARGS);
-                        DoubleCoder.INST.pop(ARGS);
-                    }
-                }},
-
-                new Task("JObjC FunCall (inlined)"){
-                    @Override public void run() {
-                        for(int i = 0; i < ITERS; ++i){
-                            // init
-                            ARGS.argPtrsPtr = ARGS.buffer.bufferPtr;
-                            ARGS.argValuesPtr = ARGS.buffer.bufferPtr + 256;
-                            // push double
-                            //// push arg ptr
-                            if(JObjCRuntime.IS64)
-                                UNSAFE.putLong(ARGS.argPtrsPtr, ARGS.argValuesPtr);
-                            else
-                                UNSAFE.putInt(ARGS.argPtrsPtr, (int) ARGS.argValuesPtr);
-                            ARGS.argPtrsPtr += JObjCRuntime.PTR_LEN;
-                            //// push arg value
-                            UNSAFE.putDouble(ARGS.argValuesPtr, ARG);
-                            ARGS.argValuesPtr += 8;
-                            // invoke
-                            FunCall.invoke(fc.cif.cif.bufferPtr, fc.fxnPtr, ARGS.retValPtr, ARGS.buffer.bufferPtr);
-                            // pop
-                            UNSAFE.getDouble(ARGS.retValPtr);
-                        }
-                    }}
-        );
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchIDPop.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSString;
-
-public class BenchIDPop extends BaseBench{
-    static native long jniNSStringAlloc();
-    static native long jniNSStringAllocAndRetain();
-    static native long jniNSStringCached();
-    static native void jniCFRetain(long x);
-    static native void jniCFRelease(long x);
-
-    final static int ITERS = 1000;
-    final static FoundationFramework FND = JOBJC.Foundation();
-
-    private static class LongWrap{
-        long l;
-        public LongWrap(long l){ this.l = l; }
-    }
-
-    public void testIt(){
-        bench("Alloc, retain, pop a new NSString", 2, 3, 2000,
-                new Task("jniNSStringAllocAndRetain()"){
-            @Override public void run() {
-                for(int i = 0; i < ITERS; i++)
-                    jniNSStringAllocAndRetain();
-            }},
-
-            new Task("new LongWrap(jniNSStringAllocAndRetain())"){
-                @Override public void run() {
-                    for(int i = 0; i < ITERS; i++)
-                        new LongWrap(jniNSStringAllocAndRetain());
-                }},
-
-                new Task("FND.NSString().alloc()"){
-                    @Override public void run() {
-                        for(int i = 0; i < ITERS; i++)
-                            FND.NSString().alloc();
-                    }},
-
-                    new Task("new NSString(jniNSStringAlloc(), RUNTIME)"){
-                        @Override public void run() {
-                            for(int i = 0; i < ITERS; i++)
-                                new NSString(jniNSStringAlloc(), RUNTIME);
-                        }}
-        );
-
-        final long nsstringPtr = jniNSStringAlloc();
-
-        bench("Get and hold an existing object", 2, 3, 2000,
-                new Task("jniCFRetain(nsstringPtr)"){
-            @Override public void run() {
-                for(int i = 0; i < ITERS; i++)
-                    jniCFRetain(nsstringPtr);
-            }},
-
-            new Task("jniCFRetain(new LongWrap(nsstringPtr).l"){
-                @Override public void run() {
-                    for(int i = 0; i < ITERS; i++)
-                        jniCFRetain(new LongWrap(nsstringPtr).l);
-                }},
-
-                new Task("ID.getInstance(nsstringPtr, RUNTIME)"){
-                    @Override public void run() {
-                        for(int i = 0; i < ITERS; i++)
-                            ID.getInstance(nsstringPtr, RUNTIME);
-                    }}
-        );
-    }
-
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchStructCoding.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.StructCoder;
-import com.apple.jobjc.Invoke.FunCall;
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSRect;
-
-public class BenchStructCoding extends BaseBench {
-    final static FoundationFramework FND = JOBJC.Foundation();
-    final static int ITERS = 1000;
-    final static PrimitiveCoder CODER = com.apple.jobjc.MixedPrimitiveCoder.FloatDoubleCoder;
-    final static StructCoder RCODER = NSRect.getStructCoder();
-    final static FunCall nsMakePoint =
-        new com.apple.jobjc.Invoke.FunCall(FND, "NSMakeRect", com.apple.jobjc.foundation.NSRect.getStructCoder(),
-                com.apple.jobjc.MixedPrimitiveCoder.FloatDoubleCoder,
-                com.apple.jobjc.MixedPrimitiveCoder.FloatDoubleCoder,
-                com.apple.jobjc.MixedPrimitiveCoder.FloatDoubleCoder,
-                com.apple.jobjc.MixedPrimitiveCoder.FloatDoubleCoder);
-
-    public void testFoo(){
-        bench("NSMakeRect", 3, 3, 10,
-                new Task("FND.NSMakeRect"){
-            @Override public void run() {
-                for(int i = 0; i < ITERS; ++i){
-                    NSRect s = FND.NSMakeRect(0, 1, 2, 3);
-//                    assertEquals(1.0D, s.origin().y());
-                }
-            }},
-
-            new Task("nsMakeRect.invoke(..., s)"){
-                @Override public void run() {
-                    for(int i = 0; i < ITERS; ++i){
-                        nsMakePoint.init(ARGS);
-                        CODER.push(ARGS, 0.0D);
-                        CODER.push(ARGS, 1.0D);
-                        CODER.push(ARGS, 2.0D);
-                        CODER.push(ARGS, 3.0D);
-                        NSRect s = FND.makeNSRect();
-                        nsMakePoint.invoke(ARGS, s);
-//                        assertEquals(1.0D, s.origin().y());
-                    }
-                }},
-
-                new Task("nsMakeRect.invoke(..); NSRect r = pop(..);"){
-                    @Override public void run() {
-                        for(int i = 0; i < ITERS; ++i){
-                            nsMakePoint.init(ARGS);
-                            CODER.push(ARGS, 0.0D);
-                            CODER.push(ARGS, 1.0D);
-                            CODER.push(ARGS, 2.0D);
-                            CODER.push(ARGS, 3.0D);
-                            nsMakePoint.invoke(ARGS);
-                            NSRect s = (NSRect) RCODER.pop(ARGS);
-//                            assertEquals(1.0D, s.origin().y());
-                        }
-                    }}
-        );
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/BenchUnsafe.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.nio.ByteBuffer;
-
-public class BenchUnsafe extends BaseBench{
-    final static int ITERS = 1000000;
-
-    final static NativeBuffer NBUF = new NativeBuffer(2 * ITERS);
-    final static ByteBuffer BBUF = NBUF.buffer;
-    final static long ADDR = NBUF.bufferPtr;
-    final static long ADDR_MAX = NBUF.bufferPtr + ITERS;
-
-    final static NativeBuffer NBUF2 = new NativeBuffer(2 * ITERS);
-    final static ByteBuffer BBUF2 = NBUF2.buffer;
-    final static long ADDR2 = NBUF2.bufferPtr;
-    final static long ADDR2_MAX = NBUF2.bufferPtr + ITERS;
-
-    final static long ARG = 345;
-
-    final static long BUFSIZE = BBUF.limit();
-
-    public void testIt(){
-        this.bench("Memory writes", 5, 3, 100L,
-
-                new Task("buffer.putLong"){
-            @Override public void run() {
-                for(long i = 0; i < ITERS; i++)
-                    BBUF.putLong((int) i, ARG);
-            }},
-
-            new Task("unsafe.putLong"){
-                @Override public void run() {
-                    for(long i = ADDR; i < ADDR_MAX; i++)
-                        UNSAFE.putLong(i, ARG);
-                }});
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/CategoryTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.appkit.AppKitFramework;
-import com.apple.jobjc.appkit.NSStringCategory;
-import com.apple.jobjc.foundation.NSSize;
-import com.apple.jobjc.foundation.NSString;
-
-public class CategoryTest extends PooledTestCase {
-    public void testAppKit_NSString(){
-        AppKitFramework APPKIT = JObjC.getInstance().AppKit();
-
-        NSString nstr = Utils.get().strings().nsString("mirzapirza");
-        NSStringCategory nstrx = APPKIT.NSStringCategory(nstr);
-        NSSize sz = nstrx.sizeWithAttributes(null);
-
-        assertEquals(57.0, sz.width());
-        assertEquals(15.0, sz.height());
-    }
-
-    public static void main(String[] args){
-        junit.textui.TestRunner.run(CategoryTest.class);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/FunctionTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.PointerCoder;
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-import com.apple.jobjc.Coder.VoidCoder;
-import com.apple.jobjc.Invoke.FunCall;
-
-public class FunctionTest extends PooledTestCase {
-    NativeArgumentBuffer nativeBuffer;
-    JObjCRuntime runtime;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        nativeBuffer = UnsafeRuntimeAccess.getNativeBuffer();
-        runtime = nativeBuffer.runtime;
-    }
-
-    public void testInvokeNoParamNoReturn() throws Throwable {
-        final FunCall fxn = UnsafeRuntimeAccess.createFunCall(TestUtils.getAppKit(), "NSBeep", VoidCoder.INST);
-
-        fxn.init(nativeBuffer);
-        fxn.invoke(nativeBuffer);
-    }
-
-    public void testInvokeNoParams() throws Throwable {
-        final FunCall fxn = UnsafeRuntimeAccess.createFunCall(TestUtils.getFoundation(), "NSFullUserName", PointerCoder.INST);
-
-        fxn.init(nativeBuffer);
-        fxn.invoke(nativeBuffer);
-
-        final long ptr = PrimitivePointerCoder.INST.pop(nativeBuffer);
-        System.out.println("0x" + Long.toHexString(ptr) + ": " + UnsafeRuntimeAccess.getDescriptionForPtr(ptr));
-    }
-
-    public void testInvokeOneParam() throws Throwable {
-        final FunCall getHomeDirFxn = UnsafeRuntimeAccess.createFunCall(TestUtils.getAppKit(), "NSHomeDirectory", PointerCoder.INST);
-
-        getHomeDirFxn.init(nativeBuffer);
-        getHomeDirFxn.invoke(nativeBuffer);
-
-        final long homeDirPtr = PrimitivePointerCoder.INST.pop(nativeBuffer);
-        System.out.println("0x" + Long.toHexString(homeDirPtr) + ": " + UnsafeRuntimeAccess.getDescriptionForPtr(homeDirPtr));
-
-        final FunCall getTypeOfFxn = UnsafeRuntimeAccess.createFunCall(TestUtils.getFoundation(), "NSLog", PointerCoder.INST, PointerCoder.INST);
-        getTypeOfFxn.init(nativeBuffer);
-        PrimitivePointerCoder.INST.push(runtime, nativeBuffer, homeDirPtr);
-        getTypeOfFxn.invoke(nativeBuffer);
-
-    //    long typePtr = PointerCoder.pointer_coder.popPtr(nativeBuffer);
-    //    System.out.println("0x" + Long.toHexString(typePtr) + ": " + TestUtils.getDescriptionForPtr(typePtr));
-    }
-
-    public static void main(final String[] args) {
-        junit.textui.TestRunner.run(FunctionTest.class);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/GUIDemo.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Utils.Strings;
-import com.apple.jobjc.appkit.NSApplication;
-import com.apple.jobjc.appkit.NSButton;
-import com.apple.jobjc.appkit.NSDrawer;
-import com.apple.jobjc.appkit.NSMenu;
-import com.apple.jobjc.appkit.NSWindow;
-import com.apple.jobjc.foundation.NSAutoreleasePool;
-import com.apple.jobjc.foundation.NSObject;
-import com.apple.jobjc.foundation.NSObjectClass;
-import com.apple.jobjc.foundation.NSRect;
-import com.apple.jobjc.foundation.NSSize;
-
-class MyDelegate extends NSObject{
-    static final JObjC objc = JObjC.getInstance();
-    static final Strings str = Utils.get().strings();
-
-    public MyDelegate(long ptr, JObjCRuntime r) { super(ptr, r); }
-
-    private NSWindow myWindow;
-    private NSDrawer myDrawer;
-
-    public void printHello(ID sender){
-        System.out.println("Hello!");
-        myDrawer.toggle(this);
-    }
-
-    public void createMenu(){
-        NSMenu menu = objc.AppKit().NSMenu().newID();
-        menu.addItemWithTitle_action_keyEquivalent(
-                str.nsString("Quit"),
-                new SEL("terminate:"),
-                str.nsString("q"));
-        NSApplication app = objc.AppKit().NSApp();
-        app.setMainMenu(menu);
-    }
-
-    public void createWindow(){
-        NSRect rect;
-        int styleMask = objc.AppKit().NSTitledWindowMask() | objc.AppKit().NSMiniaturizableWindowMask();
-        NSButton myButton;
-        NSSize buttonSize;
-        myButton = objc.AppKit().NSButton().newID();
-        myButton.setTitle(str.nsString("Print Hello!"));
-        myButton.sizeToFit();
-        myButton.setTarget(this);
-        myButton.setAction(new SEL("printHello:"));
-        buttonSize = myButton.frame().size();
-        rect = objc.Foundation().NSMakeRect(100, 100, 2*buttonSize.width(), 2*buttonSize.height());
-        myWindow = objc.AppKit().NSWindow().alloc();
-        myWindow = myWindow.initWithContentRect_styleMask_backing_defer(
-                rect, styleMask, objc.AppKit().NSBackingStoreBuffered(), false);
-        myWindow.setTitle(str.nsString("This is a test window."));
-        myWindow.setContentView(myButton);
-
-        myDrawer = objc.AppKit().NSDrawer().alloc();
-        myDrawer = myDrawer.initWithContentSize_preferredEdge(
-                  objc.Foundation().NSMakeSize(100, 40), objc.Foundation().NSMinYEdge());
-        myDrawer.setParentWindow(myWindow);
-    }
-
-    public void applicationWillFinishLaunching(ID not){
-        createMenu();
-        createWindow();
-    }
-
-    public void applicationDidFinishLaunching(ID not){
-        myWindow.makeKeyAndOrderFront(null);
-    }
-}
-
-class MyDelegateClass extends NSObjectClass{
-    public MyDelegateClass(JObjCRuntime r){ super(r); }
-}
-
-public class GUIDemo{
-    static final JObjC objc = JObjC.getInstance();
-
-    public static void main(String[] args){
-        JObjCRuntime.getInstance().registerUserClass(MyDelegate.class, MyDelegateClass.class);
-
-        objc.AppKit().NSApplication().sharedApplication();
-        NSApplication app = objc.AppKit().NSApp();
-
-        NSAutoreleasePool pool = objc.Foundation().NSAutoreleasePool().alloc();
-        pool = pool.init();
-        app.setDelegate(new MyDelegateClass(JObjCRuntime.getInstance()).newID());
-        app.run();
-        pool.drain();
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/IBDemo.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * 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
- * 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.
- */
-/**
- * To locate the nib correctly, this demo must run from
- * a .app (created with Jar Bundler...).
- *
- * TODO Add .app/Jar Bundler as ant task
- */
-
-package com.apple.jobjc;
-
-import java.awt.Toolkit;
-
-import com.apple.jobjc.appkit.AppKitFramework;
-import com.apple.jobjc.appkit.NSApplication;
-import com.apple.jobjc.appkit.NSView;
-import com.apple.jobjc.appkit.NSViewClass;
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSRect;
-import com.apple.jobjc.foundation.NSString;
-
-class MyView extends NSView{
-    static final AppKitFramework APPKIT = JObjC.getInstance().AppKit();
-
-    public MyView(long objPtr, JObjCRuntime runtime) { super(objPtr, runtime); }
-
-    @Override public void drawRect(NSRect r){
-        APPKIT.NSColor().redColor().set();
-        APPKIT.NSBezierPath().fillRect(r);
-    }
-}
-
-class MyViewClass extends NSViewClass{
-    protected MyViewClass(String name, JObjCRuntime runtime) { super(name, runtime); }
-    public MyViewClass(JObjCRuntime runtime){ this(MyView.class.getSimpleName(), runtime); }
-}
-
-public class IBDemo{
-    final static FoundationFramework FOUNDATION = JObjC.getInstance().Foundation();
-    final static AppKitFramework APPKIT = JObjC.getInstance().AppKit();
-
-    // Works if the JVM is launched on the main thread,
-    // but JavaApplicationStub does not understand -XstartOnFirstThread
-    public static void mainWithAppMain(String[] args){
-        APPKIT.NSApplicationMain(0, null);
-    }
-
-    // Work around: let someone else init, and then
-    // get on the main thread to load the nib.
-    public static void mainWithoutAppMain(String[] args){
-        Toolkit.getDefaultToolkit();
-
-        Utils.get().threads().performOnMainThread(new Runnable(){
-            public void run() {
-                APPKIT.NSApplication().sharedApplication();
-                NSApplication APP = APPKIT.NSApp();
-
-                NSString nibName = Utils.get().strings().nsString("MainMenu");
-                boolean loadedNib = APPKIT.NSBundleCategory().loadNibNamed_owner(nibName, APP);
-                if(!loadedNib) throw new RuntimeException("Failed to load nib.");
-            }}, false);
-    }
-
-    public static void main(String[] args){
-        JObjCRuntime.getInstance().registerUserClass(MyView.class, MyViewClass.class);
-        mainWithoutAppMain(args);
-        //mainWithAppMain(args);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/IntroTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import junit.framework.TestCase;
-
-import com.apple.jobjc.Invoke.FunCall;
-import com.apple.jobjc.PrimitiveCoder.DoubleCoder;
-import com.apple.jobjc.appkit.AppKitFramework;
-import com.apple.jobjc.appkit.NSApplication;
-import com.apple.jobjc.appkit.NSApplicationClass;
-import com.apple.jobjc.appkit.NSColorPanel;
-import com.apple.jobjc.appkit.NSWorkspace;
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSAutoreleasePool;
-import com.apple.jobjc.foundation.NSPoint;
-import com.apple.jobjc.foundation.NSString;
-import com.apple.jobjc.foundation.NSStringClass;
-
-public class IntroTest extends TestCase{
-    // The low-level core makes function calls, sends messages, marshals data, etc.
-    public void testCore(){
-        // pass security check and get ahold of a runtime (should cache this)
-        final JObjCRuntime RUNTIME = JObjCRuntime.getInstance();
-        final NativeArgumentBuffer ARGS = JObjCRuntime.getInstance().getThreadLocalState();
-
-        // create a funcall (should cache this)
-        final FunCall fc = new FunCall(RUNTIME, "sin", DoubleCoder.INST, DoubleCoder.INST);
-
-        // start function call
-        fc.init(ARGS);
-        // push an arg
-        DoubleCoder.INST.push(ARGS, 3.14159265 / 2.0);
-        // make the call
-        fc.invoke(ARGS);
-        // read the return value
-        double ret = DoubleCoder.INST.pop(ARGS);
-
-        assertEquals(1.0, ret);
-    }
-
-    // Frameworks bridge the Mac OS X frameworks
-    public void testFrameworks(){
-        // First, get an instance of JObjC:
-        final JObjC JOBJC = com.apple.jobjc.JObjC.getInstance();
-
-        // It's your gateway to the frameworks.
-        final FoundationFramework FND = JOBJC.Foundation();
-        final AppKitFramework APP = JOBJC.AppKit();
-
-        // From which you can then access...
-
-        // enums, defines, constants
-        int nsmye = FND.NSMaxYEdge();
-        boolean debug = FND.NSDebugEnabled();
-
-        // structs
-        NSPoint p = FND.makeNSPoint();
-        p.setX(3);
-        assertEquals(3.0, p.x());
-
-        // C functions
-        NSPoint p2 = FND.NSMakePoint(12, 34);
-        assertEquals(12.0, p2.x());
-
-        // ... Let's create an AutoreleasePool before we go on
-        NSAutoreleasePool pool = ((NSAutoreleasePool) FND.NSAutoreleasePool().alloc()).init();
-
-        // Objective-C classes
-        NSStringClass nsc = FND.NSString();
-
-        // class-methods
-        NSString nsStringClassDescr = nsc.description();
-
-        // instances
-        NSString nsi = ((NSString) FND.NSString().alloc()).init();
-
-        // instance methods
-        NSString d = nsi.description();
-
-        // The bridge marshals some types for you, but it doesn't
-        // convert between NSString and Java String automatically.
-        // For that we use Utils.get().strings().nsString(String)
-        // and Utils.get().strings().javaString(NSString);
-
-        assertEquals("NSString", Utils.get().strings().javaString(nsStringClassDescr));
-
-        NSString format = Utils.get().strings().nsString("Foo bar %d baz");
-
-        NSString formatted = ((NSString) FND.NSString().alloc()).initWithFormat(format, 34);
-        String jformatted = Utils.get().strings().javaString(formatted);
-
-        assertEquals("Foo bar 34 baz", jformatted);
-
-        // Reveal in Finder
-//        NSString file = Utils.get().strings().nsString(
-//                "/Applications/Calculator.app/Contents/Resources/Calculator.icns");
-//        APP.NSWorkspace().sharedWorkspace()
-//           .selectFile_inFileViewerRootedAtPath(file, null);
-
-        pool.drain();
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/NSClassTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSString;
-import com.apple.jobjc.foundation.NSStringClass;
-
-public class NSClassTest extends PooledTestCase{
-    JObjC JOBJC = JObjC.getInstance();
-    FoundationFramework FND = JOBJC.Foundation();
-
-    public void testNSClassName(){
-        NSString s = ((NSString) FND.NSString().alloc()).init();
-
-        NSString cname = s.className();
-        String jcname = Utils.get().strings().javaString(cname);
-        assertEquals("NSCFString", jcname);
-    }
-
-    public void testNSClassPop(){
-        NSString s = ((NSString) FND.NSString().alloc()).init();
-
-        NSStringClass c = s.classNSClass();
-        String jdescr = Utils.get().strings().javaString(c.description());
-        assertEquals("NSCFString", jdescr);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/NativeBufferTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import junit.framework.TestCase;
-
-public class NativeBufferTest extends TestCase{
-    public void testSlicePtrs(){
-        JObjC.getInstance();
-
-        NativeBuffer b = new NativeBuffer(123);
-        b.position(1);
-        NativeBuffer c = b.slice();
-        assertEquals(b.bufferPtr + 1, c.bufferPtr);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/NativeTypeTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.internal.jobjc.generator.model.types.NType;
-import com.apple.internal.jobjc.generator.utils.NTypeMerger;
-import com.apple.internal.jobjc.generator.utils.NTypeParser;
-
-public class NativeTypeTest extends PooledTestCase{
-
-    private NType doParse(String type){
-        NType nt = NTypeParser.parseFrom(type);
-        String printed = nt.toString();
-        System.out.println("Original: " + type);
-        System.out.println("Printed.: " + printed);
-        assertEquals(type, printed);
-        return nt;
-    }
-
-    // {_NSRect=
-    //   "origin"{_NSPoint="x"f"y"f}
-    //   "size"{_NSSize="width"f"height"f}}
-    public void testStruct(){
-        doParse("{_NSRect=\"origin\"{_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=\"width\"f\"height\"f}}");
-    }
-
-    // {IOBluetoothL2CAPChannelEvent=
-    //   "eventType"i
-    //   "u"(?=
-    //     "data"{IOBluetoothL2CAPChannelDataBlock=
-    //       "dataPtr"^v
-    //       "dataSize"I}
-    //     "writeRefCon"^v
-    //     "padding"[32C])
-    //   "status"i}
-    public void testUnion(){
-        doParse("{IOBluetoothL2CAPChannelEvent=\"eventType\"i\"u\"(?=\"data\"{IOBluetoothL2CAPChannelDataBlock=\"dataPtr\"^v\"dataSize\"I}\"writeRefCon\"^v\"padding\"[32C])\"status\"i}");
-    }
-
-    public void testUnknown(){
-        doParse("{_CFSocketContext=\"version\"i\"info\"^v\"retain\"^?\"release\"^?\"copyDescription\"^?}");
-    }
-
-    public void testEmptyStruct(){
-        doParse("{_CFSocketSignature=\"protocolFamily\"i\"socketType\"i\"protocol\"i\"address\"^{__CFData}}");
-    }
-
-    public void testCharPtr(){
-        doParse("^*");
-    }
-
-    public void doEquals(final String s){
-        assertEquals(doParse(s), doParse(s));
-    }
-
-    public void testEquals(){
-        doEquals("{_NSRect=\"origin\"{_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=\"width\"f\"height\"f}}");
-        doEquals("{IOBluetoothL2CAPChannelEvent=\"eventType\"i\"u\"(?=\"data\"{IOBluetoothL2CAPChannelDataBlock=\"dataPtr\"^v\"dataSize\"I}\"writeRefCon\"^v\"padding\"[32C])\"status\"i}");
-        doEquals("{_CFSocketContext=\"version\"i\"info\"^v\"retain\"^?\"release\"^?\"copyDescription\"^?}");
-        doEquals("{_CFSocketSignature=\"protocolFamily\"i\"socketType\"i\"protocol\"i\"address\"^{__CFData}}");
-    }
-
-    public void testMerge(){
-        NType a = doParse("{_NSRect={_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=ff}}");
-        NType b = doParse("{_NSRect=\"origin\"{_NSPoint=ff}{_NSSize=\"width\"f\"height\"f}}");
-        NType c = NTypeMerger.inst().merge(a, b);
-        NType expected = doParse("{_NSRect=\"origin\"{_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=\"width\"f\"height\"f}}");
-        System.out.println("Merge results:");
-        System.out.println("\ta: " + a.toString());
-        System.out.println("\tb: " + b.toString());
-        System.out.println("\tc: " + c.toString());
-        System.out.println("\tx: " + expected.toString());
-        assertEquals(expected, c);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/PooledTestCase.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import junit.framework.TestCase;
-
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSAutoreleasePool;
-
-public class PooledTestCase extends TestCase {
-    static{
-        System.loadLibrary("JObjC-tests");
-    }
-    NSAutoreleasePool pool;
-
-    @Override public void setUp() throws Exception {
-        FoundationFramework foundation = JObjC.getInstance().Foundation();
-        pool = foundation.NSAutoreleasePool().alloc();
-        pool.init();
-    }
-
-    @Override public void tearDown() throws Exception {
-        pool.drain();
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/SELTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.PointerCoder;
-import com.apple.jobjc.Coder.PrimitivePointerCoder;
-import com.apple.jobjc.Invoke.MsgSend;
-
-public class SELTest extends PooledTestCase {
-
-    NativeArgumentBuffer nativeBuffer;
-    JObjCRuntime runtime;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        nativeBuffer = UnsafeRuntimeAccess.getNativeBuffer();
-        runtime = nativeBuffer.runtime;
-    }
-
-    public void testGetBlackColor() throws Throwable {
-        final MacOSXFramework appKit = TestUtils.getAppKit();
-        final NSClass<? extends ID> clazz = UnsafeRuntimeAccess.getNSClass(appKit, "NSColor");
-        final MsgSend sel = UnsafeRuntimeAccess.createMsgSend(clazz, "redColor", PointerCoder.INST);
-
-        sel.init(nativeBuffer, clazz);
-        sel.invoke(nativeBuffer);
-
-        final long blackColorPtr = PrimitivePointerCoder.INST.pop(nativeBuffer);
-        String dscr = UnsafeRuntimeAccess.getDescriptionForPtr(blackColorPtr);
-
-        System.out.println("0x" + Long.toHexString(blackColorPtr) + ": " + dscr);
-        assertEquals("NSCalibratedRGBColorSpace 1 0 0 1", dscr);
-    }
-
-    public static void main(final String[] args) {
-        junit.textui.TestRunner.run(SELTest.class);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/StructTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.io.StringWriter;
-
-import com.apple.jobjc.coreaudio.AudioBuffer;
-import com.apple.jobjc.foundation.NSPoint;
-import com.apple.jobjc.foundation.NSRect;
-
-public class StructTest extends PooledTestCase {
-    public void testSimpleStruct(){
-        AudioBuffer b = JObjC.getInstance().CoreAudio().makeAudioBuffer();
-        assertEquals(0, b.mNumberChannels());
-        assertEquals(0, b.mDataByteSize());
-        b.setMNumberChannels(1);
-        b.setMDataByteSize(3);
-        assertEquals(1, b.mNumberChannels());
-        assertEquals(3, b.mDataByteSize());
-    }
-
-    public void testNestedStruct(){
-        NSRect r = JObjC.getInstance().Foundation().makeNSRect();
-        assertTrue(0f == r.size().width());
-        r.size().setWidth(3f);
-        assertTrue(3f == r.size().width());
-        assertTrue(r.size() == r.size());
-    }
-
-    public void testSTRET(){
-        NSPoint point = JObjC.getInstance().Foundation().NSMakePoint(3, 4);
-        assertTrue(point.x() == 3);
-        assertTrue(point.y() == 4);
-
-        NSRect rect = JObjC.getInstance().Foundation().NSMakeRect(0, 1, 2, 3);
-        assertTrue(rect.origin().x() == 0);
-        assertTrue(rect.origin().y() == 1);
-        assertTrue(rect.size().width() == 2);
-        assertTrue(rect.size().height() == 3);
-    }
-
-    //
-
-    private char halfByteToHex(int b){
-        return (b >= 0x0 && b < 0xA) ? (char) ('0' + b) : (char) ('A' + (b-0xA));
-    }
-
-    private String byteToHexString(Byte b){
-        StringWriter sw = new StringWriter();
-        sw.append(halfByteToHex(b & 0xF));
-        sw.append(halfByteToHex((b & 0xF0) >> 4));
-        return sw.toString();
-    }
-
-    String print(Struct st){
-        StringWriter sw = new StringWriter();
-        st.raw.position(0);
-        sw.append(st.getClass().getSimpleName() + ":" + st.raw.limit() + " @ " + Long.toHexString(st.raw.bufferPtr) + " : ");
-        for(int i = 0; i < st.raw.limit(); i++){
-            sw.append(byteToHexString(st.raw.get()) + " ");
-            if((i+1) % 4 == 0)
-                sw.append(" ");
-        }
-        System.out.println(sw.toString().trim());
-        return sw.toString().trim();
-    }
-
-    public static void main(String[] args){
-        junit.textui.TestRunner.run(StructTest.class);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/SubclassingTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,231 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.Coder.IDCoder;
-import com.apple.jobjc.Coder.VoidCoder;
-import com.apple.jobjc.Invoke.MsgSend;
-import com.apple.jobjc.Invoke.MsgSendSuper;
-import com.apple.jobjc.PrimitiveCoder.DoubleCoder;
-import com.apple.jobjc.PrimitiveCoder.FloatCoder;
-import com.apple.jobjc.PrimitiveCoder.SIntCoder;
-import com.apple.jobjc.PrimitiveCoder.SLongLongCoder;
-import com.apple.jobjc.foundation.NSObject;
-import com.apple.jobjc.foundation.NSObjectClass;
-import com.apple.jobjc.foundation.NSPoint;
-import com.apple.jobjc.foundation.NSString;
-
-public class SubclassingTest extends PooledTestCase{
-    JObjCRuntime runtime;
-    NativeArgumentBuffer ctx;
-
-    @Override public void setUp() throws Exception{
-        super.setUp();
-        this.runtime = JObjCRuntime.getInstance();
-        this.ctx = runtime.getThreadLocalState();
-
-        runtime.registerUserClass(MyObject.class, MyObjectClass.class);
-    }
-
-    public void testClass(){
-        final MyObjectClass cls = new MyObjectClass(runtime);
-        assertEquals(MyObject.class.getSimpleName(), UnsafeRuntimeAccess.getClassNameFor(cls));
-    }
-
-    public void testInst(){
-        final MyObjectClass cls = new MyObjectClass(runtime);
-        final MyObject instObj = cls.alloc();
-        final MyObject retrievedObj = Subclassing.getJObjectFromIVar(UnsafeRuntimeAccess.getObjPtr(instObj));
-        assertTrue(instObj == retrievedObj);
-    }
-
-    public void testVoidVoidMethod(){
-        final MyObject instObj = new MyObjectClass(runtime).alloc();
-
-        assertEquals(0, instObj.myMethodHits);
-        MsgSend sel = new MsgSend(runtime, "myMethod", VoidCoder.INST);
-        sel.init(ctx, instObj);
-        sel.invoke(ctx);
-        assertEquals(1, instObj.myMethodHits);
-    }
-
-    public void testMsgSendSuper(){
-        final MyObjectClass cls = new MyObjectClass(runtime);
-        final MyObject obj = ((MyObject) cls.alloc()).init();
-
-        // direct descr
-
-        assertEquals("foo", Utils.get().strings().javaString(obj.description()));
-
-        // indirect (from native) descr
-        {
-            MsgSend msgSend = new MsgSend(runtime, "description", IDCoder.INST);
-            msgSend.init(ctx, obj);
-            msgSend.invoke(ctx);
-            assertEquals("foo", Utils.get().strings().javaString((NSString) IDCoder.INST.pop(ctx)));
-        }
-
-        // indirect (from native) descr
-        {
-            MsgSendSuper msgSendSuper = new MsgSendSuper(runtime, "description", IDCoder.INST);
-            msgSendSuper.init(ctx, obj, cls);
-            msgSendSuper.invoke(ctx);
-            assertEquals("foo", Utils.get().strings().javaString((NSString) IDCoder.INST.pop(ctx)));
-        }
-
-        // nso descr
-        {
-            MsgSendSuper msgSendSuper = new MsgSendSuper(runtime, "description", IDCoder.INST);
-            msgSendSuper.init(ctx, obj, JObjC.getInstance().Foundation().NSObject());
-            msgSendSuper.invoke(ctx);
-
-            final NSString nsod = (NSString) IDCoder.INST.pop(ctx);
-            String jde = Utils.get().strings().javaString(nsod);
-            assertEquals(jde.substring(0, 9), "<MyObject");
-        }
-    }
-
-    public void testPerformSelector(){
-        final MyObject instObj = new MyObjectClass(runtime).alloc();
-
-        assertEquals(0, instObj.myMethodHits);
-        instObj.performSelector(new SEL("myMethod"));
-        assertEquals(1, instObj.myMethodHits);
-
-        instObj.performSelectorOnMainThread_withObject_waitUntilDone(
-                new SEL("myMethod"), null, true);
-        assertEquals(2, instObj.myMethodHits);
-    }
-
-    public void testVoidIntMethod(){
-        final MyObject instObj = new MyObjectClass(runtime).alloc();
-
-        MsgSend sel2 = new MsgSend(runtime, "intMethod", SIntCoder.INST);
-        sel2.init(ctx, instObj);
-        sel2.invoke(ctx);
-        int ret = SIntCoder.INST.popInt(ctx);
-        assertEquals(3, ret);
-    }
-
-    public void testStructStructMethod(){
-        final MyObject instObj = new MyObjectClass(runtime).alloc();
-
-        NSPoint p = JObjC.getInstance().Foundation().NSMakePoint(3, 3);
-
-        MsgSend sel2 = new MsgSend(runtime, "doubleIt:", p.getCoder(), p.getCoder());
-        sel2.init(ctx, instObj);
-        p.getCoder().push(ctx, p);
-        sel2.invoke(ctx, p);
-
-        assertEquals(6.0, p.x());
-    }
-
-    public void testNSStringNSStringMethod(){
-        final MyObject instObj = new MyObjectClass(runtime).alloc();
-
-        final NSString orig = Utils.get().strings().nsString("foobar");
-        final String expected = "foobarfoobarfoobar";
-
-        final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
-        sel.init(ctx, instObj);
-        IDCoder.INST.push(ctx, orig);
-        sel.invoke(ctx);
-        NSString ret = (NSString) IDCoder.INST.pop(ctx);
-        assertEquals(expected, Utils.get().strings().javaString(ret));
-    }
-
-    public void testDoubleIntLongMethod(){
-        final MyObject instObj = new MyObjectClass(runtime).alloc();
-
-        final int arg1 = 3;
-        final long arg2 = 4;
-        final float arg3 = 5.5F;
-        final double expected = 12.5D;
-
-        final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST,
-                SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST);
-        sel.init(ctx, instObj);
-        SIntCoder.INST.push(ctx, arg1);
-        SLongLongCoder.INST.push(ctx, arg2);
-        FloatCoder.INST.push(ctx, arg3);
-        sel.invoke(ctx);
-        final double ret = DoubleCoder.INST.pop(ctx);
-        assertEquals(expected, ret);
-    }
-
-    public static void main(String[] args){
-        junit.textui.TestRunner.run(SubclassingTest.class);
-    }
-}
-
-class MyObject extends NSObject{
-    public MyObject(long objPtr, JObjCRuntime runtime) {
-        super(objPtr, runtime);
-    }
-
-    public int myMethodHits = 0;
-
-    public void myMethod(){
-        myMethodHits++;
-    }
-
-    public int intMethod(){
-        return 3;
-    }
-
-    public NSString stringTimesThree(NSString nss){
-        int count = 3;
-        String jss = Utils.get().strings().javaString(nss);
-        String js2 = "";
-        while(count-- > 0)
-            js2 += jss;
-        return Utils.get().strings().nsString(js2);
-    }
-
-    public double add_and_and(int a, long b, float c){
-        return a + b + c;
-    }
-
-    public NSPoint doubleIt(NSPoint p){
-        System.out.println("Doubling NSPoint(" + p.x() + ", " + p.y() + ").");
-        p.setX(p.x() * 2);
-        p.setY(p.y() * 2);
-        return p;
-    }
-
-    @Override public NSString description(){
-        return Utils.get().strings().nsString("foo");
-    }
-}
-
-class MyObjectClass extends NSObjectClass{
-    protected MyObjectClass(String name, JObjCRuntime runtime) {
-        super(name, runtime);
-    }
-
-    public MyObjectClass(JObjCRuntime runtime){
-        this("MyObject", runtime);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/TestUtils.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-
-public class TestUtils {
-    static MacOSXFramework getAppKit() {
-        return UnsafeRuntimeAccess.getFramework(new String[]{"/System/Library/Frameworks/AppKit.framework/AppKit"});
-    }
-
-    static MacOSXFramework getFoundation() {
-        return UnsafeRuntimeAccess.getFramework(new String[]{"/System/Library/Frameworks/Foundation.framework/Foundation"});
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/UtilsTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import java.util.concurrent.Callable;
-
-import com.apple.jobjc.foundation.NSString;
-
-public class UtilsTest extends PooledTestCase{
-    public void testStrings(){
-        String s = "fooBarBazDazzle";
-        NSString ns = Utils.get().strings().nsString(s);
-        String t = Utils.get().strings().javaString(ns);
-        assertEquals(s, t);
-    }
-
-    public void testThreadsPerformRunnableOnMainThread(){
-        final long testThreadId = Thread.currentThread().getId();
-        class Wrap{ public long x = testThreadId; }
-        final Wrap wrap = new Wrap();
-        assertTrue(testThreadId == wrap.x);
-
-        Utils.get().threads().performOnMainThread(new Runnable(){
-            public void run() {
-                wrap.x = Thread.currentThread().getId();
-            }
-        }, true);
-
-        assertTrue(testThreadId != wrap.x);
-    }
-
-    public void testThreadsPerformCallableOnMainThread() throws Exception{
-        final long testThreadId = Thread.currentThread().getId();
-        final long mainThreadId = Utils.get().threads().performOnMainThread(new Callable<Long>(){
-            public Long call() { return Thread.currentThread().getId(); }
-        });
-        assertTrue(testThreadId != mainThreadId);
-    }
-
-    public void testThreadsPerformCallableOnMainThreadException() throws Exception{
-        class FooException extends RuntimeException{}
-        try {
-            Utils.get().threads().performOnMainThread(new Callable<Object>(){
-                public Object call() { throw new FooException(); }
-            });
-        } catch (FooException e) {
-            return;
-        }
-        fail("Failed to catch exception.");
-    }
-
-    public static void main(String[] args){
-        junit.textui.TestRunner.run(UtilsTest.class);
-    }
-}
-
--- a/src/macosx/native/jobjc/src/tests/java/com/apple/jobjc/VarArgsTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.apple.jobjc;
-
-import com.apple.jobjc.foundation.FoundationFramework;
-import com.apple.jobjc.foundation.NSDictionary;
-import com.apple.jobjc.foundation.NSString;
-
-public class VarArgsTest extends PooledTestCase {
-    FoundationFramework FND = JObjC.getInstance().Foundation();
-
-    public void testNSString_initWithFormat(){
-        String expected = "1 + 0.2 = 1.2 abracadabra";
-        NSString format = Utils.get().strings().nsString("%d + %.1f = %.1f %@");
-
-        NSString abra = Utils.get().strings().nsString("abracadabra");
-
-        NSString nstr = ((NSString)FND.NSString().alloc()).initWithFormat(format, 1, 0.2, 1.2, abra);
-        String actual = Utils.get().strings().javaString(nstr);
-
-        assertEquals(expected, actual);
-    }
-
-    public void testNSDictionary(){
-        NSString v1 = Utils.get().strings().nsString("value1");
-        NSString v2 = Utils.get().strings().nsString("value2");
-        NSString k1 = Utils.get().strings().nsString("key1");
-        NSString k2 = Utils.get().strings().nsString("key2");
-
-        NSDictionary dict = ((NSDictionary)FND.NSDictionary().alloc()).initWithObjectsAndKeys(v1, k1, v2, k2, null);
-
-        NSString nsdescr = dict.description();
-        String jdescr = Utils.get().strings().javaString(nsdescr);
-
-        assertEquals("{\n    key1 = value1;\n    key2 = value2;\n}", jdescr);
-    }
-
-    public static void main(String[] args){
-        junit.textui.TestRunner.run(VarArgsTest.class);
-    }
-}
--- a/src/macosx/native/jobjc/src/tests/native/FunCallBench.m	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-#include <JavaNativeFoundation/JavaNativeFoundation.h>
-#include <Cocoa/Cocoa.h>
-
-#include "com_apple_jobjc_BenchFunCall.h"
-#include <math.h>
-
-JNIEXPORT jdouble JNICALL Java_com_apple_jobjc_BenchFunCall_jniSin
-(JNIEnv *env, jclass clazz, jdouble x)
-{
-    return (jdouble) sin((double) x);
-}
-
-
-#include "com_apple_jobjc_BenchIDPop.h"
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_BenchIDPop_jniCFRetain
-(JNIEnv *env, jclass clazz, jlong x)
-{
-    CFRetain(jlong_to_ptr(x));
-}
-
-JNIEXPORT void JNICALL Java_com_apple_jobjc_BenchIDPop_jniCFRelease
-(JNIEnv *env, jclass clazz, jlong x)
-{
-    CFRelease(jlong_to_ptr(x));
-}
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_BenchIDPop_jniNSStringAlloc
-(JNIEnv *env, jclass clazz)
-{
-    return ptr_to_jlong([NSString alloc]);
-}
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_BenchIDPop_jniNSStringAllocAndRetain
-(JNIEnv *env, jclass clazz)
-{
-    return ptr_to_jlong(CFRetain([NSString alloc]));
-}
-
-JNIEXPORT jlong JNICALL Java_com_apple_jobjc_BenchIDPop_jniNSStringCached
-(JNIEnv *env, jclass clazz)
-{
-    static jlong str = 0;
-    if(!str) str = ptr_to_jlong([NSString alloc]);
-    return str;
-}
--- a/src/macosx/native/sun/awt/AWTView.m	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/native/sun/awt/AWTView.m	Wed Jul 09 10:42:37 2014 -0700
@@ -440,17 +440,20 @@
     JNIEnv *env = [ThreadUtilities getJNIEnv];
 
     jstring characters = NULL;
+    jstring charactersIgnoringModifiers = NULL;
     if ([event type] != NSFlagsChanged) {
         characters = JNFNSToJavaString(env, [event characters]);
+        charactersIgnoringModifiers = JNFNSToJavaString(env, [event charactersIgnoringModifiers]);
     }
 
     static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
-    static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;)V");
+    static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;Ljava/lang/String;)V");
     jobject jEvent = JNFNewObject(env, jctor_NSEvent,
                                   [event type],
                                   [event modifierFlags],
                                   [event keyCode],
-                                  characters);
+                                  characters,
+                                  charactersIgnoringModifiers);
     CHECK_NULL(jEvent);
 
     static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
--- a/src/macosx/native/sun/awt/AWTWindow.m	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -252,6 +252,10 @@
     self.ownerWindow = owner;
     [self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)];
 
+    if (IS(self.styleBits, IS_POPUP)) {
+        [self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/]; 
+    }
+
     return self;
 }
 
--- a/src/macosx/native/sun/awt/CGraphicsDevice.m	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/native/sun/awt/CGraphicsDevice.m	Wed Jul 09 10:42:37 2014 -0700
@@ -57,7 +57,7 @@
     CFArrayRef allModes = CGDisplayCopyAllDisplayModes(displayID, NULL);
 
     CFIndex numModes = CFArrayGetCount(allModes);
-    CFMutableArrayRef validModes = CFArrayCreateMutable(kCFAllocatorDefault, numModes + 1, NULL);
+    CFMutableArrayRef validModes = CFArrayCreateMutable(kCFAllocatorDefault, numModes + 1, &kCFTypeArrayCallBacks);
 
     CFIndex n;
     for (n=0; n < numModes; n++) {
--- a/src/macosx/native/sun/awt/CWrapper.m	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/native/sun/awt/CWrapper.m	Wed Jul 09 10:42:37 2014 -0700
@@ -337,12 +337,17 @@
  */
 JNIEXPORT void JNICALL
 Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setBackgroundColor
-(JNIEnv *env, jclass cls, jlong windowPtr, jlong colorPtr)
+(JNIEnv *env, jclass cls, jlong windowPtr, jint rgb)
 {
 JNF_COCOA_ENTER(env);
 
     NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
-    NSColor *color = (NSColor *)jlong_to_ptr(colorPtr);
+    CGFloat alpha = (((rgb >> 24) & 0xff) / 255.0);
+    CGFloat red   = (((rgb >> 16) & 0xff) / 255.0);
+    CGFloat green = (((rgb >>  8) & 0xff) / 255.0);
+    CGFloat blue  = (((rgb >>  0) & 0xff) / 255.0);
+    NSColor *color = [NSColor colorWithCalibratedRed:red green:green blue:blue
+                                               alpha:alpha];
     [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [window setBackgroundColor:color];
     }];
@@ -575,26 +580,3 @@
 
 JNF_COCOA_EXIT(env);
 }
-
-/*
- * Class:     sun_lwawt_macosx_CWrapper$NSColor
- * Method:    clearColor
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL
-Java_sun_lwawt_macosx_CWrapper_00024NSColor_clearColor
-(JNIEnv *env, jclass cls)
-{
-    __block jlong clearColorPtr = 0L;
-
-JNF_COCOA_ENTER(env);
-
-    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        clearColorPtr = ptr_to_jlong([NSColor clearColor]);
-    }];
-
-JNF_COCOA_EXIT(env);
-
-    return clearColorPtr;
-}
-
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.m	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.m	Wed Jul 09 10:42:37 2014 -0700
@@ -36,7 +36,7 @@
 static jobject appkitThreadGroup = NULL;
 static BOOL awtEmbedded = NO;
 
-inline void attachCurrentThread(void** env) {
+static inline void attachCurrentThread(void** env) {
     if ([NSThread isMainThread]) {
         JavaVMAttachArgs args;
         args.version = JNI_VERSION_1_4;
--- a/src/share/classes/com/sun/crypto/provider/CipherCore.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/crypto/provider/CipherCore.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -720,6 +720,15 @@
 
         int outLen = 0;
         if (len != 0) { // there is some work to do
+            if ((input == output)
+                 && (outputOffset < (inputOffset + inputLen))
+                 && (inputOffset < (outputOffset + buffer.length))) {
+                // copy 'input' out to avoid its content being
+                // overwritten prematurely.
+                input = Arrays.copyOfRange(input, inputOffset,
+                    inputOffset + inputLen);
+                inputOffset = 0;
+            }
             if (len <= buffered) {
                 // all to-be-processed data are from 'buffer'
                 if (decrypting) {
@@ -732,37 +741,37 @@
                     System.arraycopy(buffer, len, buffer, 0, buffered);
                 }
             } else { // len > buffered
-                if ((input != output) && (buffered == 0)) {
-                    // all to-be-processed data are from 'input'
-                    // however, note that if 'input' and 'output' are the same,
-                    // then they can't be passed directly to the underlying cipher
-                    // engine operations as data may be overwritten before they
-                    // are read.
-                    if (decrypting) {
-                        outLen = cipher.decrypt(input, inputOffset, len, output, outputOffset);
-                    } else {
-                        outLen = cipher.encrypt(input, inputOffset, len, output, outputOffset);
+                int inputConsumed = len - buffered;
+                int temp;
+                if (buffered > 0) {
+                    int bufferCapacity = buffer.length - buffered;
+                    if (bufferCapacity != 0) {
+                        temp = Math.min(bufferCapacity, inputConsumed);
+                        System.arraycopy(input, inputOffset, buffer, buffered, temp);
+                        inputOffset += temp;
+                        inputConsumed -= temp;
+                        inputLen -= temp;
+                        buffered += temp;
                     }
-                    inputOffset += len;
-                    inputLen -= len;
-                } else {
-                    // assemble the data using both 'buffer' and 'input'
-                    byte[] in = new byte[len];
-                    int inConsumed = len - buffered;
-                    if (buffered != 0) {
-                        System.arraycopy(buffer, 0, in, 0, buffered);
-                        buffered = 0;
+                    // process 'buffer'
+                    if (decrypting) {
+                         outLen = cipher.decrypt(buffer, 0, buffered, output, outputOffset);
+                    } else {
+                         outLen = cipher.encrypt(buffer, 0, buffered, output, outputOffset);
                     }
-                    if (inConsumed != 0) {
-                        System.arraycopy(input, inputOffset, in, len - inConsumed, inConsumed);
-                        inputOffset += inConsumed;
-                        inputLen -= inConsumed;
+                    outputOffset += outLen;
+                    buffered = 0;
+                }
+                if (inputConsumed > 0) { // still has input to process
+                    if (decrypting) {
+                        outLen += cipher.decrypt(input, inputOffset, inputConsumed,
+                            output, outputOffset);
+                    } else {
+                        outLen += cipher.encrypt(input, inputOffset, inputConsumed,
+                            output, outputOffset);
                     }
-                    if (decrypting) {
-                        outLen = cipher.decrypt(in, 0, len, output, outputOffset);
-                    } else {
-                        outLen = cipher.encrypt(in, 0, len, output, outputOffset);
-                    }
+                    inputOffset += inputConsumed;
+                    inputLen -= inputConsumed;
                 }
             }
             // Let's keep track of how many bytes are needed to make
@@ -925,8 +934,10 @@
         byte[] finalBuf = input;
         int finalOffset = inputOffset;
         int finalBufLen = inputLen;
-        if ((input == output) || (buffered != 0) ||
-            (!decrypting && padding != null)) {
+        if ((buffered != 0) || (!decrypting && padding != null) ||
+            ((input == output)
+              && (outputOffset < (inputOffset + inputLen))
+              && (inputOffset < (outputOffset + buffer.length)))) {
             if (decrypting || padding == null) {
                 paddingLen = 0;
             }
--- a/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -616,7 +616,7 @@
                     return index;
                 }
 
-                Long l1 = new Long(stream.getStreamPosition());
+                Long l1 = stream.getStreamPosition();
                 imageStartPosition.add(l1);
                 ++index;
             }
--- a/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -89,7 +89,7 @@
         java.security.AccessController.doPrivileged(
             new java.security.PrivilegedAction<Void>() {
                 public Void run() {
-                    System.loadLibrary("jpeg");
+                    System.loadLibrary("javajpeg");
                     return null;
                 }
             });
@@ -367,10 +367,10 @@
             // Now we are at the first image if there are any, so add it
             // to the list
             if (hasNextImage()) {
-                imagePositions.add(new Long(iis.getStreamPosition()));
+                imagePositions.add(iis.getStreamPosition());
             }
         } else { // Not tables only, so add original pos to the list
-            imagePositions.add(new Long(savePos));
+            imagePositions.add(savePos);
             // And set current image since we've read it now
             currentImage = 0;
         }
@@ -498,7 +498,7 @@
                 if (!hasNextImage()) {
                     throw new IndexOutOfBoundsException();
                 }
-                pos = new Long(iis.getStreamPosition());
+                pos = iis.getStreamPosition();
                 imagePositions.add(pos);
                 if (seekForwardOnly) {
                     iis.flushBefore(pos.longValue());
--- a/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -179,7 +179,7 @@
         java.security.AccessController.doPrivileged(
             new java.security.PrivilegedAction<Void>() {
                 public Void run() {
-                    System.loadLibrary("jpeg");
+                    System.loadLibrary("javajpeg");
                     return null;
                 }
             });
--- a/src/share/classes/com/sun/java/browser/dom/DOMAccessException.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.dom;
-
-@SuppressWarnings("serial") // JDK implementation class
-public class DOMAccessException extends Exception
-{
-    /**
-     * Constructs a new DOMAccessException with no detail message.
-     */
-    public DOMAccessException()
-    {
-        this(null, null);
-    }
-
-
-    /**
-     * Constructs a new DOMAccessException with the given detail message.
-     *
-     * @param msg Detail message.
-     */
-    public DOMAccessException(String msg)
-    {
-        this(null, msg);
-    }
-
-    /**
-     * Constructs a new DOMAccessException with the given exception as a root clause.
-     *
-     * @param e Exception.
-     */
-    public DOMAccessException(Exception e)
-    {
-        this(e, null);
-    }
-
-    /**
-     * Constructs a new DOMAccessException with the given exception as a root clause and the given detail message.
-     *
-     * @param e Exception.
-     * @param msg Detail message.
-     */
-    public DOMAccessException(Exception e, String msg)
-    {
-        this.ex = e;
-        this.msg = msg;
-    }
-
-    /**
-     * Returns the detail message of the error or null if there is no detail message.
-     */
-    public String getMessage()
-    {
-        return msg;
-    }
-
-    /**
-     * Returns the root cause of the error or null if there is none.
-     */
-    public Throwable getCause()
-    {
-        return ex;
-    }
-
-    private Throwable ex;
-    private String msg;
-}
--- a/src/share/classes/com/sun/java/browser/dom/DOMAccessor.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.dom;
-
-
-public interface DOMAccessor
-{
-    /**
-     * Returns the Document object of the DOM.
-     */
-    public org.w3c.dom.Document getDocument(Object obj) throws org.w3c.dom.DOMException;
-
-    /**
-     * Returns a DOMImplementation object.
-     */
-    public org.w3c.dom.DOMImplementation getDOMImplementation();
-}
--- a/src/share/classes/com/sun/java/browser/dom/DOMAction.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.dom;
-
-
-public interface DOMAction
-{
-    /**
-     * When an object implementing interface DOMAction is passed
-     * to DOMService.invokeAndWait() or DOMService.invokeLater(),
-     * run method is called in the DOM access dispatch thread.
-     *
-     * accessor is used for the DOMAction to access the entry point of
-     * the browser's DOM, if necessary.
-     *
-     * @param accessor DOMAccessor
-     */
-    public Object run(DOMAccessor accessor);
-}
--- a/src/share/classes/com/sun/java/browser/dom/DOMService.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.dom;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-public abstract class DOMService
-{
-    /**
-     * Returns new instance of a DOMService. The implementation
-     * of the DOMService returns depends on the setting of the
-     * com.sun.java.browser.dom.DOMServiceProvider property or,
-     * if the property is not set, a platform specific default.
-     *
-     * Throws DOMUnsupportedException if the DOMService is not
-     * available to the obj.
-     *
-     * @param obj Object to leverage the DOMService
-     */
-    public static DOMService getService(Object obj)
-                  throws DOMUnsupportedException
-    {
-        try
-        {
-            String provider = AccessController.doPrivileged(
-                (PrivilegedAction<String>) () ->
-                    System.getProperty("com.sun.java.browser.dom.DOMServiceProvider"));
-
-            Class clazz = Class.forName("sun.plugin.dom.DOMService");
-
-            return (DOMService) clazz.newInstance();
-        }
-        catch (Throwable e)
-        {
-            throw new DOMUnsupportedException(e.toString());
-        }
-    }
-
-    /**
-     * An empty constructor is provided. Implementations of this
-     * abstract class must provide a public no-argument constructor
-     * in order for the static getService() method to work correctly.
-     * Application programmers should not be able to directly
-     * construct implementation subclasses of this abstract subclass.
-     */
-    public DOMService()
-    {
-    }
-
-    /**
-     * Causes action.run() to be executed synchronously on the
-     * DOM action dispatching thread. This call will block until all
-     * pending DOM actions have been processed and (then)
-     * action.run() returns. This method should be used when an
-     * application thread needs to access the browser's DOM.
-     * It should not be called from the DOMActionDispatchThread.
-     *
-     * Note that if the DOMAction.run() method throws an uncaught
-     * exception (on the DOM action dispatching thread),  it's caught
-     * and re-thrown, as an DOMAccessException, on the caller's thread.
-     *
-     * If the DOMAction.run() method throws any DOM security related
-     * exception (on the DOM action dispatching thread), it's caught
-     * and re-thrown, as an DOMSecurityException, on the caller's thread.
-     *
-     * @param action DOMAction.
-     */
-    public abstract Object invokeAndWait(DOMAction action) throws DOMAccessException;
-
-    /**
-     * Causes action.run() to be executed asynchronously on the
-     * DOM action dispatching thread. This method should be used
-     * when an application thread needs to access the browser's
-     * DOM. It should not be called from the DOMActionDispatchThread.
-     *
-     * Note that if the DOMAction.run() method throws an uncaught
-     * exception (on the DOM action dispatching thread),  it will not be
-     * caught and re-thrown on the caller's thread.
-     *
-     * @param action DOMAction.
-     */
-    public abstract void invokeLater(DOMAction action);
-}
--- a/src/share/classes/com/sun/java/browser/dom/DOMServiceProvider.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.dom;
-
-public abstract class DOMServiceProvider
-{
-    /**
-     * An empty constructor is provided. Implementations should
-     * provide a public constructor so that the DOMService
-     * can instantiate instances of the implementation class.
-     * Application programmers should not be able to directly
-     * construct implementation subclasses of this abstract subclass.
-     * The only way an application should be able to obtain a
-     * reference to a DOMServiceProvider implementation
-     * instance is by using the appropriate methods of the
-     * DOMService.
-     */
-    public DOMServiceProvider()
-    {
-    }
-
-    /**
-     * Returns true if the DOMService can determine the association
-     * between the obj and the underlying DOM in the browser.
-     */
-    public abstract boolean canHandle(Object obj);
-
-    /**
-     * Returns the Document object of the DOM.
-     */
-    public abstract org.w3c.dom.Document getDocument(Object obj) throws DOMUnsupportedException;
-
-    /**
-     * Returns the DOMImplemenation object of the DOM.
-     */
-    public abstract org.w3c.dom.DOMImplementation getDOMImplementation();
-}
--- a/src/share/classes/com/sun/java/browser/dom/DOMUnsupportedException.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.dom;
-
-@SuppressWarnings("serial") // JDK implementation class
-public class DOMUnsupportedException extends Exception
-{
-    /**
-     * Constructs a new DOMUnsupportedException with no detail message.
-     */
-    public DOMUnsupportedException()
-    {
-        this(null, null);
-    }
-
-    /**
-     * Constructs a new DOMUnsupportedException with the given detail message.
-     *
-     * @param msg Detail message.
-     */
-    public DOMUnsupportedException(String msg)
-    {
-        this(null, msg);
-    }
-
-    /**
-     * Constructs a new DOMUnsupportedException with the given exception as a root clause.
-     *
-     * @param e Exception.
-     */
-    public DOMUnsupportedException(Exception e)
-    {
-        this(e, null);
-    }
-
-    /**
-     * Constructs a new DOMUnsupportedException with the given exception as a root clause and the given detail message.
-     *
-     * @param e Exception.
-     * @param msg Detail message.
-     */
-    public DOMUnsupportedException(Exception e, String msg)
-    {
-        this.ex = e;
-        this.msg = msg;
-    }
-
-    /**
-     * Returns the detail message of the error or null if there is no detail message.
-     */
-    public String getMessage()
-    {
-        return msg;
-    }
-
-    /**
-     * Returns the root cause of the error or null if there is none.
-     */
-    public Throwable getCause()
-    {
-        return ex;
-    }
-
-    private Throwable ex;
-    private String msg;
-}
--- a/src/share/classes/com/sun/java/browser/net/ProxyInfo.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.net;
-
-/**
- *
- * @author  Zhengyu Gu
- */
-public interface ProxyInfo {
-    public String   getHost();
-    public int      getPort();
-    public boolean  isSocks();
-}
--- a/src/share/classes/com/sun/java/browser/net/ProxyService.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.net;
-
-import java.net.URL;
-import java.io.IOException;
-
-/**
- *
- * @author  Zhengyu Gu
- */
-public class ProxyService extends Object {
-    private static ProxyServiceProvider provider = null;
-
-
-    public static void setProvider(ProxyServiceProvider p)
-    throws IOException {
-        if(null == provider)
-            provider = p;
-        else
-            throw new IOException("Proxy service provider has already been set.");
-    }
-
-
-    /**
-     *  <p>The function returns proxy information of the specified URL.</p>
-     *  @param url URL
-     *  @return returns proxy information. If there is not proxy, returns null
-     *  @since 1.4
-     */
-    public static ProxyInfo[] getProxyInfo(URL url)
-    throws IOException {
-        if(null == provider)
-            throw new IOException("Proxy service provider is not yet set");
-
-        return provider.getProxyInfo(url);
-    }
-}
--- a/src/share/classes/com/sun/java/browser/net/ProxyServiceProvider.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.browser.net;
-
-import java.net.URL;
-
-/**
- *
- * @author  Zhengyu Gu
- */
-public interface ProxyServiceProvider {
-    public ProxyInfo[] getProxyInfo(URL url);
-}
--- a/src/share/classes/com/sun/java/swing/SwingUtilities3.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/SwingUtilities3.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,15 +25,13 @@
 
 package com.sun.java.swing;
 
-import sun.awt.EventQueueDelegate;
 import sun.awt.AppContext;
+import sun.awt.SunToolkit;
+
 import java.util.Collections;
 import java.util.Map;
 import java.util.WeakHashMap;
-import java.util.concurrent.Callable;
 import java.applet.Applet;
-import java.awt.AWTEvent;
-import java.awt.EventQueue;
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Window;
@@ -117,8 +115,8 @@
     public static RepaintManager getDelegateRepaintManager(Component
                                                             component) {
         RepaintManager delegate = null;
-        if (Boolean.TRUE == AppContext.getAppContext().get(
-                                               DELEGATE_REPAINT_MANAGER_KEY)) {
+        if (Boolean.TRUE == SunToolkit.targetToAppContext(component)
+                                      .get(DELEGATE_REPAINT_MANAGER_KEY)) {
             while (delegate == null && component != null) {
                 while (component != null
                          && ! (component instanceof JComponent)) {
@@ -135,86 +133,4 @@
         }
         return delegate;
     }
-
-    /*
-     * We use maps to avoid reflection. Hopefully it should perform better
-     * this way.
-     */
-    public static void setEventQueueDelegate(
-            Map<String, Map<String, Object>> map) {
-        EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
-    }
-
-    private static class EventQueueDelegateFromMap
-    implements EventQueueDelegate.Delegate {
-        private final AWTEvent[] afterDispatchEventArgument;
-        private final Object[] afterDispatchHandleArgument;
-        private final Callable<Void> afterDispatchCallable;
-
-        private final AWTEvent[] beforeDispatchEventArgument;
-        private final Callable<Object> beforeDispatchCallable;
-
-        private final EventQueue[] getNextEventEventQueueArgument;
-        private final Callable<AWTEvent> getNextEventCallable;
-
-        @SuppressWarnings("unchecked")
-        public EventQueueDelegateFromMap(Map<String, Map<String, Object>> objectMap) {
-            Map<String, Object> methodMap = objectMap.get("afterDispatch");
-            afterDispatchEventArgument = (AWTEvent[]) methodMap.get("event");
-            afterDispatchHandleArgument = (Object[]) methodMap.get("handle");
-            afterDispatchCallable = (Callable<Void>) methodMap.get("method");
-
-            methodMap = objectMap.get("beforeDispatch");
-            beforeDispatchEventArgument = (AWTEvent[]) methodMap.get("event");
-            beforeDispatchCallable = (Callable<Object>) methodMap.get("method");
-
-            methodMap = objectMap.get("getNextEvent");
-            getNextEventEventQueueArgument =
-                (EventQueue[]) methodMap.get("eventQueue");
-            getNextEventCallable = (Callable<AWTEvent>) methodMap.get("method");
-        }
-
-        @Override
-        public void afterDispatch(AWTEvent event, Object handle) throws InterruptedException {
-            afterDispatchEventArgument[0] = event;
-            afterDispatchHandleArgument[0] = handle;
-            try {
-                afterDispatchCallable.call();
-            } catch (InterruptedException e) {
-                throw e;
-            } catch (RuntimeException e) {
-                throw e;
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        @Override
-        public Object beforeDispatch(AWTEvent event) throws InterruptedException {
-            beforeDispatchEventArgument[0] = event;
-            try {
-                return beforeDispatchCallable.call();
-            } catch (InterruptedException e) {
-                throw e;
-            } catch (RuntimeException e) {
-                throw e;
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        @Override
-        public AWTEvent getNextEvent(EventQueue eventQueue) throws InterruptedException {
-            getNextEventEventQueueArgument[0] = eventQueue;
-            try {
-                return getNextEventCallable.call();
-            } catch (InterruptedException e) {
-                throw e;
-            } catch (RuntimeException e) {
-                throw e;
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
 }
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Wed Jul 09 10:42:37 2014 -0700
@@ -547,7 +547,7 @@
                             i = strLowerCase.indexOf("<stringvalue>", i);
                             if (i > 0) {
                                 i += "<stringvalue>".length();
-                                int i2 = str.indexOf("<", i);
+                                int i2 = str.indexOf('<', i);
                                 return str.substring(i, i2);
                             }
                         }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1102,8 +1102,7 @@
             "PasswordField.selectionBackground", SelectionBackgroundColor,
             "PasswordField.selectionForeground", SelectionTextColor,
             "PasswordField.caretForeground",WindowTextColor,
-            "PasswordField.echoChar", new XPValue(new Character((char)0x25CF),
-                                                  new Character('*')),
+            "PasswordField.echoChar", new XPValue((char)0x25CF, '*'),
 
             // *** ProgressBar
             "ProgressBar.font", ControlFont,
--- a/src/share/classes/com/sun/jmx/snmp/SnmpCounter64.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/SnmpCounter64.java	Wed Jul 09 10:42:37 2014 -0700
@@ -84,7 +84,7 @@
      * @return The <CODE>Long</CODE> representation of the value.
      */
     public Long toLong() {
-        return new Long(value) ;
+        return value;
     }
 
     /**
--- a/src/share/classes/com/sun/jmx/snmp/SnmpInt.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/SnmpInt.java	Wed Jul 09 10:42:37 2014 -0700
@@ -130,7 +130,7 @@
      * @return The <CODE>Long</CODE> representation of the value.
      */
     public Long toLong() {
-        return new Long(value) ;
+        return value;
     }
 
     /**
--- a/src/share/classes/com/sun/jmx/snmp/SnmpString.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/SnmpString.java	Wed Jul 09 10:42:37 2014 -0700
@@ -140,7 +140,7 @@
     public Byte[] toByte() {
         Byte[] result = new Byte[value.length] ;
         for (int i = 0 ; i < value.length ; i++) {
-            result[i] = new Byte(value[i]) ;
+            result[i] = value[i];
         }
         return result ;
     }
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -136,7 +136,7 @@
      */
     public boolean isNestedArc(long arc) {
         if (subgroups == null) return false;
-        Object obj = subgroups.get(new Long(arc));
+        Object obj = subgroups.get(arc);
         // if the arc is registered in the hashtable,
         // it leads to a subgroup.
         return (obj != null);
@@ -260,7 +260,7 @@
      *
      */
     void registerNestedArc(long arc) {
-        Long obj = new Long(arc);
+        Long obj = arc;
         if (subgroups == null) subgroups = new Hashtable<>();
         // registers the arc in the hashtable.
         subgroups.put(obj,obj);
--- a/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -858,7 +858,7 @@
      */
     @Override
     public Long getSnmpOutTraps() {
-        return new Long(snmpOutTraps);
+        return (long)snmpOutTraps;
     }
 
     /**
@@ -868,7 +868,7 @@
      */
     @Override
     public Long getSnmpOutGetResponses() {
-        return new Long(snmpOutGetResponses);
+        return (long)snmpOutGetResponses;
     }
 
     /**
@@ -878,7 +878,7 @@
      */
     @Override
     public Long getSnmpOutGenErrs() {
-        return new Long(snmpOutGenErrs);
+        return (long)snmpOutGenErrs;
     }
 
     /**
@@ -888,7 +888,7 @@
      */
     @Override
     public Long getSnmpOutBadValues() {
-        return new Long(snmpOutBadValues);
+        return (long)snmpOutBadValues;
     }
 
     /**
@@ -898,7 +898,7 @@
      */
     @Override
     public Long getSnmpOutNoSuchNames() {
-        return new Long(snmpOutNoSuchNames);
+        return (long)snmpOutNoSuchNames;
     }
 
     /**
@@ -908,7 +908,7 @@
      */
     @Override
     public Long getSnmpOutTooBigs() {
-        return new Long(snmpOutTooBigs);
+        return (long)snmpOutTooBigs;
     }
 
     /**
@@ -918,7 +918,7 @@
      */
     @Override
     public Long getSnmpInASNParseErrs() {
-        return new Long(snmpInASNParseErrs);
+        return (long)snmpInASNParseErrs;
     }
 
     /**
@@ -928,7 +928,7 @@
      */
     @Override
     public Long getSnmpInBadCommunityUses() {
-        return new Long(snmpInBadCommunityUses);
+        return (long)snmpInBadCommunityUses;
     }
 
     /**
@@ -939,7 +939,7 @@
      */
     @Override
     public Long getSnmpInBadCommunityNames() {
-        return new Long(snmpInBadCommunityNames);
+        return (long)snmpInBadCommunityNames;
     }
 
     /**
@@ -949,7 +949,7 @@
      */
     @Override
     public Long getSnmpInBadVersions() {
-        return new Long(snmpInBadVersions);
+        return (long)snmpInBadVersions;
     }
 
     /**
@@ -959,7 +959,7 @@
      */
     @Override
     public Long getSnmpOutPkts() {
-        return new Long(snmpOutPkts);
+        return (long)snmpOutPkts;
     }
 
     /**
@@ -969,7 +969,7 @@
      */
     @Override
     public Long getSnmpInPkts() {
-        return new Long(snmpInPkts);
+        return (long)snmpInPkts;
     }
 
     /**
@@ -979,7 +979,7 @@
      */
     @Override
     public Long getSnmpInGetRequests() {
-        return new Long(snmpInGetRequests);
+        return (long)snmpInGetRequests;
     }
 
     /**
@@ -989,7 +989,7 @@
      */
     @Override
     public Long getSnmpInGetNexts() {
-        return new Long(snmpInGetNexts);
+        return (long)snmpInGetNexts;
     }
 
     /**
@@ -999,7 +999,7 @@
      */
     @Override
     public Long getSnmpInSetRequests() {
-        return new Long(snmpInSetRequests);
+        return (long)snmpInSetRequests;
     }
 
     /**
@@ -1009,7 +1009,7 @@
      */
     @Override
     public Long getSnmpInTotalSetVars() {
-        return new Long(snmpInTotalSetVars);
+        return (long)snmpInTotalSetVars;
     }
 
     /**
@@ -1019,7 +1019,7 @@
      */
     @Override
     public Long getSnmpInTotalReqVars() {
-        return new Long(snmpInTotalReqVars);
+        return (long)snmpInTotalReqVars;
     }
 
     /**
@@ -1032,7 +1032,7 @@
      */
     @Override
     public Long getSnmpSilentDrops() {
-        return new Long(snmpSilentDrops);
+        return (long)snmpSilentDrops;
     }
 
     /**
@@ -1045,7 +1045,7 @@
      */
     @Override
     public Long getSnmpProxyDrops() {
-        return new Long(0);
+        return 0L;
     }
 
 
--- a/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -421,7 +421,7 @@
                 try {
                     return Long.getLong(propName, defVal);
                 } catch (SecurityException e) {
-                    return new Long(defVal);
+                    return defVal;
                 }
             }
         });
--- a/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java	Wed Jul 09 10:42:37 2014 -0700
@@ -221,7 +221,7 @@
             return;
 
         NamingEvent e = new NamingEvent(eventSrc, NamingEvent.OBJECT_ADDED,
-            newBd, null, new Long(changeID));
+            newBd, null, changeID);
         support.queueEvent(e, namingListeners);
     }
 
@@ -233,7 +233,7 @@
             return;
 
         NamingEvent e = new NamingEvent(eventSrc, NamingEvent.OBJECT_REMOVED,
-            null, oldBd, new Long(changeID));
+            null, oldBd, changeID);
         support.queueEvent(e, namingListeners);
     }
 
@@ -248,7 +248,7 @@
         Binding oldBd = new Binding(newBd.getName(), null, newBd.isRelative());
 
         NamingEvent e = new NamingEvent(
-            eventSrc, NamingEvent.OBJECT_CHANGED, newBd, oldBd, new Long(changeID));
+            eventSrc, NamingEvent.OBJECT_CHANGED, newBd, oldBd, changeID);
         support.queueEvent(e, namingListeners);
     }
 
@@ -273,7 +273,7 @@
         }
 
         NamingEvent e = new NamingEvent(
-            eventSrc, NamingEvent.OBJECT_RENAMED, newBd, oldBd, new Long(changeID));
+            eventSrc, NamingEvent.OBJECT_RENAMED, newBd, oldBd, changeID);
         support.queueEvent(e, namingListeners);
     }
 
--- a/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -379,7 +379,7 @@
         // used for substring comparisons (where proto has "*" wildcards
         private boolean substringMatch(String proto, String value) {
             // simple case 1: "*" means attribute presence is being tested
-            if(proto.equals(new Character(WILDCARD_TOKEN).toString())) {
+            if(proto.equals(Character.toString(WILDCARD_TOKEN))) {
                 if(debug) {System.out.println("simple presence assertion");}
                 return true;
             }
--- a/src/share/classes/com/sun/media/sound/services/linux-i586/javax.sound.sampled.spi.MixerProvider	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-# service provider file for Linux: with DirectAudioDeviceProvider
-# last mixer is default mixer
-com.sun.media.sound.PortMixerProvider
-com.sun.media.sound.SimpleInputDeviceProvider
-com.sun.media.sound.DirectAudioDeviceProvider
-com.sun.media.sound.HeadspaceMixerProvider
--- a/src/share/classes/com/sun/media/sound/services/windows-i586/javax.sound.sampled.spi.MixerProvider	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-# service provider file for Windows: with DirectAudioDeviceProvider
-# last mixer is default mixer
-com.sun.media.sound.PortMixerProvider
-com.sun.media.sound.SimpleInputDeviceProvider
-com.sun.media.sound.DirectAudioDeviceProvider
-com.sun.media.sound.HeadspaceMixerProvider
--- a/src/share/classes/com/sun/media/sound/services/windows-ia64/javax.sound.sampled.spi.MixerProvider	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-# service provider file for Windows IA64: with DirectAudioDeviceProvider
-# last mixer is default mixer
-com.sun.media.sound.PortMixerProvider
-com.sun.media.sound.SimpleInputDeviceProvider
-com.sun.media.sound.DirectAudioDeviceProvider
-com.sun.media.sound.HeadspaceMixerProvider
--- a/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java	Wed Jul 09 10:42:37 2014 -0700
@@ -110,7 +110,7 @@
      *
      */
     public SolarisNumericGroupPrincipal(long name, boolean primaryGroup) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
         this.primaryGroup = primaryGroup;
     }
 
@@ -137,7 +137,7 @@
      *          <code>SolarisNumericGroupPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java	Wed Jul 09 10:42:37 2014 -0700
@@ -96,7 +96,7 @@
      *                  represented as a long.
      */
     public SolarisNumericUserPrincipal(long name) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
     }
 
     /**
@@ -122,7 +122,7 @@
      *          <code>SolarisNumericUserPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java	Wed Jul 09 10:42:37 2014 -0700
@@ -102,7 +102,7 @@
      *
      */
     public UnixNumericGroupPrincipal(long name, boolean primaryGroup) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
         this.primaryGroup = primaryGroup;
     }
 
@@ -129,7 +129,7 @@
      *          <code>UnixNumericGroupPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java	Wed Jul 09 10:42:37 2014 -0700
@@ -87,7 +87,7 @@
      *                  represented as a long.
      */
     public UnixNumericUserPrincipal(long name) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
     }
 
     /**
@@ -113,7 +113,7 @@
      *          <code>UnixNumericUserPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1460,7 +1460,7 @@
                     if (logger.isLoggable(Level.INFO)) {
                         logger.log(Level.INFO,
                             "DIGEST39:Incorrect padding: {0}",
-                            new Byte(msgWithPadding[msgWithPadding.length - 1]));
+                            msgWithPadding[msgWithPadding.length - 1]);
                     }
                     return EMPTY_BYTE_ARRAY;
                 }
--- a/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java	Wed Jul 09 10:42:37 2014 -0700
@@ -241,7 +241,7 @@
                         "KRB5CLNT05:Challenge [unwrapped]:", gssOutToken);
                 }
                 logger.log(Level.FINE, "KRB5CLNT06:Server protections: {0}",
-                    new Byte(gssOutToken[0]));
+                    gssOutToken[0]);
             }
 
             // Client selects preferred protection
@@ -293,7 +293,7 @@
             if (logger.isLoggable(Level.FINE)) {
                 logger.log(Level.FINE,
             "KRB5CLNT08:Selected protection: {0}; privacy: {1}; integrity: {2}",
-                    new Object[]{new Byte(selectedQop),
+                    new Object[]{selectedQop,
                                  Boolean.valueOf(privacy),
                                  Boolean.valueOf(integrity)});
             }
--- a/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java	Wed Jul 09 10:42:37 2014 -0700
@@ -221,7 +221,7 @@
             if (logger.isLoggable(Level.FINE)) {
                 logger.log(Level.FINE,
                     "KRB5SRV06:Supported protections: {0}; recv max buf size: {1}",
-                    new Object[]{new Byte(allQop),
+                    new Object[]{allQop,
                                  new Integer(recvMaxBufSize)});
             }
 
@@ -288,7 +288,7 @@
             if (logger.isLoggable(Level.FINE)) {
                 logger.log(Level.FINE,
             "KRB5SRV10:Selected protection: {0}; privacy: {1}; integrity: {2}",
-                    new Object[]{new Byte(selectedQop),
+                    new Object[]{selectedQop,
                                  Boolean.valueOf(privacy),
                                  Boolean.valueOf(integrity)});
                 logger.log(Level.FINE,
--- a/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,7 +77,7 @@
 
             if (logger.isLoggable(Level.FINE)) {
                 logger.logp(Level.FINE, myClassName, "constructor",
-                    "SASLIMPL02:Preferred qop mask: {0}", new Byte(allQop));
+                    "SASLIMPL02:Preferred qop mask: {0}", allQop);
 
                 if (qop.length > 0) {
                     StringBuilder str = new StringBuilder();
--- a/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java	Wed Jul 09 10:42:37 2014 -0700
@@ -142,8 +142,8 @@
                                          refSpec.toString()));
         } else if (e instanceof LineNotFoundException) {
             return (MessageOutput.format("No code at line",
-                                         new Object [] {new Long (lineNumber()),
-                                                        refSpec.toString()}));
+                                         new Object [] {Long.valueOf(lineNumber()),
+                                                 refSpec.toString()}));
         } else if (e instanceof InvalidTypeException) {
             return (MessageOutput.format("Breakpoints can be located only in classes.",
                                          refSpec.toString()));
--- a/src/share/classes/com/sun/tools/example/debug/tty/Commands.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/example/debug/tty/Commands.java	Wed Jul 09 10:42:37 2014 -0700
@@ -935,7 +935,7 @@
             try {
                 methodInfo = loc.sourceName() +
                     MessageOutput.format("line number",
-                                         new Object [] {new Long(lineNumber)});
+                                         new Object [] {Long.valueOf(lineNumber)});
             } catch (AbsentInformationException e) {
                 methodInfo = MessageOutput.format("unknown");
             }
@@ -946,7 +946,7 @@
                                                  meth.declaringType().name(),
                                                  meth.name(),
                                                  methodInfo,
-                                                 new Long(pc)});
+                                                 Long.valueOf(pc)});
         } else {
             MessageOutput.println("stack frame dump",
                                   new Object [] {new Integer(frameNumber + 1),
@@ -1015,7 +1015,7 @@
                                     new Object [] {loc.declaringType().name(),
                                                    loc.method().name(),
                                                    new Integer (loc.lineNumber()),
-                                                   new Long (loc.codeIndex())});
+                                                   Long.valueOf(loc.codeIndex())});
     }
 
     void listBreakpoints() {
--- a/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java	Wed Jul 09 10:42:37 2014 -0700
@@ -102,7 +102,7 @@
         if ((id & ~Snapshot.SMALL_ID_MASK) == 0) {
             return new Integer((int)id);
         } else {
-            return new Long(id);
+            return id;
         }
     }
 
--- a/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Wed Jul 09 10:42:37 2014 -0700
@@ -583,7 +583,7 @@
         if (identifierSize == 4) {
             return new Integer((int)id);
         } else {
-            return new Long(id);
+            return id;
         }
     }
 
--- a/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -215,7 +215,7 @@
                     long id = readID();
                     byte[] chars = new byte[(int)length - identifierSize];
                     in.readFully(chars);
-                    names.put(new Long(id), new String(chars));
+                    names.put(id, new String(chars));
                     break;
                 }
                 case HPROF_LOAD_CLASS: {
@@ -223,7 +223,7 @@
                     long classID = readID();
                     int stackTraceSerialNo = in.readInt();
                     long classNameID = readID();
-                    Long classIdI = new Long(classID);
+                    Long classIdI = classID;
                     String nm = getNameFromID(classNameID).replace('/', '.');
                     classNameFromObjectID.put(classIdI, nm);
                     if (classNameFromSerialNo != null) {
@@ -303,7 +303,7 @@
                             warn("Weird stack frame line number:  " + lineNumber);
                             lineNumber = StackFrame.LINE_NUMBER_UNKNOWN;
                         }
-                        stackFrames.put(new Long(id),
+                        stackFrames.put(id,
                                         new StackFrame(methodName, methodSig,
                                                        className, sourceFile,
                                                        lineNumber));
@@ -319,7 +319,7 @@
                         StackFrame[] frames = new StackFrame[in.readInt()];
                         for (int i = 0; i < frames.length; i++) {
                             long fid = readID();
-                            frames[i] = stackFrames.get(new Long(fid));
+                            frames[i] = stackFrames.get(fid);
                             if (frames[i] == null) {
                                 throw new IOException("Stack frame " + toHex(fid) + " not found");
                             }
@@ -619,7 +619,7 @@
     }
 
     private String getNameFromID(long id) throws IOException {
-        return getNameFromID(new Long(id));
+        return getNameFromID(Long.valueOf(id));
     }
 
     private String getNameFromID(Long id) throws IOException {
@@ -703,7 +703,7 @@
             String signature = "" + ((char) type);
             fields[i] = new JavaField(fieldName, signature);
         }
-        String name = classNameFromObjectID.get(new Long(id));
+        String name = classNameFromObjectID.get(id);
         if (name == null) {
             warn("Class name not found for " + toHex(id));
             name = "unknown-name@" + toHex(id);
--- a/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Wed Jul 09 10:42:37 2014 -0700
@@ -63,9 +63,9 @@
                     }
                     Long count = referrersStat.get(cl);
                     if (count == null) {
-                        count = new Long(1);
+                        count = 1L;
                     } else {
-                        count = new Long(count.longValue() + 1);
+                        count = count + 1L;
                     }
                     referrersStat.put(cl, count);
                 }
@@ -75,9 +75,9 @@
                             JavaClass cl = obj.getClazz();
                             Long count = refereesStat.get(cl);
                             if (count == null) {
-                                count = new Long(1);
+                                count = 1L;
                             } else {
-                                count = new Long(count.longValue() + 1);
+                                count = count + 1L;
                             }
                             refereesStat.put(cl, count);
                         }
--- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -781,7 +781,7 @@
             type.setSignature(signature);
         }
 
-        typesByID.put(new Long(id), type);
+        typesByID.put(id, type);
         typesBySignature.add(type);
 
         if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
@@ -809,7 +809,7 @@
             if (comp == 0) {
                 matches++;
                 iter.remove();
-                typesByID.remove(new Long(type.ref()));
+                typesByID.remove(type.ref());
                 if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
                    vm.printTrace("Uncaching ReferenceType, sig=" + signature +
                                  ", id=" + type.ref());
@@ -895,7 +895,7 @@
             ReferenceTypeImpl retType = null;
             synchronized (this) {
                 if (typesByID != null) {
-                    retType = (ReferenceTypeImpl)typesByID.get(new Long(id));
+                    retType = (ReferenceTypeImpl)typesByID.get(id);
                 }
                 if (retType == null) {
                     retType = addReferenceType(id, tag, signature);
@@ -1247,7 +1247,7 @@
             return null;
         }
         ObjectReferenceImpl object = null;
-        Long key = new Long(id);
+        Long key = id;
 
         /*
          * Attempt to retrieve an existing object object reference
@@ -1313,7 +1313,7 @@
         // Handle any queue elements that are not strongly reachable
         processQueue();
 
-        SoftObjectReference ref = objectsByID.remove(new Long(object.ref()));
+        SoftObjectReference ref = objectsByID.remove(object.ref());
         if (ref != null) {
             batchForDispose(ref);
         } else {
--- a/src/share/classes/java/awt/AWTEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/AWTEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -388,6 +388,8 @@
 
     /**
      * Returns the event type.
+     *
+     * @return the event's type id
      */
     public int getID() {
         return id;
@@ -446,6 +448,9 @@
 
     /**
      * Returns whether this event has been consumed.
+     *
+     * @return {@code true} if this event has been consumed;
+     *          otherwise {@code false}
      */
     protected boolean isConsumed() {
         return consumed;
--- a/src/share/classes/java/awt/AWTEventMulticaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/AWTEventMulticaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -110,7 +110,15 @@
     TextListener, InputMethodListener, HierarchyListener,
     HierarchyBoundsListener, MouseWheelListener {
 
-    protected final EventListener a, b;
+    /**
+     * A variable in the event chain (listener-a)
+     */
+    protected final EventListener a;
+
+    /**
+     * A variable in the event chain (listener-b)
+     */
+    protected final EventListener b;
 
     /**
      * Creates an event multicaster instance which chains listener-a
@@ -537,6 +545,7 @@
      * returns the resulting multicast listener.
      * @param a component-listener-a
      * @param b component-listener-b
+     * @return the resulting listener
      */
     public static ComponentListener add(ComponentListener a, ComponentListener b) {
         return (ComponentListener)addInternal(a, b);
@@ -547,6 +556,7 @@
      * returns the resulting multicast listener.
      * @param a container-listener-a
      * @param b container-listener-b
+     * @return the resulting listener
      */
     public static ContainerListener add(ContainerListener a, ContainerListener b) {
         return (ContainerListener)addInternal(a, b);
@@ -557,6 +567,7 @@
      * returns the resulting multicast listener.
      * @param a focus-listener-a
      * @param b focus-listener-b
+     * @return the resulting listener
      */
     public static FocusListener add(FocusListener a, FocusListener b) {
         return (FocusListener)addInternal(a, b);
@@ -567,6 +578,7 @@
      * returns the resulting multicast listener.
      * @param a key-listener-a
      * @param b key-listener-b
+     * @return the resulting listener
      */
     public static KeyListener add(KeyListener a, KeyListener b) {
         return (KeyListener)addInternal(a, b);
@@ -577,6 +589,7 @@
      * returns the resulting multicast listener.
      * @param a mouse-listener-a
      * @param b mouse-listener-b
+     * @return the resulting listener
      */
     public static MouseListener add(MouseListener a, MouseListener b) {
         return (MouseListener)addInternal(a, b);
@@ -587,6 +600,7 @@
      * returns the resulting multicast listener.
      * @param a mouse-motion-listener-a
      * @param b mouse-motion-listener-b
+     * @return the resulting listener
      */
     public static MouseMotionListener add(MouseMotionListener a, MouseMotionListener b) {
         return (MouseMotionListener)addInternal(a, b);
@@ -597,6 +611,7 @@
      * returns the resulting multicast listener.
      * @param a window-listener-a
      * @param b window-listener-b
+     * @return the resulting listener
      */
     public static WindowListener add(WindowListener a, WindowListener b) {
         return (WindowListener)addInternal(a, b);
@@ -607,6 +622,7 @@
      * and returns the resulting multicast listener.
      * @param a window-state-listener-a
      * @param b window-state-listener-b
+     * @return the resulting listener
      * @since 1.4
      */
     @SuppressWarnings("overloads")
@@ -620,6 +636,7 @@
      * and returns the resulting multicast listener.
      * @param a window-focus-listener-a
      * @param b window-focus-listener-b
+     * @return the resulting listener
      * @since 1.4
      */
     public static WindowFocusListener add(WindowFocusListener a,
@@ -632,6 +649,7 @@
      * returns the resulting multicast listener.
      * @param a action-listener-a
      * @param b action-listener-b
+     * @return the resulting listener
      */
     @SuppressWarnings("overloads")
     public static ActionListener add(ActionListener a, ActionListener b) {
@@ -643,6 +661,7 @@
      * returns the resulting multicast listener.
      * @param a item-listener-a
      * @param b item-listener-b
+     * @return the resulting listener
      */
     @SuppressWarnings("overloads")
     public static ItemListener add(ItemListener a, ItemListener b) {
@@ -654,11 +673,21 @@
      * returns the resulting multicast listener.
      * @param a adjustment-listener-a
      * @param b adjustment-listener-b
+     * @return the resulting listener
      */
     @SuppressWarnings("overloads")
     public static AdjustmentListener add(AdjustmentListener a, AdjustmentListener b) {
         return (AdjustmentListener)addInternal(a, b);
     }
+
+    /**
+     * Adds text-listener-a with text-listener-b and
+     * returns the resulting multicast listener.
+     *
+     * @param  a text-listener-a
+     * @param  b text-listener-b
+     * @return the resulting listener
+     */
     @SuppressWarnings("overloads")
     public static TextListener add(TextListener a, TextListener b) {
         return (TextListener)addInternal(a, b);
@@ -669,6 +698,7 @@
      * returns the resulting multicast listener.
      * @param a input-method-listener-a
      * @param b input-method-listener-b
+     * @return the resulting listener
      */
      public static InputMethodListener add(InputMethodListener a, InputMethodListener b) {
         return (InputMethodListener)addInternal(a, b);
@@ -679,6 +709,7 @@
      * returns the resulting multicast listener.
      * @param a hierarchy-listener-a
      * @param b hierarchy-listener-b
+     * @return the resulting listener
      * @since 1.3
      */
     @SuppressWarnings("overloads")
@@ -691,6 +722,7 @@
      * returns the resulting multicast listener.
      * @param a hierarchy-bounds-listener-a
      * @param b hierarchy-bounds-listener-b
+     * @return the resulting listener
      * @since 1.3
      */
      public static HierarchyBoundsListener add(HierarchyBoundsListener a, HierarchyBoundsListener b) {
@@ -702,6 +734,7 @@
      * returns the resulting multicast listener.
      * @param a mouse-wheel-listener-a
      * @param b mouse-wheel-listener-b
+     * @return the resulting listener
      * @since 1.4
      */
     @SuppressWarnings("overloads")
@@ -715,6 +748,7 @@
      * returns the resulting multicast listener.
      * @param l component-listener-l
      * @param oldl the component-listener being removed
+     * @return the resulting listener
      */
     public static ComponentListener remove(ComponentListener l, ComponentListener oldl) {
         return (ComponentListener) removeInternal(l, oldl);
@@ -725,6 +759,7 @@
      * returns the resulting multicast listener.
      * @param l container-listener-l
      * @param oldl the container-listener being removed
+     * @return the resulting listener
      */
     public static ContainerListener remove(ContainerListener l, ContainerListener oldl) {
         return (ContainerListener) removeInternal(l, oldl);
@@ -735,6 +770,7 @@
      * returns the resulting multicast listener.
      * @param l focus-listener-l
      * @param oldl the focus-listener being removed
+     * @return the resulting listener
      */
     public static FocusListener remove(FocusListener l, FocusListener oldl) {
         return (FocusListener) removeInternal(l, oldl);
@@ -745,6 +781,7 @@
      * returns the resulting multicast listener.
      * @param l key-listener-l
      * @param oldl the key-listener being removed
+     * @return the resulting listener
      */
     public static KeyListener remove(KeyListener l, KeyListener oldl) {
         return (KeyListener) removeInternal(l, oldl);
@@ -755,6 +792,7 @@
      * returns the resulting multicast listener.
      * @param l mouse-listener-l
      * @param oldl the mouse-listener being removed
+     * @return the resulting listener
      */
     public static MouseListener remove(MouseListener l, MouseListener oldl) {
         return (MouseListener) removeInternal(l, oldl);
@@ -765,6 +803,7 @@
      * and returns the resulting multicast listener.
      * @param l mouse-motion-listener-l
      * @param oldl the mouse-motion-listener being removed
+     * @return the resulting listener
      */
     public static MouseMotionListener remove(MouseMotionListener l, MouseMotionListener oldl) {
         return (MouseMotionListener) removeInternal(l, oldl);
@@ -775,6 +814,7 @@
      * returns the resulting multicast listener.
      * @param l window-listener-l
      * @param oldl the window-listener being removed
+     * @return the resulting listener
      */
     public static WindowListener remove(WindowListener l, WindowListener oldl) {
         return (WindowListener) removeInternal(l, oldl);
@@ -785,6 +825,7 @@
      * and returns the resulting multicast listener.
      * @param l window-state-listener-l
      * @param oldl the window-state-listener being removed
+     * @return the resulting listener
      * @since 1.4
      */
     @SuppressWarnings("overloads")
@@ -798,6 +839,7 @@
      * and returns the resulting multicast listener.
      * @param l window-focus-listener-l
      * @param oldl the window-focus-listener being removed
+     * @return the resulting listener
      * @since 1.4
      */
     public static WindowFocusListener remove(WindowFocusListener l,
@@ -810,6 +852,7 @@
      * returns the resulting multicast listener.
      * @param l action-listener-l
      * @param oldl the action-listener being removed
+     * @return the resulting listener
      */
     @SuppressWarnings("overloads")
     public static ActionListener remove(ActionListener l, ActionListener oldl) {
@@ -821,6 +864,7 @@
      * returns the resulting multicast listener.
      * @param l item-listener-l
      * @param oldl the item-listener being removed
+     * @return the resulting listener
      */
     @SuppressWarnings("overloads")
     public static ItemListener remove(ItemListener l, ItemListener oldl) {
@@ -832,11 +876,21 @@
      * returns the resulting multicast listener.
      * @param l adjustment-listener-l
      * @param oldl the adjustment-listener being removed
+     * @return the resulting listener
      */
     @SuppressWarnings("overloads")
     public static AdjustmentListener remove(AdjustmentListener l, AdjustmentListener oldl) {
         return (AdjustmentListener) removeInternal(l, oldl);
     }
+
+    /**
+     * Removes the old text-listener from text-listener-l and
+     * returns the resulting multicast listener.
+     *
+     * @param  l text-listener-l
+     * @param  oldl the text-listener being removed
+     * @return the resulting listener
+     */
     @SuppressWarnings("overloads")
     public static TextListener remove(TextListener l, TextListener oldl) {
         return (TextListener) removeInternal(l, oldl);
@@ -847,6 +901,7 @@
      * returns the resulting multicast listener.
      * @param l input-method-listener-l
      * @param oldl the input-method-listener being removed
+     * @return the resulting listener
      */
     public static InputMethodListener remove(InputMethodListener l, InputMethodListener oldl) {
         return (InputMethodListener) removeInternal(l, oldl);
@@ -857,6 +912,7 @@
      * returns the resulting multicast listener.
      * @param l hierarchy-listener-l
      * @param oldl the hierarchy-listener being removed
+     * @return the resulting listener
      * @since 1.3
      */
     @SuppressWarnings("overloads")
@@ -870,6 +926,7 @@
      * listener.
      * @param l hierarchy-bounds-listener-l
      * @param oldl the hierarchy-bounds-listener being removed
+     * @return the resulting listener
      * @since 1.3
      */
     public static HierarchyBoundsListener remove(HierarchyBoundsListener l, HierarchyBoundsListener oldl) {
@@ -881,6 +938,7 @@
      * and returns the resulting multicast listener.
      * @param l mouse-wheel-listener-l
      * @param oldl the mouse-wheel-listener being removed
+     * @return the resulting listener
      * @since 1.4
      */
     @SuppressWarnings("overloads")
@@ -898,6 +956,7 @@
      * a new AWTEventMulticaster instance which chains a with b.
      * @param a event listener-a
      * @param b event listener-b
+     * @return the resulting listener
      */
     protected static EventListener addInternal(EventListener a, EventListener b) {
         if (a == null)  return b;
@@ -915,6 +974,7 @@
      * Else, returns listener l.
      * @param l the listener being removed from
      * @param oldl the listener being removed
+     * @return the resulting listener
      */
     protected static EventListener removeInternal(EventListener l, EventListener oldl) {
         if (l == oldl || l == null) {
@@ -927,9 +987,14 @@
     }
 
 
-    /* Serialization support.
-     */
-
+   /**
+    * Serialization support. Saves all Serializable listeners
+    * to a serialization stream.
+    *
+    * @param  s the stream to save to
+    * @param  k a prefix stream to put before each serializable listener
+    * @throws IOException if serialization fails
+    */
     protected void saveInternal(ObjectOutputStream s, String k) throws IOException {
         if (a instanceof AWTEventMulticaster) {
             ((AWTEventMulticaster)a).saveInternal(s, k);
@@ -948,6 +1013,14 @@
         }
     }
 
+   /**
+    * Saves a Serializable listener chain to a serialization stream.
+    *
+    * @param  s the stream to save to
+    * @param  k a prefix stream to put before each serializable listener
+    * @param  l the listener chain to save
+    * @throws IOException if serialization fails
+    */
     protected static void save(ObjectOutputStream s, String k, EventListener l) throws IOException {
       if (l == null) {
           return;
--- a/src/share/classes/java/awt/AWTKeyStroke.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/AWTKeyStroke.java	Wed Jul 09 10:42:37 2014 -0700
@@ -802,6 +802,7 @@
      * <code>AWTKeyStroke</code>) which is equal to this instance.
      *
      * @return a cached instance which is equal to this instance
+     * @throws java.io.ObjectStreamException if a serialization problem occurs
      */
     protected Object readResolve() throws java.io.ObjectStreamException {
         synchronized (AWTKeyStroke.class) {
--- a/src/share/classes/java/awt/AlphaComposite.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/AlphaComposite.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -621,7 +621,9 @@
 
     /**
      * Creates an <code>AlphaComposite</code> object with the specified rule.
+     *
      * @param rule the compositing rule
+     * @return the {@code AlphaComposite} object created
      * @throws IllegalArgumentException if <code>rule</code> is not one of
      *         the following:  {@link #CLEAR}, {@link #SRC}, {@link #DST},
      *         {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN},
@@ -664,10 +666,12 @@
      * the constant alpha to multiply with the alpha of the source.
      * The source is multiplied with the specified alpha before being composited
      * with the destination.
+     *
      * @param rule the compositing rule
      * @param alpha the constant alpha to be multiplied with the alpha of
      * the source. <code>alpha</code> must be a floating point number in the
      * inclusive range [0.0,&nbsp;1.0].
+     * @return the {@code AlphaComposite} object created
      * @throws IllegalArgumentException if
      *         <code>alpha</code> is less than 0.0 or greater than 1.0, or if
      *         <code>rule</code> is not one of
--- a/src/share/classes/java/awt/BorderLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/BorderLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -367,6 +367,8 @@
 
     /**
      * Returns the horizontal gap between components.
+     *
+     * @return the horizontal gap between components
      * @since   1.1
      */
     public int getHgap() {
@@ -375,6 +377,7 @@
 
     /**
      * Sets the horizontal gap between components.
+     *
      * @param hgap the horizontal gap between components
      * @since   1.1
      */
@@ -384,6 +387,8 @@
 
     /**
      * Returns the vertical gap between components.
+     *
+     * @return the vertical gap between components
      * @since   1.1
      */
     public int getVgap() {
@@ -392,6 +397,7 @@
 
     /**
      * Sets the vertical gap between components.
+     *
      * @param vgap the vertical gap between components
      * @since   1.1
      */
--- a/src/share/classes/java/awt/Button.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Button.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -238,6 +238,8 @@
      * Returns the command name of the action event fired by this button.
      * If the command name is <code>null</code> (default) then this method
      * returns the label of the button.
+     *
+     * @return the action command name (or label) for this button
      */
     public String getActionCommand() {
         return (actionCommand == null? label : actionCommand);
--- a/src/share/classes/java/awt/Checkbox.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Checkbox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -713,6 +713,9 @@
          */
         private static final long serialVersionUID = 7881579233144754107L;
 
+        /**
+         * Constructor for {@code AccessibleAWTCheckbox}
+         */
         public AccessibleAWTCheckbox() {
             super();
             Checkbox.this.addItemListener(this);
--- a/src/share/classes/java/awt/CheckboxGroup.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/CheckboxGroup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,6 +91,10 @@
     }
 
     /**
+     * Returns the current choice from this check box group
+     * or {@code null} if none of checkboxes are selected.
+     *
+     * @return the selected checkbox
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getSelectedCheckbox()</code>.
      */
@@ -120,6 +124,11 @@
     }
 
     /**
+     * Sets the currently selected check box in this group
+     * to be the specified check box and unsets all others.
+     *
+     * @param  box the {@code Checkbox} to set as the
+     *         current selection.
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setSelectedCheckbox(Checkbox)</code>.
      */
--- a/src/share/classes/java/awt/Choice.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Choice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -156,6 +156,7 @@
 
     /**
      * Returns the number of items in this <code>Choice</code> menu.
+     *
      * @return the number of items in this <code>Choice</code> menu
      * @see     #getItem
      * @since   1.1
@@ -165,6 +166,9 @@
     }
 
     /**
+     * Returns the number of items in this {@code Choice} menu.
+     *
+     * @return the number of items in this {@code Choice} menu
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getItemCount()</code>.
      */
@@ -176,8 +180,10 @@
     /**
      * Gets the string at the specified index in this
      * <code>Choice</code> menu.
-     * @param      index the index at which to begin
-     * @see        #getItemCount
+     *
+     * @param  index the index at which to begin
+     * @return the item at the specified index
+     * @see    #getItemCount
      */
     public String getItem(int index) {
         return getItemImpl(index);
@@ -759,6 +765,9 @@
          */
         private static final long serialVersionUID = 7175603582428509322L;
 
+        /**
+         * Constructor for {@code AccessibleAWTChoice}
+         */
         public AccessibleAWTChoice() {
             super();
         }
--- a/src/share/classes/java/awt/Component.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Component.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1075,6 +1075,7 @@
      * @deprecated As of JDK version 1.1,
      * programs should not directly manipulate peers;
      * replaced by <code>boolean isDisplayable()</code>.
+     * @return the peer for this component
      */
     @Deprecated
     public ComponentPeer getPeer() {
@@ -1132,6 +1133,8 @@
     /**
      * Gets the <code>DropTarget</code> associated with this
      * <code>Component</code>.
+     *
+     * @return the drop target
      */
 
     public synchronized DropTarget getDropTarget() { return dropTarget; }
@@ -1498,6 +1501,11 @@
     }
 
     /**
+     * Enables or disables this component.
+     *
+     * @param  b {@code true} to enable this component;
+     *         otherwise {@code false}
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setEnabled(boolean)</code>.
      */
@@ -1656,6 +1664,11 @@
     }
 
     /**
+     * Makes this component visible or invisible.
+     *
+     * @param  b {@code true} to make this component visible;
+     *         otherwise {@code false}
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setVisible(boolean)</code>.
      */
@@ -2068,6 +2081,9 @@
 
 
     /**
+     * Returns the location of this component's top left corner.
+     *
+     * @return the location of this component's top left corner
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getLocation()</code>.
      */
@@ -2102,6 +2118,13 @@
     }
 
     /**
+     * Moves this component to a new location.
+     *
+     * @param  x the <i>x</i>-coordinate of the new location's
+     *           top-left corner in the parent's coordinate space
+     * @param  y the <i>y</i>-coordinate of the new location's
+     *           top-left corner in the parent's coordinate space
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setLocation(int, int)</code>.
      */
@@ -2150,6 +2173,11 @@
     }
 
     /**
+     * Returns the size of this component in the form of a
+     * {@code Dimension} object.
+     *
+     * @return the {@code Dimension} object that indicates the
+     *         size of this component
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getSize()</code>.
      */
@@ -2177,6 +2205,10 @@
     }
 
     /**
+     * Resizes this component.
+     *
+     * @param  width the new width of the component
+     * @param  height the new height of the component
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setSize(int, int)</code>.
      */
@@ -2208,6 +2240,10 @@
     }
 
     /**
+     * Resizes this component so that it has width {@code d.width}
+     * and height {@code d.height}.
+     *
+     * @param  d the new size of this component
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setSize(Dimension)</code>.
      */
@@ -2231,6 +2267,9 @@
     }
 
     /**
+     * Returns the bounding rectangle of this component.
+     *
+     * @return the bounding rectangle for this component
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getBounds()</code>.
      */
@@ -2265,6 +2304,13 @@
     }
 
     /**
+     * Reshapes the bounding rectangle for this component.
+     *
+     * @param  x the <i>x</i> coordinate of the upper left corner of the rectangle
+     * @param  y the <i>y</i> coordinate of the upper left corner of the rectangle
+     * @param  width the width of the rectangle
+     * @param  height the height of the rectangle
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setBounds(int, int, int, int)</code>.
      */
@@ -2631,6 +2677,9 @@
 
 
     /**
+     * Returns the component's preferred size.
+     *
+     * @return the component's preferred size
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getPreferredSize()</code>.
      */
@@ -2701,6 +2750,9 @@
     }
 
     /**
+     * Returns the minimum size of this component.
+     *
+     * @return the minimum size of this component
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getMinimumSize()</code>.
      */
@@ -2781,6 +2833,8 @@
      * components.  The value should be a number between 0 and 1
      * where 0 represents alignment along the origin, 1 is aligned
      * the furthest away from the origin, 0.5 is centered, etc.
+     *
+     * @return the horizontal alignment of this component
      */
     public float getAlignmentX() {
         return CENTER_ALIGNMENT;
@@ -2792,6 +2846,8 @@
      * components.  The value should be a number between 0 and 1
      * where 0 represents alignment along the origin, 1 is aligned
      * the furthest away from the origin, 0.5 is centered, etc.
+     *
+     * @return the vertical alignment of this component
      */
     public float getAlignmentY() {
         return CENTER_ALIGNMENT;
@@ -3157,8 +3213,10 @@
      * not have a cursor set, the cursor of its parent is returned.
      * If no cursor is set in the entire hierarchy,
      * <code>Cursor.DEFAULT_CURSOR</code> is returned.
+     *
+     * @return the cursor for this component
      * @see #setCursor
-     * @since      1.1
+     * @since 1.1
      */
     public Cursor getCursor() {
         return getCursor_NoClientCode();
@@ -3411,7 +3469,7 @@
                 (width > 0) && (height > 0)) {
                 PaintEvent e = new PaintEvent(this, PaintEvent.UPDATE,
                                               new Rectangle(x, y, width, height));
-                Toolkit.getEventQueue().postEvent(e);
+                SunToolkit.postEvent(SunToolkit.targetToAppContext(this), e);
             }
         }
     }
@@ -3942,6 +4000,7 @@
          * a lost state.
          */
         protected boolean validatedContents; // = false
+
         /**
          * Size of the back buffers.  (Note: these fields were added in 6.0
          * but kept package-private to avoid exposing them in the spec.
@@ -3949,7 +4008,15 @@
          * protected when they were introduced in 1.4, but now we just have
          * to live with that decision.)
          */
+
+         /**
+          * The width of the back buffers
+          */
         int width;
+
+        /**
+         * The height of the back buffers
+         */
         int height;
 
         /**
@@ -4304,6 +4371,8 @@
 
         /**
          * Creates the back buffers
+         *
+         * @param numBuffers the number of buffers to create
          */
         protected void createBackBuffers(int numBuffers) {
             if (numBuffers == 0) {
@@ -4593,6 +4662,9 @@
      * better performance is desired, or if page-flipping is used as the
      * buffer strategy.
      *
+     * @param ignoreRepaint {@code true} if the paint messages from the OS
+     *                      should be ignored; otherwise {@code false}
+     *
      * @since 1.4
      * @see #getIgnoreRepaint
      * @see Canvas#createBufferStrategy
@@ -4619,8 +4691,11 @@
      * Checks whether this component "contains" the specified point,
      * where <code>x</code> and <code>y</code> are defined to be
      * relative to the coordinate system of this component.
+     *
      * @param     x   the <i>x</i> coordinate of the point
      * @param     y   the <i>y</i> coordinate of the point
+     * @return {@code true} if the point is within the component;
+     *         otherwise {@code false}
      * @see       #getComponentAt(int, int)
      * @since     1.1
      */
@@ -4629,6 +4704,12 @@
     }
 
     /**
+     * Checks whether the point is inside of this component.
+     *
+     * @param  x the <i>x</i> coordinate of the point
+     * @param  y the <i>y</i> coordinate of the point
+     * @return {@code true} if the point is within the component;
+     *         otherwise {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by contains(int, int).
      */
@@ -4641,7 +4722,10 @@
      * Checks whether this component "contains" the specified point,
      * where the point's <i>x</i> and <i>y</i> coordinates are defined
      * to be relative to the coordinate system of this component.
+     *
      * @param     p     the point
+     * @return {@code true} if the point is within the component;
+     *         otherwise {@code false}
      * @throws    NullPointerException if {@code p} is {@code null}
      * @see       #getComponentAt(Point)
      * @since     1.1
@@ -4676,6 +4760,13 @@
     }
 
     /**
+     * Returns the component occupying the position specified (this component,
+     * or immediate child component, or null if neither
+     * of the first two occupies the location).
+     *
+     * @param  x the <i>x</i> coordinate to search for components at
+     * @param  y the <i>y</i> coordinate to search for components at
+     * @return the component at the specified location or {@code null}
      * @deprecated As of JDK version 1.1,
      * replaced by getComponentAt(int, int).
      */
@@ -4687,15 +4778,17 @@
     /**
      * Returns the component or subcomponent that contains the
      * specified point.
-     * @param     p   the point
-     * @see       java.awt.Component#contains
-     * @since     1.1
+     * @param  p the point
+     * @return the component at the specified location or {@code null}
+     * @see java.awt.Component#contains
+     * @since 1.1
      */
     public Component getComponentAt(Point p) {
         return getComponentAt(p.x, p.y);
     }
 
     /**
+     * @param  e the event to deliver
      * @deprecated As of JDK version 1.1,
      * replaced by <code>dispatchEvent(AWTEvent e)</code>.
      */
@@ -6746,6 +6839,8 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @return {@code true} if the event was handled, {@code false} otherwise
      * @deprecated As of JDK version 1.1
      * replaced by processEvent(AWTEvent).
      */
@@ -6789,6 +6884,10 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  x the x coordinate
+     * @param  y the y coordinate
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processMouseEvent(MouseEvent).
      */
@@ -6798,6 +6897,10 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  x the x coordinate
+     * @param  y the y coordinate
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processMouseMotionEvent(MouseEvent).
      */
@@ -6807,6 +6910,10 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  x the x coordinate
+     * @param  y the y coordinate
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processMouseEvent(MouseEvent).
      */
@@ -6816,6 +6923,10 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  x the x coordinate
+     * @param  y the y coordinate
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processMouseMotionEvent(MouseEvent).
      */
@@ -6825,6 +6936,10 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  x the x coordinate
+     * @param  y the y coordinate
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processMouseEvent(MouseEvent).
      */
@@ -6834,6 +6949,10 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  x the x coordinate
+     * @param  y the y coordinate
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processMouseEvent(MouseEvent).
      */
@@ -6843,6 +6962,9 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  key the key pressed
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processKeyEvent(KeyEvent).
      */
@@ -6852,6 +6974,9 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  key the key pressed
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processKeyEvent(KeyEvent).
      */
@@ -6861,6 +6986,9 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  what the object acted on
+     * @return {@code false}
      * @deprecated As of JDK version 1.1,
      * should register this component as ActionListener on component
      * which fires action events.
@@ -7070,6 +7198,9 @@
     }
 
     /**
+     * @param  evt the event to handle
+     * @param  what the object focused
+     * @return  {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processFocusEvent(FocusEvent).
      */
@@ -7079,6 +7210,9 @@
     }
 
     /**
+     * @param evt  the event to handle
+     * @param what the object focused
+     * @return  {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by processFocusEvent(FocusEvent).
      */
@@ -8390,6 +8524,7 @@
      * Returns an array of all the listeners which have been associated
      * with the named property.
      *
+     * @param  propertyName the property name
      * @return all of the <code>PropertyChangeListener</code>s associated with
      *         the named property; if no such listeners have been added or
      *         if <code>propertyName</code> is <code>null</code>, an empty
@@ -8400,8 +8535,7 @@
      * @see #getPropertyChangeListeners
      * @since 1.4
      */
-    public PropertyChangeListener[] getPropertyChangeListeners(
-                                                                            String propertyName) {
+    public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) {
         synchronized (getObjectLock()) {
             if (changeSupport == null) {
                 return new PropertyChangeListener[0];
@@ -8506,7 +8640,7 @@
         if (changeSupport == null || oldValue == newValue) {
             return;
         }
-        firePropertyChange(propertyName, new Character(oldValue), new Character(newValue));
+        firePropertyChange(propertyName, Character.valueOf(oldValue), Character.valueOf(newValue));
     }
 
     /**
@@ -8879,6 +9013,7 @@
      * This method changes layout-related information, and therefore,
      * invalidates the component hierarchy.
      *
+     * @param  o the orientation to be set
      *
      * @see ComponentOrientation
      * @see #invalidate
@@ -8906,6 +9041,7 @@
      * subclasses that wish to respect orientation should call this method to
      * get the component's orientation before performing layout or drawing.
      *
+     * @return the orientation to order the elements or text
      * @see ComponentOrientation
      *
      * @author Laura Werner, IBM
@@ -9063,7 +9199,16 @@
          */
         private volatile transient int propertyListenersCount = 0;
 
+        /**
+         * A component listener to track show/hide/resize events
+         * and convert them to PropertyChange events.
+         */
         protected ComponentListener accessibleAWTComponentHandler = null;
+
+        /**
+         * A listener to track focus events
+         * and convert them to PropertyChange events.
+         */
         protected FocusListener accessibleAWTFocusHandler = null;
 
         /**
--- a/src/share/classes/java/awt/ComponentOrientation.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/ComponentOrientation.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -126,6 +126,8 @@
      * Are lines horizontal?
      * This will return true for horizontal, left-to-right writing
      * systems such as Roman.
+     *
+     * @return {@code true} if this orientation has horizontal lines
      */
     public boolean isHorizontal() {
         return (orientation & HORIZ_BIT) != 0;
@@ -136,6 +138,8 @@
      * Vertical Lines:  Do lines run left-to-right?<br>
      * This will return true for horizontal, left-to-right writing
      * systems such as Roman.
+     *
+     * @return {@code true} if this orientation is left-to-right
      */
     public boolean isLeftToRight() {
         return (orientation & LTR_BIT) != 0;
@@ -143,7 +147,9 @@
 
     /**
      * Returns the orientation that is appropriate for the given locale.
+     *
      * @param locale the specified locale
+     * @return the orientation for the locale
      */
     public static ComponentOrientation getOrientation(Locale locale) {
         // A more flexible implementation would consult a ResourceBundle
@@ -171,6 +177,8 @@
      * <li>Return the default locale's orientation.
      * </ol>
      *
+     * @param  bdl the bundle to use
+     * @return the orientation
      * @deprecated As of J2SE 1.4, use {@link #getOrientation(java.util.Locale)}.
      */
     @Deprecated
--- a/src/share/classes/java/awt/Container.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Container.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -310,6 +310,9 @@
     }
 
     /**
+     * Returns the number of components in this container.
+     *
+     * @return the number of components in this container
      * @deprecated As of JDK version 1.1,
      * replaced by getComponentCount().
      */
@@ -391,8 +394,11 @@
     }
 
     /**
+     * Returns the insets for this container.
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getInsets()</code>.
+     * @return the insets for this container
      */
     @Deprecated
     public Insets insets() {
@@ -438,6 +444,9 @@
      * displayed, the hierarchy must be validated thereafter in order to
      * display the added component.
      *
+     * @param  name the name of the component to be added
+     * @param  comp the component to be added
+     * @return the component added
      * @exception NullPointerException if {@code comp} is {@code null}
      * @see #add(Component, Object)
      * @see #invalidate
@@ -1471,8 +1480,10 @@
 
     /**
      * Gets the layout manager for this container.
+     *
      * @see #doLayout
      * @see #setLayout
+     * @return the current layout manager for this container
      */
     public LayoutManager getLayout() {
         return layoutMgr;
@@ -3854,6 +3865,10 @@
          */
         private volatile transient int propertyListenersCount = 0;
 
+        /**
+         * The handler to fire {@code PropertyChange}
+         * when children are added or removed
+         */
         protected ContainerListener accessibleContainerHandler = null;
 
         /**
--- a/src/share/classes/java/awt/Cursor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Cursor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -294,6 +294,7 @@
      * @return the system specific custom cursor named
      * @exception HeadlessException if
      * <code>GraphicsEnvironment.isHeadless</code> returns true
+     * @exception AWTException in case of erroneous retrieving of the cursor
      */
     static public Cursor getSystemCustomCursor(final String name)
         throws AWTException, HeadlessException {
@@ -378,6 +379,8 @@
 
     /**
      * Return the system default cursor.
+     *
+     * @return the default cursor
      */
     static public Cursor getDefaultCursor() {
         return getPredefinedCursor(Cursor.DEFAULT_CURSOR);
@@ -416,6 +419,8 @@
 
     /**
      * Returns the type for this cursor.
+     *
+     * @return the cursor type
      */
     public int getType() {
         return type;
--- a/src/share/classes/java/awt/DisplayMode.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/DisplayMode.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -125,6 +125,8 @@
 
     /**
      * Returns whether the two display modes are equal.
+     *
+     * @param  dm the display mode to compare to
      * @return whether the two display modes are equal
      */
     public boolean equals(DisplayMode dm) {
--- a/src/share/classes/java/awt/EventDispatchThread.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/EventDispatchThread.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,7 +33,6 @@
 import sun.util.logging.PlatformLogger;
 
 import sun.awt.dnd.SunDragSourceContextPeer;
-import sun.awt.EventQueueDelegate;
 
 /**
  * EventDispatchThread is a package-private AWT class which takes
@@ -158,17 +157,11 @@
         boolean eventOK = false;
         try {
             EventQueue eq = null;
-            EventQueueDelegate.Delegate delegate = null;
             do {
                 // EventQueue may change during the dispatching
                 eq = getEventQueue();
-                delegate = EventQueueDelegate.getDelegate();
 
-                if (delegate != null && id == ANY_EVENT) {
-                    event = delegate.getNextEvent(eq);
-                } else {
-                    event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
-                }
+                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
 
                 eventOK = true;
                 synchronized (eventFilters) {
@@ -194,14 +187,7 @@
                 eventLog.finest("Dispatching: " + event);
             }
 
-            Object handle = null;
-            if (delegate != null) {
-                handle = delegate.beforeDispatch(event);
-            }
             eq.dispatchEvent(event);
-            if (delegate != null) {
-                delegate.afterDispatch(event, handle);
-            }
         }
         catch (ThreadDeath death) {
             doDispatch = false;
--- a/src/share/classes/java/awt/EventQueue.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/EventQueue.java	Wed Jul 09 10:42:37 2014 -0700
@@ -214,9 +214,17 @@
                                             FwDispatcher dispatcher) {
                     eventQueue.setFwDispatcher(dispatcher);
                 }
+
+                @Override
+                public long getMostRecentEventTime(EventQueue eventQueue) {
+                    return eventQueue.getMostRecentEventTimeImpl();
+                }
             });
     }
 
+    /**
+     * Initializes a new instance of {@code EventQueue}.
+     */
     public EventQueue() {
         for (int i = 0; i < NUM_PRIORITIES; i++) {
             queues[i] = new Queue();
--- a/src/share/classes/java/awt/Frame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Frame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1089,6 +1089,9 @@
     }
 
     /**
+     * Sets the cursor for this frame to the specified type.
+     *
+     * @param  cursorType the cursor type
      * @deprecated As of JDK version 1.1,
      * replaced by <code>Component.setCursor(Cursor)</code>.
      */
@@ -1103,6 +1106,7 @@
     /**
      * @deprecated As of JDK version 1.1,
      * replaced by <code>Component.getCursor()</code>.
+     * @return the cursor type for this frame
      */
     @Deprecated
     public int getCursorType() {
@@ -1124,6 +1128,8 @@
      * ownerless {@code Dialog}s (introduced in release 1.6), use {@link
      * Window#getOwnerlessWindows Window.getOwnerlessWindows}.
      *
+     * @return the array of all {@code Frame}s created by this application
+     *
      * @see Window#getWindows()
      * @see Window#getOwnerlessWindows
      *
--- a/src/share/classes/java/awt/GraphicsEnvironment.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/GraphicsEnvironment.java	Wed Jul 09 10:42:37 2014 -0700
@@ -357,6 +357,8 @@
      * <p>Notice that an application can supersede the registration
      * of an earlier created font with a new one.
      * </ul>
+     *
+     * @param  font the font to be registered
      * @return true if the <code>font</code> is successfully
      * registered in this <code>GraphicsEnvironment</code>.
      * @throws NullPointerException if <code>font</code> is null
--- a/src/share/classes/java/awt/GridBagLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/GridBagLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -981,9 +981,15 @@
      * This method is obsolete and supplied for backwards
      * compatibility only; new code should call {@link
      * #getLayoutInfo(java.awt.Container, int) getLayoutInfo} instead.
-     * This method is the same as <code>getLayoutInfo</code>;
-     * refer to <code>getLayoutInfo</code> for details on parameters
-     * and return value.
+     *
+     * Fills in an instance of {@code GridBagLayoutInfo} for the
+     * current set of managed children. This method is the same
+     * as {@code getLayoutInfo}; refer to {@code getLayoutInfo}
+     * description for details.
+     *
+     * @param  parent the layout container
+     * @param  sizeflag either {@code PREFERREDSIZE} or {@code MINSIZE}
+     * @return the {@code GridBagLayoutInfo} for the set of children
      */
     protected GridBagLayoutInfo GetLayoutInfo(Container parent, int sizeflag) {
         synchronized (parent.getTreeLock()) {
@@ -1611,13 +1617,17 @@
     }
 
     /**
+     * Adjusts the x, y, width, and height fields to the correct
+     * values depending on the constraint geometry and pads.
+     * <p>
      * This method is obsolete and supplied for backwards
      * compatibility only; new code should call {@link
      * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle)
      * adjustForGravity} instead.
-     * This method is the same as <code>adjustForGravity</code>;
-     * refer to <code>adjustForGravity</code> for details
-     * on parameters.
+     * This method is the same as <code>adjustForGravity</code>
+     *
+     * @param  constraints the constraints to be applied
+     * @param  r the {@code Rectangle} to be adjusted
      */
     protected void AdjustForGravity(GridBagConstraints constraints,
                                     Rectangle r) {
@@ -1995,9 +2005,12 @@
      * This method is obsolete and supplied for backwards
      * compatibility only; new code should call {@link
      * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead.
-     * This method is the same as <code>getMinSize</code>;
-     * refer to <code>getMinSize</code> for details on parameters
-     * and return value.
+     * This method is the same as <code>getMinSize</code>
+     *
+     * @param  parent the layout container
+     * @param  info the layout info for this parent
+     * @return a <code>Dimension</code> object containing the
+     *         minimum size
      */
     protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info) {
         Dimension d = new Dimension();
@@ -2035,9 +2048,9 @@
      * This method is obsolete and supplied for backwards
      * compatibility only; new code should call {@link
      * #arrangeGrid(Container) arrangeGrid} instead.
-     * This method is the same as <code>arrangeGrid</code>;
-     * refer to <code>arrangeGrid</code> for details on the
-     * parameter.
+     * This method is the same as <code>arrangeGrid</code>
+     *
+     * @param  parent the layout container
      */
     protected void ArrangeGrid(Container parent) {
         Component comp;
--- a/src/share/classes/java/awt/HeadlessException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/HeadlessException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,10 +38,24 @@
      * JDK 1.4 serialVersionUID
      */
     private static final long serialVersionUID = 167183644944358563L;
+
+    /**
+     * Constructs new {@code HeadlessException}
+     */
     public HeadlessException() {}
+
+    /**
+     * Create a new instance with the specified detailed error message.
+     *
+     * @param  msg the error message
+     */
     public HeadlessException(String msg) {
         super(msg);
     }
+
+    /**
+     * {@inheritDoc}
+     */
     public String getMessage() {
         String superMessage = super.getMessage();
         String headlessMessage = GraphicsEnvironment.getHeadlessMessage();
--- a/src/share/classes/java/awt/ItemSelectable.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/ItemSelectable.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
     /**
      * Returns the selected items or <code>null</code> if no
      * items are selected.
+     *
+     * @return the list of selected objects, or {@code null}
      */
     public Object[] getSelectedObjects();
 
--- a/src/share/classes/java/awt/KeyboardFocusManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/KeyboardFocusManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1459,6 +1459,7 @@
      * Returns an array of all the <code>PropertyChangeListener</code>s
      * associated with the named property.
      *
+     * @param  propertyName the property name
      * @return all of the <code>PropertyChangeListener</code>s associated with
      *         the named property or an empty array if no such listeners have
      *         been added.
@@ -1628,6 +1629,7 @@
      * Returns an array of all the <code>VetoableChangeListener</code>s
      * associated with the named property.
      *
+     * @param  propertyName the property name
      * @return all of the <code>VetoableChangeListener</code>s associated with
      *         the named property or an empty array if no such listeners have
      *         been added.
--- a/src/share/classes/java/awt/Label.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Label.java	Wed Jul 09 10:42:37 2014 -0700
@@ -193,7 +193,8 @@
      * Gets the current alignment of this label. Possible values are
      * <code>Label.LEFT</code>, <code>Label.RIGHT</code>, and
      * <code>Label.CENTER</code>.
-     * @see        java.awt.Label#setAlignment
+     * @return the alignment of this label
+     * @see java.awt.Label#setAlignment
      */
     public int getAlignment() {
         return alignment;
@@ -321,6 +322,9 @@
          */
         private static final long serialVersionUID = -3568967560160480438L;
 
+        /**
+         * Constructor for the accessible label.
+         */
         public AccessibleAWTLabel() {
             super();
         }
--- a/src/share/classes/java/awt/LayoutManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/LayoutManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,9 @@
     /**
      * Calculates the preferred size dimensions for the specified
      * container, given the components it contains.
-     * @param parent the container to be laid out
+     *
+     * @param  parent the container to be laid out
+     * @return the preferred dimension for the container
      *
      * @see #minimumLayoutSize
      */
@@ -70,7 +72,10 @@
     /**
      * Calculates the minimum size dimensions for the specified
      * container, given the components it contains.
-     * @param parent the component to be laid out
+     *
+     * @param  parent the component to be laid out
+     * @return the minimum dimension for the container
+     *
      * @see #preferredLayoutSize
      */
     Dimension minimumLayoutSize(Container parent);
--- a/src/share/classes/java/awt/LayoutManager2.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/LayoutManager2.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,8 +55,11 @@
     /**
      * Calculates the maximum size dimensions for the specified container,
      * given the components it contains.
+     *
      * @see java.awt.Component#getMaximumSize
      * @see LayoutManager
+     * @param  target the target container
+     * @return the maximum size of the container
      */
     public Dimension maximumLayoutSize(Container target);
 
@@ -66,6 +69,9 @@
      * components.  The value should be a number between 0 and 1
      * where 0 represents alignment along the origin, 1 is aligned
      * the furthest away from the origin, 0.5 is centered, etc.
+     *
+     * @param  target the target container
+     * @return the x-axis alignment preference
      */
     public float getLayoutAlignmentX(Container target);
 
@@ -75,12 +81,16 @@
      * components.  The value should be a number between 0 and 1
      * where 0 represents alignment along the origin, 1 is aligned
      * the furthest away from the origin, 0.5 is centered, etc.
+     *
+     * @param  target the target container
+     * @return the y-axis alignment preference
      */
     public float getLayoutAlignmentY(Container target);
 
     /**
      * Invalidates the layout, indicating that if the layout manager
      * has cached information it should be discarded.
+     * @param  target the target container
      */
     public void invalidateLayout(Container target);
 
--- a/src/share/classes/java/awt/List.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/List.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -282,6 +282,9 @@
     }
 
     /**
+     * Returns the number of items in the list.
+     *
+     * @return the number of items in the list
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getItemCount()</code>.
      */
@@ -333,7 +336,10 @@
     }
 
     /**
-     * @deprecated      replaced by <code>add(String)</code>.
+     * Adds the specified item to the end of the list.
+     *
+     * @param  item the item to be added
+     * @deprecated replaced by <code>add(String)</code>.
      */
     @Deprecated
     public void addItem(String item) {
@@ -358,7 +364,12 @@
     }
 
     /**
-     * @deprecated      replaced by <code>add(String, int)</code>.
+     * Adds the specified item to the the list
+     * at the position indicated by the index.
+     *
+     * @param  item the item to be added
+     * @param  index the position at which to add the item
+     * @deprecated replaced by <code>add(String, int)</code>.
      */
     @Deprecated
     public synchronized void addItem(String item, int index) {
@@ -455,8 +466,11 @@
     }
 
     /**
-     * @deprecated     replaced by <code>remove(String)</code>
-     *                         and <code>remove(int)</code>.
+     * Removes the item at the specified position.
+     *
+     * @param  position the index of the item to delete
+     * @deprecated replaced by <code>remove(String)</code>
+     *             and <code>remove(int)</code>.
      */
     @Deprecated
     public void delItem(int position) {
@@ -646,6 +660,10 @@
     }
 
     /**
+     * Determines if the specified item in the list is selected.
+     *
+     * @param  index specifies the item to be checked
+     * @return {@code true} if the item is selected; otherwise {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by <code>isIndexSelected(int)</code>.
      */
@@ -672,6 +690,7 @@
 
     /**
      * Determines whether this list allows multiple selections.
+     *
      * @return     <code>true</code> if this list allows multiple
      *                 selections; otherwise, <code>false</code>
      * @see        #setMultipleMode
@@ -682,6 +701,10 @@
     }
 
     /**
+     * Determines whether this list allows multiple selections.
+     *
+     * @return {@code true} if this list allows multiple
+     *         selections; otherwise {@code false}
      * @deprecated As of JDK version 1.1,
      * replaced by <code>isMultipleMode()</code>.
      */
@@ -709,6 +732,9 @@
     }
 
     /**
+     * Enables or disables multiple selection mode for this list.
+     *
+     * @param  b {@code true} to enable multiple mode, {@code false} otherwise
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setMultipleMode(boolean)</code>.
      */
@@ -760,6 +786,11 @@
     }
 
     /**
+     * Returns the preferred size of this component
+     * assuming it has the specified number of rows.
+     *
+     * @param  rows the number of rows
+     * @return the preferred dimensions for displaying this list
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getPreferredSize(int)</code>.
      */
@@ -810,6 +841,11 @@
     }
 
     /**
+     * Returns the minimum dimensions for the list
+     * with the specified number of rows.
+     *
+     * @param  rows the number of rows in the list
+     * @return the minimum dimensions for displaying this list
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getMinimumSize(int)</code>.
      */
@@ -1146,6 +1182,10 @@
     }
 
     /**
+     * Deletes the list items in the specified index range.
+     *
+     * @param  start the beginning index of the range to delete
+     * @param  end the ending index of the range to delete
      * @deprecated As of JDK version 1.1,
      * Not for public use in the future.
      * This method is expected to be retained only as a package
@@ -1290,6 +1330,9 @@
          */
         private static final long serialVersionUID = 7924617370136012829L;
 
+        /**
+         * Constructs new {@code AccessibleAWTList}
+         */
         public AccessibleAWTList() {
             super();
             List.this.addActionListener(this);
@@ -1491,6 +1534,13 @@
             private List parent;
             private int  indexInParent;
 
+            /**
+             * Constructs new {@code AccessibleAWTListChild} with the given
+             * parent {@code List} and 0-based index of this object in the parent.
+             *
+             * @param  parent the parent {@code List}
+             * @param  indexInParent the index in the parent
+             */
             public AccessibleAWTListChild(List parent, int indexInParent)  {
                 this.parent = parent;
                 this.setAccessibleParent(parent);
--- a/src/share/classes/java/awt/MediaTracker.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/MediaTracker.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -226,7 +226,9 @@
         addImageImpl(image, id, w, h);
         Image rvImage = getResolutionVariant(image);
         if (rvImage != null) {
-            addImageImpl(rvImage, id, 2 * w, 2 * h);
+            addImageImpl(rvImage, id,
+                    w == -1 ? -1 : 2 * w,
+                    h == -1 ? -1 : 2 * h);
         }
     }
 
@@ -641,9 +643,11 @@
      * image is considered to have finished loading. Use the
      * <code>statusID</code>, <code>isErrorID</code>, and
      * <code>isErrorAny</code> methods to check for errors.
-     * @param         id   the identifier of the images to check
-     * @param         ms   the length of time, in milliseconds, to wait
-     *                           for the loading to complete
+     * @param  id the identifier of the images to check
+     * @param  ms the length of time, in milliseconds, to wait
+     *         for the loading to complete
+     * @return {@code true} if the loading completed in time;
+     *         otherwise {@code false}
      * @see           java.awt.MediaTracker#waitForAll
      * @see           java.awt.MediaTracker#waitForID(int)
      * @see           java.awt.MediaTracker#statusID
@@ -810,8 +814,9 @@
         removeImageImpl(image, id, width, height);
         Image rvImage = getResolutionVariant(image);
         if (rvImage != null) {
-            removeImageImpl(rvImage, id, 2 * width, 2 * height);
-
+            removeImageImpl(rvImage, id,
+                    width == -1 ? -1 : 2 * width,
+                    height == -1 ? -1 : 2 * height);
         }
         notifyAll();    // Notify in case remaining images are "done".
     }
--- a/src/share/classes/java/awt/Menu.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Menu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -213,7 +213,7 @@
 
     /**
       * Get the number of items in this menu.
-      * @return     the number of items in this menu.
+      * @return the number of items in this menu
       * @since      1.1
       */
     public int getItemCount() {
@@ -221,6 +221,9 @@
     }
 
     /**
+     * Returns the number of items in this menu.
+     *
+     * @return the number of items in this menu
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getItemCount()</code>.
      */
--- a/src/share/classes/java/awt/MenuBar.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/MenuBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -279,6 +279,9 @@
     }
 
     /**
+     * Gets the number of menus on the menu bar.
+     *
+     * @return the number of menus on the menu bar.
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getMenuCount()</code>.
      */
@@ -338,10 +341,11 @@
      * or <code>null</code> if none of the menu items being managed
      * by this menu bar is associated with the specified menu
      * shortcut.
-     * @param        s the specified menu shortcut.
-     * @see          java.awt.MenuItem
-     * @see          java.awt.MenuShortcut
-     * @since        1.1
+     * @param  s the specified menu shortcut.
+     * @return the menu item for the specified shortcut.
+     * @see java.awt.MenuItem
+     * @see java.awt.MenuShortcut
+     * @since 1.1
      */
      public MenuItem getShortcutMenuItem(MenuShortcut s) {
         int nmenus = getMenuCount();
--- a/src/share/classes/java/awt/MenuComponent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/MenuComponent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -220,6 +220,7 @@
     /**
      * @deprecated As of JDK version 1.1,
      * programs should not directly manipulate peers.
+     * @return the peer for this component
      */
     @Deprecated
     public MenuComponentPeer getPeer() {
--- a/src/share/classes/java/awt/MenuContainer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/MenuContainer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,25 @@
  */
 
 public interface MenuContainer {
+
+    /**
+     * Returns the font in use by this container.
+     *
+     * @return the menu font
+     */
     Font getFont();
+
+    /**
+     * Removes the specified menu component from the menu.
+     *
+     * @param  comp the menu component to remove
+     */
     void remove(MenuComponent comp);
 
     /**
+     * Posts an event to the listeners.
+     *
+     * @param  evt the event to dispatch
      * @deprecated As of JDK version 1.1
      * replaced by dispatchEvent(AWTEvent).
      */
--- a/src/share/classes/java/awt/MenuItem.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/MenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -264,6 +264,9 @@
 
     /**
      * Checks whether this menu item is enabled.
+     *
+     * @return {@code true} if the item is enabled;
+     *         otherwise {@code false}
      * @see        java.awt.MenuItem#setEnabled
      * @since      1.0
      */
@@ -296,6 +299,10 @@
     }
 
     /**
+     * Sets whether or not this menu item can be chosen.
+     *
+     * @param  b if {@code true}, enables this menu item;
+     *           otherwise disables
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setEnabled(boolean)</code>.
      */
@@ -494,8 +501,10 @@
     /**
      * Gets the command name of the action event that is fired
      * by this menu item.
-     * @see         java.awt.MenuItem#setActionCommand
-     * @since       1.1
+     *
+     * @return the action command name
+     * @see java.awt.MenuItem#setActionCommand
+     * @since 1.1
      */
     public String getActionCommand() {
         return getActionCommandImpl();
--- a/src/share/classes/java/awt/PrintGraphics.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/PrintGraphics.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
     /**
      * Returns the PrintJob object from which this PrintGraphics
      * object originated.
+     *
+     * @return the print job for this object
      */
     public PrintJob getPrintJob();
 
--- a/src/share/classes/java/awt/PrintJob.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/PrintJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
      * object is disposed.  This graphics object will also implement
      * the PrintGraphics interface.
      * @see PrintGraphics
+     * @return the graphics context for printing the next page
      */
     public abstract Graphics getGraphics();
 
@@ -49,6 +50,8 @@
      * Returns the dimensions of the page in pixels.
      * The resolution of the page is chosen so that it
      * is similar to the screen resolution.
+     *
+     * @return the page dimension
      */
     public abstract Dimension getPageDimension();
 
@@ -56,11 +59,16 @@
      * Returns the resolution of the page in pixels per inch.
      * Note that this doesn't have to correspond to the physical
      * resolution of the printer.
+     *
+     * @return the page resolution
      */
     public abstract int getPageResolution();
 
     /**
      * Returns true if the last page will be printed first.
+     *
+     * @return {@code true} if the last page will be printed first;
+     *         otherwise {@code false}
      */
     public abstract boolean lastPageFirst();
 
--- a/src/share/classes/java/awt/Robot.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Robot.java	Wed Jul 09 10:42:37 2014 -0700
@@ -498,6 +498,8 @@
 
     /**
      * Returns the number of milliseconds this Robot sleeps after generating an event.
+     *
+     * @return the delay duration in milliseconds
      */
     public synchronized int getAutoDelay() {
         return autoDelay;
@@ -505,7 +507,10 @@
 
     /**
      * Sets the number of milliseconds this Robot sleeps after generating an event.
-     * @throws  IllegalArgumentException If <code>ms</code> is not between 0 and 60,000 milliseconds inclusive
+     *
+     * @param  ms the delay duration in milliseconds
+     * @throws IllegalArgumentException If {@code ms}
+     *         is not between 0 and 60,000 milliseconds inclusive
      */
     public synchronized void setAutoDelay(int ms) {
         checkDelayArgument(ms);
@@ -523,9 +528,11 @@
      * Sleeps for the specified time.
      * To catch any <code>InterruptedException</code>s that occur,
      * <code>Thread.sleep()</code> may be used instead.
-     * @param   ms      time to sleep in milliseconds
-     * @throws  IllegalArgumentException if <code>ms</code> is not between 0 and 60,000 milliseconds inclusive
-     * @see     java.lang.Thread#sleep
+     *
+     * @param  ms time to sleep in milliseconds
+     * @throws IllegalArgumentException if {@code ms}
+     *         is not between 0 and 60,000 milliseconds inclusive
+     * @see java.lang.Thread#sleep
      */
     public synchronized void delay(int ms) {
         checkDelayArgument(ms);
--- a/src/share/classes/java/awt/ScrollPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/ScrollPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -323,7 +323,9 @@
      * represents the state of the vertical scrollbar.
      * The declared return type of this method is
      * <code>Adjustable</code> to maintain backward compatibility.
+     *
      * @see java.awt.ScrollPaneAdjustable
+     * @return the vertical scrollbar state
      */
     public Adjustable getVAdjustable() {
         return vAdjustable;
@@ -334,7 +336,9 @@
      * represents the state of the horizontal scrollbar.
      * The declared return type of this method is
      * <code>Adjustable</code> to maintain backward compatibility.
+     *
      * @see java.awt.ScrollPaneAdjustable
+     * @return the horizontal scrollbar state
      */
     public Adjustable getHAdjustable() {
         return hAdjustable;
@@ -657,6 +661,9 @@
      * Indicates whether or not scrolling will take place in response to
      * the mouse wheel.  Wheel scrolling is enabled by default.
      *
+     * @return {@code true} if the wheel scrolling enabled;
+     *         otherwise {@code false}
+     *
      * @see #setWheelScrollingEnabled(boolean)
      * @since 1.4
      */
--- a/src/share/classes/java/awt/Scrollbar.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Scrollbar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -656,6 +656,9 @@
     }
 
     /**
+     * Returns the visible amount of this scroll bar.
+     *
+     * @return the visible amount of this scroll bar
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getVisibleAmount()</code>.
      */
@@ -729,6 +732,10 @@
     }
 
     /**
+     * Sets the unit increment for this scroll bar.
+     *
+     * @param  v the increment value
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setUnitIncrement(int)</code>.
      */
@@ -768,6 +775,9 @@
     }
 
     /**
+     * Returns the unit increment for this scrollbar.
+     *
+     * @return the unit increment for this scrollbar
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getUnitIncrement()</code>.
      */
@@ -797,6 +807,9 @@
     }
 
     /**
+     * Sets the block increment for this scroll bar.
+     *
+     * @param  v the block increment
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setBlockIncrement()</code>.
      */
@@ -833,6 +846,10 @@
     }
 
     /**
+     * Returns the block increment of this scroll bar.
+     *
+     * @return the block increment of this scroll bar
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getBlockIncrement()</code>.
      */
--- a/src/share/classes/java/awt/TextArea.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/TextArea.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -314,6 +314,11 @@
     }
 
     /**
+     * Inserts the specified text at the specified position
+     * in this text area.
+     *
+     * @param  str the non-{@code null} text to insert
+     * @param  pos the position at which to insert
      * @deprecated As of JDK version 1.1,
      * replaced by <code>insert(String, int)</code>.
      */
@@ -342,6 +347,9 @@
     }
 
     /**
+     * Appends the given text to the text area's current text.
+     *
+     * @param  str the text to append
      * @deprecated As of JDK version 1.1,
      * replaced by <code>append(String)</code>.
      */
@@ -378,6 +386,15 @@
     }
 
     /**
+     * Replaces a range of characters between
+     * the indicated start and end positions
+     * with the specified replacement text (the text at the end
+     * position will not be replaced).
+     *
+     * @param  str the non-{@code null} text to use as
+     *         the replacement
+     * @param  start the start position
+     * @param  end the end position
      * @deprecated As of JDK version 1.1,
      * replaced by <code>replaceRange(String, int, int)</code>.
      */
@@ -492,6 +509,12 @@
     }
 
     /**
+     * Determines the preferred size of the text area with the specified
+     * number of rows and columns.
+     *
+     * @param  rows the number of rows
+     * @param  columns the number of columns
+     * @return the preferred dimensions needed for the text area
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getPreferredSize(int, int)</code>.
      */
@@ -544,6 +567,12 @@
     }
 
     /**
+     * Determines the minimum size of the text area with the specified
+     * number of rows and columns.
+     *
+     * @param  rows the number of rows
+     * @param  columns the number of columns
+     * @return the minimum size for the text area
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getMinimumSize(int, int)</code>.
      */
--- a/src/share/classes/java/awt/TextComponent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/TextComponent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -107,6 +107,9 @@
     // the background color of non-editable TextComponents.
     boolean backgroundSetByClientCode = false;
 
+    /**
+     * A list of listeners that will receive events from this object.
+     */
     transient protected TextListener textListener;
 
     /*
--- a/src/share/classes/java/awt/TextField.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/TextField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -272,6 +272,10 @@
     }
 
     /**
+     * Sets the character to be echoed when protected input is displayed.
+     *
+     *  @param  c the echo character for this text field
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setEchoChar(char)</code>.
      */
@@ -368,6 +372,12 @@
     }
 
     /**
+     * Returns the preferred size for this text field
+     * with the specified number of columns.
+     *
+     * @param  columns the number of columns
+     * @return the preferred size for the text field
+     *
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getPreferredSize(int)</code>.
      */
@@ -407,8 +417,9 @@
     /**
      * Gets the minimum dimensions for a text field with
      * the specified number of columns.
-     * @param    columns   the number of columns in
-     *                          this text field.
+     * @param  columns the number of columns in
+     *         this text field.
+     * @return the minimum size for this text field
      * @since    1.1
      */
     public Dimension getMinimumSize(int columns) {
@@ -416,6 +427,11 @@
     }
 
     /**
+     * Returns the minimum dimensions for a text field with
+     * the specified number of columns.
+     *
+     * @param  columns the number of columns
+     * @return the minimum size for this text field
      * @deprecated As of JDK version 1.1,
      * replaced by <code>getMinimumSize(int)</code>.
      */
--- a/src/share/classes/java/awt/Toolkit.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Toolkit.java	Wed Jul 09 10:42:37 2014 -0700
@@ -422,7 +422,8 @@
      * and allows the Component and Container classes to be extended directly
      * to create windowless components that are defined entirely in java.
      *
-     * @param target The Component to be created.
+     * @param  target The Component to be created.
+     * @return the peer for the specified component
      */
     protected LightweightPeer createComponent(Component target) {
         if (lightweightMarker == null) {
@@ -1370,6 +1371,9 @@
      * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and
      * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}.
      *
+     * @param  keyCode the key code
+     * @return {@code true} if the given key is currently in its "on" state;
+     *          otherwise {@code false}
      * @exception java.lang.IllegalArgumentException if <code>keyCode</code>
      * is not one of the valid key codes
      * @exception java.lang.UnsupportedOperationException if the host system doesn't
@@ -1404,6 +1408,8 @@
      * involve event processing and therefore may not be immediately
      * observable through getLockingKeyState.
      *
+     * @param  keyCode the key code
+     * @param  on the state of the key
      * @exception java.lang.IllegalArgumentException if <code>keyCode</code>
      * is not one of the valid key codes
      * @exception java.lang.UnsupportedOperationException if the host system doesn't
@@ -1429,6 +1435,9 @@
     /**
      * Give native peers the ability to query the native container
      * given a native component (eg the direct parent may be lightweight).
+     *
+     * @param  c the component to fetch the container for
+     * @return the native container object for the component
      */
     protected static Container getNativeContainer(Component c) {
         return c.getNativeContainer();
@@ -1449,6 +1458,7 @@
      * @param     name a localized description of the cursor, for Java Accessibility use
      * @exception IndexOutOfBoundsException if the hotSpot values are outside
      *   the bounds of the cursor
+     * @return the cursor created
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true
      * @see       java.awt.GraphicsEnvironment#isHeadless
@@ -1675,6 +1685,11 @@
     /**
      * Gets a property with the specified key and default.
      * This method returns defaultValue if the property is not found.
+     *
+     * @param  key the key
+     * @param  defaultValue the default value
+     * @return the value of the property or the default value
+     *         if the property was not found
      */
     public static String getProperty(String key, String defaultValue) {
         // first try platform specific bundle
@@ -1738,6 +1753,9 @@
      * Creates the peer for a DragSourceContext.
      * Always throws InvalidDndOperationException if
      * GraphicsEnvironment.isHeadless() returns true.
+     *
+     * @param  dge the {@code DragGestureEvent}
+     * @return the peer created
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public abstract DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException;
@@ -1775,6 +1793,9 @@
      * representation for an underlying platform dependent desktop setting.
      * For more information on desktop properties supported by the AWT see
      * <a href="doc-files/DesktopProperties.html">AWT Desktop Properties</a>.
+     *
+     * @param  propertyName the property name
+     * @return the value for the specified desktop property
      */
     public final synchronized Object getDesktopProperty(String propertyName) {
         // This is a workaround for headless toolkits.  It would be
@@ -1818,6 +1839,9 @@
     /**
      * Sets the named desktop property to the specified value and fires a
      * property change event to notify any listeners that the value has changed.
+     *
+     * @param  name the property name
+     * @param  newValue the new property value
      */
     protected final void setDesktopProperty(String name, Object newValue) {
         // This is a workaround for headless toolkits.  It would be
--- a/src/share/classes/java/awt/Window.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/Window.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1452,6 +1452,8 @@
 
     /**
      * Returns the owner of this window.
+     *
+     * @return the owner of this window
      * @since 1.2
      */
     public Window getOwner() {
@@ -1464,6 +1466,8 @@
     /**
      * Return an array containing all the windows this
      * window currently owns.
+     *
+     * @return the array of all the owned windows
      * @since 1.2
      */
     public Window[] getOwnedWindows() {
@@ -1586,6 +1590,7 @@
      * dialogs such as component positions, {@code LayoutManager}s
      * or serialization.
      *
+     * @return the array of all the {@code Window}s created by the application
      * @see Frame#getFrames
      * @see Window#getOwnerlessWindows
      *
@@ -1608,6 +1613,8 @@
      * dialogs such as component positions, {@code LayoutManager}s
      * or serialization.
      *
+     * @return the array of all the ownerless {@code Window}s
+     *         created by this application
      * @see Frame#getFrames
      * @see Window#getWindows()
      *
@@ -2849,6 +2856,7 @@
      *
      * This method can only be called while the window is not displayable.
      *
+     * @param  type the window type
      * @throws IllegalComponentStateException if the window
      *         is displayable.
      * @throws IllegalArgumentException if the type is {@code null}
@@ -2874,6 +2882,7 @@
     /**
      * Returns the type of the window.
      *
+     * @return the type of the window
      * @see   #setType
      * @since 1.7
      */
--- a/src/share/classes/java/awt/event/InputMethodEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/event/InputMethodEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,6 +25,10 @@
 
 package java.awt.event;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AppContext;
+import sun.awt.SunToolkit;
+
 import java.awt.AWTEvent;
 import java.awt.Component;
 import java.awt.EventQueue;
@@ -217,8 +221,10 @@
     public InputMethodEvent(Component source, int id,
             AttributedCharacterIterator text, int committedCharacterCount,
             TextHitInfo caret, TextHitInfo visiblePosition) {
-        this(source, id, EventQueue.getMostRecentEventTime(), text,
-             committedCharacterCount, caret, visiblePosition);
+        this(source, id,
+                getMostRecentEventTimeForSource(source),
+                text, committedCharacterCount,
+                caret, visiblePosition);
     }
 
     /**
@@ -258,8 +264,9 @@
      */
     public InputMethodEvent(Component source, int id, TextHitInfo caret,
             TextHitInfo visiblePosition) {
-        this(source, id, EventQueue.getMostRecentEventTime(), null,
-             0, caret, visiblePosition);
+        this(source, id,
+                getMostRecentEventTimeForSource(source),
+                null, 0, caret, visiblePosition);
     }
 
     /**
@@ -411,7 +418,25 @@
     private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
         s.defaultReadObject();
         if (when == 0) {
-            when = EventQueue.getMostRecentEventTime();
+            when = getMostRecentEventTimeForSource(this.source);
         }
     }
+
+    /**
+     * Get the most recent event time in the {@code EventQueue} which the {@code source}
+     * belongs to.
+     *
+     * @param source the source of the event
+     * @exception  IllegalArgumentException  if source is null.
+     * @return most recent event time in the {@code EventQueue}
+     */
+    private static long getMostRecentEventTimeForSource(Object source) {
+        if (source == null) {
+            // throw the IllegalArgumentException to conform to EventObject spec
+            throw new IllegalArgumentException("null source");
+        }
+        AppContext appContext = SunToolkit.targetToAppContext(source);
+        EventQueue eventQueue = SunToolkit.getSystemEventQueueImplPP(appContext);
+        return AWTAccessor.getEventQueueAccessor().getMostRecentEventTime(eventQueue);
+    }
 }
--- a/src/share/classes/java/awt/font/StyledParagraph.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/font/StyledParagraph.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,9 +38,9 @@
 import java.util.Vector;
 import java.util.HashMap;
 import java.util.Map;
+import sun.font.CodePointIterator;
 import sun.font.Decoration;
 import sun.font.FontResolver;
-import sun.text.CodePointIterator;
 
 /**
  * This class stores Font, GraphicAttribute, and Decoration intervals
--- a/src/share/classes/java/awt/font/TextLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/font/TextLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,13 +60,13 @@
 import java.util.HashMap;
 import java.util.Hashtable;
 import sun.font.AttributeValues;
+import sun.font.CodePointIterator;
 import sun.font.CoreMetrics;
 import sun.font.Decoration;
 import sun.font.FontLineMetrics;
 import sun.font.FontResolver;
 import sun.font.GraphicComponent;
 import sun.font.LayoutPathImpl;
-import sun.text.CodePointIterator;
 
 /**
  *
--- a/src/share/classes/java/awt/font/TextLine.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/font/TextLine.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,6 +50,7 @@
 import java.util.Map;
 import sun.font.AttributeValues;
 import sun.font.BidiUtils;
+import sun.font.CodePointIterator;
 import sun.font.CoreMetrics;
 import sun.font.Decoration;
 import sun.font.FontLineMetrics;
@@ -60,7 +61,6 @@
 import sun.font.LayoutPathImpl.SegmentPathBuilder;
 import sun.font.TextLabelFactory;
 import sun.font.TextLineComponent;
-import sun.text.CodePointIterator;
 
 import java.awt.geom.Line2D;
 
--- a/src/share/classes/java/awt/geom/Path2D.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/geom/Path2D.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -285,6 +285,8 @@
                 int grow = size;
                 if (grow > EXPAND_MAX) {
                     grow = EXPAND_MAX;
+                } else if (grow == 0) {
+                    grow = 1;
                 }
                 pointTypes = Arrays.copyOf(pointTypes, size+grow);
             }
@@ -1121,6 +1123,8 @@
                 int grow = size;
                 if (grow > EXPAND_MAX) {
                     grow = EXPAND_MAX;
+                } else if (grow == 0) {
+                    grow = 1;
                 }
                 pointTypes = Arrays.copyOf(pointTypes, size+grow);
             }
--- a/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Wed Jul 09 10:42:37 2014 -0700
@@ -337,7 +337,7 @@
      *         the specified parameter.
      */
     public ParameterBlock add(byte b) {
-        return add(new Byte(b));
+        return add(Byte.valueOf(b));
     }
 
     /**
@@ -348,7 +348,7 @@
      *         the specified parameter.
      */
     public ParameterBlock add(char c) {
-        return add(new Character(c));
+        return add(Character.valueOf(c));
     }
 
     /**
@@ -359,7 +359,7 @@
      *         the specified parameter.
      */
     public ParameterBlock add(short s) {
-        return add(new Short(s));
+        return add(Short.valueOf(s));
     }
 
     /**
@@ -381,7 +381,7 @@
      *         the specified parameter.
      */
     public ParameterBlock add(long l) {
-        return add(new Long(l));
+        return add(Long.valueOf(l));
     }
 
     /**
@@ -441,7 +441,7 @@
      *        the specified parameter.
      */
     public ParameterBlock set(byte b, int index) {
-        return set(new Byte(b), index);
+        return set(Byte.valueOf(b), index);
     }
 
     /**
@@ -457,7 +457,7 @@
      *        the specified parameter.
      */
     public ParameterBlock set(char c, int index) {
-        return set(new Character(c), index);
+        return set(Character.valueOf(c), index);
     }
 
     /**
@@ -473,7 +473,7 @@
      *        the specified parameter.
      */
     public ParameterBlock set(short s, int index) {
-        return set(new Short(s), index);
+        return set(Short.valueOf(s), index);
     }
 
     /**
@@ -505,7 +505,7 @@
      *        the specified parameter.
      */
     public ParameterBlock set(long l, int index) {
-        return set(new Long(l), index);
+        return set(Long.valueOf(l), index);
     }
 
     /**
--- a/src/share/classes/java/beans/BeanDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/BeanDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
  * <p>
  * This is one of the kinds of descriptor returned by a BeanInfo object,
  * which also returns descriptors for properties, method, and events.
+ *
+ * @since 1.1
  */
 
 public class BeanDescriptor extends FeatureDescriptor {
--- a/src/share/classes/java/beans/BeanInfo.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/BeanInfo.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,6 +48,8 @@
  * the {@code SimpleBeanInfo} class to define specific information.
  * <p>
  * See also the {@link Introspector} class to learn more about bean behavior.
+ *
+ * @since 1.1
  */
 public interface BeanInfo {
 
--- a/src/share/classes/java/beans/Beans.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/Beans.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,6 +56,8 @@
 
 /**
  * This class provides some general purpose beans control methods.
+ *
+ * @since 1.1
  */
 
 public class Beans {
@@ -96,6 +98,7 @@
      * @exception ClassNotFoundException if the class of a serialized
      *              object could not be found.
      * @exception IOException if an I/O error occurs.
+     * @since 1.2
      */
 
     public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext) throws IOException, ClassNotFoundException {
@@ -152,6 +155,7 @@
      * @exception ClassNotFoundException if the class of a serialized
      *              object could not be found.
      * @exception IOException if an I/O error occurs.
+     * @since 1.2
      */
 
     public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer)
--- a/src/share/classes/java/beans/Customizer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/Customizer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
  * it can be instantiated inside an AWT dialog or panel.
  * <P>
  * Each customizer should have a null constructor.
+ *
+ * @since 1.1
  */
 
 public interface Customizer {
--- a/src/share/classes/java/beans/EventHandler.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/EventHandler.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -446,7 +446,7 @@
         }
 
         if (listenerMethodName == null || listenerMethodName.equals(methodName)) {
-            Class[] argTypes = null;
+            Class<?>[] argTypes = null;
             Object[] newArgs = null;
 
             if (eventPropertyName == null) {     // Nullary method.
--- a/src/share/classes/java/beans/EventSetDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/EventSetDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,8 @@
  * The given group of events are all delivered as method calls on a single
  * event listener interface, and an event listener object can be registered
  * via a call on a registration method supplied by the event source.
+ *
+ * @since 1.1
  */
 public class EventSetDescriptor extends FeatureDescriptor {
 
@@ -81,7 +83,7 @@
         String eventName = NameGenerator.capitalize(eventSetName) + "Event";
         Method[] listenerMethods = getListenerMethods();
         if (listenerMethods.length > 0) {
-            Class[] args = getParameterTypes(getClass0(), listenerMethods[0]);
+            Class<?>[] args = getParameterTypes(getClass0(), listenerMethods[0]);
             // Check for EventSet compliance. Special case for vetoableChange. See 4529996
             if (!"vetoableChange".equals(eventSetName) && !args[0].getName().endsWith(eventName)) {
                 throw new IntrospectionException("Method \"" + listenerMethodName +
--- a/src/share/classes/java/beans/FeatureDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/FeatureDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -46,6 +46,8 @@
  * <p>
  * In addition it provides an extension mechanism so that arbitrary
  * attribute/value pairs can be associated with a design feature.
+ *
+ * @since 1.1
  */
 
 public class FeatureDescriptor {
@@ -145,6 +147,7 @@
      * important for presenting to humans.
      *
      * @return True if this feature should be preferentially shown to human users.
+     * @since 1.2
      */
     public boolean isPreferred() {
         return preferred;
@@ -156,6 +159,7 @@
      *
      * @param preferred  True if this feature should be preferentially shown
      *                   to human users.
+     * @since 1.2
      */
     public void setPreferred(boolean preferred) {
         this.preferred = preferred;
--- a/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,8 @@
  * An indexed property may also provide simple non-indexed read and write
  * methods.  If these are present, they read and write arrays of the type
  * returned by the indexed read method.
+ *
+ * @since 1.1
  */
 
 public class IndexedPropertyDescriptor extends PropertyDescriptor {
@@ -209,6 +211,8 @@
      * @param readMethod The new indexed read method.
      * @throws IntrospectionException if an exception occurs during
      * introspection.
+     *
+     * @since 1.2
      */
     public synchronized void setIndexedReadMethod(Method readMethod)
         throws IntrospectionException {
@@ -288,6 +292,8 @@
      * @param writeMethod The new indexed write method.
      * @throws IntrospectionException if an exception occurs during
      * introspection.
+     *
+     * @since 1.2
      */
     public synchronized void setIndexedWriteMethod(Method writeMethod)
         throws IntrospectionException {
@@ -353,7 +359,7 @@
         Class<?> indexedPropertyType = null;
 
         if (indexedReadMethod != null) {
-            Class params[] = getParameterTypes(getClass0(), indexedReadMethod);
+            Class<?>[] params = getParameterTypes(getClass0(), indexedReadMethod);
             if (params.length != 1) {
                 throw new IntrospectionException("bad indexed read method arg count");
             }
@@ -366,7 +372,7 @@
             }
         }
         if (indexedWriteMethod != null) {
-            Class params[] = getParameterTypes(getClass0(), indexedWriteMethod);
+            Class<?>[] params = getParameterTypes(getClass0(), indexedWriteMethod);
             if (params.length != 2) {
                 throw new IntrospectionException("bad indexed write method arg count");
             }
--- a/src/share/classes/java/beans/IntrospectionException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/IntrospectionException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
  * to a Class object, not being able to resolve a string method name,
  * or specifying a method name that has the wrong type signature for
  * its intended use.
+ *
+ * @since 1.1
  */
 
 public
--- a/src/share/classes/java/beans/Introspector.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/Introspector.java	Wed Jul 09 10:42:37 2014 -0700
@@ -90,6 +90,8 @@
  * For more information about introspection and design patterns, please
  * consult the
  *  <a href="http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html">JavaBeans&trade; specification</a>.
+ *
+ * @since 1.1
  */
 
 public class Introspector {
@@ -97,14 +99,17 @@
     // Flags that can be used to control getBeanInfo:
     /**
      * Flag to indicate to use of all beaninfo.
+     * @since 1.2
      */
     public final static int USE_ALL_BEANINFO           = 1;
     /**
      * Flag to indicate to ignore immediate beaninfo.
+     * @since 1.2
      */
     public final static int IGNORE_IMMEDIATE_BEANINFO  = 2;
     /**
      * Flag to indicate to ignore all beaninfo.
+     * @since 1.2
      */
     public final static int IGNORE_ALL_BEANINFO        = 3;
 
@@ -214,6 +219,7 @@
      * @return  A BeanInfo object describing the target bean.
      * @exception IntrospectionException if an exception occurs during
      *              introspection.
+     * @since 1.2
      */
     public static BeanInfo getBeanInfo(Class<?> beanClass, int flags)
                                                 throws IntrospectionException {
@@ -354,6 +360,8 @@
      * not normally required.  It is normally only needed by advanced
      * tools that update existing "Class" objects in-place and need
      * to make the Introspector re-analyze existing Class objects.
+     *
+     * @since 1.2
      */
 
     public static void flushCaches() {
@@ -377,6 +385,7 @@
      *
      * @param clz  Class object to be flushed.
      * @throws NullPointerException If the Class object is null.
+     * @since 1.2
      */
     public static void flushFromCaches(Class<?> clz) {
         if (clz == null) {
@@ -1384,7 +1393,7 @@
      * parameter list on a given class.
      */
     private static Method internalFindMethod(Class<?> start, String methodName,
-                                                 int argCount, Class args[]) {
+                                                 int argCount, Class<?> args[]) {
         // For overriden methods we need to find the most derived version.
         // So we start with the given class and walk up the superclass chain.
 
@@ -1426,7 +1435,7 @@
         // Now check any inherited interfaces.  This is necessary both when
         // the argument class is itself an interface, and when the argument
         // class is an abstract class.
-        Class ifcs[] = start.getInterfaces();
+        Class<?>[] ifcs = start.getInterfaces();
         for (int i = 0 ; i < ifcs.length; i++) {
             // Note: The original implementation had both methods calling
             // the 3 arg method. This is preserved but perhaps it should
@@ -1459,7 +1468,7 @@
      * @return the method or null if not found
      */
     static Method findMethod(Class<?> cls, String methodName, int argCount,
-                             Class args[]) {
+                             Class<?>[] args) {
         if (methodName == null) {
             return null;
         }
@@ -1502,7 +1511,7 @@
      * Return true iff the given method throws the given exception.
      */
     private boolean throwsException(Method method, Class<?> exception) {
-        Class exs[] = method.getExceptionTypes();
+        Class<?>[] exs = method.getExceptionTypes();
         for (int i = 0; i < exs.length; i++) {
             if (exs[i] == exception) {
                 return true;
--- a/src/share/classes/java/beans/MetaData.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/MetaData.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1401,7 +1401,7 @@
     }
 
     private static boolean isValid(Constructor<?> constructor, String[] names) {
-        Class[] parameters = constructor.getParameterTypes();
+        Class<?>[] parameters = constructor.getParameterTypes();
         if (names.length != parameters.length) {
             return false;
         }
--- a/src/share/classes/java/beans/MethodDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/MethodDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -34,6 +34,8 @@
 /**
  * A MethodDescriptor describes a particular method that a Java Bean
  * supports for external access from other components.
+ *
+ * @since 1.1
  */
 
 public class MethodDescriptor extends FeatureDescriptor {
--- a/src/share/classes/java/beans/ParameterDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/ParameterDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
  * class.
  * <p>
  * Currently all our state comes from the FeatureDescriptor base class.
+ *
+ * @since 1.1
  */
 
 public class ParameterDescriptor extends FeatureDescriptor {
--- a/src/share/classes/java/beans/PropertyChangeEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyChangeEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -43,6 +43,8 @@
  * An event source may send a null object as the name to indicate that an
  * arbitrary set of if its properties have changed.  In this case the
  * old and new values should also be null.
+ *
+ * @since 1.1
  */
 public class PropertyChangeEvent extends EventObject {
     private static final long serialVersionUID = 7042693688939648123L;
--- a/src/share/classes/java/beans/PropertyChangeListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyChangeListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,6 +29,7 @@
  * A "PropertyChange" event gets fired whenever a bean changes a "bound"
  * property.  You can register a PropertyChangeListener with a source
  * bean so as to be notified of any bound property updates.
+ * @since 1.1
  */
 
 public interface PropertyChangeListener extends java.util.EventListener {
--- a/src/share/classes/java/beans/PropertyChangeSupport.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyChangeSupport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  * non-serializable listeners will be skipped during serialization.
  *
  * @see VetoableChangeSupport
+ * @since 1.1
  */
 public class PropertyChangeSupport implements Serializable {
     private PropertyChangeListenerMap map = new PropertyChangeListenerMap();
@@ -191,6 +192,7 @@
      *
      * @param propertyName  The name of the property to listen on.
      * @param listener  The PropertyChangeListener to be added
+     * @since 1.2
      */
     public void addPropertyChangeListener(
                 String propertyName,
@@ -216,6 +218,7 @@
      *
      * @param propertyName  The name of the property that was listened on.
      * @param listener  The PropertyChangeListener to be removed
+     * @since 1.2
      */
     public void removePropertyChangeListener(
                 String propertyName,
@@ -277,6 +280,7 @@
      * @param propertyName  the programmatic name of the property that was changed
      * @param oldValue      the old value of the property
      * @param newValue      the new value of the property
+     * @since 1.2
      */
     public void firePropertyChange(String propertyName, int oldValue, int newValue) {
         if (oldValue != newValue) {
@@ -297,6 +301,7 @@
      * @param propertyName  the programmatic name of the property that was changed
      * @param oldValue      the old value of the property
      * @param newValue      the new value of the property
+     * @since 1.2
      */
     public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
         if (oldValue != newValue) {
@@ -312,6 +317,7 @@
      * No event is fired if the given event's old and new values are equal and non-null.
      *
      * @param event  the {@code PropertyChangeEvent} to be fired
+     * @since 1.2
      */
     public void firePropertyChange(PropertyChangeEvent event) {
         Object oldValue = event.getOldValue();
@@ -410,6 +416,7 @@
      *
      * @param propertyName  the property name.
      * @return true if there are one or more listeners for the given property
+     * @since 1.2
      */
     public boolean hasListeners(String propertyName) {
         return this.map.hasListeners(propertyName);
--- a/src/share/classes/java/beans/PropertyDescriptor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyDescriptor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 /**
  * A PropertyDescriptor describes one property that a Java Bean
  * exports via a pair of accessor methods.
+ * @since 1.1
  */
 public class PropertyDescriptor extends FeatureDescriptor {
 
@@ -112,7 +113,7 @@
         // If this class or one of its base classes allow PropertyChangeListener,
         // then we assume that any properties we discover are "bound".
         // See Introspector.getTargetPropertyInfo() method.
-        Class[] args = { PropertyChangeListener.class };
+        Class<?>[] args = { PropertyChangeListener.class };
         this.bound = null != Introspector.findMethod(beanClass, "addPropertyChangeListener", args.length, args);
     }
 
@@ -244,6 +245,7 @@
      *
      * @param readMethod The new read method.
      * @throws IntrospectionException if the read method is invalid
+     * @since 1.2
      */
     public synchronized void setReadMethod(Method readMethod)
                                 throws IntrospectionException {
@@ -314,6 +316,7 @@
      *
      * @param writeMethod The new write method.
      * @throws IntrospectionException if the write method is invalid
+     * @since 1.2
      */
     public synchronized void setWriteMethod(Method writeMethod)
                                 throws IntrospectionException {
--- a/src/share/classes/java/beans/PropertyEditor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyEditor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -51,6 +51,8 @@
  * or support setAsText.
  * <p>
  * Each PropertyEditor should have a null constructor.
+ *
+ * @since 1.1
  */
 
 public interface PropertyEditor {
--- a/src/share/classes/java/beans/PropertyEditorManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyEditorManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,6 +48,8 @@
  * Default PropertyEditors will be provided for the Java primitive types
  * "boolean", "byte", "short", "int", "long", "float", and "double"; and
  * for the classes java.lang.String. java.awt.Color, and java.awt.Font.
+ *
+ * @since 1.1
  */
 
 public class PropertyEditorManager {
--- a/src/share/classes/java/beans/PropertyEditorSupport.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyEditorSupport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
  * This is a support class to help build property editors.
  * <p>
  * It can be used either as a base class or as a delegate.
+ *
+ * @since 1.1
  */
 
 public class PropertyEditorSupport implements PropertyEditor {
--- a/src/share/classes/java/beans/PropertyVetoException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/PropertyVetoException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,6 +29,7 @@
 /**
  * A PropertyVetoException is thrown when a proposed change to a
  * property represents an unacceptable value.
+ * @since 1.1
  */
 
 public
--- a/src/share/classes/java/beans/SimpleBeanInfo.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/SimpleBeanInfo.java	Wed Jul 09 10:42:37 2014 -0700
@@ -34,6 +34,8 @@
  * When the introspector sees the "noop" values, it will apply low
  * level introspection and design patterns to automatically analyze
  * the target bean.
+ *
+ * @since 1.1
  */
 
 public class SimpleBeanInfo implements BeanInfo {
--- a/src/share/classes/java/beans/Statement.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/Statement.java	Wed Jul 09 10:42:37 2014 -0700
@@ -248,7 +248,7 @@
                 // ignored elsewhere.
                 if (target == Character.class && arguments.length == 1 &&
                     argClasses[0] == String.class) {
-                    return new Character(((String)arguments[0]).charAt(0));
+                    return ((String)arguments[0]).charAt(0);
                 }
                 try {
                     m = ConstructorFinder.findConstructor((Class)target, argClasses);
--- a/src/share/classes/java/beans/VetoableChangeListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/VetoableChangeListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,6 +29,7 @@
  * A VetoableChange event gets fired whenever a bean changes a "constrained"
  * property.  You can register a VetoableChangeListener with a source bean
  * so as to be notified of any constrained property updates.
+ * @since 1.1
  */
 public interface VetoableChangeListener extends java.util.EventListener {
     /**
--- a/src/share/classes/java/beans/VetoableChangeSupport.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/VetoableChangeSupport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  * non-serializable listeners will be skipped during serialization.
  *
  * @see PropertyChangeSupport
+ * @since 1.1
  */
 public class VetoableChangeSupport implements Serializable {
     private VetoableChangeListenerMap map = new VetoableChangeListenerMap();
@@ -191,6 +192,7 @@
      *
      * @param propertyName  The name of the property to listen on.
      * @param listener  The VetoableChangeListener to be added
+     * @since 1.2
      */
     public void addVetoableChangeListener(
                                 String propertyName,
@@ -216,6 +218,7 @@
      *
      * @param propertyName  The name of the property that was listened on.
      * @param listener  The VetoableChangeListener to be removed
+     * @since 1.2
      */
     public void removeVetoableChangeListener(
                                 String propertyName,
@@ -292,6 +295,7 @@
      * @param oldValue      the old value of the property
      * @param newValue      the new value of the property
      * @throws PropertyVetoException if one of listeners vetoes the property update
+     * @since 1.2
      */
     public void fireVetoableChange(String propertyName, int oldValue, int newValue)
             throws PropertyVetoException {
@@ -320,6 +324,7 @@
      * @param oldValue      the old value of the property
      * @param newValue      the new value of the property
      * @throws PropertyVetoException if one of listeners vetoes the property update
+     * @since 1.2
      */
     public void fireVetoableChange(String propertyName, boolean oldValue, boolean newValue)
             throws PropertyVetoException {
@@ -343,6 +348,7 @@
      *
      * @param event  the {@code PropertyChangeEvent} to be fired
      * @throws PropertyVetoException if one of listeners vetoes the property update
+     * @since 1.2
      */
     public void fireVetoableChange(PropertyChangeEvent event)
             throws PropertyVetoException {
@@ -399,6 +405,7 @@
      *
      * @param propertyName  the property name.
      * @return true if there are one or more listeners for the given property
+     * @since 1.2
      */
     public boolean hasListeners(String propertyName) {
         return this.map.hasListeners(propertyName);
--- a/src/share/classes/java/beans/Visibility.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/Visibility.java	Wed Jul 09 10:42:37 2014 -0700
@@ -34,6 +34,8 @@
  * This interface is for expert developers, and is not needed
  * for normal simple beans.  To avoid confusing end-users we
  * avoid using getXXX setXXX design patterns for these methods.
+ *
+ * @since 1.1
  */
 
 public interface Visibility {
--- a/src/share/classes/java/beans/beancontext/BeanContextServiceAvailableEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/beancontext/BeanContextServiceAvailableEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
      * @param bcs The context in which the service has become available
      * @param sc A <code>Class</code> reference to the newly available service
      */
-    public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
+    public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class<?> sc) {
         super((BeanContext)bcs);
 
         serviceClass = sc;
@@ -65,13 +65,13 @@
      * Gets the service class that is the subject of this notification.
      * @return A <code>Class</code> reference to the newly available service
      */
-    public Class getServiceClass() { return serviceClass; }
+    public Class<?> getServiceClass() { return serviceClass; }
 
     /**
      * Gets the list of service dependent selectors.
      * @return the current selectors available from the service
      */
-    public Iterator getCurrentServiceSelectors() {
+    public Iterator<?> getCurrentServiceSelectors() {
         return ((BeanContextServices)getSource()).getCurrentServiceSelectors(serviceClass);
     }
 
@@ -82,5 +82,5 @@
     /**
      * A <code>Class</code> reference to the newly available service
      */
-    protected Class                      serviceClass;
+    protected Class<?>                   serviceClass;
 }
--- a/src/share/classes/java/beans/beancontext/BeanContextServiceProvider.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/beancontext/BeanContextServiceProvider.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@
     *
     * @return a reference to the requested service
     */
-    Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector);
+    Object getService(BeanContextServices bcs, Object requestor, Class<?> serviceClass, Object serviceSelector);
 
     /**
      * Invoked by <code>BeanContextServices</code>,
@@ -100,5 +100,5 @@
      * @param serviceClass  the specified service
      * @return   the current service selectors for the specified serviceClass
      */
-    Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass);
+    Iterator<?> getCurrentServiceSelectors(BeanContextServices bcs, Class<?> serviceClass);
 }
--- a/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
      * @param sc the service that is being revoked
      * @param invalidate <code>true</code> for immediate revocation
      */
-    public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc, boolean invalidate) {
+    public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class<?> sc, boolean invalidate) {
         super((BeanContext)bcs);
 
         serviceClass    = sc;
@@ -67,7 +67,7 @@
      * @return A <code>Class</code> reference to the
      * service that is being revoked
      */
-    public Class getServiceClass() { return serviceClass; }
+    public Class<?> getServiceClass() { return serviceClass; }
 
     /**
      * Checks this event to determine whether or not
@@ -76,7 +76,7 @@
      * @return <code>true</code> if the service being revoked is of the
      * same class as the specified service
      */
-    public boolean isServiceClass(Class service) {
+    public boolean isServiceClass(Class<?> service) {
         return serviceClass.equals(service);
     }
 
@@ -94,6 +94,6 @@
     /**
      * A <code>Class</code> reference to the service that is being revoked.
      */
-    protected Class                      serviceClass;
+    protected Class<?>                   serviceClass;
     private   boolean                    invalidateRefs;
 }
--- a/src/share/classes/java/beans/beancontext/BeanContextServices.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/beancontext/BeanContextServices.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@
      * associated with the service
      * @return true if the service was successful added, false otherwise
      */
-    boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider);
+    boolean addService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider);
 
     /**
      * BeanContextServiceProviders wishing to remove
@@ -83,7 +83,7 @@
      * terminate service to all currently outstanding references
      * to the specified service.
      */
-    void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow);
+    void revokeService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow);
 
     /**
      * Reports whether or not a given service is
@@ -91,7 +91,7 @@
      * @param serviceClass the service in question
      * @return true if the service is available
      */
-    boolean hasService(Class serviceClass);
+    boolean hasService(Class<?> serviceClass);
 
     /**
      * A <code>BeanContextChild</code>, or any arbitrary object
@@ -113,7 +113,7 @@
      * @return a reference to this context's named
      * Service as requested or <code>null</code>
      */
-    Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException;
+    Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException;
 
     /**
      * Releases a <code>BeanContextChild</code>'s
@@ -131,7 +131,7 @@
      * @return an <code>Iterator</code> consisting of the
      * currently available services
      */
-    Iterator getCurrentServiceClasses();
+    Iterator<?> getCurrentServiceClasses();
 
     /**
      * Gets the list of service dependent service parameters
@@ -142,7 +142,7 @@
      * @return the currently available service selectors
      * for the named serviceClass
      */
-    Iterator getCurrentServiceSelectors(Class serviceClass);
+    Iterator<?> getCurrentServiceSelectors(Class<?> serviceClass);
 
     /**
      * Adds a <code>BeanContextServicesListener</code> to this BeanContext
--- a/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -129,9 +129,8 @@
 
     public void initialize() {
         super.initialize();
-
-        services     = new HashMap(serializable + 1);
-        bcsListeners = new ArrayList(1);
+        services     = new HashMap<>(serializable + 1);
+        bcsListeners = new ArrayList<>(1);
     }
 
     /**
@@ -169,7 +168,7 @@
 
             // create an instance of a service ref
 
-            BCSSCServiceClassRef(Class sc, BeanContextServiceProvider bcsp, boolean delegated) {
+            BCSSCServiceClassRef(Class<?> sc, BeanContextServiceProvider bcsp, boolean delegated) {
                 super();
 
                 serviceClass     = sc;
@@ -183,7 +182,7 @@
             // add a requestor and assoc listener
 
             void addRequestor(Object requestor, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
-                BeanContextServiceRevokedListener cbcsrl = (BeanContextServiceRevokedListener)requestors.get(requestor);
+                BeanContextServiceRevokedListener cbcsrl = requestors.get(requestor);
 
                 if (cbcsrl != null && !cbcsrl.equals(bcsrl))
                     throw new TooManyListenersException();
@@ -200,7 +199,7 @@
             // check a requestors listener
 
             void verifyRequestor(Object requestor, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
-                BeanContextServiceRevokedListener cbcsrl = (BeanContextServiceRevokedListener)requestors.get(requestor);
+                BeanContextServiceRevokedListener cbcsrl = requestors.get(requestor);
 
                 if (cbcsrl != null && !cbcsrl.equals(bcsrl))
                     throw new TooManyListenersException();
@@ -230,15 +229,18 @@
 
             }
 
-            Iterator cloneOfEntries() {
-                return ((HashMap)requestors.clone()).entrySet().iterator();
+            @SuppressWarnings("unchecked") // Cast from clone
+            Iterator<Map.Entry<Object, BeanContextServiceRevokedListener>> cloneOfEntries() {
+                return ((HashMap<Object, BeanContextServiceRevokedListener>)requestors.clone()).entrySet().iterator();
             }
 
-            Iterator entries() { return requestors.entrySet().iterator(); }
+            Iterator<Map.Entry<Object, BeanContextServiceRevokedListener>> entries() {
+                return requestors.entrySet().iterator();
+            }
 
             boolean isEmpty() { return requestors.isEmpty(); }
 
-            Class getServiceClass() { return serviceClass; }
+            Class<?> getServiceClass() { return serviceClass; }
 
             BeanContextServiceProvider getServiceProvider() {
                 return serviceProvider;
@@ -281,7 +283,7 @@
              * fields
              */
 
-            Class                               serviceClass;
+            Class<?>                            serviceClass;
 
             BeanContextServiceProvider          serviceProvider;
             int                                 serviceRefs;
@@ -289,7 +291,7 @@
             BeanContextServiceProvider          delegateProvider; // proxy
             int                                 delegateRefs;
 
-            HashMap                             requestors = new HashMap(1);
+            HashMap<Object, BeanContextServiceRevokedListener> requestors = new HashMap<>(1);
         }
 
         /*
@@ -322,16 +324,16 @@
 
         // note usage of service per requestor, per service
 
-        synchronized void usingService(Object requestor, Object service, Class serviceClass, BeanContextServiceProvider bcsp, boolean isDelegated, BeanContextServiceRevokedListener bcsrl)  throws TooManyListenersException, UnsupportedOperationException {
+        synchronized void usingService(Object requestor, Object service, Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean isDelegated, BeanContextServiceRevokedListener bcsrl)  throws TooManyListenersException, UnsupportedOperationException {
 
             // first, process mapping from serviceClass to requestor(s)
 
             BCSSCServiceClassRef serviceClassRef = null;
 
             if (serviceClasses == null)
-                serviceClasses = new HashMap(1);
+                serviceClasses = new HashMap<>(1);
             else
-                serviceClassRef = (BCSSCServiceClassRef)serviceClasses.get(serviceClass);
+                serviceClassRef = serviceClasses.get(serviceClass);
 
             if (serviceClassRef == null) { // new service being used ...
                 serviceClassRef = new BCSSCServiceClassRef(serviceClass, bcsp, isDelegated);
@@ -348,20 +350,20 @@
             // now handle mapping from requestor to service(s)
 
             BCSSCServiceRef serviceRef = null;
-            Map             services   = null;
+            Map<Object , BCSSCServiceRef> services   = null;
 
             if (serviceRequestors == null) {
-                serviceRequestors = new HashMap(1);
+                serviceRequestors = new HashMap<>(1);
             } else {
-                services = (Map)serviceRequestors.get(requestor);
+                services = serviceRequestors.get(requestor);
             }
 
             if (services == null) {
-                services = new HashMap(1);
+                services = new HashMap<>(1);
 
                 serviceRequestors.put(requestor, services);
             } else
-                serviceRef = (BCSSCServiceRef)services.get(service);
+                serviceRef = services.get(service);
 
             if (serviceRef == null) {
                 serviceRef = new BCSSCServiceRef(serviceClassRef, isDelegated);
@@ -377,11 +379,11 @@
         synchronized void releaseService(Object requestor, Object service) {
             if (serviceRequestors == null) return;
 
-            Map services = (Map)serviceRequestors.get(requestor);
+            Map<Object, BCSSCServiceRef> services = serviceRequestors.get(requestor);
 
             if (services == null) return; // oops its not there anymore!
 
-            BCSSCServiceRef serviceRef = (BCSSCServiceRef)services.get(service);
+            BCSSCServiceRef serviceRef = services.get(service);
 
             if (serviceRef == null) return; // oops its not there anymore!
 
@@ -418,33 +420,33 @@
 
         // revoke a service
 
-        synchronized void revokeService(Class serviceClass, boolean isDelegated, boolean revokeNow) {
+        synchronized void revokeService(Class<?> serviceClass, boolean isDelegated, boolean revokeNow) {
             if (serviceClasses == null) return;
 
-            BCSSCServiceClassRef serviceClassRef = (BCSSCServiceClassRef)serviceClasses.get(serviceClass);
+            BCSSCServiceClassRef serviceClassRef = serviceClasses.get(serviceClass);
 
             if (serviceClassRef == null) return;
 
-            Iterator i = serviceClassRef.cloneOfEntries();
+            Iterator<Map.Entry<Object, BeanContextServiceRevokedListener>> i = serviceClassRef.cloneOfEntries();
 
             BeanContextServiceRevokedEvent bcsre       = new BeanContextServiceRevokedEvent(BeanContextServicesSupport.this.getBeanContextServicesPeer(), serviceClass, revokeNow);
             boolean                        noMoreRefs  = false;
 
             while (i.hasNext() && serviceRequestors != null) {
-                Map.Entry                         entry    = (Map.Entry)i.next();
-                BeanContextServiceRevokedListener listener = (BeanContextServiceRevokedListener)entry.getValue();
+                Map.Entry<Object,BeanContextServiceRevokedListener> entry    = i.next();
+                BeanContextServiceRevokedListener listener = entry.getValue();
 
                 if (revokeNow) {
                     Object  requestor = entry.getKey();
-                    Map     services  = (Map)serviceRequestors.get(requestor);
+                    Map<Object, BCSSCServiceRef> services  = serviceRequestors.get(requestor);
 
                     if (services != null) {
-                        Iterator i1 = services.entrySet().iterator();
+                        Iterator<Map.Entry<Object, BCSSCServiceRef>> i1 = services.entrySet().iterator();
 
                         while (i1.hasNext()) {
-                            Map.Entry       tmp        = (Map.Entry)i1.next();
+                            Map.Entry<Object, BCSSCServiceRef> tmp        = i1.next();
 
-                            BCSSCServiceRef serviceRef = (BCSSCServiceRef)tmp.getValue();
+                            BCSSCServiceRef serviceRef = tmp.getValue();
                             if (serviceRef.getServiceClassRef().equals(serviceClassRef) && isDelegated == serviceRef.isDelegated()) {
                                 i1.remove();
                             }
@@ -479,19 +481,19 @@
 
             if (serviceRequestors == null) return;
 
-            Iterator requestors = serviceRequestors.entrySet().iterator();
+            Iterator<Map.Entry<Object, Map<Object, BCSSCServiceRef>>> requestors = serviceRequestors.entrySet().iterator();
 
             while(requestors.hasNext()) {
-                Map.Entry            tmp       = (Map.Entry)requestors.next();
+                Map.Entry<Object, Map<Object, BCSSCServiceRef>> tmp = requestors.next();
                 Object               requestor = tmp.getKey();
-                Iterator             services  = ((Map)tmp.getValue()).entrySet().iterator();
+                Iterator<Map.Entry<Object, BCSSCServiceRef>> services  = tmp.getValue().entrySet().iterator();
 
                 requestors.remove();
 
                 while (services.hasNext()) {
-                    Map.Entry       entry   = (Map.Entry)services.next();
+                    Map.Entry<Object, BCSSCServiceRef> entry   = services.next();
                     Object          service = entry.getKey();
-                    BCSSCServiceRef sref    = (BCSSCServiceRef)entry.getValue();
+                    BCSSCServiceRef sref    = entry.getValue();
 
                     BCSSCServiceClassRef       scref = sref.getServiceClassRef();
 
@@ -513,32 +515,32 @@
         void revokeAllDelegatedServicesNow() {
             if (serviceClasses == null) return;
 
-            Iterator serviceClassRefs  =
-                new HashSet(serviceClasses.values()).iterator();
+            Iterator<BCSSCServiceClassRef> serviceClassRefs  =
+                new HashSet<>(serviceClasses.values()).iterator();
 
             while (serviceClassRefs.hasNext()) {
-                BCSSCServiceClassRef serviceClassRef = (BCSSCServiceClassRef)serviceClassRefs.next();
+                BCSSCServiceClassRef serviceClassRef = serviceClassRefs.next();
 
                 if (!serviceClassRef.isDelegated()) continue;
 
-                Iterator i = serviceClassRef.cloneOfEntries();
+                Iterator<Map.Entry<Object, BeanContextServiceRevokedListener>> i = serviceClassRef.cloneOfEntries();
                 BeanContextServiceRevokedEvent bcsre       = new BeanContextServiceRevokedEvent(BeanContextServicesSupport.this.getBeanContextServicesPeer(), serviceClassRef.getServiceClass(), true);
                 boolean                        noMoreRefs  = false;
 
                 while (i.hasNext()) {
-                    Map.Entry                         entry     = (Map.Entry)i.next();
-                    BeanContextServiceRevokedListener listener  = (BeanContextServiceRevokedListener)entry.getValue();
+                    Map.Entry<Object, BeanContextServiceRevokedListener> entry     = i.next();
+                    BeanContextServiceRevokedListener listener  = entry.getValue();
 
                     Object                            requestor = entry.getKey();
-                    Map                               services  = (Map)serviceRequestors.get(requestor);
+                    Map<Object, BCSSCServiceRef>      services  = serviceRequestors.get(requestor);
 
                     if (services != null) {
-                        Iterator i1 = services.entrySet().iterator();
+                        Iterator<Map.Entry<Object, BCSSCServiceRef>> i1 = services.entrySet().iterator();
 
                         while (i1.hasNext()) {
-                            Map.Entry       tmp        = (Map.Entry)i1.next();
+                            Map.Entry<Object, BCSSCServiceRef>   tmp        = i1.next();
 
-                            BCSSCServiceRef serviceRef = (BCSSCServiceRef)tmp.getValue();
+                            BCSSCServiceRef serviceRef = tmp.getValue();
                             if (serviceRef.getServiceClassRef().equals(serviceClassRef) && serviceRef.isDelegated()) {
                                 i1.remove();
                             }
@@ -568,8 +570,8 @@
          * fields
          */
 
-        private transient HashMap       serviceClasses;
-        private transient HashMap       serviceRequestors;
+        private transient HashMap<Class<?>, BCSSCServiceClassRef> serviceClasses;
+        private transient HashMap<Object, Map<Object, BeanContextServicesSupport.BCSSChild.BCSSCServiceRef>> serviceRequestors;
     }
 
     /**
@@ -597,7 +599,7 @@
         protected static class BCSSServiceProvider implements Serializable {
             private static final long serialVersionUID = 861278251667444782L;
 
-            BCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
+            BCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp) {
                 super();
 
                 serviceProvider = bcsp;
@@ -627,7 +629,7 @@
          * @return a service provider without overriding addService()
          */
 
-        protected BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
+        protected BCSSServiceProvider createBCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp) {
             return new BCSSServiceProvider(sc, bcsp);
         }
 
@@ -671,7 +673,7 @@
      * @param bcsp the service provider
      */
 
-    public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp) {
+    public boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp) {
         return addService(serviceClass, bcsp, true);
     }
 
@@ -683,7 +685,7 @@
      * @return true if the service was successfully added
      */
 
-    protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
+    protected boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
 
         if (serviceClass == null) throw new NullPointerException("serviceClass");
         if (bcsp         == null) throw new NullPointerException("bcsp");
@@ -704,7 +706,7 @@
                 fireServiceAdded(bcssae);
 
                 synchronized(children) {
-                    Iterator i = children.keySet().iterator();
+                    Iterator<Object> i = children.keySet().iterator();
 
                     while (i.hasNext()) {
                         Object c = i.next();
@@ -727,7 +729,7 @@
      * @param revokeCurrentServicesNow whether or not to revoke the service
      */
 
-    public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
+    public void revokeService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
 
         if (serviceClass == null) throw new NullPointerException("serviceClass");
         if (bcsp         == null) throw new NullPointerException("bcsp");
@@ -735,7 +737,7 @@
         synchronized(BeanContext.globalHierarchyLock) {
             if (!services.containsKey(serviceClass)) return;
 
-            BCSSServiceProvider bcsssp = (BCSSServiceProvider)services.get(serviceClass);
+            BCSSServiceProvider bcsssp = services.get(serviceClass);
 
             if (!bcsssp.getServiceProvider().equals(bcsp))
                 throw new IllegalArgumentException("service provider mismatch");
@@ -744,7 +746,7 @@
 
             if (bcsp instanceof Serializable) serializable--;
 
-            Iterator i = bcsChildren(); // get the BCSChild values.
+            Iterator<BeanContextSupport.BCSChild> i = bcsChildren(); // get the BCSChild values.
 
             while (i.hasNext()) {
                 ((BCSSChild)i.next()).revokeService(serviceClass, false, revokeCurrentServicesNow);
@@ -758,7 +760,7 @@
      * has a service, which may be delegated
      */
 
-    public synchronized boolean hasService(Class serviceClass) {
+    public synchronized boolean hasService(Class<?> serviceClass) {
         if (serviceClass == null) throw new NullPointerException("serviceClass");
 
         synchronized(BeanContext.globalHierarchyLock) {
@@ -791,7 +793,7 @@
             nestingCtxt = bcs;
         }
 
-        public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) {
+        public Object getService(BeanContextServices bcs, Object requestor, Class<?> serviceClass, Object serviceSelector) {
             Object service = null;
 
             try {
@@ -807,12 +809,12 @@
             nestingCtxt.releaseService(bcs, requestor, service);
         }
 
-        public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) {
+        public Iterator<?> getCurrentServiceSelectors(BeanContextServices bcs, Class<?> serviceClass) {
             return nestingCtxt.getCurrentServiceSelectors(serviceClass);
         }
 
         public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) {
-            Iterator i = bcsChildren(); // get the BCSChild values.
+            Iterator<BeanContextSupport.BCSChild> i = bcsChildren(); // get the BCSChild values.
 
             while (i.hasNext()) {
                 ((BCSSChild)i.next()).revokeService(bcsre.getServiceClass(), true, bcsre.isCurrentServiceInvalidNow());
@@ -832,7 +834,7 @@
      * obtain a service which may be delegated
      */
 
-     public Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
+     public Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
         if (child        == null) throw new NullPointerException("child");
         if (serviceClass == null) throw new NullPointerException("serviceClass");
         if (requestor    == null) throw new NullPointerException("requestor");
@@ -847,7 +849,7 @@
 
             if (bcsc == null) throw new IllegalArgumentException("not a child of this context"); // not a child ...
 
-            BCSSServiceProvider bcsssp = (BCSSServiceProvider)services.get(serviceClass);
+            BCSSServiceProvider bcsssp = services.get(serviceClass);
 
             if (bcsssp != null) {
                 BeanContextServiceProvider bcsp = bcsssp.getServiceProvider();
@@ -918,7 +920,7 @@
      * @return an iterator for all the currently registered service classes.
      */
 
-    public Iterator getCurrentServiceClasses() {
+    public Iterator<Object> getCurrentServiceClasses() {
         return new BCSIterator(services.keySet().iterator());
     }
 
@@ -927,9 +929,9 @@
      * (if any) available for the specified service.
      */
 
-    public Iterator getCurrentServiceSelectors(Class serviceClass) {
+    public Iterator<?> getCurrentServiceSelectors(Class<?> serviceClass) {
 
-        BCSSServiceProvider bcsssp = (BCSSServiceProvider)services.get(serviceClass);
+        BCSSServiceProvider bcsssp = services.get(serviceClass);
 
         return bcsssp != null ? new BCSIterator(bcsssp.getServiceProvider().getCurrentServiceSelectors(getBeanContextServicesPeer(), serviceClass)) : null;
     }
@@ -950,7 +952,7 @@
 
             fireServiceAdded(bcssae);
 
-            Iterator i;
+            Iterator<Object> i;
 
             synchronized(children) {
                 i = children.keySet().iterator();
@@ -982,7 +984,7 @@
 
             fireServiceRevoked(bcssre);
 
-            Iterator i;
+            Iterator<Object> i;
 
             synchronized(children) {
                 i = children.keySet().iterator();
@@ -1085,7 +1087,7 @@
      * Fires a <tt>BeanContextServiceEvent</tt> notifying of a new service.
      * @param serviceClass the service class
      */
-    protected final void fireServiceAdded(Class serviceClass) {
+    protected final void fireServiceAdded(Class<?> serviceClass) {
         BeanContextServiceAvailableEvent bcssae = new BeanContextServiceAvailableEvent(getBeanContextServicesPeer(), serviceClass);
 
         fireServiceAdded(bcssae);
@@ -1129,7 +1131,7 @@
      * @param serviceClass the service class
      * @param revokeNow whether or not the event should be revoked now
      */
-    protected final void fireServiceRevoked(Class serviceClass, boolean revokeNow) {
+    protected final void fireServiceRevoked(Class<?> serviceClass, boolean revokeNow) {
         Object[]                       copy;
         BeanContextServiceRevokedEvent bcsre = new BeanContextServiceRevokedEvent(getBeanContextServicesPeer(), serviceClass, revokeNow);
 
@@ -1159,14 +1161,14 @@
 
         int count = 0;
 
-        Iterator i = services.entrySet().iterator();
+        Iterator<Map.Entry<Object, BCSSServiceProvider>> i = services.entrySet().iterator();
 
         while (i.hasNext() && count < serializable) {
-            Map.Entry           entry = (Map.Entry)i.next();
+            Map.Entry<Object, BCSSServiceProvider> entry = i.next();
             BCSSServiceProvider bcsp  = null;
 
              try {
-                bcsp = (BCSSServiceProvider)entry.getValue();
+                bcsp = entry.getValue();
              } catch (ClassCastException cce) {
                 continue;
              }
@@ -1201,7 +1203,7 @@
         int count = serializable;
 
         while (count > 0) {
-            services.put(ois.readObject(), ois.readObject());
+            services.put(ois.readObject(), (BCSSServiceProvider)ois.readObject());
             count--;
         }
     }
@@ -1236,7 +1238,7 @@
      * all accesses to the <code> protected transient HashMap services </code>
      * field should be synchronized on that object
      */
-    protected transient HashMap                  services;
+    protected transient HashMap<Object, BCSSServiceProvider>  services;
 
     /**
      * The number of instances of a serializable <tt>BeanContextServceProvider</tt>.
@@ -1253,5 +1255,5 @@
     /**
      * List of <tt>BeanContextServicesListener</tt> objects.
      */
-    protected transient ArrayList                bcsListeners;
+    protected transient ArrayList<BeanContextServicesListener> bcsListeners;
 }
--- a/src/share/classes/java/beans/beancontext/BeanContextSupport.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/beans/beancontext/BeanContextSupport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -254,7 +254,7 @@
      * currently nested in this <tt>BeanContext</tt>.
      * @return an <tt>Iterator</tt> of the nested children
      */
-    public Iterator iterator() {
+    public Iterator<Object> iterator() {
         synchronized(children) {
             return new BCSIterator(children.keySet().iterator());
         }
@@ -292,14 +292,14 @@
      * a noop remove() method.
      */
 
-    protected static final class BCSIterator implements Iterator {
-        BCSIterator(Iterator i) { super(); src = i; }
+    protected static final class BCSIterator implements Iterator<Object> {
+        BCSIterator(Iterator<?> i) { super(); src = i; }
 
         public boolean hasNext() { return src.hasNext(); }
-        public Object  next()    { return src.next();    }
+        public Object       next()    { return src.next();    }
         public void    remove()  { /* do nothing */      }
 
-        private Iterator src;
+        private Iterator<?> src;
     }
 
     /************************************************************************/
@@ -504,7 +504,7 @@
                 throw new IllegalStateException();
             }
 
-            BCSChild bcsc  = (BCSChild)children.get(targetChild);
+            BCSChild bcsc  = children.get(targetChild);
             BCSChild pbcsc = null;
             Object   peer  = null;
 
@@ -533,7 +533,7 @@
                     children.remove(targetChild);
 
                     if (bcsc.isProxyPeer()) {
-                        pbcsc = (BCSChild)children.get(peer = bcsc.getProxyPeer());
+                        pbcsc = children.get(peer = bcsc.getProxyPeer());
                         children.remove(peer);
                     }
                 }
@@ -566,9 +566,10 @@
      * in the collection are children of
      * this <tt>BeanContext</tt>, false if not.
      */
+    @SuppressWarnings("rawtypes")
     public boolean containsAll(Collection c) {
         synchronized(children) {
-            Iterator i = c.iterator();
+            Iterator<?> i = c.iterator();
             while (i.hasNext())
                 if(!contains(i.next()))
                     return false;
@@ -583,6 +584,7 @@
      * @throws UnsupportedOperationException thrown unconditionally by this implementation
      * @return this implementation unconditionally throws {@code UnsupportedOperationException}
      */
+    @SuppressWarnings("rawtypes")
     public boolean addAll(Collection c) {
         throw new UnsupportedOperationException();
     }
@@ -594,6 +596,7 @@
      * @return this implementation unconditionally throws {@code UnsupportedOperationException}
 
      */
+    @SuppressWarnings("rawtypes")
     public boolean removeAll(Collection c) {
         throw new UnsupportedOperationException();
     }
@@ -605,6 +608,7 @@
      * @throws UnsupportedOperationException thrown unconditionally by this implementation
      * @return this implementation unconditionally throws {@code UnsupportedOperationException}
      */
+    @SuppressWarnings("rawtypes")
     public boolean retainAll(Collection c) {
         throw new UnsupportedOperationException();
     }
@@ -763,7 +767,7 @@
         }
 
         synchronized(children) {
-            for (Iterator i = children.keySet().iterator(); i.hasNext();) {
+            for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                 Object c = i.next();
 
                 try {
@@ -790,7 +794,7 @@
 
             // lets also tell the Children that can that they may not use their GUI's
             synchronized(children) {
-                for (Iterator i = children.keySet().iterator(); i.hasNext();) {
+                for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                     Visibility v = getChildVisibility(i.next());
 
                     if (v != null) v.dontUseGui();
@@ -809,7 +813,7 @@
 
             // lets also tell the Children that can that they may use their GUI's
             synchronized(children) {
-                for (Iterator i = children.keySet().iterator(); i.hasNext();) {
+                for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
                     Visibility v = getChildVisibility(i.next());
 
                     if (v != null) v.okToUseGui();
@@ -841,7 +845,7 @@
      * of this <tt>BeanContext</tt>.
      * @return an iterator for all the current BCSChild values
      */
-    protected Iterator bcsChildren() { synchronized(children) { return children.values().iterator();  } }
+    protected Iterator<BCSChild> bcsChildren() { synchronized(children) { return children.values().iterator();  } }
 
     /**
      * called by writeObject after defaultWriteObject() but prior to
@@ -896,7 +900,7 @@
      * @param coll the <tt>Collection</tt> to serialize
      * @throws IOException if serialization failed
      */
-    protected final void serialize(ObjectOutputStream oos, Collection coll) throws IOException {
+    protected final void serialize(ObjectOutputStream oos, Collection<?> coll) throws IOException {
         int      count   = 0;
         Object[] objects = coll.toArray();
 
@@ -926,6 +930,7 @@
      * @throws IOException if deserialization failed
      * @throws ClassNotFoundException if needed classes are not found
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException {
         int count = 0;
 
@@ -953,10 +958,10 @@
         int count = 0;
 
         synchronized(children) {
-            Iterator i = children.entrySet().iterator();
+            Iterator<Map.Entry<Object, BCSChild>> i = children.entrySet().iterator();
 
             while (i.hasNext() && count < serializable) {
-                Map.Entry entry = (Map.Entry)i.next();
+                Map.Entry<Object, BCSChild> entry = i.next();
 
                 if (entry.getKey() instanceof Serializable) {
                     try {
@@ -1082,7 +1087,7 @@
             if (serializable > 0 && this.equals(getBeanContextPeer()))
                 readChildren(ois);
 
-            deserialize(ois, bcmListeners = new ArrayList(1));
+            deserialize(ois, bcmListeners = new ArrayList<>(1));
         }
     }
 
@@ -1101,7 +1106,7 @@
             ) {
                 if (!validatePendingRemove(source)) {
                     throw new PropertyVetoException("current BeanContext vetoes setBeanContext()", pce);
-                } else ((BCSChild)children.get(source)).setRemovePending(true);
+                } else children.get(source).setRemovePending(true);
             }
         }
     }
@@ -1117,13 +1122,13 @@
         synchronized(children) {
             if ("beanContext".equals(propertyName) &&
                 containsKey(source)                    &&
-                ((BCSChild)children.get(source)).isRemovePending()) {
+                children.get(source).isRemovePending()) {
                 BeanContext bc = getBeanContextPeer();
 
                 if (bc.equals(pce.getOldValue()) && !bc.equals(pce.getNewValue())) {
                     remove(source, false);
                 } else {
-                    ((BCSChild)children.get(source)).setRemovePending(false);
+                    children.get(source).setRemovePending(false);
                 }
             }
         }
@@ -1312,8 +1317,8 @@
      */
 
     protected synchronized void initialize() {
-        children     = new HashMap(serializable + 1);
-        bcmListeners = new ArrayList(1);
+        children     = new HashMap<>(serializable + 1);
+        bcmListeners = new ArrayList<>(1);
 
         childPCL = new PropertyChangeListener() {
 
@@ -1359,7 +1364,7 @@
      * @param second the second object
      * @return true if equal, false if not
      */
-    protected static final boolean classEquals(Class first, Class second) {
+    protected static final boolean classEquals(Class<?> first, Class<?> second) {
         return first.equals(second) || first.getName().equals(second.getName());
     }
 
@@ -1373,7 +1378,7 @@
      * all accesses to the <code> protected HashMap children </code> field
      * shall be synchronized on that object.
      */
-    protected transient HashMap         children;
+    protected transient HashMap<Object, BCSChild>         children;
 
     private             int             serializable  = 0; // children serializable
 
@@ -1381,7 +1386,7 @@
      * all accesses to the <code> protected ArrayList bcmListeners </code> field
      * shall be synchronized on that object.
      */
-    protected transient ArrayList       bcmListeners;
+    protected transient ArrayList<BeanContextMembershipListener> bcmListeners;
 
     //
 
--- a/src/share/classes/java/io/File.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/io/File.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1997,8 +1997,10 @@
                                       File directory)
         throws IOException
     {
-        if (prefix.length() < 3)
-            throw new IllegalArgumentException("Prefix string too short");
+        if (prefix.length() < 3) {
+            throw new IllegalArgumentException("Prefix string \"" + prefix +
+                "\" too short: length must be at least 3");
+        }
         if (suffix == null)
             suffix = ".tmp";
 
--- a/src/share/classes/java/lang/ClassLoader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/lang/ClassLoader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1859,18 +1859,17 @@
         String name = NativeLibrary.findBuiltinLib(file.getName());
         boolean isBuiltin = (name != null);
         if (!isBuiltin) {
-            boolean exists = AccessController.doPrivileged(
-                new PrivilegedAction<Object>() {
-                    public Object run() {
-                        return file.exists() ? Boolean.TRUE : null;
-                    }})
-                != null;
-            if (!exists) {
-                return false;
-            }
-            try {
-                name = file.getCanonicalPath();
-            } catch (IOException e) {
+            name = AccessController.doPrivileged(
+                new PrivilegedAction<String>() {
+                    public String run() {
+                        try {
+                            return file.exists() ? file.getCanonicalPath() : null;
+                        } catch (IOException e) {
+                            return null;
+                        }
+                    }
+                });
+            if (name == null) {
                 return false;
             }
         }
--- a/src/share/classes/java/lang/Package.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/lang/Package.java	Wed Jul 09 10:42:37 2014 -0700
@@ -107,6 +107,7 @@
  * loader to be found.
  *
  * @see ClassLoader#definePackage
+ * @since 1.2
  */
 public class Package implements java.lang.reflect.AnnotatedElement {
     /**
--- a/src/share/classes/java/lang/SafeVarargs.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/lang/SafeVarargs.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
  * <li>  the declaration is a fixed arity method or constructor
  *
  * <li> the declaration is a variable arity method that is neither
- * {@code static} nor {@code final}.
+ * {@code static} nor {@code final} nor {@code private}.
  *
  * </ul>
  *
--- a/src/share/classes/java/security/package-info.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/security/package-info.java	Wed Jul 09 10:42:37 2014 -0700
@@ -92,14 +92,14 @@
  *     </b></a></li>
  *
  *   <li><b>keytool</b>
- *     (<a href="{@docRoot}/../technotes/tools/solaris/keytool.html">
+ *     (<a href="{@docRoot}/../technotes/tools/unix/keytool.html">
  *       for Solaris/Linux</a>)
  *     (<a href="{@docRoot}/../technotes/tools/windows/keytool.html">
  *       for Windows</a>)
  *     </li>
  *
  *   <li><b>jarsigner</b>
- *     (<a href="{@docRoot}/../technotes/tools/solaris/jarsigner.html">
+ *     (<a href="{@docRoot}/../technotes/tools/unix/jarsigner.html">
  *       for Solaris/Linux</a>)
  *     (<a href="{@docRoot}/../technotes/tools/windows/jarsigner.html">
  *       for Windows</a>)
--- a/src/share/classes/java/text/DecimalFormat.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/text/DecimalFormat.java	Wed Jul 09 10:42:37 2014 -0700
@@ -2094,7 +2094,7 @@
             }
 
             return gotDouble ?
-                (Number)new Double(doubleResult) : (Number)new Long(longResult);
+                (Number)new Double(doubleResult) : (Number)Long.valueOf(longResult);
         }
     }
 
--- a/src/share/classes/java/util/Collections.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/util/Collections.java	Wed Jul 09 10:42:37 2014 -0700
@@ -3031,9 +3031,11 @@
         final Collection<E> c;
         final Class<E> type;
 
-        void typeCheck(Object o) {
+        @SuppressWarnings("unchecked")
+        E typeCheck(Object o) {
             if (o != null && !type.isInstance(o))
                 throw new ClassCastException(badElementMsg(o));
+            return (E) o;
         }
 
         private String badElementMsg(Object o) {
@@ -3042,10 +3044,8 @@
         }
 
         CheckedCollection(Collection<E> c, Class<E> type) {
-            if (c==null || type == null)
-                throw new NullPointerException();
-            this.c = c;
-            this.type = type;
+            this.c = Objects.requireNonNull(c, "c");
+            this.type = Objects.requireNonNull(type, "type");
         }
 
         public int size()                 { return c.size(); }
@@ -3077,10 +3077,7 @@
                 public void remove()     {        it.remove(); }};
         }
 
-        public boolean add(E e) {
-            typeCheck(e);
-            return c.add(e);
-        }
+        public boolean add(E e)          { return c.add(typeCheck(e)); }
 
         private E[] zeroLengthElementArray; // Lazily initialized
 
@@ -3091,7 +3088,7 @@
 
         @SuppressWarnings("unchecked")
         Collection<E> checkedCopyOf(Collection<? extends E> coll) {
-            Object[] a = null;
+            Object[] a;
             try {
                 E[] z = zeroLengthElementArray();
                 a = coll.toArray(z);
@@ -3187,11 +3184,7 @@
         public E peek()                 {return queue.peek();}
         public E poll()                 {return queue.poll();}
         public E remove()               {return queue.remove();}
-
-        public boolean offer(E e) {
-            typeCheck(e);
-            return add(e);
-        }
+        public boolean offer(E e)       {return queue.offer(typeCheck(e));}
     }
 
     /**
@@ -3440,13 +3433,11 @@
         public int lastIndexOf(Object o) { return list.lastIndexOf(o); }
 
         public E set(int index, E element) {
-            typeCheck(element);
-            return list.set(index, element);
+            return list.set(index, typeCheck(element));
         }
 
         public void add(int index, E element) {
-            typeCheck(element);
-            list.add(index, element);
+            list.add(index, typeCheck(element));
         }
 
         public boolean addAll(int index, Collection<? extends E> c) {
@@ -3467,13 +3458,11 @@
                 public void remove()         {        i.remove(); }
 
                 public void set(E e) {
-                    typeCheck(e);
-                    i.set(e);
+                    i.set(typeCheck(e));
                 }
 
                 public void add(E e) {
-                    typeCheck(e);
-                    i.add(e);
+                    i.add(typeCheck(e));
                 }
 
                 @Override
@@ -3487,10 +3476,19 @@
             return new CheckedList<>(list.subList(fromIndex, toIndex), type);
         }
 
+        /**
+         * {@inheritDoc}
+         *
+         * @throws ClassCastException if the class of an element returned by the
+         *         operator prevents it from being added to this collection. The
+         *         exception may be thrown after some elements of the list have
+         *         already been replaced.
+         */
         @Override
         public void replaceAll(UnaryOperator<E> operator) {
-            list.replaceAll(operator);
-        }
+            list.replaceAll(e -> typeCheck(operator.apply(e)));
+        }
+
         @Override
         public void sort(Comparator<? super E> c) {
             list.sort(c);
--- a/src/share/classes/java/util/Currency.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/util/Currency.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -212,13 +212,9 @@
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             @Override
             public Void run() {
-                String homeDir = System.getProperty("java.home");
                 try {
-                    String dataFile = homeDir + File.separator +
-                            "lib" + File.separator + "currency.data";
                     try (DataInputStream dis = new DataInputStream(
-                             new BufferedInputStream(
-                             new FileInputStream(dataFile)))) {
+                             new BufferedInputStream(getClass().getResourceAsStream("/java/util/currency.data")))) {
                         if (dis.readInt() != MAGIC_NUMBER) {
                             throw new InternalError("Currency data is possibly corrupted");
                         }
@@ -248,7 +244,7 @@
                 // look for the properties file for overrides
                 String propsFile = System.getProperty("java.util.currency.data");
                 if (propsFile == null) {
-                    propsFile = homeDir + File.separator + "lib" +
+                    propsFile = System.getProperty("java.home") + File.separator + "lib" +
                         File.separator + "currency.properties";
                 }
                 try {
--- a/src/share/classes/java/util/stream/Collectors.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/util/stream/Collectors.java	Wed Jul 09 10:42:37 2014 -0700
@@ -729,7 +729,7 @@
      * person in each city:
      * <pre>{@code
      *     Comparator<Person> byHeight = Comparator.comparing(Person::getHeight);
-     *     Map<City, Person> tallestByCity
+     *     Map<City, Optional<Person>> tallestByCity
      *         = people.stream().collect(groupingBy(Person::getCity, reducing(BinaryOperator.maxBy(byHeight))));
      * }</pre>
      *
@@ -784,7 +784,7 @@
      *     Comparator<String> byLength = Comparator.comparing(String::length);
      *     Map<City, String> longestLastNameByCity
      *         = people.stream().collect(groupingBy(Person::getCity,
-     *                                              reducing(Person::getLastName, BinaryOperator.maxBy(byLength))));
+     *                                              reducing("", Person::getLastName, BinaryOperator.maxBy(byLength))));
      * }</pre>
      *
      * @param <T> the type of the input elements
@@ -1220,7 +1220,7 @@
      * students to their grade point average:
      * <pre>{@code
      *     Map<Student, Double> studentToGPA
-     *         students.stream().collect(toMap(Functions.identity(),
+     *         students.stream().collect(toMap(Function.identity(),
      *                                         student -> computeGPA(student)));
      * }</pre>
      * And the following produces a {@code Map} mapping a unique identifier to
@@ -1228,7 +1228,7 @@
      * <pre>{@code
      *     Map<String, Student> studentIdToStudent
      *         students.stream().collect(toMap(Student::getId,
-     *                                         Functions.identity());
+     *                                         Function.identity());
      * }</pre>
      *
      * @implNote
@@ -1390,7 +1390,7 @@
      * students to their grade point average:
      * <pre>{@code
      *     Map<Student, Double> studentToGPA
-     *         students.stream().collect(toMap(Functions.identity(),
+     *         students.stream().collect(toMap(Function.identity(),
      *                                         student -> computeGPA(student)));
      * }</pre>
      * And the following produces a {@code Map} mapping a unique identifier to
@@ -1398,7 +1398,7 @@
      * <pre>{@code
      *     Map<String, Student> studentIdToStudent
      *         students.stream().collect(toConcurrentMap(Student::getId,
-     *                                                   Functions.identity());
+     *                                                   Function.identity());
      * }</pre>
      *
      * <p>This is a {@link Collector.Characteristics#CONCURRENT concurrent} and
--- a/src/share/classes/java/util/stream/package-info.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/java/util/stream/package-info.java	Wed Jul 09 10:42:37 2014 -0700
@@ -468,7 +468,7 @@
  * <pre>{@code
  *     int sumOfWeights = widgets.stream()
  *                               .reduce(0,
- *                                       (sum, b) -> sum + b.getWeight())
+ *                                       (sum, b) -> sum + b.getWeight(),
  *                                       Integer::sum);
  * }</pre>
  * though the explicit map-reduce form is more readable and therefore should
--- a/src/share/classes/javax/crypto/CipherInputStream.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/crypto/CipherInputStream.java	Wed Jul 09 10:42:37 2014 -0700
@@ -170,7 +170,6 @@
      * @return  the next byte of data, or <code>-1</code> if the end of the
      *          stream is reached.
      * @exception  IOException  if an I/O error occurs.
-     * @since JCE1.2
      */
     public int read() throws IOException {
         if (ostart >= ofinish) {
@@ -196,7 +195,6 @@
      *             the stream has been reached.
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.InputStream#read(byte[], int, int)
-     * @since      JCE1.2
      */
     public int read(byte b[]) throws IOException {
         return read(b, 0, b.length);
@@ -217,7 +215,6 @@
      *             the stream has been reached.
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.InputStream#read()
-     * @since      JCE1.2
      */
     public int read(byte b[], int off, int len) throws IOException {
         if (ostart >= ofinish) {
@@ -254,7 +251,6 @@
      * @param      n the number of bytes to be skipped.
      * @return     the actual number of bytes skipped.
      * @exception  IOException  if an I/O error occurs.
-     * @since JCE1.2
      */
     public long skip(long n) throws IOException {
         int available = ofinish - ostart;
@@ -277,7 +273,6 @@
      * @return     the number of bytes that can be read from this input stream
      *             without blocking.
      * @exception  IOException  if an I/O error occurs.
-     * @since      JCE1.2
      */
     public int available() throws IOException {
         return (ofinish - ostart);
@@ -292,7 +287,6 @@
      * stream.
      *
      * @exception  IOException  if an I/O error occurs.
-     * @since JCE1.2
      */
     public void close() throws IOException {
         if (closed) {
@@ -321,7 +315,6 @@
      *          <code>mark</code> and <code>reset</code> methods.
      * @see     java.io.InputStream#mark(int)
      * @see     java.io.InputStream#reset()
-     * @since   JCE1.2
      */
     public boolean markSupported() {
         return false;
--- a/src/share/classes/javax/crypto/CipherOutputStream.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/crypto/CipherOutputStream.java	Wed Jul 09 10:42:37 2014 -0700
@@ -114,7 +114,6 @@
      *
      * @param      b   the <code>byte</code>.
      * @exception  IOException  if an I/O error occurs.
-     * @since      JCE1.2
      */
     public void write(int b) throws IOException {
         ibuffer[0] = (byte) b;
@@ -138,7 +137,6 @@
      * @exception  NullPointerException if <code>b</code> is null.
      * @exception  IOException  if an I/O error occurs.
      * @see        javax.crypto.CipherOutputStream#write(byte[], int, int)
-     * @since JCE1.2
      */
     public void write(byte b[]) throws IOException {
         write(b, 0, b.length);
@@ -152,7 +150,6 @@
      * @param      off   the start offset in the data.
      * @param      len   the number of bytes to write.
      * @exception  IOException  if an I/O error occurs.
-     * @since      JCE1.2
      */
     public void write(byte b[], int off, int len) throws IOException {
         obuffer = cipher.update(b, off, len);
@@ -174,7 +171,6 @@
      * the cipher's block size, no bytes will be written out.
      *
      * @exception  IOException  if an I/O error occurs.
-     * @since      JCE1.2
      */
     public void flush() throws IOException {
         if (obuffer != null) {
@@ -198,7 +194,6 @@
      * stream.
      *
      * @exception  IOException  if an I/O error occurs.
-     * @since      JCE1.2
      */
     public void close() throws IOException {
         if (closed) {
--- a/src/share/classes/javax/management/loading/MLet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/management/loading/MLet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1307,11 +1307,11 @@
         if (type.compareTo("java.lang.Boolean") == 0)
              return Boolean.valueOf(param);
         if (type.compareTo("java.lang.Byte") == 0)
-             return new Byte(param);
+             return Byte.valueOf(param);
         if (type.compareTo("java.lang.Short") == 0)
-             return new Short(param);
+             return Short.valueOf(param);
         if (type.compareTo("java.lang.Long") == 0)
-             return new Long(param);
+             return Long.valueOf(param);
         if (type.compareTo("java.lang.Integer") == 0)
              return new Integer(param);
         if (type.compareTo("java.lang.Float") == 0)
--- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Wed Jul 09 10:42:37 2014 -0700
@@ -544,7 +544,7 @@
             }
 
             // convert seconds to milliseconds for time comparison
-            currencyPeriod = ((new Long(expTime)).longValue()) * 1000;
+            currencyPeriod = Long.parseLong(expTime) * 1000;
             if (currencyPeriod < 0) {
                 /* if currencyTimeLimit is -1 then value is never cached */
                 returnCachedValue = false;
@@ -580,7 +580,7 @@
                 if (tStamp == null)
                     tStamp = "0";
 
-                long lastTime = (new Long(tStamp)).longValue();
+                long lastTime = Long.parseLong(tStamp);
 
                 if (tracing) {
                     MODELMBEAN_LOGGER.logp(Level.FINER,
--- a/src/share/classes/javax/naming/InitialContext.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/naming/InitialContext.java	Wed Jul 09 10:42:37 2014 -0700
@@ -125,7 +125,7 @@
  * @see Context
  * @see NamingManager#setInitialContextFactoryBuilder
  *      NamingManager.setInitialContextFactoryBuilder
- * @since JNDI 1.1 / Java 2 Platform, Standard Edition, v 1.3
+ * @since 1.3, JNDI 1.1
  */
 
 public class InitialContext implements Context {
--- a/src/share/classes/javax/print/AttributeException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/AttributeException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -52,7 +52,7 @@
      *
      * @return unsupported attribute classes
      */
-    public Class[] getUnsupportedAttributes();
+    public Class<?>[] getUnsupportedAttributes();
 
     /**
      * Returns the array of printing attributes for which the Print Service
--- a/src/share/classes/javax/print/DocFlavor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/DocFlavor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -545,8 +545,7 @@
      * @exception NullPointerException if paramName is null.
      */
     public String getParameter(String paramName) {
-        return
-            (String)myMimeType.getParameterMap().get(paramName.toLowerCase());
+        return myMimeType.getParameterMap().get(paramName.toLowerCase());
     }
 
     /**
--- a/src/share/classes/javax/print/MimeType.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/MimeType.java	Wed Jul 09 10:42:37 2014 -0700
@@ -117,18 +117,18 @@
     /**
      * Parameter map entry.
      */
-    private class ParameterMapEntry implements Map.Entry {
+    private class ParameterMapEntry implements Map.Entry<String, String> {
         private int myIndex;
         public ParameterMapEntry(int theIndex) {
             myIndex = theIndex;
         }
-        public Object getKey(){
+        public String getKey(){
             return myPieces[myIndex];
         }
-        public Object getValue(){
+        public String getValue(){
             return myPieces[myIndex+1];
         }
-        public Object setValue (Object value) {
+        public String setValue (String value) {
             throw new UnsupportedOperationException();
         }
         public boolean equals(Object o) {
@@ -145,12 +145,12 @@
     /**
      * Parameter map entry set iterator.
      */
-    private class ParameterMapEntrySetIterator implements Iterator {
+    private class ParameterMapEntrySetIterator implements Iterator<Map.Entry<String, String>> {
         private int myIndex = 2;
         public boolean hasNext() {
             return myIndex < myPieces.length;
         }
-        public Object next() {
+        public Map.Entry<String, String> next() {
             if (hasNext()) {
                 ParameterMapEntry result = new ParameterMapEntry (myIndex);
                 myIndex += 2;
@@ -167,8 +167,8 @@
     /**
      * Parameter map entry set.
      */
-    private class ParameterMapEntrySet extends AbstractSet {
-        public Iterator iterator() {
+    private class ParameterMapEntrySet extends AbstractSet<Map.Entry<String, String>> {
+        public Iterator<Map.Entry<String, String>> iterator() {
             return new ParameterMapEntrySetIterator();
         }
         public int size() {
@@ -179,8 +179,8 @@
     /**
      * Parameter map.
      */
-    private class ParameterMap extends AbstractMap {
-        public Set entrySet() {
+    private class ParameterMap extends AbstractMap<String, String> {
+        public Set<Map.Entry<String, String>> entrySet() {
             if (myEntrySet == null) {
                 myEntrySet = new ParameterMapEntrySet();
             }
@@ -234,7 +234,7 @@
      *
      * @return  Parameter map for this MIME type object.
      */
-    public Map getParameterMap() {
+    public Map<String, String> getParameterMap() {
         if (myParameterMap == null) {
             myParameterMap = new ParameterMap();
         }
@@ -548,7 +548,7 @@
         }
         LexicalAnalyzer theLexer = new LexicalAnalyzer (s);
         int theLexemeType;
-        Vector thePieces = new Vector();
+        Vector<String> thePieces = new Vector<>();
         boolean mediaTypeIsText = false;
         boolean parameterNameIsCharset = false;
 
@@ -623,7 +623,7 @@
 
         // Save the pieces. Parameters are not in ascending order yet.
         int n = thePieces.size();
-        myPieces = (String[]) thePieces.toArray (new String [n]);
+        myPieces = thePieces.toArray (new String [n]);
 
         // Sort the parameters into ascending order using an insertion sort.
         int i, j;
--- a/src/share/classes/javax/print/PrintServiceLookup.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/PrintServiceLookup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -69,8 +69,8 @@
 public abstract class PrintServiceLookup {
 
     static class Services {
-        private ArrayList listOfLookupServices = null;
-        private ArrayList registeredServices = null;
+        private ArrayList<PrintServiceLookup> listOfLookupServices = null;
+        private ArrayList<PrintService> registeredServices = null;
     }
 
     private static Services getServicesForContext() {
@@ -83,23 +83,23 @@
         return services;
     }
 
-    private static ArrayList getListOfLookupServices() {
+    private static ArrayList<PrintServiceLookup> getListOfLookupServices() {
         return getServicesForContext().listOfLookupServices;
     }
 
-    private static ArrayList initListOfLookupServices() {
-        ArrayList listOfLookupServices = new ArrayList();
+    private static ArrayList<PrintServiceLookup> initListOfLookupServices() {
+        ArrayList<PrintServiceLookup> listOfLookupServices = new ArrayList<>();
         getServicesForContext().listOfLookupServices = listOfLookupServices;
         return listOfLookupServices;
     }
 
 
-    private static ArrayList getRegisteredServices() {
+    private static ArrayList<PrintService> getRegisteredServices() {
         return getServicesForContext().registeredServices;
     }
 
-    private static ArrayList initRegisteredServices() {
-        ArrayList registeredServices = new ArrayList();
+    private static ArrayList<PrintService> initRegisteredServices() {
+        ArrayList<PrintService> registeredServices = new ArrayList<>();
         getServicesForContext().registeredServices = registeredServices;
         return registeredServices;
     }
@@ -120,8 +120,8 @@
     public static final PrintService[]
         lookupPrintServices(DocFlavor flavor,
                             AttributeSet attributes) {
-        ArrayList list = getServices(flavor, attributes);
-        return (PrintService[])(list.toArray(new PrintService[list.size()]));
+        ArrayList<PrintService> list = getServices(flavor, attributes);
+        return list.toArray(new PrintService[list.size()]);
     }
 
 
@@ -148,9 +148,8 @@
     public static final MultiDocPrintService[]
         lookupMultiDocPrintServices(DocFlavor[] flavors,
                                     AttributeSet attributes) {
-        ArrayList list = getMultiDocServices(flavors, attributes);
-        return (MultiDocPrintService[])
-            list.toArray(new MultiDocPrintService[list.size()]);
+        ArrayList<MultiDocPrintService> list = getMultiDocServices(flavors, attributes);
+        return list.toArray(new MultiDocPrintService[list.size()]);
     }
 
 
@@ -177,10 +176,10 @@
 
     public static final PrintService lookupDefaultPrintService() {
 
-        Iterator psIterator = getAllLookupServices().iterator();
+        Iterator<PrintServiceLookup> psIterator = getAllLookupServices().iterator();
         while (psIterator.hasNext()) {
             try {
-                PrintServiceLookup lus = (PrintServiceLookup)psIterator.next();
+                PrintServiceLookup lus = psIterator.next();
                 PrintService service = lus.getDefaultPrintService();
                 if (service != null) {
                     return service;
@@ -208,7 +207,8 @@
      */
     public static boolean registerServiceProvider(PrintServiceLookup sp) {
         synchronized (PrintServiceLookup.class) {
-            Iterator psIterator = getAllLookupServices().iterator();
+            Iterator<PrintServiceLookup> psIterator =
+                getAllLookupServices().iterator();
             while (psIterator.hasNext()) {
                 try {
                     Object lus = psIterator.next();
@@ -249,7 +249,7 @@
             if (service instanceof StreamPrintService) {
                 return false;
             }
-            ArrayList registeredServices = getRegisteredServices();
+            ArrayList<PrintService> registeredServices = getRegisteredServices();
             if (registeredServices == null) {
                 registeredServices = initRegisteredServices();
             }
@@ -326,9 +326,9 @@
      */
     public abstract PrintService getDefaultPrintService();
 
-    private static ArrayList getAllLookupServices() {
+    private static ArrayList<PrintServiceLookup> getAllLookupServices() {
         synchronized (PrintServiceLookup.class) {
-            ArrayList listOfLookupServices = getListOfLookupServices();
+            ArrayList<PrintServiceLookup> listOfLookupServices = getListOfLookupServices();
             if (listOfLookupServices != null) {
                 return listOfLookupServices;
             } else {
@@ -336,12 +336,12 @@
             }
             try {
                 java.security.AccessController.doPrivileged(
-                     new java.security.PrivilegedExceptionAction() {
+                     new java.security.PrivilegedExceptionAction<Object>() {
                         public Object run() {
                             Iterator<PrintServiceLookup> iterator =
                                 ServiceLoader.load(PrintServiceLookup.class).
                                 iterator();
-                            ArrayList los = getListOfLookupServices();
+                            ArrayList<PrintServiceLookup> los = getListOfLookupServices();
                             while (iterator.hasNext()) {
                                 try {
                                     los.add(iterator.next());
@@ -364,14 +364,14 @@
         }
     }
 
-    private static ArrayList getServices(DocFlavor flavor,
-                                         AttributeSet attributes) {
+    private static ArrayList<PrintService> getServices(DocFlavor flavor,
+                                                       AttributeSet attributes) {
 
-        ArrayList listOfServices = new ArrayList();
-        Iterator psIterator = getAllLookupServices().iterator();
+        ArrayList<PrintService> listOfServices = new ArrayList<>();
+        Iterator<PrintServiceLookup> psIterator = getAllLookupServices().iterator();
         while (psIterator.hasNext()) {
             try {
-                PrintServiceLookup lus = (PrintServiceLookup)psIterator.next();
+                PrintServiceLookup lus = psIterator.next();
                 PrintService[] services=null;
                 if (flavor == null && attributes == null) {
                     try {
@@ -391,7 +391,7 @@
             }
         }
         /* add any directly registered services */
-        ArrayList registeredServices = null;
+        ArrayList<PrintService> registeredServices = null;
         try {
           SecurityManager security = System.getSecurityManager();
           if (security != null) {
@@ -401,8 +401,7 @@
         } catch (SecurityException se) {
         }
         if (registeredServices != null) {
-            PrintService[] services = (PrintService[])
-                registeredServices.toArray(
+            PrintService[] services = registeredServices.toArray(
                            new PrintService[registeredServices.size()]);
             for (int i=0; i<services.length; i++) {
                 if (!listOfServices.contains(services[i])) {
@@ -421,15 +420,15 @@
         return listOfServices;
     }
 
-    private static ArrayList getMultiDocServices(DocFlavor[] flavors,
-                                                 AttributeSet attributes) {
+    private static ArrayList<MultiDocPrintService> getMultiDocServices(DocFlavor[] flavors,
+                                                                       AttributeSet attributes) {
 
 
-        ArrayList listOfServices = new ArrayList();
-        Iterator psIterator = getAllLookupServices().iterator();
+        ArrayList<MultiDocPrintService> listOfServices = new ArrayList<>();
+        Iterator<PrintServiceLookup> psIterator = getAllLookupServices().iterator();
         while (psIterator.hasNext()) {
             try {
-                PrintServiceLookup lus = (PrintServiceLookup)psIterator.next();
+                PrintServiceLookup lus = psIterator.next();
                 MultiDocPrintService[] services  =
                     lus.getMultiDocPrintServices(flavors, attributes);
                 if (services == null) {
@@ -442,7 +441,7 @@
             }
         }
         /* add any directly registered services */
-        ArrayList registeredServices = null;
+        ArrayList<PrintService> registeredServices = null;
         try {
           SecurityManager security = System.getSecurityManager();
           if (security != null) {
@@ -452,14 +451,13 @@
         } catch (Exception e) {
         }
         if (registeredServices != null) {
-            PrintService[] services = (PrintService[])
-                registeredServices.toArray(
-                           new PrintService[registeredServices.size()]);
+            PrintService[] services =
+                registeredServices.toArray(new PrintService[registeredServices.size()]);
             for (int i=0; i<services.length; i++) {
                 if (services[i] instanceof MultiDocPrintService &&
                     !listOfServices.contains(services[i])) {
                     if (flavors == null || flavors.length == 0) {
-                        listOfServices.add(services[i]);
+                        listOfServices.add((MultiDocPrintService)services[i]);
                     } else {
                         boolean supported = true;
                         for (int f=0; f<flavors.length; f++) {
@@ -476,7 +474,7 @@
                             }
                         }
                         if (supported) {
-                            listOfServices.add(services[i]);
+                            listOfServices.add((MultiDocPrintService)services[i]);
                         }
                     }
                 }
--- a/src/share/classes/javax/print/ServiceUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/ServiceUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -228,9 +228,9 @@
 
         if (dialog.getStatus() == ServiceDialog.APPROVE) {
             PrintRequestAttributeSet newas = dialog.getAttributes();
-            Class dstCategory = Destination.class;
-            Class amCategory = SunAlternateMedia.class;
-            Class fdCategory = Fidelity.class;
+            Class<?> dstCategory = Destination.class;
+            Class<?> amCategory = SunAlternateMedia.class;
+            Class<?> fdCategory = Fidelity.class;
 
             if (attributes.containsKey(dstCategory) &&
                 !newas.containsKey(dstCategory))
@@ -315,7 +315,7 @@
             Attribute[] usAttrs = asUnsupported.toArray();
 
             for (int i=0; i<usAttrs.length; i++) {
-                Class category = usAttrs[i].getCategory();
+                Class<? extends Attribute> category = usAttrs[i].getCategory();
 
                 if (ps.isAttributeCategorySupported(category)) {
                     Attribute attr =
--- a/src/share/classes/javax/print/SimpleDoc.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/SimpleDoc.java	Wed Jul 09 10:42:37 2014 -0700
@@ -89,7 +89,7 @@
            throw new IllegalArgumentException("null argument(s)");
        }
 
-       Class repClass = null;
+       Class<?> repClass = null;
        try {
             String className = flavor.getRepresentationClassName();
             sun.reflect.misc.ReflectUtil.checkPackageAccess(className);
--- a/src/share/classes/javax/print/StreamPrintServiceFactory.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/StreamPrintServiceFactory.java	Wed Jul 09 10:42:37 2014 -0700
@@ -59,7 +59,7 @@
 public abstract class StreamPrintServiceFactory {
 
     static class Services {
-        private ArrayList listOfFactories = null;
+        private ArrayList<StreamPrintServiceFactory> listOfFactories = null;
     }
 
     private static Services getServices() {
@@ -72,12 +72,12 @@
         return services;
     }
 
-    private static ArrayList getListOfFactories() {
+    private static ArrayList<StreamPrintServiceFactory> getListOfFactories() {
         return getServices().listOfFactories;
     }
 
-    private static ArrayList initListOfFactories() {
-        ArrayList listOfFactories = new ArrayList();
+    private static ArrayList<StreamPrintServiceFactory> initListOfFactories() {
+        ArrayList<StreamPrintServiceFactory> listOfFactories = new ArrayList<>();
         getServices().listOfFactories = listOfFactories;
         return listOfFactories;
     }
@@ -108,9 +108,8 @@
          lookupStreamPrintServiceFactories(DocFlavor flavor,
                                            String outputMimeType) {
 
-         ArrayList list = getFactories(flavor, outputMimeType);
-         return (StreamPrintServiceFactory[])
-               (list.toArray(new StreamPrintServiceFactory[list.size()]));
+         ArrayList<StreamPrintServiceFactory> list = getFactories(flavor, outputMimeType);
+         return list.toArray(new StreamPrintServiceFactory[list.size()]);
      }
 
     /** Queries the factory for the document format that is emitted
@@ -162,10 +161,10 @@
     public abstract StreamPrintService getPrintService(OutputStream out);
 
 
-    private static ArrayList getAllFactories() {
+    private static ArrayList<StreamPrintServiceFactory> getAllFactories() {
         synchronized (StreamPrintServiceFactory.class) {
 
-          ArrayList listOfFactories = getListOfFactories();
+          ArrayList<StreamPrintServiceFactory> listOfFactories = getListOfFactories();
             if (listOfFactories != null) {
                 return listOfFactories;
             } else {
@@ -174,12 +173,12 @@
 
             try {
                 java.security.AccessController.doPrivileged(
-                     new java.security.PrivilegedExceptionAction() {
+                     new java.security.PrivilegedExceptionAction<Object>() {
                         public Object run() {
                             Iterator<StreamPrintServiceFactory> iterator =
                                 ServiceLoader.load
                                 (StreamPrintServiceFactory.class).iterator();
-                            ArrayList lof = getListOfFactories();
+                            ArrayList<StreamPrintServiceFactory> lof = getListOfFactories();
                             while (iterator.hasNext()) {
                                 try {
                                     lof.add(iterator.next());
@@ -210,17 +209,16 @@
         return false;
     }
 
-    private static ArrayList getFactories(DocFlavor flavor, String outType) {
+    private static ArrayList<StreamPrintServiceFactory> getFactories(DocFlavor flavor, String outType) {
 
         if (flavor == null && outType == null) {
             return getAllFactories();
         }
 
-        ArrayList list = new ArrayList();
-        Iterator iterator = getAllFactories().iterator();
+        ArrayList<StreamPrintServiceFactory> list = new ArrayList<>();
+        Iterator<StreamPrintServiceFactory> iterator = getAllFactories().iterator();
         while (iterator.hasNext()) {
-            StreamPrintServiceFactory factory =
-                (StreamPrintServiceFactory)iterator.next();
+            StreamPrintServiceFactory factory = iterator.next();
             if ((outType == null ||
                  outType.equalsIgnoreCase(factory.getOutputFormat())) &&
                 (flavor == null ||
--- a/src/share/classes/javax/print/attribute/AttributeSetUtilities.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/attribute/AttributeSetUtilities.java	Wed Jul 09 10:42:37 2014 -0700
@@ -523,7 +523,7 @@
     public static Class<?>
         verifyAttributeCategory(Object object, Class<?> interfaceName) {
 
-        Class result = (Class) object;
+        Class<?> result = (Class<?>) object;
         if (interfaceName.isAssignableFrom (result)) {
             return result;
         }
--- a/src/share/classes/javax/print/attribute/HashAttributeSet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/attribute/HashAttributeSet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,13 +48,13 @@
      * or a subinterface thereof.
      * @serial
      */
-    private Class myInterface;
+    private Class<?> myInterface;
 
     /*
      * A HashMap used by the implementation.
      * The serialised form doesn't include this instance variable.
      */
-    private transient HashMap attrMap = new HashMap();
+    private transient HashMap<Class<?>, Attribute> attrMap = new HashMap<>();
 
     /**
      * Write the instance to a stream (ie serialize the object)
@@ -82,7 +82,7 @@
         throws ClassNotFoundException, IOException {
 
         s.defaultReadObject();
-        attrMap = new HashMap();
+        attrMap = new HashMap<>();
         int count = s.readInt();
         Attribute attr;
         for (int i = 0; i < count; i++) {
@@ -274,10 +274,9 @@
      *     Attribute Attribute}.
      */
     public Attribute get(Class<?> category) {
-        return (Attribute)
-            attrMap.get(AttributeSetUtilities.
-                        verifyAttributeCategory(category,
-                                                Attribute.class));
+        return attrMap.get(AttributeSetUtilities.
+                           verifyAttributeCategory(category,
+                                                   Attribute.class));
     }
 
     /**
--- a/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Wed Jul 09 10:42:37 2014 -0700
@@ -112,7 +112,7 @@
     private static int[][] parse(String members) {
         // Create vector to hold int[] elements, each element being one range
         // parsed out of members.
-        Vector theRanges = new Vector();
+        Vector<int[]> theRanges = new Vector<>();
 
         // Run state machine over members.
         int n = (members == null ? 0 : members.length());
@@ -243,7 +243,7 @@
      * Accumulate the given range (lb .. ub) into the canonical array form
      * into the given vector of int[] objects.
      */
-    private static void accumulate(Vector ranges, int lb,int ub) {
+    private static void accumulate(Vector<int[]> ranges, int lb,int ub) {
         // Make sure range is non-null.
         if (lb <= ub) {
             // Stick range at the back of the vector.
@@ -253,10 +253,10 @@
             // with the existing ranges.
             for (int j = ranges.size()-2; j >= 0; -- j) {
             // Get lower and upper bounds of the two ranges being compared.
-                int[] rangea = (int[]) ranges.elementAt (j);
+                int[] rangea = ranges.elementAt (j);
                 int lba = rangea[0];
                 int uba = rangea[1];
-                int[] rangeb = (int[]) ranges.elementAt (j+1);
+                int[] rangeb = ranges.elementAt (j+1);
                 int lbb = rangeb[0];
                 int ubb = rangeb[1];
 
@@ -293,8 +293,8 @@
     /**
      * Convert the given vector of int[] objects to canonical array form.
      */
-    private static int[][] canonicalArrayForm(Vector ranges) {
-        return (int[][]) ranges.toArray (new int[ranges.size()][]);
+    private static int[][] canonicalArrayForm(Vector<int[]> ranges) {
+        return ranges.toArray (new int[ranges.size()][]);
     }
 
     /**
@@ -323,7 +323,7 @@
     private static int[][] parse(int[][] members) {
         // Create vector to hold int[] elements, each element being one range
         // parsed out of members.
-        Vector ranges = new Vector();
+        Vector<int[]> ranges = new Vector<>();
 
         // Process all integer groups in members.
         int n = (members == null ? 0 : members.length);
--- a/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,6 +26,7 @@
 package javax.print.attribute.standard;
 
 import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintRequestAttribute;
 
 /**
@@ -110,7 +111,7 @@
      * @return  Printing attribute class (category), an instance of class
      *          {@link java.lang.Class java.lang.Class}.
      */
-    public final Class getCategory() {
+    public final Class<? extends Attribute> getCategory() {
         return DialogTypeSelection.class;
     }
 
--- a/src/share/classes/javax/print/attribute/standard/MediaSize.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/attribute/standard/MediaSize.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,9 +56,9 @@
 
     private MediaSizeName mediaName;
 
-    private static HashMap mediaMap = new HashMap(100, 10);
+    private static HashMap<MediaSizeName, MediaSize> mediaMap = new HashMap<>(100, 10);
 
-    private static Vector sizeVector = new Vector(100, 10);
+    private static Vector<MediaSize> sizeVector = new Vector<>(100, 10);
 
     /**
      * Construct a new media size attribute from the given floating-point
@@ -174,7 +174,7 @@
      * with any size.
      */
     public static MediaSize getMediaSizeForName(MediaSizeName media) {
-        return (MediaSize)mediaMap.get(media);
+        return mediaMap.get(media);
     }
 
     /**
@@ -213,7 +213,7 @@
         float diffy = y;
 
         for (int i=0; i < sizeVector.size() ; i++) {
-            MediaSize mediaSize = (MediaSize)sizeVector.elementAt(i);
+            MediaSize mediaSize = sizeVector.elementAt(i);
             dim = mediaSize.getSize(units);
             if (x == dim[0] && y == dim[1]) {
                 match = mediaSize;
--- a/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java	Wed Jul 09 10:42:37 2014 -0700
@@ -242,16 +242,18 @@
         extends AbstractSet<PrinterStateReason>
     {
         private Severity mySeverity;
-        private Set myEntrySet;
+
+        private Set<Map.Entry<PrinterStateReason, Severity>> myEntrySet;
 
-        public PrinterStateReasonSet(Severity severity, Set entrySet) {
+        public PrinterStateReasonSet(Severity severity,
+                                     Set<Map.Entry<PrinterStateReason, Severity>> entrySet) {
             mySeverity = severity;
             myEntrySet = entrySet;
         }
 
         public int size() {
             int result = 0;
-            Iterator iter = iterator();
+            Iterator<PrinterStateReason> iter = iterator();
             while (iter.hasNext()) {
                 iter.next();
                 ++ result;
@@ -259,19 +261,19 @@
             return result;
         }
 
-        public Iterator iterator() {
+        public Iterator<PrinterStateReason> iterator() {
             return new PrinterStateReasonSetIterator(mySeverity,
                                                      myEntrySet.iterator());
         }
     }
 
-    private class PrinterStateReasonSetIterator implements Iterator {
+    private class PrinterStateReasonSetIterator implements Iterator<PrinterStateReason> {
         private Severity mySeverity;
-        private Iterator myIterator;
-        private Map.Entry myEntry;
+        private Iterator<Map.Entry<PrinterStateReason, Severity>> myIterator;
+        private Map.Entry<PrinterStateReason, Severity> myEntry;
 
         public PrinterStateReasonSetIterator(Severity severity,
-                                             Iterator iterator) {
+                                             Iterator<Map.Entry<PrinterStateReason, Severity>> iterator) {
             mySeverity = severity;
             myIterator = iterator;
             goToNext();
@@ -280,8 +282,8 @@
         private void goToNext() {
             myEntry = null;
             while (myEntry == null && myIterator.hasNext()) {
-                myEntry = (Map.Entry) myIterator.next();
-                if ((Severity) myEntry.getValue() != mySeverity) {
+                myEntry = myIterator.next();
+                if (myEntry.getValue() != mySeverity) {
                     myEntry = null;
                 }
             }
@@ -291,11 +293,11 @@
             return myEntry != null;
         }
 
-        public Object next() {
+        public PrinterStateReason next() {
             if (myEntry == null) {
                 throw new NoSuchElementException();
             }
-            Object result = myEntry.getKey();
+            PrinterStateReason result = myEntry.getKey();
             goToNext();
             return result;
         }
--- a/src/share/classes/javax/security/auth/Subject.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/security/auth/Subject.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,9 @@
      * <p> The newly constructed Sets check whether this {@code Subject}
      * has been set read-only before permitting subsequent modifications.
      * The newly created Sets also prevent illegal modifications
-     * by ensuring that callers have sufficient permissions.
+     * by ensuring that callers have sufficient permissions.  These Sets
+     * also prohibit null elements, and attempts to add or query a null
+     * element will result in a {@code NullPointerException}.
      *
      * <p> To modify the Principals Set, the caller must have
      * {@code AuthPermission("modifyPrincipals")}.
@@ -170,7 +172,9 @@
      * These newly created Sets check whether this {@code Subject}
      * has been set read-only before permitting subsequent modifications.
      * The newly created Sets also prevent illegal modifications
-     * by ensuring that callers have sufficient permissions.
+     * by ensuring that callers have sufficient permissions.  These Sets
+     * also prohibit null elements, and attempts to add or query a null
+     * element will result in a {@code NullPointerException}.
      *
      * <p> To modify the Principals Set, the caller must have
      * {@code AuthPermission("modifyPrincipals")}.
@@ -194,17 +198,16 @@
      *
      * @exception NullPointerException if the specified
      *          {@code principals}, {@code pubCredentials},
-     *          or {@code privCredentials} are {@code null}.
+     *          or {@code privCredentials} are {@code null},
+     *          or a null value exists within any of these three
+     *          Sets.
      */
     public Subject(boolean readOnly, Set<? extends Principal> principals,
                    Set<?> pubCredentials, Set<?> privCredentials)
     {
-
-        if (principals == null ||
-            pubCredentials == null ||
-            privCredentials == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.input.s."));
+        collectionNullClean(principals);
+        collectionNullClean(pubCredentials);
+        collectionNullClean(privCredentials);
 
         this.principals = Collections.synchronizedSet(new SecureSet<Principal>
                                 (this, PRINCIPAL_SET, principals));
@@ -287,18 +290,17 @@
             sm.checkPermission(AuthPermissionHolder.GET_SUBJECT_PERMISSION);
         }
 
-        if (acc == null) {
-            throw new NullPointerException(ResourcesMgr.getString
+        Objects.requireNonNull(acc, ResourcesMgr.getString
                 ("invalid.null.AccessControlContext.provided"));
-        }
 
         // return the Subject from the DomainCombiner of the provided context
         return AccessController.doPrivileged
             (new java.security.PrivilegedAction<Subject>() {
             public Subject run() {
                 DomainCombiner dc = acc.getDomainCombiner();
-                if (!(dc instanceof SubjectDomainCombiner))
+                if (!(dc instanceof SubjectDomainCombiner)) {
                     return null;
+                }
                 SubjectDomainCombiner sdc = (SubjectDomainCombiner)dc;
                 return sdc.getSubject();
             }
@@ -347,9 +349,9 @@
         if (sm != null) {
             sm.checkPermission(AuthPermissionHolder.DO_AS_PERMISSION);
         }
-        if (action == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.action.provided"));
+
+        Objects.requireNonNull(action,
+                ResourcesMgr.getString("invalid.null.action.provided"));
 
         // set up the new Subject-based AccessControlContext
         // for doPrivileged
@@ -410,9 +412,8 @@
             sm.checkPermission(AuthPermissionHolder.DO_AS_PERMISSION);
         }
 
-        if (action == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.action.provided"));
+        Objects.requireNonNull(action,
+                ResourcesMgr.getString("invalid.null.action.provided"));
 
         // set up the new Subject-based AccessControlContext for doPrivileged
         final AccessControlContext currentAcc = AccessController.getContext();
@@ -467,9 +468,8 @@
             sm.checkPermission(AuthPermissionHolder.DO_AS_PRIVILEGED_PERMISSION);
         }
 
-        if (action == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.action.provided"));
+        Objects.requireNonNull(action,
+                ResourcesMgr.getString("invalid.null.action.provided"));
 
         // set up the new Subject-based AccessControlContext
         // for doPrivileged
@@ -534,9 +534,8 @@
             sm.checkPermission(AuthPermissionHolder.DO_AS_PRIVILEGED_PERMISSION);
         }
 
-        if (action == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.action.provided"));
+        Objects.requireNonNull(action,
+                ResourcesMgr.getString("invalid.null.action.provided"));
 
         // set up the new Subject-based AccessControlContext for doPrivileged
         final AccessControlContext callerAcc =
@@ -557,13 +556,14 @@
         return java.security.AccessController.doPrivileged
             (new java.security.PrivilegedAction<AccessControlContext>() {
             public AccessControlContext run() {
-                if (subject == null)
+                if (subject == null) {
                     return new AccessControlContext(acc, null);
-                else
+                } else {
                     return new AccessControlContext
                                         (acc,
                                         new SubjectDomainCombiner(subject));
             }
+            }
         });
     }
 
@@ -615,9 +615,8 @@
      */
     public <T extends Principal> Set<T> getPrincipals(Class<T> c) {
 
-        if (c == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.Class.provided"));
+        Objects.requireNonNull(c,
+                ResourcesMgr.getString("invalid.null.Class.provided"));
 
         // always return an empty Set instead of null
         // so LoginModules can add to the Set if necessary
@@ -711,9 +710,8 @@
      */
     public <T> Set<T> getPublicCredentials(Class<T> c) {
 
-        if (c == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.Class.provided"));
+        Objects.requireNonNull(c,
+                ResourcesMgr.getString("invalid.null.Class.provided"));
 
         // always return an empty Set instead of null
         // so LoginModules can add to the Set if necessary
@@ -758,9 +756,8 @@
         // would do is protect the set operations themselves
         // (like size()), which don't seem security-sensitive.
 
-        if (c == null)
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.Class.provided"));
+        Objects.requireNonNull(c,
+                ResourcesMgr.getString("invalid.null.Class.provided"));
 
         // always return an empty Set instead of null
         // so LoginModules can add to the Set if necessary
@@ -790,11 +787,13 @@
      */
     public boolean equals(Object o) {
 
-        if (o == null)
+        if (o == null) {
             return false;
+        }
 
-        if (this == o)
+        if (this == o) {
             return true;
+        }
 
         if (o instanceof Subject) {
 
@@ -969,11 +968,10 @@
 
         Set<Principal> inputPrincs = (Set<Principal>)gf.get("principals", null);
 
+        Objects.requireNonNull(inputPrincs,
+                ResourcesMgr.getString("invalid.null.input.s."));
+
         // Rewrap the principals into a SecureSet
-        if (inputPrincs == null) {
-            throw new NullPointerException
-                (ResourcesMgr.getString("invalid.null.input.s."));
-        }
         try {
             principals = Collections.synchronizedSet(new SecureSet<Principal>
                                 (this, PRINCIPAL_SET, inputPrincs));
@@ -993,13 +991,43 @@
     }
 
     /**
+     * Tests for null-clean collections (both non-null reference and
+     * no null elements)
+     *
+     * @param coll A {@code Collection} to be tested for null references
+     *
+     * @exception NullPointerException if the specified collection is either
+     *            {@code null} or contains a {@code null} element
+     */
+    private static void collectionNullClean(Collection<?> coll) {
+        boolean hasNullElements = false;
+
+        Objects.requireNonNull(coll,
+                ResourcesMgr.getString("invalid.null.input.s."));
+
+        try {
+            hasNullElements = coll.contains(null);
+        } catch (NullPointerException npe) {
+            // A null-hostile collection may choose to throw
+            // NullPointerException if contains(null) is called on it
+            // rather than returning false.
+            // If this happens we know the collection is null-clean.
+            hasNullElements = false;
+        } finally {
+            if (hasNullElements) {
+                throw new NullPointerException
+                    (ResourcesMgr.getString("invalid.null.input.s."));
+            }
+        }
+    }
+
+    /**
      * Prevent modifications unless caller has permission.
      *
      * @serial include
      */
     private static class SecureSet<E>
-        extends AbstractSet<E>
-        implements java.io.Serializable {
+        implements Set<E>, java.io.Serializable {
 
         private static final long serialVersionUID = 7911754171111800359L;
 
@@ -1098,6 +1126,9 @@
 
         public boolean add(E o) {
 
+            Objects.requireNonNull(o,
+                    ResourcesMgr.getString("invalid.null.input.s."));
+
             if (subject.isReadOnly()) {
                 throw new IllegalStateException
                         (ResourcesMgr.getString("Subject.is.read.only"));
@@ -1133,12 +1164,16 @@
             // check for duplicates
             if (!elements.contains(o))
                 return elements.add(o);
-            else
+            else {
                 return false;
         }
+        }
 
         public boolean remove(Object o) {
 
+            Objects.requireNonNull(o,
+                    ResourcesMgr.getString("invalid.null.input.s."));
+
             final Iterator<E> e = iterator();
             while (e.hasNext()) {
                 E next;
@@ -1153,12 +1188,7 @@
                     });
                 }
 
-                if (next == null) {
-                    if (o == null) {
-                        e.remove();
-                        return true;
-                    }
-                } else if (next.equals(o)) {
+                if (next.equals(o)) {
                     e.remove();
                     return true;
                 }
@@ -1167,6 +1197,10 @@
         }
 
         public boolean contains(Object o) {
+
+            Objects.requireNonNull(o,
+                    ResourcesMgr.getString("invalid.null.input.s."));
+
             final Iterator<E> e = iterator();
             while (e.hasNext()) {
                 E next;
@@ -1194,19 +1228,28 @@
                     });
                 }
 
-                if (next == null) {
-                    if (o == null) {
-                        return true;
-                    }
-                } else if (next.equals(o)) {
+                if (next.equals(o)) {
                     return true;
                 }
             }
             return false;
         }
 
+        public boolean addAll(Collection<? extends E> c) {
+            boolean result = false;
+
+            collectionNullClean(c);
+
+            for (E item : c) {
+                result |= this.add(item);
+            }
+
+            return result;
+        }
+
         public boolean removeAll(Collection<?> c) {
-            Objects.requireNonNull(c);
+            collectionNullClean(c);
+
             boolean modified = false;
             final Iterator<E> e = iterator();
             while (e.hasNext()) {
@@ -1224,30 +1267,34 @@
 
                 Iterator<?> ce = c.iterator();
                 while (ce.hasNext()) {
-                    Object o = ce.next();
-                    if (next == null) {
-                        if (o == null) {
+                    if (next.equals(ce.next())) {
                             e.remove();
                             modified = true;
                             break;
                         }
-                    } else if (next.equals(o)) {
-                        e.remove();
-                        modified = true;
-                        break;
-                    }
                 }
             }
             return modified;
         }
 
+        public boolean containsAll(Collection<?> c) {
+            collectionNullClean(c);
+
+            for (Object item : c) {
+                if (this.contains(item) == false) {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
         public boolean retainAll(Collection<?> c) {
-            Objects.requireNonNull(c);
+            collectionNullClean(c);
+
             boolean modified = false;
-            boolean retain = false;
             final Iterator<E> e = iterator();
             while (e.hasNext()) {
-                retain = false;
                 E next;
                 if (which != Subject.PRIV_CREDENTIAL_SET) {
                     next = e.next();
@@ -1260,26 +1307,12 @@
                     });
                 }
 
-                Iterator<?> ce = c.iterator();
-                while (ce.hasNext()) {
-                    Object o = ce.next();
-                    if (next == null) {
-                        if (o == null) {
-                            retain = true;
-                            break;
-                        }
-                    } else if (next.equals(o)) {
-                        retain = true;
-                        break;
+                if (c.contains(next) == false) {
+                    e.remove();
+                    modified = true;
                     }
                 }
 
-                if (!retain) {
-                    e.remove();
-                    retain = false;
-                    modified = true;
-                }
-            }
             return modified;
         }
 
@@ -1301,6 +1334,73 @@
             }
         }
 
+        public boolean isEmpty() {
+            return elements.isEmpty();
+        }
+
+        public Object[] toArray() {
+            final Iterator<E> e = iterator();
+            while (e.hasNext()) {
+                // The next() method performs a security manager check
+                // on each element in the SecureSet.  If we make it all
+                // the way through we should be able to simply return
+                // element's toArray results.  Otherwise we'll let
+                // the SecurityException pass up the call stack.
+                e.next();
+            }
+
+            return elements.toArray();
+        }
+
+        public <T> T[] toArray(T[] a) {
+            final Iterator<E> e = iterator();
+            while (e.hasNext()) {
+                // The next() method performs a security manager check
+                // on each element in the SecureSet.  If we make it all
+                // the way through we should be able to simply return
+                // element's toArray results.  Otherwise we'll let
+                // the SecurityException pass up the call stack.
+                e.next();
+            }
+
+            return elements.toArray(a);
+        }
+
+        public boolean equals(Object o) {
+            if (o == this) {
+                return true;
+            }
+
+            if (!(o instanceof Set)) {
+                return false;
+            }
+
+            Collection<?> c = (Collection<?>) o;
+            if (c.size() != size()) {
+                return false;
+            }
+
+            try {
+                return containsAll(c);
+            } catch (ClassCastException unused)   {
+                return false;
+            } catch (NullPointerException unused) {
+                return false;
+            }
+        }
+
+        public int hashCode() {
+            int h = 0;
+            Iterator<E> i = iterator();
+            while (i.hasNext()) {
+                E obj = i.next();
+                if (obj != null) {
+                    h += obj.hashCode();
+                }
+            }
+            return h;
+        }
+
         /**
          * Writes this object out to a stream (i.e., serializes it).
          *
@@ -1338,12 +1438,16 @@
             which = fields.get("which", 0);
 
             LinkedList<E> tmp = (LinkedList<E>) fields.get("elements", null);
+
+            Subject.collectionNullClean(tmp);
+
             if (tmp.getClass() != LinkedList.class) {
                 elements = new LinkedList<E>(tmp);
             } else {
                 elements = tmp;
             }
         }
+
     }
 
     /**
--- a/src/share/classes/javax/sound/midi/MidiFileFormat.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/midi/MidiFileFormat.java	Wed Jul 09 10:42:37 2014 -0700
@@ -266,6 +266,7 @@
      * @see #getProperty(String)
      * @since 1.5
      */
+    @SuppressWarnings("unchecked") // Cast of result of clone
     public Map<String,Object> properties() {
         Map<String,Object> ret;
         if (properties == null) {
--- a/src/share/classes/javax/sound/midi/MidiSystem.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/midi/MidiSystem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -187,17 +187,17 @@
      * an array of length 0 is returned.
      */
     public static MidiDevice.Info[] getMidiDeviceInfo() {
-        List allInfos = new ArrayList();
-        List providers = getMidiDeviceProviders();
+        List<MidiDevice.Info> allInfos = new ArrayList<>();
+        List<MidiDeviceProvider> providers = getMidiDeviceProviders();
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiDeviceProvider provider = (MidiDeviceProvider) providers.get(i);
+            MidiDeviceProvider provider = providers.get(i);
             MidiDevice.Info[] tmpinfo = provider.getDeviceInfo();
             for (int j = 0; j < tmpinfo.length; j++) {
                 allInfos.add( tmpinfo[j] );
             }
         }
-        MidiDevice.Info[] infosArray = (MidiDevice.Info[]) allInfos.toArray(new MidiDevice.Info[0]);
+        MidiDevice.Info[] infosArray = allInfos.toArray(new MidiDevice.Info[0]);
         return infosArray;
     }
 
@@ -214,10 +214,10 @@
      * @see #getMidiDeviceInfo
      */
     public static MidiDevice getMidiDevice(MidiDevice.Info info) throws MidiUnavailableException {
-        List providers = getMidiDeviceProviders();
+        List<MidiDeviceProvider> providers = getMidiDeviceProviders();
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiDeviceProvider provider = (MidiDeviceProvider) providers.get(i);
+            MidiDeviceProvider provider = providers.get(i);
             if (provider.isDeviceSupported(info)) {
                 MidiDevice device = provider.getDevice(info);
                 return device;
@@ -528,10 +528,10 @@
         SoundbankReader sp = null;
         Soundbank s = null;
 
-        List providers = getSoundbankReaders();
+        List<SoundbankReader> providers = getSoundbankReaders();
 
         for(int i = 0; i < providers.size(); i++) {
-            sp = (SoundbankReader)providers.get(i);
+            sp = providers.get(i);
             s = sp.getSoundbank(stream);
 
             if( s!= null) {
@@ -559,10 +559,10 @@
         SoundbankReader sp = null;
         Soundbank s = null;
 
-        List providers = getSoundbankReaders();
+        List<SoundbankReader> providers = getSoundbankReaders();
 
         for(int i = 0; i < providers.size(); i++) {
-            sp = (SoundbankReader)providers.get(i);
+            sp = providers.get(i);
             s = sp.getSoundbank(url);
 
             if( s!= null) {
@@ -591,10 +591,10 @@
         SoundbankReader sp = null;
         Soundbank s = null;
 
-        List providers = getSoundbankReaders();
+        List<SoundbankReader> providers = getSoundbankReaders();
 
         for(int i = 0; i < providers.size(); i++) {
-            sp = (SoundbankReader)providers.get(i);
+            sp = providers.get(i);
             s = sp.getSoundbank(file);
 
             if( s!= null) {
@@ -641,11 +641,11 @@
     public static MidiFileFormat getMidiFileFormat(InputStream stream)
         throws InvalidMidiDataException, IOException {
 
-        List providers = getMidiFileReaders();
+        List<MidiFileReader> providers = getMidiFileReaders();
         MidiFileFormat format = null;
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiFileReader reader = (MidiFileReader) providers.get(i);
+            MidiFileReader reader =  providers.get(i);
             try {
                 format = reader.getMidiFileFormat( stream ); // throws IOException
                 break;
@@ -687,11 +687,11 @@
     public static MidiFileFormat getMidiFileFormat(URL url)
         throws InvalidMidiDataException, IOException {
 
-        List providers = getMidiFileReaders();
+        List<MidiFileReader> providers = getMidiFileReaders();
         MidiFileFormat format = null;
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiFileReader reader = (MidiFileReader) providers.get(i);
+            MidiFileReader reader = providers.get(i);
             try {
                 format = reader.getMidiFileFormat( url ); // throws IOException
                 break;
@@ -733,11 +733,11 @@
     public static MidiFileFormat getMidiFileFormat(File file)
         throws InvalidMidiDataException, IOException {
 
-        List providers = getMidiFileReaders();
+        List<MidiFileReader> providers = getMidiFileReaders();
         MidiFileFormat format = null;
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiFileReader reader = (MidiFileReader) providers.get(i);
+            MidiFileReader reader = providers.get(i);
             try {
                 format = reader.getMidiFileFormat( file ); // throws IOException
                 break;
@@ -788,11 +788,11 @@
     public static Sequence getSequence(InputStream stream)
         throws InvalidMidiDataException, IOException {
 
-        List providers = getMidiFileReaders();
+        List<MidiFileReader> providers = getMidiFileReaders();
         Sequence sequence = null;
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiFileReader reader = (MidiFileReader) providers.get(i);
+            MidiFileReader reader = providers.get(i);
             try {
                 sequence = reader.getSequence( stream ); // throws IOException
                 break;
@@ -832,11 +832,11 @@
     public static Sequence getSequence(URL url)
         throws InvalidMidiDataException, IOException {
 
-        List providers = getMidiFileReaders();
+        List<MidiFileReader> providers = getMidiFileReaders();
         Sequence sequence = null;
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiFileReader reader = (MidiFileReader) providers.get(i);
+            MidiFileReader reader = providers.get(i);
             try {
                 sequence = reader.getSequence( url ); // throws IOException
                 break;
@@ -876,11 +876,11 @@
     public static Sequence getSequence(File file)
         throws InvalidMidiDataException, IOException {
 
-        List providers = getMidiFileReaders();
+        List<MidiFileReader> providers = getMidiFileReaders();
         Sequence sequence = null;
 
         for(int i = 0; i < providers.size(); i++) {
-            MidiFileReader reader = (MidiFileReader) providers.get(i);
+            MidiFileReader reader = providers.get(i);
             try {
                 sequence = reader.getSequence( file ); // throws IOException
                 break;
@@ -905,13 +905,13 @@
      */
     public static int[] getMidiFileTypes() {
 
-        List providers = getMidiFileWriters();
-        Set allTypes = new HashSet();
+        List<MidiFileWriter> providers = getMidiFileWriters();
+        Set<Integer> allTypes = new HashSet<>();
 
         // gather from all the providers
 
         for (int i = 0; i < providers.size(); i++ ) {
-            MidiFileWriter writer = (MidiFileWriter) providers.get(i);
+            MidiFileWriter writer = providers.get(i);
             int[] types = writer.getMidiFileTypes();
             for (int j = 0; j < types.length; j++ ) {
                 allTypes.add(new Integer(types[j]));
@@ -919,9 +919,9 @@
         }
         int resultTypes[] = new int[allTypes.size()];
         int index = 0;
-        Iterator iterator = allTypes.iterator();
+        Iterator<Integer> iterator = allTypes.iterator();
         while (iterator.hasNext()) {
-            Integer integer = (Integer) iterator.next();
+            Integer integer = iterator.next();
             resultTypes[index++] = integer.intValue();
         }
         return resultTypes;
@@ -937,10 +937,10 @@
      */
     public static boolean isFileTypeSupported(int fileType) {
 
-        List providers = getMidiFileWriters();
+        List<MidiFileWriter> providers = getMidiFileWriters();
 
         for (int i = 0; i < providers.size(); i++ ) {
-            MidiFileWriter writer = (MidiFileWriter) providers.get(i);
+            MidiFileWriter writer = providers.get(i);
             if( writer.isFileTypeSupported(fileType)) {
                 return true;
             }
@@ -959,13 +959,13 @@
      */
     public static int[] getMidiFileTypes(Sequence sequence) {
 
-        List providers = getMidiFileWriters();
-        Set allTypes = new HashSet();
+        List<MidiFileWriter> providers = getMidiFileWriters();
+        Set<Integer> allTypes = new HashSet<>();
 
         // gather from all the providers
 
         for (int i = 0; i < providers.size(); i++ ) {
-            MidiFileWriter writer = (MidiFileWriter) providers.get(i);
+            MidiFileWriter writer = providers.get(i);
             int[] types = writer.getMidiFileTypes(sequence);
             for (int j = 0; j < types.length; j++ ) {
                 allTypes.add(new Integer(types[j]));
@@ -973,9 +973,9 @@
         }
         int resultTypes[] = new int[allTypes.size()];
         int index = 0;
-        Iterator iterator = allTypes.iterator();
+        Iterator<Integer> iterator = allTypes.iterator();
         while (iterator.hasNext()) {
-            Integer integer = (Integer) iterator.next();
+            Integer integer = iterator.next();
             resultTypes[index++] = integer.intValue();
         }
         return resultTypes;
@@ -993,10 +993,10 @@
      */
     public static boolean isFileTypeSupported(int fileType, Sequence sequence) {
 
-        List providers = getMidiFileWriters();
+        List<MidiFileWriter> providers = getMidiFileWriters();
 
         for (int i = 0; i < providers.size(); i++ ) {
-            MidiFileWriter writer = (MidiFileWriter) providers.get(i);
+            MidiFileWriter writer = providers.get(i);
             if( writer.isFileTypeSupported(fileType,sequence)) {
                 return true;
             }
@@ -1020,12 +1020,12 @@
      */
     public static int write(Sequence in, int fileType, OutputStream out) throws IOException {
 
-        List providers = getMidiFileWriters();
+        List<MidiFileWriter> providers = getMidiFileWriters();
         //$$fb 2002-04-17: Fix for 4635287: Standard MidiFileWriter cannot write empty Sequences
         int bytesWritten = -2;
 
         for (int i = 0; i < providers.size(); i++ ) {
-            MidiFileWriter writer = (MidiFileWriter) providers.get(i);
+            MidiFileWriter writer = providers.get(i);
             if( writer.isFileTypeSupported( fileType, in ) ) {
 
                 bytesWritten = writer.write(in, fileType, out);
@@ -1054,12 +1054,12 @@
      */
     public static int write(Sequence in, int type, File out) throws IOException {
 
-        List providers = getMidiFileWriters();
+        List<MidiFileWriter> providers = getMidiFileWriters();
         //$$fb 2002-04-17: Fix for 4635287: Standard MidiFileWriter cannot write empty Sequences
         int bytesWritten = -2;
 
         for (int i = 0; i < providers.size(); i++ ) {
-            MidiFileWriter writer = (MidiFileWriter) providers.get(i);
+            MidiFileWriter writer = providers.get(i);
             if( writer.isFileTypeSupported( type, in ) ) {
 
                 bytesWritten = writer.write(in, type, out);
@@ -1075,24 +1075,24 @@
 
 
     // HELPER METHODS
-
-    private static List getMidiDeviceProviders() {
-        return getProviders(MidiDeviceProvider.class);
+    @SuppressWarnings("unchecked")
+    private static List<MidiDeviceProvider> getMidiDeviceProviders() {
+        return (List<MidiDeviceProvider>) getProviders(MidiDeviceProvider.class);
     }
 
-
-    private static List getSoundbankReaders() {
-        return getProviders(SoundbankReader.class);
+    @SuppressWarnings("unchecked")
+    private static List<SoundbankReader> getSoundbankReaders() {
+        return (List<SoundbankReader>) getProviders(SoundbankReader.class);
     }
 
-
-    private static List getMidiFileWriters() {
-        return getProviders(MidiFileWriter.class);
+    @SuppressWarnings("unchecked")
+    private static List<MidiFileWriter> getMidiFileWriters() {
+        return (List<MidiFileWriter>) getProviders(MidiFileWriter.class);
     }
 
-
-    private static List getMidiFileReaders() {
-        return getProviders(MidiFileReader.class);
+    @SuppressWarnings("unchecked")
+    private static List<MidiFileReader> getMidiFileReaders() {
+        return (List<MidiFileReader>) getProviders(MidiFileReader.class);
     }
 
 
@@ -1109,7 +1109,7 @@
      * Sequencer.class, Receiver.class or Transmitter.class.
      * @throws  MidiUnavalableException on failure.
      */
-    private static MidiDevice getDefaultDeviceWrapper(Class deviceClass)
+    private static MidiDevice getDefaultDeviceWrapper(Class<?> deviceClass)
         throws MidiUnavailableException{
         try {
             return getDefaultDevice(deviceClass);
@@ -1128,8 +1128,8 @@
      * Sequencer.class, Receiver.class or Transmitter.class.
      * @throws  IllegalArgumentException on failure.
      */
-    private static MidiDevice getDefaultDevice(Class deviceClass) {
-        List providers = getMidiDeviceProviders();
+    private static MidiDevice getDefaultDevice(Class<?> deviceClass) {
+        List<MidiDeviceProvider> providers = getMidiDeviceProviders();
         String providerClassName = JDK13Services.getDefaultProviderClassName(deviceClass);
         String instanceName = JDK13Services.getDefaultInstanceName(deviceClass);
         MidiDevice device;
@@ -1179,9 +1179,10 @@
         @return A MidiDeviceProvider of the requested class, or null if none
         is found.
     */
-    private static MidiDeviceProvider getNamedProvider(String providerClassName, List providers) {
+    private static MidiDeviceProvider getNamedProvider(String providerClassName,
+                                                       List<MidiDeviceProvider> providers) {
         for(int i = 0; i < providers.size(); i++) {
-            MidiDeviceProvider provider = (MidiDeviceProvider) providers.get(i);
+            MidiDeviceProvider provider = providers.get(i);
             if (provider.getClass().getName().equals(providerClassName)) {
                 return provider;
             }
@@ -1200,7 +1201,7 @@
     */
     private static MidiDevice getNamedDevice(String deviceName,
                                              MidiDeviceProvider provider,
-                                             Class deviceClass) {
+                                             Class<?> deviceClass) {
         MidiDevice device;
         // try to get MIDI port
         device = getNamedDevice(deviceName, provider, deviceClass,
@@ -1232,7 +1233,7 @@
      */
     private static MidiDevice getNamedDevice(String deviceName,
                                              MidiDeviceProvider provider,
-                                             Class deviceClass,
+                                             Class<?> deviceClass,
                                              boolean allowSynthesizer,
                                              boolean allowSequencer) {
         MidiDevice.Info[] infos = provider.getDeviceInfo();
@@ -1259,8 +1260,8 @@
         @return A Mixer matching the requirements, or null if none is found.
     */
     private static MidiDevice getNamedDevice(String deviceName,
-                                             List providers,
-                                             Class deviceClass) {
+                                             List<MidiDeviceProvider> providers,
+                                             Class<?> deviceClass) {
         MidiDevice device;
         // try to get MIDI port
         device = getNamedDevice(deviceName, providers, deviceClass,
@@ -1292,12 +1293,12 @@
         @return A Mixer matching the requirements, or null if none is found.
      */
     private static MidiDevice getNamedDevice(String deviceName,
-                                             List providers,
-                                             Class deviceClass,
+                                             List<MidiDeviceProvider> providers,
+                                             Class<?> deviceClass,
                                              boolean allowSynthesizer,
                                              boolean allowSequencer) {
         for(int i = 0; i < providers.size(); i++) {
-            MidiDeviceProvider provider = (MidiDeviceProvider) providers.get(i);
+            MidiDeviceProvider provider = providers.get(i);
             MidiDevice device = getNamedDevice(deviceName, provider,
                                                deviceClass,
                                                allowSynthesizer,
@@ -1318,7 +1319,7 @@
         appropriate device is found.
     */
     private static MidiDevice getFirstDevice(MidiDeviceProvider provider,
-                                             Class deviceClass) {
+                                             Class<?> deviceClass) {
         MidiDevice device;
         // try to get MIDI port
         device = getFirstDevice(provider, deviceClass,
@@ -1348,7 +1349,7 @@
         appropriate device is found.
      */
     private static MidiDevice getFirstDevice(MidiDeviceProvider provider,
-                                             Class deviceClass,
+                                             Class<?> deviceClass,
                                              boolean allowSynthesizer,
                                              boolean allowSequencer) {
         MidiDevice.Info[] infos = provider.getDeviceInfo();
@@ -1371,8 +1372,8 @@
         @return A MidiDevice that is considered appropriate, or null
         if none is found.
     */
-    private static MidiDevice getFirstDevice(List providers,
-                                             Class deviceClass) {
+    private static MidiDevice getFirstDevice(List<MidiDeviceProvider> providers,
+                                             Class<?> deviceClass) {
         MidiDevice device;
         // try to get MIDI port
         device = getFirstDevice(providers, deviceClass,
@@ -1402,12 +1403,12 @@
         @return A MidiDevice that is considered appropriate, or null
         if none is found.
      */
-    private static MidiDevice getFirstDevice(List providers,
-                                             Class deviceClass,
+    private static MidiDevice getFirstDevice(List<MidiDeviceProvider> providers,
+                                             Class<?> deviceClass,
                                              boolean allowSynthesizer,
                                              boolean allowSequencer) {
         for(int i = 0; i < providers.size(); i++) {
-            MidiDeviceProvider provider = (MidiDeviceProvider) providers.get(i);
+            MidiDeviceProvider provider = providers.get(i);
             MidiDevice device = getFirstDevice(provider, deviceClass,
                                                allowSynthesizer,
                                                allowSequencer);
@@ -1441,11 +1442,11 @@
         rules given above, false otherwise.
     */
     private static boolean isAppropriateDevice(MidiDevice device,
-                                               Class deviceClass,
+                                               Class<?> deviceClass,
                                                boolean allowSynthesizer,
                                                boolean allowSequencer) {
         if (deviceClass.isInstance(device)) {
-            // This clause is for deviceClass being either Synthesizer
+           // This clause is for deviceClass being either Synthesizer
             // or Sequencer.
             return true;
         } else {
@@ -1479,7 +1480,7 @@
      * @return a List of instances of providers for the requested service.
      * If no providers are available, a List of length 0 will be returned.
      */
-    private static List getProviders(Class providerClass) {
-        return JDK13Services.getProviders(providerClass);
+     private static List<?> getProviders(Class<?> providerClass) {
+         return JDK13Services.getProviders(providerClass);
     }
 }
--- a/src/share/classes/javax/sound/midi/SoundbankResource.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/midi/SoundbankResource.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
     /**
      * The class used to represent the sample's data.
      */
-    private final Class dataClass;
+    private final Class<?> dataClass;
 
 
     /**
--- a/src/share/classes/javax/sound/midi/Track.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/midi/Track.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,10 +66,10 @@
     // TODO: use arrays for faster access
 
     // the list containing the events
-    private ArrayList eventsList = new ArrayList();
+    private ArrayList<MidiEvent> eventsList = new ArrayList<>();
 
     // use a hashset to detect duplicate events in add(MidiEvent)
-    private HashSet set = new HashSet();
+    private HashSet<MidiEvent> set = new HashSet<>();
 
     private MidiEvent eotEvent;
 
@@ -108,7 +108,7 @@
                 // get the last event
                 MidiEvent lastEvent = null;
                 if (eventsCount > 0) {
-                    lastEvent = (MidiEvent) eventsList.get(eventsCount - 1);
+                    lastEvent = eventsList.get(eventsCount - 1);
                 }
                 // sanity check that we have a correct end-of-track
                 if (lastEvent != eotEvent) {
@@ -148,7 +148,7 @@
                 // tick order
                 int i = eventsCount;
                 for ( ; i > 0; i--) {
-                    if (event.getTick() >= ((MidiEvent)eventsList.get(i-1)).getTick()) {
+                    if (event.getTick() >= (eventsList.get(i-1)).getTick()) {
                         break;
                     }
                 }
@@ -220,7 +220,7 @@
     public MidiEvent get(int index) throws ArrayIndexOutOfBoundsException {
         try {
             synchronized(eventsList) {
-                return (MidiEvent)eventsList.get(index);
+                return eventsList.get(index);
             }
         } catch (IndexOutOfBoundsException ioobe) {
             throw new ArrayIndexOutOfBoundsException(ioobe.getMessage());
@@ -253,7 +253,7 @@
         long ret = 0;
         synchronized (eventsList) {
             if (eventsList.size() > 0) {
-                ret = ((MidiEvent)eventsList.get(eventsList.size() - 1)).getTick();
+                ret = (eventsList.get(eventsList.size() - 1)).getTick();
             }
         }
         return ret;
--- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,36 +25,29 @@
 
 package javax.sound.sampled;
 
-import java.io.File;
-import java.io.OutputStream;
-import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-
 /**
- * An instance of the <code>AudioFileFormat</code> class describes
- * an audio file, including the file type, the file's length in bytes,
- * the length in sample frames of the audio data contained in the file,
- * and the format of the audio data.
+ * An instance of the {@code AudioFileFormat} class describes an audio file,
+ * including the file type, the file's length in bytes, the length in sample
+ * frames of the audio data contained in the file, and the format of the audio
+ * data.
  * <p>
- * The <code>{@link AudioSystem}</code> class includes methods for determining the format
- * of an audio file, obtaining an audio input stream from an audio file, and
+ * The {@link AudioSystem} class includes methods for determining the format of
+ * an audio file, obtaining an audio input stream from an audio file, and
  * writing an audio file from an audio input stream.
- *
- * <p>An <code>AudioFileFormat</code> object can
- * include a set of properties. A property is a pair of key and value:
- * the key is of type <code>String</code>, the associated property
- * value is an arbitrary object.
- * Properties specify additional informational
- * meta data (like a author, copyright, or file duration).
- * Properties are optional information, and file reader and file
- * writer implementations are not required to provide or
- * recognize properties.
- *
- * <p>The following table lists some common properties that should
- * be used in implementations:
+ * <p>
+ * An {@code AudioFileFormat} object can include a set of properties. A property
+ * is a pair of key and value: the key is of type {@code String}, the associated
+ * property value is an arbitrary object. Properties specify additional
+ * informational meta data (like a author, copyright, or file duration).
+ * Properties are optional information, and file reader and file writer
+ * implementations are not required to provide or recognize properties.
+ * <p>
+ * The following table lists some common properties that should be used in
+ * implementations:
  *
  * <table border=1>
  *  <caption>Audio File Format Properties</caption>
@@ -104,17 +97,13 @@
  */
 public class AudioFileFormat {
 
-
-    // INSTANCE VARIABLES
-
-
     /**
      * File type.
      */
     private Type type;
 
     /**
-     * File length in bytes
+     * File length in bytes.
      */
     private int byteLength;
 
@@ -124,25 +113,26 @@
     private AudioFormat format;
 
     /**
-     * Audio data length in sample frames
+     * Audio data length in sample frames.
      */
     private int frameLength;
 
-
-    /** The set of properties */
+    /**
+     * The set of properties.
+     */
     private HashMap<String, Object> properties;
 
-
     /**
-     * Constructs an audio file format object.
-     * This protected constructor is intended for use by providers of file-reading
-     * services when returning information about an audio file or about supported audio file
-     * formats.
-     * @param type the type of the audio file
-     * @param byteLength the length of the file in bytes, or <code>AudioSystem.NOT_SPECIFIED</code>
-     * @param format the format of the audio data contained in the file
-     * @param frameLength the audio data length in sample frames, or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Constructs an audio file format object. This protected constructor is
+     * intended for use by providers of file-reading services when returning
+     * information about an audio file or about supported audio file formats.
      *
+     * @param  type the type of the audio file
+     * @param  byteLength the length of the file in bytes, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
+     * @param  format the format of the audio data contained in the file
+     * @param  frameLength the audio data length in sample frames, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      * @see #getType
      */
     protected AudioFileFormat(Type type, int byteLength, AudioFormat format, int frameLength) {
@@ -154,14 +144,15 @@
         this.properties = null;
     }
 
-
     /**
-     * Constructs an audio file format object.
-     * This public constructor may be used by applications to describe the
-     * properties of a requested audio file.
-     * @param type the type of the audio file
-     * @param format the format of the audio data contained in the file
-     * @param frameLength the audio data length in sample frames, or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Constructs an audio file format object. This public constructor may be
+     * used by applications to describe the properties of a requested audio
+     * file.
+     *
+     * @param  type the type of the audio file
+     * @param  format the format of the audio data contained in the file
+     * @param  frameLength the audio data length in sample frames, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      */
     public AudioFileFormat(Type type, AudioFormat format, int frameLength) {
 
@@ -170,19 +161,16 @@
     }
 
     /**
-     * Construct an audio file format object with a set of
-     * defined properties.
+     * Construct an audio file format object with a set of defined properties.
      * This public constructor may be used by applications to describe the
-     * properties of a requested audio file. The properties map
-     * will be copied to prevent any changes to it.
+     * properties of a requested audio file. The properties map will be copied
+     * to prevent any changes to it.
      *
-     * @param type        the type of the audio file
-     * @param format      the format of the audio data contained in the file
-     * @param frameLength the audio data length in sample frames, or
-     *                    <code>AudioSystem.NOT_SPECIFIED</code>
-     * @param properties  a <code>Map&lt;String,Object&gt;</code> object
-     *        with properties
-     *
+     * @param  type the type of the audio file
+     * @param  format the format of the audio data contained in the file
+     * @param  frameLength the audio data length in sample frames, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
+     * @param  properties a {@code Map<String, Object>} object with properties
      * @since 1.5
      */
     public AudioFileFormat(Type type, AudioFormat format,
@@ -191,11 +179,10 @@
         this.properties = new HashMap<String, Object>(properties);
     }
 
-
     /**
-     * Obtains the audio file type, such as <code>WAVE</code> or <code>AU</code>.
+     * Obtains the audio file type, such as {@code WAVE} or {@code AU}.
+     *
      * @return the audio file type
-     *
      * @see Type#WAVE
      * @see Type#AU
      * @see Type#AIFF
@@ -207,7 +194,9 @@
     }
 
     /**
-     * Obtains the size in bytes of the entire audio file (not just its audio data).
+     * Obtains the size in bytes of the entire audio file (not just its audio
+     * data).
+     *
      * @return the audio file length in bytes
      * @see AudioSystem#NOT_SPECIFIED
      */
@@ -217,6 +206,7 @@
 
     /**
      * Obtains the format of the audio data contained in the audio file.
+     *
      * @return the audio data format
      */
     public AudioFormat getFormat() {
@@ -224,7 +214,9 @@
     }
 
     /**
-     * Obtains the length of the audio data contained in the file, expressed in sample frames.
+     * Obtains the length of the audio data contained in the file, expressed in
+     * sample frames.
+     *
      * @return the number of sample frames of audio data in the file
      * @see AudioSystem#NOT_SPECIFIED
      */
@@ -233,41 +225,35 @@
     }
 
     /**
-     * Obtain an unmodifiable map of properties.
-     * The concept of properties is further explained in
-     * the {@link AudioFileFormat class description}.
+     * Obtain an unmodifiable map of properties. The concept of properties is
+     * further explained in the {@link AudioFileFormat class description}.
      *
-     * @return a <code>Map&lt;String,Object&gt;</code> object containing
-     *         all properties. If no properties are recognized, an empty map is
-     *         returned.
-     *
+     * @return a {@code Map<String, Object>} object containing all properties.
+     *         If no properties are recognized, an empty map is returned.
      * @see #getProperty(String)
      * @since 1.5
      */
-    public Map<String,Object> properties() {
+    @SuppressWarnings("unchecked") // Cast of result of clone
+    public Map<String, Object> properties() {
         Map<String,Object> ret;
         if (properties == null) {
-            ret = new HashMap<String,Object>(0);
+            ret = new HashMap<>(0);
         } else {
             ret = (Map<String,Object>) (properties.clone());
         }
         return Collections.unmodifiableMap(ret);
     }
 
-
     /**
-     * Obtain the property value specified by the key.
-     * The concept of properties is further explained in
-     * the {@link AudioFileFormat class description}.
+     * Obtain the property value specified by the key. The concept of properties
+     * is further explained in the {@link AudioFileFormat class description}.
+     * <p>
+     * If the specified property is not defined for a particular file format,
+     * this method returns {@code null}.
      *
-     * <p>If the specified property is not defined for a
-     * particular file format, this method returns
-     * <code>null</code>.
-     *
-     * @param key the key of the desired property
-     * @return the value of the property with the specified key,
-     *         or <code>null</code> if the property does not exist.
-     *
+     * @param  key the key of the desired property
+     * @return the value of the property with the specified key, or {@code null}
+     *         if the property does not exist
      * @see #properties()
      * @since 1.5
      */
@@ -278,11 +264,12 @@
         return properties.get(key);
     }
 
-
     /**
      * Provides a string representation of the file format.
+     *
      * @return the file format as a string
      */
+    @Override
     public String toString() {
 
         StringBuffer buf = new StringBuffer();
@@ -307,11 +294,9 @@
         return new String(buf);
     }
 
-
     /**
-     * An instance of the <code>Type</code> class represents one of the
-     * standard types of audio file.  Static instances are provided for the
-     * common types.
+     * An instance of the {@code Type} class represents one of the standard
+     * types of audio file. Static instances are provided for the common types.
      */
     public static class Type {
 
@@ -342,9 +327,6 @@
          */
         public static final Type SND = new Type("SND", "snd");
 
-
-        // INSTANCE VARIABLES
-
         /**
          * File type name.
          */
@@ -355,27 +337,22 @@
          */
         private final String extension;
 
-
-        // CONSTRUCTOR
-
         /**
          * Constructs a file type.
-         * @param name the string that names the file type
-         * @param extension the string that commonly marks the file type
-         * without leading dot.
+         *
+         * @param  name the string that names the file type
+         * @param  extension the string that commonly marks the file type
+         *         without leading dot
          */
         public Type(String name, String extension) {
-
             this.name = name;
             this.extension = extension;
         }
 
-
-        // METHODS
-
         /**
-         * Finalizes the equals method
+         * Finalizes the equals method.
          */
+        @Override
         public final boolean equals(Object obj) {
             if (toString() == null) {
                 return (obj != null) && (obj.toString() == null);
@@ -387,8 +364,9 @@
         }
 
         /**
-         * Finalizes the hashCode method
+         * Finalizes the hashCode method.
          */
+        @Override
         public final int hashCode() {
             if (toString() == null) {
                 return 0;
@@ -397,22 +375,23 @@
         }
 
         /**
-         * Provides the file type's name as the <code>String</code> representation
-         * of the file type.
+         * Provides the file type's name as the {@code String} representation of
+         * the file type.
+         *
          * @return the file type's name
          */
+        @Override
         public final String toString() {
             return name;
         }
 
         /**
          * Obtains the common file name extension for this file type.
+         *
          * @return file type extension
          */
         public String getExtension() {
             return extension;
         }
-
-    } // class Type
-
-} // class AudioFileFormat
+    }
+}
--- a/src/share/classes/javax/sound/sampled/AudioFormat.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/AudioFormat.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,59 +30,63 @@
 import java.util.Map;
 
 /**
- * <code>AudioFormat</code> is the class that specifies a particular arrangement of data in a sound stream.
- * By examining the information stored in the audio format, you can discover how to interpret the bits in the
- * binary sound data.
+ * {@code AudioFormat} is the class that specifies a particular arrangement of
+ * data in a sound stream. By examining the information stored in the audio
+ * format, you can discover how to interpret the bits in the binary sound data.
  * <p>
- * Every data line has an audio format associated with its data stream. The audio format of a source (playback) data line indicates
- * what kind of data the data line expects to receive for output.  For a target (capture) data line, the audio format specifies the kind
- * of the data that can be read from the line.
- * Sound files also have audio formats, of course.  The <code>{@link AudioFileFormat}</code>
- * class encapsulates an <code>AudioFormat</code> in addition to other,
- * file-specific information.  Similarly, an <code>{@link AudioInputStream}</code> has an
- * <code>AudioFormat</code>.
+ * Every data line has an audio format associated with its data stream. The
+ * audio format of a source (playback) data line indicates what kind of data the
+ * data line expects to receive for output. For a target (capture) data line,
+ * the audio format specifies the kind of the data that can be read from the
+ * line.
+ * Sound files also have audio formats, of course. The {@link AudioFileFormat}
+ * class encapsulates an {@code AudioFormat} in addition to other, file-specific
+ * information. Similarly, an {@link AudioInputStream} has an
+ * {@code AudioFormat}.
+ * <p>
+ * The {@code AudioFormat} class accommodates a number of common sound-file
+ * encoding techniques, including pulse-code modulation (PCM), mu-law encoding,
+ * and a-law encoding. These encoding techniques are predefined, but service
+ * providers can create new encoding types. The encoding that a specific format
+ * uses is named by its {@code encoding} field.
  * <p>
- * The <code>AudioFormat</code> class accommodates a number of common sound-file encoding techniques, including
- * pulse-code modulation (PCM), mu-law encoding, and a-law encoding.  These encoding techniques are predefined,
- * but service providers can create new encoding types.
- * The encoding that a specific format uses is named by its <code>encoding</code> field.
- *<p>
- * In addition to the encoding, the audio format includes other properties that further specify the exact
- * arrangement of the data.
- * These include the number of channels, sample rate, sample size, byte order, frame rate, and frame size.
- * Sounds may have different numbers of audio channels: one for mono, two for stereo.
- * The sample rate measures how many "snapshots" (samples) of the sound pressure are taken per second, per channel.
- * (If the sound is stereo rather than mono, two samples are actually measured at each instant of time: one for the left channel,
- * and another for the right channel; however, the sample rate still measures the number per channel, so the rate is the same
- * regardless of the number of channels.   This is the standard use of the term.)
- * The sample size indicates how many bits are used to store each snapshot; 8 and 16 are typical values.
- * For 16-bit samples (or any other sample size larger than a byte),
- * byte order is important; the bytes in each sample are arranged in
- * either the "little-endian" or "big-endian" style.
- * For encodings like PCM, a frame consists of the set of samples for all channels at a given
- * point in time, and so the size of a frame (in bytes) is always equal to the size of a sample (in bytes) times
- * the number of channels.  However, with some other sorts of encodings a frame can contain
- * a bundle of compressed data for a whole series of samples, as well as additional, non-sample
- * data.  For such encodings, the sample rate and sample size refer to the data after it is decoded into PCM,
- * and so they are completely different from the frame rate and frame size.
- *
- * <p>An <code>AudioFormat</code> object can include a set of
- * properties. A property is a pair of key and value: the key
- * is of type <code>String</code>, the associated property
- * value is an arbitrary object. Properties specify
- * additional format specifications, like the bit rate for
- * compressed formats. Properties are mainly used as a means
- * to transport additional information of the audio format
- * to and from the service providers. Therefore, properties
- * are ignored in the {@link #matches(AudioFormat)} method.
- * However, methods which rely on the installed service
- * providers, like {@link AudioSystem#isConversionSupported
- * (AudioFormat, AudioFormat) isConversionSupported} may consider
- * properties, depending on the respective service provider
- * implementation.
- *
- * <p>The following table lists some common properties which
- * service providers should use, if applicable:
+ * In addition to the encoding, the audio format includes other properties that
+ * further specify the exact arrangement of the data. These include the number
+ * of channels, sample rate, sample size, byte order, frame rate, and frame
+ * size. Sounds may have different numbers of audio channels: one for mono, two
+ * for stereo. The sample rate measures how many "snapshots" (samples) of the
+ * sound pressure are taken per second, per channel. (If the sound is stereo
+ * rather than mono, two samples are actually measured at each instant of time:
+ * one for the left channel, and another for the right channel; however, the
+ * sample rate still measures the number per channel, so the rate is the same
+ * regardless of the number of channels. This is the standard use of the term.)
+ * The sample size indicates how many bits are used to store each snapshot; 8
+ * and 16 are typical values. For 16-bit samples (or any other sample size
+ * larger than a byte), byte order is important; the bytes in each sample are
+ * arranged in either the "little-endian" or "big-endian" style. For encodings
+ * like PCM, a frame consists of the set of samples for all channels at a given
+ * point in time, and so the size of a frame (in bytes) is always equal to the
+ * size of a sample (in bytes) times the number of channels. However, with some
+ * other sorts of encodings a frame can contain a bundle of compressed data for
+ * a whole series of samples, as well as additional, non-sample data. For such
+ * encodings, the sample rate and sample size refer to the data after it is
+ * decoded into PCM, and so they are completely different from the frame rate
+ * and frame size.
+ * <p>
+ * An {@code AudioFormat} object can include a set of properties. A property is
+ * a pair of key and value: the key is of type {@code String}, the associated
+ * property value is an arbitrary object. Properties specify additional format
+ * specifications, like the bit rate for compressed formats. Properties are
+ * mainly used as a means to transport additional information of the audio
+ * format to and from the service providers. Therefore, properties are ignored
+ * in the {@link #matches(AudioFormat)} method. However, methods which rely on
+ * the installed service providers, like
+ * {@link AudioSystem#isConversionSupported (AudioFormat, AudioFormat)
+ * isConversionSupported} may consider properties, depending on the respective
+ * service provider implementation.
+ * <p>
+ * The following table lists some common properties which service providers
+ * should use, if applicable:
  *
  * <table border=0>
  *  <caption>Audio Format Properties</caption>
@@ -99,7 +103,7 @@
  *  <tr>
  *   <td>&quot;vbr&quot;</td>
  *   <td>{@link java.lang.Boolean Boolean}</td>
- *   <td><code>true</code>, if the file is encoded in variable bit
+ *   <td>{@code true}, if the file is encoded in variable bit
  *       rate (VBR)</td>
  *  </tr>
  *  <tr>
@@ -108,11 +112,10 @@
  *   <td>encoding/conversion quality, 1..100</td>
  *  </tr>
  * </table>
- *
- * <p>Vendors of service providers (plugins) are encouraged
- * to seek information about other already established
- * properties in third party plugins, and follow the same
- * conventions.
+ * <p>
+ * Vendors of service providers (plugins) are encouraged to seek information
+ * about other already established properties in third party plugins, and follow
+ * the same conventions.
  *
  * @author Kara Kytle
  * @author Florian Bomers
@@ -124,16 +127,14 @@
  */
 public class AudioFormat {
 
-    // INSTANCE VARIABLES
-
-
     /**
      * The audio encoding technique used by this format.
      */
     protected Encoding encoding;
 
     /**
-     * The number of samples played or recorded per second, for sounds that have this format.
+     * The number of samples played or recorded per second, for sounds that have
+     * this format.
      */
     protected float sampleRate;
 
@@ -153,34 +154,37 @@
     protected int frameSize;
 
     /**
-     * The number of frames played or recorded per second, for sounds that have this format.
+     * The number of frames played or recorded per second, for sounds that have
+     * this format.
      */
     protected float frameRate;
 
     /**
-     * Indicates whether the audio data is stored in big-endian or little-endian order.
+     * Indicates whether the audio data is stored in big-endian or little-endian
+     * order.
      */
     protected boolean bigEndian;
 
-
-    /** The set of properties */
+    /**
+     * The set of properties.
+     */
     private HashMap<String, Object> properties;
 
-
     /**
-     * Constructs an <code>AudioFormat</code> with the given parameters.
-     * The encoding specifies the convention used to represent the data.
-     * The other parameters are further explained in the {@link AudioFormat
-     * class description}.
-     * @param encoding                  the audio encoding technique
-     * @param sampleRate                the number of samples per second
-     * @param sampleSizeInBits  the number of bits in each sample
-     * @param channels                  the number of channels (1 for mono, 2 for stereo, and so on)
-     * @param frameSize                 the number of bytes in each frame
-     * @param frameRate                 the number of frames per second
-     * @param bigEndian                 indicates whether the data for a single sample
-     *                                                  is stored in big-endian byte order (<code>false</code>
-     *                                                  means little-endian)
+     * Constructs an {@code AudioFormat} with the given parameters. The encoding
+     * specifies the convention used to represent the data. The other parameters
+     * are further explained in the {@link AudioFormat class description}.
+     *
+     * @param  encoding the audio encoding technique
+     * @param  sampleRate the number of samples per second
+     * @param  sampleSizeInBits the number of bits in each sample
+     * @param  channels the number of channels (1 for mono, 2 for stereo,
+     *         and so on)
+     * @param  frameSize the number of bytes in each frame
+     * @param  frameRate the number of frames per second
+     * @param  bigEndian indicates whether the data for a single sample is
+     *         stored in big-endian byte order ({@code false} means
+     *         little-endian)
      */
     public AudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits,
                        int channels, int frameSize, float frameRate, boolean bigEndian) {
@@ -195,25 +199,22 @@
         this.properties = null;
     }
 
-
     /**
-     * Constructs an <code>AudioFormat</code> with the given parameters.
-     * The encoding specifies the convention used to represent the data.
-     * The other parameters are further explained in the {@link AudioFormat
-     * class description}.
-     * @param encoding         the audio encoding technique
-     * @param sampleRate       the number of samples per second
-     * @param sampleSizeInBits the number of bits in each sample
-     * @param channels         the number of channels (1 for mono, 2 for
-     *                         stereo, and so on)
-     * @param frameSize        the number of bytes in each frame
-     * @param frameRate        the number of frames per second
-     * @param bigEndian        indicates whether the data for a single sample
-     *                         is stored in big-endian byte order
-     *                         (<code>false</code> means little-endian)
-     * @param properties       a <code>Map&lt;String,Object&gt;</code> object
-     *                         containing format properties
+     * Constructs an {@code AudioFormat} with the given parameters. The encoding
+     * specifies the convention used to represent the data. The other parameters
+     * are further explained in the {@link AudioFormat class description}.
      *
+     * @param  encoding the audio encoding technique
+     * @param  sampleRate the number of samples per second
+     * @param  sampleSizeInBits the number of bits in each sample
+     * @param  channels the number of channels (1 for mono, 2 for stereo, and so
+     *         on)
+     * @param  frameSize the number of bytes in each frame
+     * @param  frameRate the number of frames per second
+     * @param  bigEndian indicates whether the data for a single sample is
+     *         stored in big-endian byte order ({@code false} means little-endian)
+     * @param  properties a {@code Map<String, Object>} object containing format
+     *         properties
      * @since 1.5
      */
     public AudioFormat(Encoding encoding, float sampleRate,
@@ -225,20 +226,20 @@
         this.properties = new HashMap<String, Object>(properties);
     }
 
-
     /**
-     * Constructs an <code>AudioFormat</code> with a linear PCM encoding and
-     * the given parameters.  The frame size is set to the number of bytes
-     * required to contain one sample from each channel, and the frame rate
-     * is set to the sample rate.
+     * Constructs an {@code AudioFormat} with a linear PCM encoding and the
+     * given parameters. The frame size is set to the number of bytes required
+     * to contain one sample from each channel, and the frame rate is set to the
+     * sample rate.
      *
-     * @param sampleRate                the number of samples per second
-     * @param sampleSizeInBits  the number of bits in each sample
-     * @param channels                  the number of channels (1 for mono, 2 for stereo, and so on)
-     * @param signed                    indicates whether the data is signed or unsigned
-     * @param bigEndian                 indicates whether the data for a single sample
-     *                                                  is stored in big-endian byte order (<code>false</code>
-     *                                                  means little-endian)
+     * @param  sampleRate the number of samples per second
+     * @param  sampleSizeInBits the number of bits in each sample
+     * @param  channels the number of channels (1 for mono, 2 for stereo, and so
+     *         on)
+     * @param  signed indicates whether the data is signed or unsigned
+     * @param  bigEndian indicates whether the data for a single sample is
+     *         stored in big-endian byte order ({@code false} means
+     *         little-endian)
      */
     public AudioFormat(float sampleRate, int sampleSizeInBits,
                        int channels, boolean signed, boolean bigEndian) {
@@ -269,19 +270,17 @@
     }
 
     /**
-     * Obtains the sample rate.
-     * For compressed formats, the return value is the sample rate of the uncompressed
-     * audio data.
-     * When this AudioFormat is used for queries (e.g. {@link
-     * AudioSystem#isConversionSupported(AudioFormat, AudioFormat)
-     * AudioSystem.isConversionSupported}) or capabilities (e.g. {@link
-     * DataLine.Info#getFormats() DataLine.Info.getFormats}), a sample rate of
-     * <code>AudioSystem.NOT_SPECIFIED</code> means that any sample rate is
-     * acceptable. <code>AudioSystem.NOT_SPECIFIED</code> is also returned when
-     * the sample rate is not defined for this audio format.
-     * @return the number of samples per second,
-     * or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Obtains the sample rate. For compressed formats, the return value is the
+     * sample rate of the uncompressed audio data. When this AudioFormat is used
+     * for queries (e.g. {@link AudioSystem#isConversionSupported(AudioFormat,
+     * AudioFormat) AudioSystem.isConversionSupported}) or capabilities (e.g.
+     * {@link DataLine.Info#getFormats DataLine.Info.getFormats}), a sample rate
+     * of {@code AudioSystem.NOT_SPECIFIED} means that any sample rate is
+     * acceptable. {@code AudioSystem.NOT_SPECIFIED} is also returned when the
+     * sample rate is not defined for this audio format.
      *
+     * @return the number of samples per second, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      * @see #getFrameRate()
      * @see AudioSystem#NOT_SPECIFIED
      */
@@ -291,19 +290,18 @@
     }
 
     /**
-     * Obtains the size of a sample.
-     * For compressed formats, the return value is the sample size of the
-     * uncompressed audio data.
-     * When this AudioFormat is used for queries (e.g. {@link
-     * AudioSystem#isConversionSupported(AudioFormat, AudioFormat)
-     * AudioSystem.isConversionSupported}) or capabilities (e.g. {@link
-     * DataLine.Info#getFormats() DataLine.Info.getFormats}), a sample size of
-     * <code>AudioSystem.NOT_SPECIFIED</code> means that any sample size is
-     * acceptable. <code>AudioSystem.NOT_SPECIFIED</code> is also returned when
-     * the sample size is not defined for this audio format.
-     * @return the number of bits in each sample,
-     * or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Obtains the size of a sample. For compressed formats, the return value is
+     * the sample size of the uncompressed audio data. When this AudioFormat is
+     * used for queries (e.g. {@link AudioSystem#isConversionSupported(
+     * AudioFormat,AudioFormat) AudioSystem.isConversionSupported}) or
+     * capabilities (e.g.
+     * {@link DataLine.Info#getFormats DataLine.Info.getFormats}), a sample size
+     * of {@code AudioSystem.NOT_SPECIFIED} means that any sample size is
+     * acceptable. {@code AudioSystem.NOT_SPECIFIED} is also returned when the
+     * sample size is not defined for this audio format.
      *
+     * @return the number of bits in each sample, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      * @see #getFrameSize()
      * @see AudioSystem#NOT_SPECIFIED
      */
@@ -313,16 +311,15 @@
     }
 
     /**
-     * Obtains the number of channels.
-     * When this AudioFormat is used for queries (e.g. {@link
-     * AudioSystem#isConversionSupported(AudioFormat, AudioFormat)
-     * AudioSystem.isConversionSupported}) or capabilities (e.g. {@link
-     * DataLine.Info#getFormats() DataLine.Info.getFormats}), a return value of
-     * <code>AudioSystem.NOT_SPECIFIED</code> means that any (positive) number of channels is
-     * acceptable.
-     * @return The number of channels (1 for mono, 2 for stereo, etc.),
-     * or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Obtains the number of channels. When this AudioFormat is used for queries
+     * (e.g. {@link AudioSystem#isConversionSupported(AudioFormat, AudioFormat)
+     * AudioSystem.isConversionSupported}) or capabilities (e.g.
+     * {@link DataLine.Info#getFormats DataLine.Info.getFormats}), a return
+     * value of {@code AudioSystem.NOT_SPECIFIED} means that any (positive)
+     * number of channels is acceptable.
      *
+     * @return The number of channels (1 for mono, 2 for stereo, etc.), or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      * @see AudioSystem#NOT_SPECIFIED
      */
     public int getChannels() {
@@ -331,17 +328,16 @@
     }
 
     /**
-     * Obtains the frame size in bytes.
-     * When this AudioFormat is used for queries (e.g. {@link
-     * AudioSystem#isConversionSupported(AudioFormat, AudioFormat)
-     * AudioSystem.isConversionSupported}) or capabilities (e.g. {@link
-     * DataLine.Info#getFormats() DataLine.Info.getFormats}), a frame size of
-     * <code>AudioSystem.NOT_SPECIFIED</code> means that any frame size is
-     * acceptable. <code>AudioSystem.NOT_SPECIFIED</code> is also returned when
-     * the frame size is not defined for this audio format.
-     * @return the number of bytes per frame,
-     * or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Obtains the frame size in bytes. When this AudioFormat is used for
+     * queries (e.g. {@link AudioSystem#isConversionSupported(AudioFormat,
+     * AudioFormat) AudioSystem.isConversionSupported}) or capabilities (e.g.
+     * {@link DataLine.Info#getFormats DataLine.Info.getFormats}), a frame size
+     * of {@code AudioSystem.NOT_SPECIFIED} means that any frame size is
+     * acceptable. {@code AudioSystem.NOT_SPECIFIED} is also returned when the
+     * frame size is not defined for this audio format.
      *
+     * @return the number of bytes per frame, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      * @see #getSampleSizeInBits()
      * @see AudioSystem#NOT_SPECIFIED
      */
@@ -351,17 +347,17 @@
     }
 
     /**
-     * Obtains the frame rate in frames per second.
-     * When this AudioFormat is used for queries (e.g. {@link
-     * AudioSystem#isConversionSupported(AudioFormat, AudioFormat)
-     * AudioSystem.isConversionSupported}) or capabilities (e.g. {@link
-     * DataLine.Info#getFormats() DataLine.Info.getFormats}), a frame rate of
-     * <code>AudioSystem.NOT_SPECIFIED</code> means that any frame rate is
-     * acceptable. <code>AudioSystem.NOT_SPECIFIED</code> is also returned when
-     * the frame rate is not defined for this audio format.
-     * @return the number of frames per second,
-     * or <code>AudioSystem.NOT_SPECIFIED</code>
+     * Obtains the frame rate in frames per second. When this AudioFormat is
+     * used for queries (e.g. {@link AudioSystem#isConversionSupported(
+     * AudioFormat,AudioFormat) AudioSystem.isConversionSupported}) or
+     * capabilities (e.g.
+     * {@link DataLine.Info#getFormats DataLine.Info.getFormats}), a frame rate
+     * of {@code AudioSystem.NOT_SPECIFIED} means that any frame rate is
+     * acceptable. {@code AudioSystem.NOT_SPECIFIED} is also returned when the
+     * frame rate is not defined for this audio format.
      *
+     * @return the number of frames per second, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      * @see #getSampleRate()
      * @see AudioSystem#NOT_SPECIFIED
      */
@@ -370,56 +366,49 @@
         return frameRate;
     }
 
-
     /**
      * Indicates whether the audio data is stored in big-endian or little-endian
-     * byte order.  If the sample size is not more than one byte, the return value is
-     * irrelevant.
-     * @return <code>true</code> if the data is stored in big-endian byte order,
-     * <code>false</code> if little-endian
+     * byte order. If the sample size is not more than one byte, the return
+     * value is irrelevant.
+     *
+     * @return {@code true} if the data is stored in big-endian byte order,
+     *         {@code false} if little-endian
      */
     public boolean isBigEndian() {
 
         return bigEndian;
     }
 
-
     /**
-     * Obtain an unmodifiable map of properties.
-     * The concept of properties is further explained in
-     * the {@link AudioFileFormat class description}.
+     * Obtain an unmodifiable map of properties. The concept of properties is
+     * further explained in the {@link AudioFileFormat class description}.
      *
-     * @return a <code>Map&lt;String,Object&gt;</code> object containing
-     *         all properties. If no properties are recognized, an empty map is
-     *         returned.
-     *
+     * @return a {@code Map<String, Object>} object containing all properties.
+     *         If no properties are recognized, an empty map is returned.
      * @see #getProperty(String)
      * @since 1.5
      */
+    @SuppressWarnings("unchecked") // Cast of result of clone.
     public Map<String,Object> properties() {
         Map<String,Object> ret;
         if (properties == null) {
-            ret = new HashMap<String,Object>(0);
+            ret = new HashMap<>(0);
         } else {
             ret = (Map<String,Object>) (properties.clone());
         }
         return Collections.unmodifiableMap(ret);
     }
 
-
     /**
-     * Obtain the property value specified by the key.
-     * The concept of properties is further explained in
-     * the {@link AudioFileFormat class description}.
+     * Obtain the property value specified by the key. The concept of properties
+     * is further explained in the {@link AudioFileFormat class description}.
+     * <p>
+     * If the specified property is not defined for a particular file format,
+     * this method returns {@code null}.
      *
-     * <p>If the specified property is not defined for a
-     * particular file format, this method returns
-     * <code>null</code>.
-     *
-     * @param key the key of the desired property
-     * @return the value of the property with the specified key,
-     *         or <code>null</code> if the property does not exist.
-     *
+     * @param  key the key of the desired property
+     * @return the value of the property with the specified key, or {@code null}
+     *         if the property does not exist
      * @see #properties()
      * @since 1.5
      */
@@ -430,21 +419,18 @@
         return properties.get(key);
     }
 
-
     /**
-     * Indicates whether this format matches the one specified.
-     * To match, two formats must have the same encoding,
-     * and consistent values of the number of channels, sample rate, sample size,
-     * frame rate, and frame size.
-     * The values of the property are consistent if they are equal
-     * or the specified format has the property value
-     * {@code AudioSystem.NOT_SPECIFIED}.
-     * The byte order (big-endian or little-endian) must be the same
-     * if the sample size is greater than one byte.
+     * Indicates whether this format matches the one specified. To match, two
+     * formats must have the same encoding, and consistent values of the number
+     * of channels, sample rate, sample size, frame rate, and frame size. The
+     * values of the property are consistent if they are equal or the specified
+     * format has the property value {@code AudioSystem.NOT_SPECIFIED}. The byte
+     * order (big-endian or little-endian) must be the same if the sample size
+     * is greater than one byte.
      *
-     * @param format format to test for match
+     * @param  format format to test for match
      * @return {@code true} if this format matches the one specified,
-     *         {@code false} otherwise.
+     *         {@code false} otherwise
      */
     public boolean matches(AudioFormat format) {
         if (format.getEncoding().equals(getEncoding())
@@ -465,14 +451,14 @@
         return false;
     }
 
-
     /**
-     * Returns a string that describes the format, such as:
-     * "PCM SIGNED 22050 Hz 16 bit mono big-endian".  The contents of the string
-     * may vary between implementations of Java Sound.
+     * Returns a string that describes the format, such as: "PCM SIGNED 22050 Hz
+     * 16 bit mono big-endian". The contents of the string may vary between
+     * implementations of Java Sound.
      *
      * @return a string that describes the format parameters
      */
+    @Override
     public String toString() {
         String sEncoding = "";
         if (getEncoding() != null) {
@@ -546,42 +532,36 @@
     }
 
     /**
-     * The <code>Encoding</code> class  names the  specific type of data representation
-     * used for an audio stream.   The encoding includes aspects of the
-     * sound format other than the number of channels, sample rate, sample size,
-     * frame rate, frame size, and byte order.
+     * The {@code Encoding} class names the specific type of data representation
+     * used for an audio stream. The encoding includes aspects of the sound
+     * format other than the number of channels, sample rate, sample size, frame
+     * rate, frame size, and byte order.
      * <p>
      * One ubiquitous type of audio encoding is pulse-code modulation (PCM),
      * which is simply a linear (proportional) representation of the sound
-     * waveform.  With PCM, the number stored in each sample is proportional
-     * to the instantaneous amplitude of the sound pressure at that point in
-     * time.  The numbers may be signed or unsigned integers or floats.
-     * Besides PCM, other encodings include mu-law and a-law, which are nonlinear
-     * mappings of the sound amplitude that are often used for recording speech.
+     * waveform. With PCM, the number stored in each sample is proportional to
+     * the instantaneous amplitude of the sound pressure at that point in time.
+     * The numbers may be signed or unsigned integers or floats. Besides PCM,
+     * other encodings include mu-law and a-law, which are nonlinear mappings of
+     * the sound amplitude that are often used for recording speech.
      * <p>
      * You can use a predefined encoding by referring to one of the static
-     * objects created by this class, such as PCM_SIGNED or
-     * PCM_UNSIGNED.  Service providers can create new encodings, such as
-     * compressed audio formats, and make
-     * these available through the <code>{@link AudioSystem}</code> class.
+     * objects created by this class, such as PCM_SIGNED or PCM_UNSIGNED.
+     * Service providers can create new encodings, such as compressed audio
+     * formats, and make these available through the {@link AudioSystem} class.
      * <p>
-     * The <code>Encoding</code> class is static, so that all
-     * <code>AudioFormat</code> objects that have the same encoding will refer
-     * to the same object (rather than different instances of the same class).
-     * This allows matches to be made by checking that two format's encodings
-     * are equal.
+     * The {@code Encoding} class is static, so that all {@code AudioFormat}
+     * objects that have the same encoding will refer to the same object (rather
+     * than different instances of the same class). This allows matches to be
+     * made by checking that two format's encodings are equal.
      *
+     * @author Kara Kytle
      * @see AudioFormat
      * @see javax.sound.sampled.spi.FormatConversionProvider
-     *
-     * @author Kara Kytle
      * @since 1.3
      */
     public static class Encoding {
 
-
-        // ENCODING DEFINES
-
         /**
          * Specifies signed, linear PCM data.
          */
@@ -609,31 +589,24 @@
          */
         public static final Encoding ALAW = new Encoding("ALAW");
 
-
-        // INSTANCE VARIABLES
-
         /**
          * Encoding name.
          */
         private String name;
 
-
-        // CONSTRUCTOR
-
         /**
          * Constructs a new encoding.
-         * @param name  the name of the new type of encoding
+         *
+         * @param  name the name of the new type of encoding
          */
         public Encoding(String name) {
             this.name = name;
         }
 
-
-        // METHODS
-
         /**
-         * Finalizes the equals method
+         * Finalizes the equals method.
          */
+        @Override
         public final boolean equals(Object obj) {
             if (toString() == null) {
                 return (obj != null) && (obj.toString() == null);
@@ -645,8 +618,9 @@
         }
 
         /**
-         * Finalizes the hashCode method
+         * Finalizes the hashCode method.
          */
+        @Override
         public final int hashCode() {
             if (toString() == null) {
                 return 0;
@@ -655,16 +629,17 @@
         }
 
         /**
-         * Provides the <code>String</code> representation of the encoding.  This <code>String</code> is
-         * the same name that was passed to the constructor.  For the predefined encodings, the name
-         * is similar to the encoding's variable (field) name.  For example, <code>PCM_SIGNED.toString()</code> returns
-         * the name "pcm_signed".
+         * Provides the {@code String} representation of the encoding. This
+         * {@code String} is the same name that was passed to the constructor.
+         * For the predefined encodings, the name is similar to the encoding's
+         * variable (field) name. For example, {@code PCM_SIGNED.toString()}
+         * returns the name "pcm_signed".
          *
          * @return the encoding name
          */
+        @Override
         public final String toString() {
             return name;
         }
-
-    } // class Encoding
+    }
 }
--- a/src/share/classes/javax/sound/sampled/AudioInputStream.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/AudioInputStream.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,27 +25,24 @@
 
 package javax.sound.sampled;
 
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.PushbackInputStream;
-import java.io.IOException;
 
 
 /**
  * An audio input stream is an input stream with a specified audio format and
- * length.  The length is expressed in sample frames, not bytes.
- * Several methods are provided for reading a certain number of bytes from
- * the stream, or an unspecified number of bytes.
- * The audio input stream keeps track  of the last byte that was read.
- * You can skip over an arbitrary number of bytes to get to a later position
- * for reading. An audio input stream may support marks.  When you set a mark,
- * the current position is remembered so that you can return to it later.
+ * length. The length is expressed in sample frames, not bytes. Several methods
+ * are provided for reading a certain number of bytes from the stream, or an
+ * unspecified number of bytes. The audio input stream keeps track of the last
+ * byte that was read. You can skip over an arbitrary number of bytes to get to
+ * a later position for reading. An audio input stream may support marks. When
+ * you set a mark, the current position is remembered so that you can return to
+ * it later.
  * <p>
- * The <code>AudioSystem</code> class includes many methods that manipulate
- * <code>AudioInputStream</code> objects.
- * For example, the methods let you:
+ * The {@code AudioSystem} class includes many methods that manipulate
+ * {@code AudioInputStream} objects. For example, the methods let you:
  * <ul>
- * <li> obtain an
- * audio input stream from an external audio file, stream, or URL
+ * <li> obtain an audio input stream from an external audio file, stream, or URL
  * <li> write an external file from an audio input stream
  * <li> convert an audio input stream to a different audio format
  * </ul>
@@ -53,16 +50,15 @@
  * @author David Rivas
  * @author Kara Kytle
  * @author Florian Bomers
- *
  * @see AudioSystem
- * @see Clip#open(AudioInputStream) Clip.open(AudioInputStream)
+ * @see Clip#open(AudioInputStream)
  * @since 1.3
  */
 public class AudioInputStream extends InputStream {
 
     /**
-     * The <code>InputStream</code> from which this <code>AudioInputStream</code>
-     * object was constructed.
+     * The {@code InputStream} from which this {@code AudioInputStream} object
+     * was constructed.
      */
     private InputStream stream;
 
@@ -92,35 +88,34 @@
     private long markpos;
 
     /**
-     * When the underlying stream could only return
-     * a non-integral number of frames, store
-     * the remainder in a temporary buffer
+     * When the underlying stream could only return a non-integral number of
+     * frames, store the remainder in a temporary buffer.
      */
     private byte[] pushBackBuffer = null;
 
     /**
-     * number of valid bytes in the pushBackBuffer
+     * number of valid bytes in the pushBackBuffer.
      */
     private int pushBackLen = 0;
 
     /**
-     * MarkBuffer at mark position
+     * MarkBuffer at mark position.
      */
     private byte[] markPushBackBuffer = null;
 
     /**
-     * number of valid bytes in the markPushBackBuffer
+     * number of valid bytes in the markPushBackBuffer.
      */
     private int markPushBackLen = 0;
 
-
     /**
-     * Constructs an audio input stream that has the requested format and length in sample frames,
-     * using audio data from the specified input stream.
-     * @param stream the stream on which this <code>AudioInputStream</code>
-     * object is based
-     * @param format the format of this stream's audio data
-     * @param length the length in sample frames of the data in this stream
+     * Constructs an audio input stream that has the requested format and length
+     * in sample frames, using audio data from the specified input stream.
+     *
+     * @param  stream the stream on which this {@code AudioInputStream} object
+     *         is based
+     * @param  format the format of this stream's audio data
+     * @param  length the length in sample frames of the data in this stream
      */
     public AudioInputStream(InputStream stream, AudioFormat format, long length) {
 
@@ -141,12 +136,12 @@
         markpos = 0;
     }
 
-
     /**
-     * Constructs an audio input stream that reads its data from the target
-     * data line indicated.  The format of the stream is the same as that of
-     * the target data line, and the length is AudioSystem#NOT_SPECIFIED.
-     * @param line the target data line from which this stream obtains its data.
+     * Constructs an audio input stream that reads its data from the target data
+     * line indicated. The format of the stream is the same as that of the
+     * target data line, and the length is AudioSystem#NOT_SPECIFIED.
+     *
+     * @param  line the target data line from which this stream obtains its data
      * @see AudioSystem#NOT_SPECIFIED
      */
     public AudioInputStream(TargetDataLine line) {
@@ -164,29 +159,29 @@
         markpos = 0;
     }
 
-
     /**
      * Obtains the audio format of the sound data in this audio input stream.
+     *
      * @return an audio format object describing this stream's format
      */
     public AudioFormat getFormat() {
         return format;
     }
 
-
     /**
-     * Obtains the length of the stream, expressed in sample frames rather than bytes.
+     * Obtains the length of the stream, expressed in sample frames rather than
+     * bytes.
+     *
      * @return the length in sample frames
      */
     public long getFrameLength() {
         return frameLength;
     }
 
-
     /**
-     * Reads the next byte of data from the audio input stream.  The audio input
-     * stream's frame size must be one byte, or an <code>IOException</code>
-     * will be thrown.
+     * Reads the next byte of data from the audio input stream. The audio input
+     * stream's frame size must be one byte, or an {@code IOException} will be
+     * thrown.
      *
      * @return the next byte of data, or -1 if the end of the stream is reached
      * @throws IOException if an input or output error occurs
@@ -194,6 +189,7 @@
      * @see #read(byte[])
      * @see #available
      */
+    @Override
     public int read() throws IOException {
         if( frameSize != 1 ) {
             throw new IOException("cannot read a single byte if frame size > 1");
@@ -208,50 +204,50 @@
         return data[0] & 0xFF;
     }
 
-
     /**
-     * Reads some number of bytes from the audio input stream and stores them into
-     * the buffer array <code>b</code>. The number of bytes actually read is
-     * returned as an integer. This method blocks until input data is
-     * available, the end of the stream is detected, or an exception is thrown.
-     * <p>This method will always read an integral number of frames.
-     * If the length of the array is not an integral number
-     * of frames, a maximum of <code>b.length - (b.length % frameSize)
-     * </code> bytes will be read.
+     * Reads some number of bytes from the audio input stream and stores them
+     * into the buffer array {@code b}. The number of bytes actually read is
+     * returned as an integer. This method blocks until input data is available,
+     * the end of the stream is detected, or an exception is thrown.
+     * <p>
+     * This method will always read an integral number of frames. If the length
+     * of the array is not an integral number of frames, a maximum of
+     * {@code b.length - (b.length % frameSize)} bytes will be read.
      *
-     * @param b the buffer into which the data is read
-     * @return the total number of bytes read into the buffer, or -1 if there
-     * is no more data because the end of the stream has been reached
+     * @param  b the buffer into which the data is read
+     * @return the total number of bytes read into the buffer, or -1 if there is
+     *         no more data because the end of the stream has been reached
      * @throws IOException if an input or output error occurs
      * @see #read(byte[], int, int)
      * @see #read()
      * @see #available
      */
+    @Override
     public int read(byte[] b) throws IOException {
         return read(b,0,b.length);
     }
 
-
     /**
      * Reads up to a specified maximum number of bytes of data from the audio
      * stream, putting them into the given byte array.
-     * <p>This method will always read an integral number of frames.
-     * If <code>len</code> does not specify an integral number
-     * of frames, a maximum of <code>len - (len % frameSize)
-     * </code> bytes will be read.
+     * <p>
+     * This method will always read an integral number of frames. If {@code len}
+     * does not specify an integral number of frames, a maximum of
+     * {@code len - (len % frameSize)} bytes will be read.
      *
-     * @param b the buffer into which the data is read
-     * @param off the offset, from the beginning of array <code>b</code>, at which
-     * the data will be written
-     * @param len the maximum number of bytes to read
-     * @return the total number of bytes read into the buffer, or -1 if there
-     * is no more data because the end of the stream has been reached
+     * @param  b the buffer into which the data is read
+     * @param  off the offset, from the beginning of array {@code b}, at which
+     *         the data will be written
+     * @param  len the maximum number of bytes to read
+     * @return the total number of bytes read into the buffer, or -1 if there is
+     *         no more data because the end of the stream has been reached
      * @throws IOException if an input or output error occurs
      * @see #read(byte[])
      * @see #read()
      * @see #skip
      * @see #available
      */
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
 
         // make sure we don't read fractions of a frame.
@@ -313,16 +309,17 @@
         return bytesRead;
     }
 
-
     /**
-     * Skips over and discards a specified number of bytes from this
-     * audio input stream.
-     * @param n the requested number of bytes to be skipped
+     * Skips over and discards a specified number of bytes from this audio input
+     * stream.
+     *
+     * @param  n the requested number of bytes to be skipped
      * @return the actual number of bytes skipped
      * @throws IOException if an input or output error occurs
      * @see #read
      * @see #available
      */
+    @Override
     public long skip(long n) throws IOException {
 
         // make sure not to skip fractional frames
@@ -351,21 +348,23 @@
 
     }
 
-
     /**
-     * Returns the maximum number of bytes that can be read (or skipped over) from this
-     * audio input stream without blocking.  This limit applies only to the next invocation of
-     * a <code>read</code> or <code>skip</code> method for this audio input stream; the limit
-     * can vary each time these methods are invoked.
-     * Depending on the underlying stream,an IOException may be thrown if this
-     * stream is closed.
-     * @return the number of bytes that can be read from this audio input stream without blocking
+     * Returns the maximum number of bytes that can be read (or skipped over)
+     * from this audio input stream without blocking. This limit applies only
+     * to the next invocation of a {@code read} or {@code skip} method for this
+     * audio input stream; the limit can vary each time these methods are
+     * invoked. Depending on the underlying stream, an IOException may be thrown
+     * if this stream is closed.
+     *
+     * @return the number of bytes that can be read from this audio input stream
+     *         without blocking
      * @throws IOException if an input or output error occurs
      * @see #read(byte[], int, int)
      * @see #read(byte[])
      * @see #read()
      * @see #skip
      */
+    @Override
     public int available() throws IOException {
 
         int temp = stream.available();
@@ -378,25 +377,26 @@
         }
     }
 
-
     /**
-     * Closes this audio input stream and releases any system resources associated
-     * with the stream.
+     * Closes this audio input stream and releases any system resources
+     * associated with the stream.
+     *
      * @throws IOException if an input or output error occurs
      */
+    @Override
     public void close() throws IOException {
         stream.close();
     }
 
-
     /**
      * Marks the current position in this audio input stream.
-     * @param readlimit the maximum number of bytes that can be read before
-     * the mark position becomes invalid.
+     *
+     * @param  readlimit the maximum number of bytes that can be read before the
+     *         mark position becomes invalid.
      * @see #reset
      * @see #markSupported
      */
-
+    @Override
     public void mark(int readlimit) {
 
         stream.mark(readlimit);
@@ -413,14 +413,15 @@
         }
     }
 
-
     /**
-     * Repositions this audio input stream to the position it had at the time its
-     * <code>mark</code> method was last invoked.
-     * @throws IOException if an input or output error occurs.
+     * Repositions this audio input stream to the position it had at the time
+     * its {@code mark} method was last invoked.
+     *
+     * @throws IOException if an input or output error occurs
      * @see #mark
      * @see #markSupported
      */
+    @Override
     public void reset() throws IOException {
 
         stream.reset();
@@ -435,21 +436,21 @@
         }
     }
 
-
     /**
-     * Tests whether this audio input stream supports the <code>mark</code> and
-     * <code>reset</code> methods.
-     * @return <code>true</code> if this stream supports the <code>mark</code>
-     * and <code>reset</code> methods; <code>false</code> otherwise
+     * Tests whether this audio input stream supports the {@code mark} and
+     * {@code reset} methods.
+     *
+     * @return {@code true} if this stream supports the {@code mark} and
+     *         {@code reset} methods; {@code false} otherwise
      * @see #mark
      * @see #reset
      */
+    @Override
     public boolean markSupported() {
 
         return stream.markSupported();
     }
 
-
     /**
      * Private inner class that makes a TargetDataLine look like an InputStream.
      */
@@ -460,19 +461,19 @@
          */
         TargetDataLine line;
 
-
         TargetDataLineInputStream(TargetDataLine line) {
             super();
             this.line = line;
         }
 
-
+        @Override
         public int available() throws IOException {
             return line.available();
         }
 
         //$$fb 2001-07-16: added this method to correctly close the underlying TargetDataLine.
         // fixes bug 4479984
+        @Override
         public void close() throws IOException {
             // the line needs to be flushed and stopped to avoid a dead lock...
             // Probably related to bugs 4417527, 4334868, 4383457
@@ -483,6 +484,7 @@
             line.close();
         }
 
+        @Override
         public int read() throws IOException {
 
             byte[] b = new byte[1];
@@ -502,7 +504,7 @@
             return value;
         }
 
-
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
             try {
                 return line.read(b, off, len);
--- a/src/share/classes/javax/sound/sampled/AudioPermission.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/AudioPermission.java	Wed Jul 09 10:42:37 2014 -0700
@@ -28,18 +28,18 @@
 import java.security.BasicPermission;
 
 /**
- * The <code>AudioPermission</code> class represents access rights to the audio
- * system resources.  An <code>AudioPermission</code> contains a target name
- * but no actions list; you either have the named permission or you don't.
+ * The {@code AudioPermission} class represents access rights to the audio
+ * system resources. An {@code AudioPermission} contains a target name but no
+ * actions list; you either have the named permission or you don't.
  * <p>
  * The target name is the name of the audio permission (see the table below).
- * The names follow the hierarchical property-naming convention. Also, an asterisk
- * can be used to represent all the audio permissions.
+ * The names follow the hierarchical property-naming convention. Also, an
+ * asterisk can be used to represent all the audio permissions.
  * <p>
- * The following table lists the possible <code>AudioPermission</code> target names.
- * For each name, the table provides a description of exactly what that permission
- * allows, as well as a discussion of the risks of granting code the permission.
- *
+ * The following table lists the possible {@code AudioPermission} target names.
+ * For each name, the table provides a description of exactly what that
+ * permission allows, as well as a discussion of the risks of granting code the
+ * permission.
  *
  * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">
  * <tr>
@@ -57,7 +57,7 @@
  * applications because the audio from one line may be mixed with other audio
  * being played on the system, or because manipulation of a mixer affects the
  * audio for all lines using that mixer.</td>
- *</tr>
+ * </tr>
  *
  * <tr>
  * <td>record</td>
@@ -68,42 +68,40 @@
  * applications because manipulation of a mixer affects the audio for all lines
  * using that mixer.
  * This permission can enable an applet or application to eavesdrop on a user.</td>
- *</tr>
- *</table>
- *<p>
+ * </tr>
+ * </table>
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public class AudioPermission extends BasicPermission {
+
     private static final long serialVersionUID = -5518053473477801126L;
 
     /**
-     * Creates a new <code>AudioPermission</code> object that has the specified
-     * symbolic name, such as "play" or "record". An asterisk can be used to indicate
-     * all audio permissions.
-     * @param name the name of the new <code>AudioPermission</code>
+     * Creates a new {@code AudioPermission} object that has the specified
+     * symbolic name, such as "play" or "record". An asterisk can be used to
+     * indicate all audio permissions.
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty.
+     * @param  name the name of the new {@code AudioPermission}
+     * @throws NullPointerException if {@code name} is {@code null}
+     * @throws IllegalArgumentException if {@code name} is empty
      */
-    public AudioPermission(String name) {
-
+    public AudioPermission(final String name) {
         super(name);
     }
 
     /**
-     * Creates a new <code>AudioPermission</code> object that has the specified
-     * symbolic name, such as "play" or "record".  The <code>actions</code>
-     * parameter is currently unused and should be <code>null</code>.
-     * @param name the name of the new <code>AudioPermission</code>
-     * @param actions (unused; should be <code>null</code>)
+     * Creates a new {@code AudioPermission} object that has the specified
+     * symbolic name, such as "play" or "record". The {@code actions} parameter
+     * is currently unused and should be {@code null}.
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty.
+     * @param  name the name of the new {@code AudioPermission}
+     * @param  actions (unused; should be {@code null})
+     * @throws NullPointerException if {@code name} is {@code null}
+     * @throws IllegalArgumentException if {@code name} is empty
      */
-    public AudioPermission(String name, String actions) {
-
+    public AudioPermission(final String name, final String actions) {
         super(name, actions);
     }
 }
--- a/src/share/classes/javax/sound/sampled/AudioSystem.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/AudioSystem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,29 +50,24 @@
 
 
 /**
- * The <code>AudioSystem</code> class acts as the entry point to the
- * sampled-audio system resources. This class lets you query and
- * access the mixers that are installed on the system.
- * <code>AudioSystem</code> includes a number of
- * methods for converting audio data between different formats, and for
- * translating between audio files and streams. It also provides a method
- * for obtaining a <code>{@link Line}</code> directly from the
- * <code>AudioSystem</code> without dealing explicitly
+ * The {@code AudioSystem} class acts as the entry point to the sampled-audio
+ * system resources. This class lets you query and access the mixers that are
+ * installed on the system. {@code AudioSystem} includes a number of methods for
+ * converting audio data between different formats, and for translating between
+ * audio files and streams. It also provides a method for obtaining a
+ * {@link Line} directly from the {@code AudioSystem} without dealing explicitly
  * with mixers.
- *
- * <p>Properties can be used to specify the default mixer
- * for specific line types.
- * Both system properties and a properties file are considered.
- * The <code>sound.properties</code> properties file is read from
- * an implementation-specific location (typically it is the <code>lib</code>
- * directory in the Java installation directory).
- * If a property exists both as a system property and in the
- * properties file, the system property takes precedence. If none is
- * specified, a suitable default is chosen among the available devices.
- * The syntax of the properties file is specified in
- * {@link java.util.Properties#load(InputStream) Properties.load}. The
- * following table lists the available property keys and which methods
- * consider them:
+ * <p>
+ * Properties can be used to specify the default mixer for specific line types.
+ * Both system properties and a properties file are considered. The
+ * {@code sound.properties} properties file is read from an
+ * implementation-specific location (typically it is the {@code lib} directory
+ * in the Java installation directory). If a property exists both as a system
+ * property and in the properties file, the system property takes precedence.
+ * If none is specified, a suitable default is chosen among the available
+ * devices. The syntax of the properties file is specified in
+ * {@link java.util.Properties#load(InputStream) Properties.load}. The following
+ * table lists the available property keys and which methods consider them:
  *
  * <table border=0>
  *  <caption>Audio System Property Keys</caption>
@@ -82,84 +77,68 @@
  *   <th>Affected Method(s)</th>
  *  </tr>
  *  <tr>
- *   <td><code>javax.sound.sampled.Clip</code></td>
+ *   <td>{@code javax.sound.sampled.Clip}</td>
  *   <td>{@link Clip}</td>
  *   <td>{@link #getLine}, {@link #getClip}</td>
  *  </tr>
  *  <tr>
- *   <td><code>javax.sound.sampled.Port</code></td>
+ *   <td>{@code javax.sound.sampled.Port}</td>
  *   <td>{@link Port}</td>
  *   <td>{@link #getLine}</td>
  *  </tr>
  *  <tr>
- *   <td><code>javax.sound.sampled.SourceDataLine</code></td>
+ *   <td>{@code javax.sound.sampled.SourceDataLine}</td>
  *   <td>{@link SourceDataLine}</td>
  *   <td>{@link #getLine}, {@link #getSourceDataLine}</td>
  *  </tr>
  *  <tr>
- *   <td><code>javax.sound.sampled.TargetDataLine</code></td>
+ *   <td>{@code javax.sound.sampled.TargetDataLine}</td>
  *   <td>{@link TargetDataLine}</td>
  *   <td>{@link #getLine}, {@link #getTargetDataLine}</td>
  *  </tr>
  * </table>
  *
- * The property value consists of the provider class name
- * and the mixer name, separated by the hash mark (&quot;#&quot;).
- * The provider class name is the fully-qualified
- * name of a concrete {@link javax.sound.sampled.spi.MixerProvider
- * mixer provider} class. The mixer name is matched against
- * the <code>String</code> returned by the <code>getName</code>
- * method of <code>Mixer.Info</code>.
- * Either the class name, or the mixer name may be omitted.
- * If only the class name is specified, the trailing hash mark
- * is optional.
- *
- * <p>If the provider class is specified, and it can be
- * successfully retrieved from the installed providers, the list of
- * <code>Mixer.Info</code> objects is retrieved
- * from the provider. Otherwise, or when these mixers
- * do not provide a subsequent match, the list is retrieved
- * from {@link #getMixerInfo} to contain
- * all available <code>Mixer.Info</code> objects.
- *
- * <p>If a mixer name is specified, the resulting list of
- * <code>Mixer.Info</code> objects is searched:
- * the first one with a matching name, and whose
- * <code>Mixer</code> provides the
+ * The property value consists of the provider class name and the mixer name,
+ * separated by the hash mark (&quot;#&quot;). The provider class name is the
+ * fully-qualified name of a concrete
+ * {@link javax.sound.sampled.spi.MixerProvider mixer provider} class. The mixer
+ * name is matched against the {@code String} returned by the {@code getName}
+ * method of {@code Mixer.Info}. Either the class name, or the mixer name may be
+ * omitted. If only the class name is specified, the trailing hash mark is
+ * optional.
+ * <p>
+ * If the provider class is specified, and it can be successfully retrieved from
+ * the installed providers, the list of {@code Mixer.Info} objects is retrieved
+ * from the provider. Otherwise, or when these mixers do not provide a
+ * subsequent match, the list is retrieved from {@link #getMixerInfo} to contain
+ * all available {@code Mixer.Info} objects.
+ * <p>
+ * If a mixer name is specified, the resulting list of {@code Mixer.Info}
+ * objects is searched: the first one with a matching name, and whose
+ * {@code Mixer} provides the respective line interface, will be returned. If no
+ * matching {@code Mixer.Info} object is found, or the mixer name is not
+ * specified, the first mixer from the resulting list, which provides the
  * respective line interface, will be returned.
- * If no matching <code>Mixer.Info</code> object
- * is found, or the mixer name is not specified,
- * the first mixer from the resulting
- * list, which provides the respective line
- * interface, will be returned.
  *
- * For example, the property <code>javax.sound.sampled.Clip</code>
- * with a value
- * <code>&quot;com.sun.media.sound.MixerProvider#SunClip&quot;</code>
- * will have the following consequences when
- * <code>getLine</code> is called requesting a <code>Clip</code>
- * instance:
- * if the class <code>com.sun.media.sound.MixerProvider</code> exists
- * in the list of installed mixer providers,
- * the first <code>Clip</code> from the first mixer with name
- * <code>&quot;SunClip&quot;</code> will be returned. If it cannot
- * be found, the first <code>Clip</code> from the first mixer
- * of the specified provider will be returned, regardless of name.
- * If there is none, the first <code>Clip</code> from the first
- * <code>Mixer</code> with name
- * <code>&quot;SunClip&quot;</code> in the list of all mixers
- * (as returned by <code>getMixerInfo</code>) will be returned,
- * or, if not found, the first <code>Clip</code> of the first
- * <code>Mixer</code>that can be found in the list of all
- * mixers is returned.
- * If that fails, too, an <code>IllegalArgumentException</code>
- * is thrown.
+ * For example, the property {@code javax.sound.sampled.Clip} with a value
+ * {@code "com.sun.media.sound.MixerProvider#SunClip"}
+ * will have the following consequences when {@code getLine} is called
+ * requesting a {@code Clip} instance: if the class
+ * {@code com.sun.media.sound.MixerProvider} exists in the list of installed
+ * mixer providers, the first {@code Clip} from the first mixer with name
+ * {@code "SunClip"} will be returned. If it cannot be found, the
+ * first {@code Clip} from the first mixer of the specified provider will be
+ * returned, regardless of name. If there is none, the first {@code Clip} from
+ * the first {@code Mixer} with name {@code "SunClip"} in the list of
+ * all mixers (as returned by {@code getMixerInfo}) will be returned, or, if not
+ * found, the first {@code Clip} of the first {@code Mixer} that can be found in
+ * the list of all mixers is returned. If that fails, too, an
+ * {@code IllegalArgumentException} is thrown.
  *
  * @author Kara Kytle
  * @author Florian Bomers
  * @author Matthias Pfisterer
  * @author Kevin P. Smith
- *
  * @see AudioFormat
  * @see AudioInputStream
  * @see Mixer
@@ -170,13 +149,12 @@
 public class AudioSystem {
 
     /**
-     * An integer that stands for an unknown numeric value.
-     * This value is appropriate only for signed quantities that do not
-     * normally take negative values.  Examples include file sizes, frame
-     * sizes, buffer sizes, and sample rates.
-     * A number of Java Sound constructors accept
-     * a value of <code>NOT_SPECIFIED</code> for such parameters.  Other
-     * methods may also accept or return this value, as documented.
+     * An integer that stands for an unknown numeric value. This value is
+     * appropriate only for signed quantities that do not normally take negative
+     * values. Examples include file sizes, frame sizes, buffer sizes, and
+     * sample rates. A number of Java Sound constructors accept a value of
+     * {@code NOT_SPECIFIED} for such parameters. Other methods may also accept
+     * or return this value, as documented.
      */
     public static final int NOT_SPECIFIED = -1;
 
@@ -186,42 +164,43 @@
     private AudioSystem() {
     }
 
-
     /**
-     * Obtains an array of mixer info objects that represents
-     * the set of audio mixers that are currently installed on the system.
-     * @return an array of info objects for the currently installed mixers.  If no mixers
-     * are available on the system, an array of length 0 is returned.
+     * Obtains an array of mixer info objects that represents the set of audio
+     * mixers that are currently installed on the system.
+     *
+     * @return an array of info objects for the currently installed mixers. If
+     *         no mixers are available on the system, an array of length 0 is
+     *         returned.
      * @see #getMixer
      */
     public static Mixer.Info[] getMixerInfo() {
 
-        List infos = getMixerInfoList();
-        Mixer.Info[] allInfos = (Mixer.Info[]) infos.toArray(new Mixer.Info[infos.size()]);
+        List<Mixer.Info> infos = getMixerInfoList();
+        Mixer.Info[] allInfos = infos.toArray(new Mixer.Info[infos.size()]);
         return allInfos;
     }
 
-
     /**
      * Obtains the requested audio mixer.
-     * @param info a <code>Mixer.Info</code> object representing the desired
-     * mixer, or <code>null</code> for the system default mixer
+     *
+     * @param  info a {@code Mixer.Info} object representing the desired mixer,
+     *         or {@code null} for the system default mixer
      * @return the requested mixer
-     * @throws SecurityException if the requested mixer
-     * is unavailable because of security restrictions
-     * @throws IllegalArgumentException if the info object does not represent
-     * a mixer installed on the system
+     * @throws SecurityException if the requested mixer is unavailable because
+     *         of security restrictions
+     * @throws IllegalArgumentException if the info object does not represent a
+     *         mixer installed on the system
      * @see #getMixerInfo
      */
     public static Mixer getMixer(Mixer.Info info) {
 
         Mixer mixer = null;
-        List providers = getMixerProviders();
+        List<MixerProvider> providers = getMixerProviders();
 
         for(int i = 0; i < providers.size(); i++ ) {
 
             try {
-                return ((MixerProvider)providers.get(i)).getMixer(info);
+                return providers.get(i).getMixer(info);
 
             } catch (IllegalArgumentException e) {
             } catch (NullPointerException e) {
@@ -238,7 +217,7 @@
         if (info == null) {
             for(int i = 0; i < providers.size(); i++ ) {
                 try {
-                    MixerProvider provider = (MixerProvider) providers.get(i);
+                    MixerProvider provider = providers.get(i);
                     Mixer.Info[] infos = provider.getMixerInfo();
                     // start from 0 to last device (do not reverse this order)
                     for (int ii = 0; ii < infos.length; ii++) {
@@ -259,22 +238,22 @@
                                            + (info!=null?info.toString():"null"));
     }
 
+    //$$fb 2002-11-26: fix for 4757930: DOC: AudioSystem.getTarget/SourceLineInfo() is ambiguous
 
-    //$$fb 2002-11-26: fix for 4757930: DOC: AudioSystem.getTarget/SourceLineInfo() is ambiguous
     /**
-     * Obtains information about all source lines of a particular type that are supported
-     * by the installed mixers.
-     * @param info a <code>Line.Info</code> object that specifies the kind of
-     * lines about which information is requested
-     * @return an array of <code>Line.Info</code> objects describing source lines matching
-     * the type requested.  If no matching source lines are supported, an array of length 0
-     * is returned.
+     * Obtains information about all source lines of a particular type that are
+     * supported by the installed mixers.
      *
+     * @param  info a {@code Line.Info} object that specifies the kind of lines
+     *         about which information is requested
+     * @return an array of {@code Line.Info} objects describing source lines
+     *         matching the type requested. If no matching source lines are
+     *         supported, an array of length 0 is returned.
      * @see Mixer#getSourceLineInfo(Line.Info)
      */
     public static Line.Info[] getSourceLineInfo(Line.Info info) {
 
-        Vector vector = new Vector();
+        Vector<Line.Info> vector = new Vector<>();
         Line.Info[] currentInfoArray;
 
         Mixer mixer;
@@ -294,27 +273,26 @@
         Line.Info[] returnedArray = new Line.Info[vector.size()];
 
         for (int i = 0; i < returnedArray.length; i++) {
-            returnedArray[i] = (Line.Info)vector.get(i);
+            returnedArray[i] = vector.get(i);
         }
 
         return returnedArray;
     }
 
-
     /**
-     * Obtains information about all target lines of a particular type that are supported
-     * by the installed mixers.
-     * @param info a <code>Line.Info</code> object that specifies the kind of
-     * lines about which information is requested
-     * @return an array of <code>Line.Info</code> objects describing target lines matching
-     * the type requested.  If no matching target lines are supported, an array of length 0
-     * is returned.
+     * Obtains information about all target lines of a particular type that are
+     * supported by the installed mixers.
      *
+     * @param  info a {@code Line.Info} object that specifies the kind of lines
+     *         about which information is requested
+     * @return an array of {@code Line.Info} objects describing target lines
+     *         matching the type requested. If no matching target lines are
+     *         supported, an array of length 0 is returned.
      * @see Mixer#getTargetLineInfo(Line.Info)
      */
     public static Line.Info[] getTargetLineInfo(Line.Info info) {
 
-        Vector vector = new Vector();
+        Vector<Line.Info> vector = new Vector<>();
         Line.Info[] currentInfoArray;
 
         Mixer mixer;
@@ -334,21 +312,21 @@
         Line.Info[] returnedArray = new Line.Info[vector.size()];
 
         for (int i = 0; i < returnedArray.length; i++) {
-            returnedArray[i] = (Line.Info)vector.get(i);
+            returnedArray[i] = vector.get(i);
         }
 
         return returnedArray;
     }
 
-
     /**
-     * Indicates whether the system supports any lines that match
-     * the specified <code>Line.Info</code> object.  A line is supported if
-     * any installed mixer supports it.
-     * @param info a <code>Line.Info</code> object describing the line for which support is queried
-     * @return <code>true</code> if at least one matching line is
-     * supported, otherwise <code>false</code>
+     * Indicates whether the system supports any lines that match the specified
+     * {@code Line.Info} object. A line is supported if any installed mixer
+     * supports it.
      *
+     * @param  info a {@code Line.Info} object describing the line for which
+     *         support is queried
+     * @return {@code true} if at least one matching line is supported,
+     *         otherwise {@code false}
      * @see Mixer#isLineSupported(Line.Info)
      */
     public static boolean isLineSupported(Line.Info info) {
@@ -371,44 +349,40 @@
 
     /**
      * Obtains a line that matches the description in the specified
-     * <code>Line.Info</code> object.
-     *
-     * <p>If a <code>DataLine</code> is requested, and <code>info</code>
-     * is an instance of <code>DataLine.Info</code> specifying at least
-     * one fully qualified audio format, the last one
-     * will be used as the default format of the returned
-     * <code>DataLine</code>.
-     *
-     * <p>If system properties
-     * <code>javax.sound.sampled.Clip</code>,
-     * <code>javax.sound.sampled.Port</code>,
-     * <code>javax.sound.sampled.SourceDataLine</code> and
-     * <code>javax.sound.sampled.TargetDataLine</code> are defined
-     * or they are defined in the file &quot;sound.properties&quot;,
-     * they are used to retrieve default lines.
-     * For details, refer to the {@link AudioSystem class description}.
+     * {@code Line.Info} object.
+     * <p>
+     * If a {@code DataLine} is requested, and {@code info} is an instance of
+     * {@code DataLine.Info} specifying at least one fully qualified audio
+     * format, the last one will be used as the default format of the returned
+     * {@code DataLine}.
+     * <p>
+     * If system properties
+     * {@code javax.sound.sampled.Clip},
+     * {@code javax.sound.sampled.Port},
+     * {@code javax.sound.sampled.SourceDataLine} and
+     * {@code javax.sound.sampled.TargetDataLine} are defined or they are
+     * defined in the file "sound.properties", they are used to retrieve default
+     * lines. For details, refer to the {@link AudioSystem class description}.
      *
-     * If the respective property is not set, or the mixer
-     * requested in the property is not installed or does not provide the
-     * requested line, all installed mixers are queried for the
-     * requested line type. A Line will be returned from the first mixer
-     * providing the requested line type.
-     *
-     * @param info a <code>Line.Info</code> object describing the desired kind of line
-     * @return a line of the requested kind
+     * If the respective property is not set, or the mixer requested in the
+     * property is not installed or does not provide the requested line, all
+     * installed mixers are queried for the requested line type. A Line will be
+     * returned from the first mixer providing the requested line type.
      *
-     * @throws LineUnavailableException if a matching line
-     * is not available due to resource restrictions
-     * @throws SecurityException if a matching line
-     * is not available due to security restrictions
-     * @throws IllegalArgumentException if the system does not
-     * support at least one line matching the specified
-     * <code>Line.Info</code> object
-     * through any installed mixer
+     * @param  info a {@code Line.Info} object describing the desired kind of
+     *         line
+     * @return a line of the requested kind
+     * @throws LineUnavailableException if a matching line is not available due
+     *         to resource restrictions
+     * @throws SecurityException if a matching line is not available due to
+     *         security restrictions
+     * @throws IllegalArgumentException if the system does not support at least
+     *         one line matching the specified {@code Line.Info} object through
+     *         any installed mixer
      */
     public static Line getLine(Line.Info info) throws LineUnavailableException {
         LineUnavailableException lue = null;
-        List providers = getMixerProviders();
+        List<MixerProvider> providers = getMixerProviders();
 
 
         // 1: try from default mixer for this line class
@@ -427,7 +401,7 @@
 
         // 2: if that doesn't work, try to find any mixing mixer
         for(int i = 0; i < providers.size(); i++) {
-            MixerProvider provider = (MixerProvider) providers.get(i);
+            MixerProvider provider = providers.get(i);
             Mixer.Info[] infos = provider.getMixerInfo();
 
             for (int j = 0; j < infos.length; j++) {
@@ -449,7 +423,7 @@
 
         // 3: if that didn't work, try to find any non-mixing mixer
         for(int i = 0; i < providers.size(); i++) {
-            MixerProvider provider = (MixerProvider) providers.get(i);
+            MixerProvider provider = providers.get(i);
             Mixer.Info[] infos = provider.getMixerInfo();
             for (int j = 0; j < infos.length; j++) {
                 try {
@@ -479,37 +453,30 @@
                                            info.toString() + " is supported.");
     }
 
-
     /**
-     * Obtains a clip that can be used for playing back
-     * an audio file or an audio stream. The returned clip
-     * will be provided by the default system mixer, or,
-     * if not possible, by any other mixer installed in the
-     * system that supports a <code>Clip</code>
-     * object.
-     *
-     * <p>The returned clip must be opened with the
-     * <code>open(AudioFormat)</code> or
-     * <code>open(AudioInputStream)</code> method.
-     *
-     * <p>This is a high-level method that uses <code>getMixer</code>
-     * and <code>getLine</code> internally.
-     *
-     * <p>If the system property
-     * <code>javax.sound.sampled.Clip</code>
-     * is defined or it is defined in the file &quot;sound.properties&quot;,
-     * it is used to retrieve the default clip.
-     * For details, refer to the {@link AudioSystem class description}.
+     * Obtains a clip that can be used for playing back an audio file or an
+     * audio stream. The returned clip will be provided by the default system
+     * mixer, or, if not possible, by any other mixer installed in the system
+     * that supports a {@code Clip} object.
+     * <p>
+     * The returned clip must be opened with the {@code open(AudioFormat)} or
+     * {@code open(AudioInputStream)} method.
+     * <p>
+     * This is a high-level method that uses {@code getMixer} and
+     * {@code getLine} internally.
+     * <p>
+     * If the system property {@code javax.sound.sampled.Clip} is defined or it
+     * is defined in the file "sound.properties", it is used to retrieve the
+     * default clip. For details, refer to the
+     * {@link AudioSystem class description}.
      *
      * @return the desired clip object
-     *
-     * @throws LineUnavailableException if a clip object
-     * is not available due to resource restrictions
-     * @throws SecurityException if a clip object
-     * is not available due to security restrictions
-     * @throws IllegalArgumentException if the system does not
-     * support at least one clip instance through any installed mixer
-     *
+     * @throws LineUnavailableException if a clip object is not available due to
+     *         resource restrictions
+     * @throws SecurityException if a clip object is not available due to
+     *         security restrictions
+     * @throws IllegalArgumentException if the system does not support at least
+     *         one clip instance through any installed mixer
      * @see #getClip(Mixer.Info)
      * @since 1.5
      */
@@ -522,29 +489,26 @@
         return (Clip) AudioSystem.getLine(info);
     }
 
-
     /**
-     * Obtains a clip from the specified mixer that can be
-     * used for playing back an audio file or an audio stream.
+     * Obtains a clip from the specified mixer that can be used for playing back
+     * an audio file or an audio stream.
+     * <p>
+     * The returned clip must be opened with the {@code open(AudioFormat)} or
+     * {@code open(AudioInputStream)} method.
+     * <p>
+     * This is a high-level method that uses {@code getMixer} and
+     * {@code getLine} internally.
      *
-     * <p>The returned clip must be opened with the
-     * <code>open(AudioFormat)</code> or
-     * <code>open(AudioInputStream)</code> method.
-     *
-     * <p>This is a high-level method that uses <code>getMixer</code>
-     * and <code>getLine</code> internally.
-     *
-     * @param mixerInfo a <code>Mixer.Info</code> object representing the
-     * desired mixer, or <code>null</code> for the system default mixer
+     * @param  mixerInfo a {@code Mixer.Info} object representing the desired
+     *         mixer, or {@code null} for the system default mixer
      * @return a clip object from the specified mixer
      *
-     * @throws LineUnavailableException if a clip
-     * is not available from this mixer due to resource restrictions
-     * @throws SecurityException if a clip
-     * is not available from this mixer due to security restrictions
-     * @throws IllegalArgumentException if the system does not
-     * support at least one clip through the specified mixer
-     *
+     * @throws LineUnavailableException if a clip is not available from this
+     *         mixer due to resource restrictions
+     * @throws SecurityException if a clip is not available from this mixer due
+     *         to security restrictions
+     * @throws IllegalArgumentException if the system does not support at least
+     *         one clip through the specified mixer
      * @see #getClip()
      * @since 1.5
      */
@@ -558,45 +522,38 @@
         return (Clip) mixer.getLine(info);
     }
 
-
     /**
-     * Obtains a source data line that can be used for playing back
-     * audio data in the format specified by the
-     * <code>AudioFormat</code> object. The returned line
-     * will be provided by the default system mixer, or,
-     * if not possible, by any other mixer installed in the
-     * system that supports a matching
-     * <code>SourceDataLine</code> object.
-     *
-     * <p>The returned line should be opened with the
-     * <code>open(AudioFormat)</code> or
-     * <code>open(AudioFormat, int)</code> method.
-     *
-     * <p>This is a high-level method that uses <code>getMixer</code>
-     * and <code>getLine</code> internally.
-     *
-     * <p>The returned <code>SourceDataLine</code>'s default
-     * audio format will be initialized with <code>format</code>.
+     * Obtains a source data line that can be used for playing back audio data
+     * in the format specified by the {@code AudioFormat} object. The returned
+     * line will be provided by the default system mixer, or, if not possible,
+     * by any other mixer installed in the system that supports a matching
+     * {@code SourceDataLine} object.
+     * <p>
+     * The returned line should be opened with the {@code open(AudioFormat)} or
+     * {@code open(AudioFormat, int)} method.
+     * <p>
+     * This is a high-level method that uses {@code getMixer} and
+     * {@code getLine} internally.
+     * <p>
+     * The returned {@code SourceDataLine}'s default audio format will be
+     * initialized with {@code format}.
+     * <p>
+     * If the system property {@code javax.sound.sampled.SourceDataLine} is
+     * defined or it is defined in the file "sound.properties", it is used to
+     * retrieve the default source data line. For details, refer to the
+     * {@link AudioSystem class description}.
      *
-     * <p>If the system property
-     * <code>javax.sound.sampled.SourceDataLine</code>
-     * is defined or it is defined in the file &quot;sound.properties&quot;,
-     * it is used to retrieve the default source data line.
-     * For details, refer to the {@link AudioSystem class description}.
-     *
-     * @param format an <code>AudioFormat</code> object specifying
-     *        the supported audio format of the returned line,
-     *        or <code>null</code> for any audio format
-     * @return the desired <code>SourceDataLine</code> object
-     *
-     * @throws LineUnavailableException if a matching source data line
-     *         is not available due to resource restrictions
-     * @throws SecurityException if a matching source data line
-     *         is not available due to security restrictions
-     * @throws IllegalArgumentException if the system does not
-     *         support at least one source data line supporting the
-     *         specified audio format through any installed mixer
-     *
+     * @param  format an {@code AudioFormat} object specifying the supported
+     *         audio format of the returned line, or {@code null} for any audio
+     *         format
+     * @return the desired {@code SourceDataLine} object
+     * @throws LineUnavailableException if a matching source data line is not
+     *         available due to resource restrictions
+     * @throws SecurityException if a matching source data line is not available
+     *         due to security restrictions
+     * @throws IllegalArgumentException if the system does not support at least
+     *         one source data line supporting the specified audio format
+     *         through any installed mixer
      * @see #getSourceDataLine(AudioFormat, Mixer.Info)
      * @since 1.5
      */
@@ -606,41 +563,33 @@
         return (SourceDataLine) AudioSystem.getLine(info);
     }
 
-
     /**
-     * Obtains a source data line that can be used for playing back
-     * audio data in the format specified by the
-     * <code>AudioFormat</code> object, provided by the mixer
-     * specified by the <code>Mixer.Info</code> object.
-     *
-     * <p>The returned line should be opened with the
-     * <code>open(AudioFormat)</code> or
-     * <code>open(AudioFormat, int)</code> method.
-     *
-     * <p>This is a high-level method that uses <code>getMixer</code>
-     * and <code>getLine</code> internally.
-     *
-     * <p>The returned <code>SourceDataLine</code>'s default
-     * audio format will be initialized with <code>format</code>.
+     * Obtains a source data line that can be used for playing back audio data
+     * in the format specified by the {@code AudioFormat} object, provided by
+     * the mixer specified by the {@code Mixer.Info} object.
+     * <p>
+     * The returned line should be opened with the {@code open(AudioFormat)} or
+     * {@code open(AudioFormat, int)} method.
+     * <p>
+     * This is a high-level method that uses {@code getMixer} and
+     * {@code getLine} internally.
+     * <p>
+     * The returned {@code SourceDataLine}'s default audio format will be
+     * initialized with {@code format}.
      *
-     * @param format an <code>AudioFormat</code> object specifying
-     *        the supported audio format of the returned line,
-     *        or <code>null</code> for any audio format
-     * @param mixerinfo a <code>Mixer.Info</code> object representing
-     *        the desired mixer, or <code>null</code> for the system
-     *        default mixer
-     * @return the desired <code>SourceDataLine</code> object
-     *
-     * @throws LineUnavailableException if a matching source data
-     *         line is not available from the specified mixer due
-     *         to resource restrictions
-     * @throws SecurityException if a matching source data line
-     *         is not available from the specified mixer due to
-     *         security restrictions
-     * @throws IllegalArgumentException if the specified mixer does
-     *         not support at least one source data line supporting
-     *         the specified audio format
-     *
+     * @param  format an {@code AudioFormat} object specifying the supported
+     *         audio format of the returned line, or {@code null} for any audio
+     *         format
+     * @param  mixerinfo a {@code Mixer.Info} object representing the desired
+     *         mixer, or {@code null} for the system default mixer
+     * @return the desired {@code SourceDataLine} object
+     * @throws LineUnavailableException if a matching source data line is not
+     *         available from the specified mixer due to resource restrictions
+     * @throws SecurityException if a matching source data line is not available
+     *         from the specified mixer due to security restrictions
+     * @throws IllegalArgumentException if the specified mixer does not support
+     *         at least one source data line supporting the specified audio
+     *         format
      * @see #getSourceDataLine(AudioFormat)
      * @since 1.5
      */
@@ -650,47 +599,40 @@
         DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
         Mixer mixer = AudioSystem.getMixer(mixerinfo);
         return (SourceDataLine) mixer.getLine(info);
-  }
-
+    }
 
     /**
-     * Obtains a target data line that can be used for recording
-     * audio data in the format specified by the
-     * <code>AudioFormat</code> object. The returned line
-     * will be provided by the default system mixer, or,
-     * if not possible, by any other mixer installed in the
-     * system that supports a matching
-     * <code>TargetDataLine</code> object.
-     *
-     * <p>The returned line should be opened with the
-     * <code>open(AudioFormat)</code> or
-     * <code>open(AudioFormat, int)</code> method.
-     *
-     * <p>This is a high-level method that uses <code>getMixer</code>
-     * and <code>getLine</code> internally.
-     *
-     * <p>The returned <code>TargetDataLine</code>'s default
-     * audio format will be initialized with <code>format</code>.
+     * Obtains a target data line that can be used for recording audio data in
+     * the format specified by the {@code AudioFormat} object. The returned line
+     * will be provided by the default system mixer, or, if not possible, by any
+     * other mixer installed in the system that supports a matching
+     * {@code TargetDataLine} object.
+     * <p>
+     * The returned line should be opened with the {@code open(AudioFormat)} or
+     * {@code open(AudioFormat, int)} method.
+     * <p>
+     * This is a high-level method that uses {@code getMixer} and
+     * {@code getLine} internally.
+     * <p>
+     * The returned {@code TargetDataLine}'s default audio format will be
+     * initialized with {@code format}.
+     * <p>
+     * If the system property {@code javax.sound.sampled.TargetDataLine} is
+     * defined or it is defined in the file "sound.properties", it is used to
+     * retrieve the default target data line. For details, refer to the
+     * {@link AudioSystem class description}.
      *
-     * <p>If the system property
-     * {@code javax.sound.sampled.TargetDataLine}
-     * is defined or it is defined in the file &quot;sound.properties&quot;,
-     * it is used to retrieve the default target data line.
-     * For details, refer to the {@link AudioSystem class description}.
-     *
-     * @param format an <code>AudioFormat</code> object specifying
-     *        the supported audio format of the returned line,
-     *        or <code>null</code> for any audio format
-     * @return the desired <code>TargetDataLine</code> object
-     *
-     * @throws LineUnavailableException if a matching target data line
-     *         is not available due to resource restrictions
-     * @throws SecurityException if a matching target data line
-     *         is not available due to security restrictions
-     * @throws IllegalArgumentException if the system does not
-     *         support at least one target data line supporting the
-     *         specified audio format through any installed mixer
-     *
+     * @param  format an {@code AudioFormat} object specifying the supported
+     *         audio format of the returned line, or {@code null} for any audio
+     *         format
+     * @return the desired {@code TargetDataLine} object
+     * @throws LineUnavailableException if a matching target data line is not
+     *         available due to resource restrictions
+     * @throws SecurityException if a matching target data line is not available
+     *         due to security restrictions
+     * @throws IllegalArgumentException if the system does not support at least
+     *         one target data line supporting the specified audio format
+     *         through any installed mixer
      * @see #getTargetDataLine(AudioFormat, Mixer.Info)
      * @see AudioPermission
      * @since 1.5
@@ -702,41 +644,33 @@
         return (TargetDataLine) AudioSystem.getLine(info);
     }
 
-
-
     /**
-     * Obtains a target data line that can be used for recording
-     * audio data in the format specified by the
-     * <code>AudioFormat</code> object, provided by the mixer
-     * specified by the <code>Mixer.Info</code> object.
-     *
-     * <p>The returned line should be opened with the
-     * <code>open(AudioFormat)</code> or
-     * <code>open(AudioFormat, int)</code> method.
-     *
-     * <p>This is a high-level method that uses <code>getMixer</code>
-     * and <code>getLine</code> internally.
-     *
-     * <p>The returned <code>TargetDataLine</code>'s default
-     * audio format will be initialized with <code>format</code>.
+     * Obtains a target data line that can be used for recording audio data in
+     * the format specified by the {@code AudioFormat} object, provided by the
+     * mixer specified by the {@code Mixer.Info} object.
+     * <p>
+     * The returned line should be opened with the {@code open(AudioFormat)} or
+     * {@code open(AudioFormat, int)} method.
+     * <p>
+     * This is a high-level method that uses {@code getMixer} and
+     * {@code getLine} internally.
+     * <p>
+     * The returned {@code TargetDataLine}'s default audio format will be
+     * initialized with {@code format}.
      *
-     * @param format an <code>AudioFormat</code> object specifying
-     *        the supported audio format of the returned line,
-     *        or <code>null</code> for any audio format
-     * @param mixerinfo a <code>Mixer.Info</code> object representing the
-     *        desired mixer, or <code>null</code> for the system default mixer
-     * @return the desired <code>TargetDataLine</code> object
-     *
-     * @throws LineUnavailableException if a matching target data
-     *         line is not available from the specified mixer due
-     *         to resource restrictions
-     * @throws SecurityException if a matching target data line
-     *         is not available from the specified mixer due to
-     *         security restrictions
-     * @throws IllegalArgumentException if the specified mixer does
-     *         not support at least one target data line supporting
-     *         the specified audio format
-     *
+     * @param  format an {@code AudioFormat} object specifying the supported
+     *         audio format of the returned line, or {@code null} for any audio
+     *         format
+     * @param  mixerinfo a {@code Mixer.Info} object representing the desired
+     *         mixer, or {@code null} for the system default mixer
+     * @return the desired {@code TargetDataLine} object
+     * @throws LineUnavailableException if a matching target data line is not
+     *         available from the specified mixer due to resource restrictions
+     * @throws SecurityException if a matching target data line is not available
+     *         from the specified mixer due to security restrictions
+     * @throws IllegalArgumentException if the specified mixer does not support
+     *         at least one target data line supporting the specified audio
+     *         format
      * @see #getTargetDataLine(AudioFormat)
      * @see AudioPermission
      * @since 1.5
@@ -750,28 +684,30 @@
         return (TargetDataLine) mixer.getLine(info);
     }
 
+    // $$fb 2002-04-12: fix for 4662082: behavior of AudioSystem.getTargetEncodings() methods doesn't match the spec
 
-    // $$fb 2002-04-12: fix for 4662082: behavior of AudioSystem.getTargetEncodings() methods doesn't match the spec
     /**
-     * Obtains the encodings that the system can obtain from an
-     * audio input stream with the specified encoding using the set
-     * of installed format converters.
-     * @param sourceEncoding the encoding for which conversion support
-     * is queried
-     * @return array of encodings.  If <code>sourceEncoding</code>is not supported,
-     * an array of length 0 is returned. Otherwise, the array will have a length
-     * of at least 1, representing <code>sourceEncoding</code> (no conversion).
+     * Obtains the encodings that the system can obtain from an audio input
+     * stream with the specified encoding using the set of installed format
+     * converters.
+     *
+     * @param  sourceEncoding the encoding for which conversion support is
+     *         queried
+     * @return array of encodings. If {@code sourceEncoding}is not supported, an
+     *         array of length 0 is returned. Otherwise, the array will have a
+     *         length of at least 1, representing {@code sourceEncoding}
+     *         (no conversion).
      */
     public static AudioFormat.Encoding[] getTargetEncodings(AudioFormat.Encoding sourceEncoding) {
 
-        List codecs = getFormatConversionProviders();
-        Vector encodings = new Vector();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
+        Vector<AudioFormat.Encoding> encodings = new Vector<>();
 
         AudioFormat.Encoding encs[] = null;
 
         // gather from all the codecs
         for(int i=0; i<codecs.size(); i++ ) {
-            FormatConversionProvider codec = (FormatConversionProvider) codecs.get(i);
+            FormatConversionProvider codec = codecs.get(i);
             if( codec.isSourceEncodingSupported( sourceEncoding ) ) {
                 encs = codec.getTargetEncodings();
                 for (int j = 0; j < encs.length; j++) {
@@ -779,28 +715,28 @@
                 }
             }
         }
-        AudioFormat.Encoding encs2[] = (AudioFormat.Encoding[]) encodings.toArray(new AudioFormat.Encoding[0]);
+        AudioFormat.Encoding encs2[] = encodings.toArray(new AudioFormat.Encoding[0]);
         return encs2;
     }
 
-
+    // $$fb 2002-04-12: fix for 4662082: behavior of AudioSystem.getTargetEncodings() methods doesn't match the spec
 
-    // $$fb 2002-04-12: fix for 4662082: behavior of AudioSystem.getTargetEncodings() methods doesn't match the spec
     /**
-     * Obtains the encodings that the system can obtain from an
-     * audio input stream with the specified format using the set
-     * of installed format converters.
-     * @param sourceFormat the audio format for which conversion
-     * is queried
-     * @return array of encodings. If <code>sourceFormat</code>is not supported,
-     * an array of length 0 is returned. Otherwise, the array will have a length
-     * of at least 1, representing the encoding of <code>sourceFormat</code> (no conversion).
+     * Obtains the encodings that the system can obtain from an audio input
+     * stream with the specified format using the set of installed format
+     * converters.
+     *
+     * @param  sourceFormat the audio format for which conversion is queried
+     * @return array of encodings. If {@code sourceFormat}is not supported, an
+     *         array of length 0 is returned. Otherwise, the array will have a
+     *         length of at least 1, representing the encoding of
+     *         {@code sourceFormat} (no conversion).
      */
     public static AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) {
 
 
-        List codecs = getFormatConversionProviders();
-        Vector encodings = new Vector();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
+        Vector<AudioFormat.Encoding[]> encodings = new Vector<>();
 
         int size = 0;
         int index = 0;
@@ -809,7 +745,7 @@
         // gather from all the codecs
 
         for(int i=0; i<codecs.size(); i++ ) {
-            encs = ((FormatConversionProvider) codecs.get(i)).getTargetEncodings(sourceFormat);
+            encs = codecs.get(i).getTargetEncodings(sourceFormat);
             size += encs.length;
             encodings.addElement( encs );
         }
@@ -818,7 +754,7 @@
 
         AudioFormat.Encoding encs2[] = new AudioFormat.Encoding[size];
         for(int i=0; i<encodings.size(); i++ ) {
-            encs = (AudioFormat.Encoding [])(encodings.get(i));
+            encs = encodings.get(i);
             for(int j=0; j<encs.length; j++ ) {
                 encs2[index++] = encs[j];
             }
@@ -826,23 +762,22 @@
         return encs2;
     }
 
-
     /**
-     * Indicates whether an audio input stream of the specified encoding
-     * can be obtained from an audio input stream that has the specified
-     * format.
-     * @param targetEncoding the desired encoding after conversion
-     * @param sourceFormat the audio format before conversion
-     * @return <code>true</code> if the conversion is supported,
-     * otherwise <code>false</code>
+     * Indicates whether an audio input stream of the specified encoding can be
+     * obtained from an audio input stream that has the specified format.
+     *
+     * @param  targetEncoding the desired encoding after conversion
+     * @param  sourceFormat the audio format before conversion
+     * @return {@code true} if the conversion is supported, otherwise
+     *         {@code false}
      */
     public static boolean isConversionSupported(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) {
 
 
-        List codecs = getFormatConversionProviders();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
 
         for(int i=0; i<codecs.size(); i++ ) {
-            FormatConversionProvider codec = (FormatConversionProvider) codecs.get(i);
+            FormatConversionProvider codec = codecs.get(i);
             if(codec.isConversionSupported(targetEncoding,sourceFormat) ) {
                 return true;
             }
@@ -850,12 +785,12 @@
         return false;
     }
 
-
     /**
-     * Obtains an audio input stream of the indicated encoding, by converting the
-     * provided audio input stream.
-     * @param targetEncoding the desired encoding after conversion
-     * @param sourceStream the stream to be converted
+     * Obtains an audio input stream of the indicated encoding, by converting
+     * the provided audio input stream.
+     *
+     * @param  targetEncoding the desired encoding after conversion
+     * @param  sourceStream the stream to be converted
      * @return an audio input stream of the indicated encoding
      * @throws IllegalArgumentException if the conversion is not supported
      * @see #getTargetEncodings(AudioFormat.Encoding)
@@ -866,10 +801,10 @@
     public static AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding,
                                                        AudioInputStream sourceStream) {
 
-        List codecs = getFormatConversionProviders();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
 
         for(int i = 0; i < codecs.size(); i++) {
-            FormatConversionProvider codec = (FormatConversionProvider) codecs.get(i);
+            FormatConversionProvider codec = codecs.get(i);
             if( codec.isConversionSupported( targetEncoding, sourceStream.getFormat() ) ) {
                 return codec.getAudioInputStream( targetEncoding, sourceStream );
             }
@@ -878,20 +813,20 @@
         throw new IllegalArgumentException("Unsupported conversion: " + targetEncoding + " from " + sourceStream.getFormat());
     }
 
-
     /**
-     * Obtains the formats that have a particular encoding and that the system can
-     * obtain from a stream of the specified format using the set of
+     * Obtains the formats that have a particular encoding and that the system
+     * can obtain from a stream of the specified format using the set of
      * installed format converters.
-     * @param targetEncoding the desired encoding after conversion
-     * @param sourceFormat the audio format before conversion
-     * @return array of formats.  If no formats of the specified
-     * encoding are supported, an array of length 0 is returned.
+     *
+     * @param  targetEncoding the desired encoding after conversion
+     * @param  sourceFormat the audio format before conversion
+     * @return array of formats. If no formats of the specified encoding are
+     *         supported, an array of length 0 is returned.
      */
     public static AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) {
 
-        List codecs = getFormatConversionProviders();
-        Vector formats = new Vector();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
+        Vector<AudioFormat[]> formats = new Vector<>();
 
         int size = 0;
         int index = 0;
@@ -900,7 +835,7 @@
         // gather from all the codecs
 
         for(int i=0; i<codecs.size(); i++ ) {
-            FormatConversionProvider codec = (FormatConversionProvider) codecs.get(i);
+            FormatConversionProvider codec = codecs.get(i);
             fmts = codec.getTargetFormats(targetEncoding, sourceFormat);
             size += fmts.length;
             formats.addElement( fmts );
@@ -910,7 +845,7 @@
 
         AudioFormat fmts2[] = new AudioFormat[size];
         for(int i=0; i<formats.size(); i++ ) {
-            fmts = (AudioFormat [])(formats.get(i));
+            fmts = formats.get(i);
             for(int j=0; j<fmts.length; j++ ) {
                 fmts2[index++] = fmts[j];
             }
@@ -918,22 +853,21 @@
         return fmts2;
     }
 
-
     /**
-     * Indicates whether an audio input stream of a specified format
-     * can be obtained from an audio input stream of another specified format.
-     * @param targetFormat the desired audio format after conversion
-     * @param sourceFormat the audio format before conversion
-     * @return <code>true</code> if the conversion is supported,
-     * otherwise <code>false</code>
+     * Indicates whether an audio input stream of a specified format can be
+     * obtained from an audio input stream of another specified format.
+     *
+     * @param  targetFormat the desired audio format after conversion
+     * @param  sourceFormat the audio format before conversion
+     * @return {@code true} if the conversion is supported, otherwise
+     *         {@code false}
      */
-
     public static boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat) {
 
-        List codecs = getFormatConversionProviders();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
 
         for(int i=0; i<codecs.size(); i++ ) {
-            FormatConversionProvider codec = (FormatConversionProvider) codecs.get(i);
+            FormatConversionProvider codec = codecs.get(i);
             if(codec.isConversionSupported(targetFormat, sourceFormat) ) {
                 return true;
             }
@@ -941,15 +875,15 @@
         return false;
     }
 
-
     /**
      * Obtains an audio input stream of the indicated format, by converting the
      * provided audio input stream.
-     * @param targetFormat the desired audio format after conversion
-     * @param sourceStream the stream to be converted
+     *
+     * @param  targetFormat the desired audio format after conversion
+     * @param  sourceStream the stream to be converted
      * @return an audio input stream of the indicated format
      * @throws IllegalArgumentException if the conversion is not supported
-     * #see #getTargetEncodings(AudioFormat)
+     * @see #getTargetEncodings(AudioFormat)
      * @see #getTargetFormats(AudioFormat.Encoding, AudioFormat)
      * @see #isConversionSupported(AudioFormat, AudioFormat)
      * @see #getAudioInputStream(AudioFormat.Encoding, AudioInputStream)
@@ -961,10 +895,10 @@
             return sourceStream;
         }
 
-        List codecs = getFormatConversionProviders();
+        List<FormatConversionProvider> codecs = getFormatConversionProviders();
 
         for(int i = 0; i < codecs.size(); i++) {
-            FormatConversionProvider codec = (FormatConversionProvider) codecs.get(i);
+            FormatConversionProvider codec = codecs.get(i);
             if(codec.isConversionSupported(targetFormat,sourceStream.getFormat()) ) {
                 return codec.getAudioInputStream(targetFormat,sourceStream);
             }
@@ -974,20 +908,22 @@
         throw new IllegalArgumentException("Unsupported conversion: " + targetFormat + " from " + sourceStream.getFormat());
     }
 
-
     /**
-     * Obtains the audio file format of the provided input stream.  The stream must
-     * point to valid audio file data.  The implementation of this method may require
-     * multiple parsers to examine the stream to determine whether they support it.
-     * These parsers must be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support these operations, this method may fail
-     * with an <code>IOException</code>.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the stream's audio file format
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
+     * Obtains the audio file format of the provided input stream. The stream
+     * must point to valid audio file data. The implementation of this method
+     * may require multiple parsers to examine the stream to determine whether
+     * they support it. These parsers must be able to mark the stream, read
+     * enough data to determine whether they support the stream, and, if not,
+     * reset the stream's read pointer to its original position. If the input
+     * stream does not support these operations, this method may fail with an
+     * {@code IOException}.
+     *
+     * @param  stream the input stream from which file format information should
+     *         be extracted
+     * @return an {@code AudioFileFormat} object describing the stream's audio
+     *         file format
+     * @throws UnsupportedAudioFileException if the stream does not point to
+     *         valid audio file data recognized by the system
      * @throws IOException if an input/output exception occurs
      * @see InputStream#markSupported
      * @see InputStream#mark
@@ -995,11 +931,11 @@
     public static AudioFileFormat getAudioFileFormat(InputStream stream)
         throws UnsupportedAudioFileException, IOException {
 
-        List providers = getAudioFileReaders();
+        List<AudioFileReader> providers = getAudioFileReaders();
         AudioFileFormat format = null;
 
         for(int i = 0; i < providers.size(); i++ ) {
-            AudioFileReader reader = (AudioFileReader) providers.get(i);
+            AudioFileReader reader = providers.get(i);
             try {
                 format = reader.getAudioFileFormat( stream ); // throws IOException
                 break;
@@ -1016,23 +952,25 @@
     }
 
     /**
-     * Obtains the audio file format of the specified URL.  The URL must
-     * point to valid audio file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
+     * Obtains the audio file format of the specified URL. The URL must point to
+     * valid audio file data.
+     *
+     * @param  url the URL from which file format information should be
+     *         extracted
+     * @return an {@code AudioFileFormat} object describing the audio file
+     *         format
+     * @throws UnsupportedAudioFileException if the URL does not point to valid
+     *         audio file data recognized by the system
      * @throws IOException if an input/output exception occurs
      */
     public static AudioFileFormat getAudioFileFormat(URL url)
         throws UnsupportedAudioFileException, IOException {
 
-        List providers = getAudioFileReaders();
+        List<AudioFileReader> providers = getAudioFileReaders();
         AudioFileFormat format = null;
 
         for(int i = 0; i < providers.size(); i++ ) {
-            AudioFileReader reader = (AudioFileReader) providers.get(i);
+            AudioFileReader reader = providers.get(i);
             try {
                 format = reader.getAudioFileFormat( url ); // throws IOException
                 break;
@@ -1049,23 +987,25 @@
     }
 
     /**
-     * Obtains the audio file format of the specified <code>File</code>.  The <code>File</code> must
-     * point to valid audio file data.
-     * @param file the <code>File</code> from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the <code>File</code> does not point to valid audio
-     * file data recognized by the system
+     * Obtains the audio file format of the specified {@code File}. The
+     * {@code File} must point to valid audio file data.
+     *
+     * @param  file the {@code File} from which file format information should
+     *         be extracted
+     * @return an {@code AudioFileFormat} object describing the audio file
+     *         format
+     * @throws UnsupportedAudioFileException if the {@code File} does not point
+     *         to valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
     public static AudioFileFormat getAudioFileFormat(File file)
         throws UnsupportedAudioFileException, IOException {
 
-        List providers = getAudioFileReaders();
+        List<AudioFileReader> providers = getAudioFileReaders();
         AudioFileFormat format = null;
 
         for(int i = 0; i < providers.size(); i++ ) {
-            AudioFileReader reader = (AudioFileReader) providers.get(i);
+            AudioFileReader reader = providers.get(i);
             try {
                 format = reader.getAudioFileFormat( file ); // throws IOException
                 break;
@@ -1081,22 +1021,22 @@
         }
     }
 
-
     /**
-     * Obtains an audio input stream from the provided input stream.  The stream must
-     * point to valid audio file data.  The implementation of this method may
-     * require multiple parsers to
-     * examine the stream to determine whether they support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support these operation, this method may fail
-     * with an <code>IOException</code>.
-     * @param stream the input stream from which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data contained
-     * in the input stream.
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
+     * Obtains an audio input stream from the provided input stream. The stream
+     * must point to valid audio file data. The implementation of this method
+     * may require multiple parsers to examine the stream to determine whether
+     * they support it. These parsers must be able to mark the stream, read
+     * enough data to determine whether they support the stream, and, if not,
+     * reset the stream's read pointer to its original position. If the input
+     * stream does not support these operation, this method may fail with an
+     * {@code IOException}.
+     *
+     * @param  stream the input stream from which the {@code AudioInputStream}
+     *         should be constructed
+     * @return an {@code AudioInputStream} object based on the audio file data
+     *         contained in the input stream
+     * @throws UnsupportedAudioFileException if the stream does not point to
+     *         valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      * @see InputStream#markSupported
      * @see InputStream#mark
@@ -1104,11 +1044,11 @@
     public static AudioInputStream getAudioInputStream(InputStream stream)
         throws UnsupportedAudioFileException, IOException {
 
-        List providers = getAudioFileReaders();
+        List<AudioFileReader> providers = getAudioFileReaders();
         AudioInputStream audioStream = null;
 
         for(int i = 0; i < providers.size(); i++ ) {
-            AudioFileReader reader = (AudioFileReader) providers.get(i);
+            AudioFileReader reader = providers.get(i);
             try {
                 audioStream = reader.getAudioInputStream( stream ); // throws IOException
                 break;
@@ -1125,24 +1065,25 @@
     }
 
     /**
-     * Obtains an audio input stream from the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the URL
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
+     * Obtains an audio input stream from the URL provided. The URL must point
+     * to valid audio file data.
+     *
+     * @param  url the URL for which the {@code AudioInputStream} should be
+     *         constructed
+     * @return an {@code AudioInputStream} object based on the audio file data
+     *         pointed to by the URL
+     * @throws UnsupportedAudioFileException if the URL does not point to valid
+     *         audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
     public static AudioInputStream getAudioInputStream(URL url)
         throws UnsupportedAudioFileException, IOException {
 
-        List providers = getAudioFileReaders();
+        List<AudioFileReader> providers = getAudioFileReaders();
         AudioInputStream audioStream = null;
 
         for(int i = 0; i < providers.size(); i++ ) {
-            AudioFileReader reader = (AudioFileReader) providers.get(i);
+            AudioFileReader reader = providers.get(i);
             try {
                 audioStream = reader.getAudioInputStream( url ); // throws IOException
                 break;
@@ -1159,24 +1100,25 @@
     }
 
     /**
-     * Obtains an audio input stream from the provided <code>File</code>.  The <code>File</code> must
-     * point to valid audio file data.
-     * @param file the <code>File</code> for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the <code>File</code>
-     * @throws UnsupportedAudioFileException if the <code>File</code> does not point to valid audio
-     * file data recognized by the system
+     * Obtains an audio input stream from the provided {@code File}. The
+     * {@code File} must point to valid audio file data.
+     *
+     * @param  file the {@code File} for which the {@code AudioInputStream}
+     *         should be constructed
+     * @return an {@code AudioInputStream} object based on the audio file data
+     *         pointed to by the {@code File}
+     * @throws UnsupportedAudioFileException if the {@code File} does not point
+     *         to valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
     public static AudioInputStream getAudioInputStream(File file)
         throws UnsupportedAudioFileException, IOException {
 
-        List providers = getAudioFileReaders();
+        List<AudioFileReader> providers = getAudioFileReaders();
         AudioInputStream audioStream = null;
 
         for(int i = 0; i < providers.size(); i++ ) {
-            AudioFileReader reader = (AudioFileReader) providers.get(i);
+            AudioFileReader reader = providers.get(i);
             try {
                 audioStream = reader.getAudioInputStream( file ); // throws IOException
                 break;
@@ -1192,42 +1134,43 @@
         }
     }
 
-
     /**
-     * Obtains the file types for which file writing support is provided by the system.
-     * @return array of unique file types.  If no file types are supported,
-     * an array of length 0 is returned.
+     * Obtains the file types for which file writing support is provided by the
+     * system.
+     *
+     * @return array of unique file types. If no file types are supported, an
+     *         array of length 0 is returned.
      */
     public static AudioFileFormat.Type[] getAudioFileTypes() {
-        List providers = getAudioFileWriters();
-        Set returnTypesSet = new HashSet();
+        List<AudioFileWriter> providers = getAudioFileWriters();
+        Set<AudioFileFormat.Type> returnTypesSet = new HashSet<>();
 
         for(int i=0; i < providers.size(); i++) {
-            AudioFileWriter writer = (AudioFileWriter) providers.get(i);
+            AudioFileWriter writer = providers.get(i);
             AudioFileFormat.Type[] fileTypes = writer.getAudioFileTypes();
             for(int j=0; j < fileTypes.length; j++) {
                 returnTypesSet.add(fileTypes[j]);
             }
         }
-        AudioFileFormat.Type returnTypes[] = (AudioFileFormat.Type[])
+        AudioFileFormat.Type returnTypes[] =
             returnTypesSet.toArray(new AudioFileFormat.Type[0]);
         return returnTypes;
     }
 
-
     /**
-     * Indicates whether file writing support for the specified file type is provided
-     * by the system.
-     * @param fileType the file type for which write capabilities are queried
-     * @return <code>true</code> if the file type is supported,
-     * otherwise <code>false</code>
+     * Indicates whether file writing support for the specified file type is
+     * provided by the system.
+     *
+     * @param  fileType the file type for which write capabilities are queried
+     * @return {@code true} if the file type is supported, otherwise
+     *         {@code false}
      */
     public static boolean isFileTypeSupported(AudioFileFormat.Type fileType) {
 
-        List providers = getAudioFileWriters();
+        List<AudioFileWriter> providers = getAudioFileWriters();
 
         for(int i=0; i < providers.size(); i++) {
-            AudioFileWriter writer = (AudioFileWriter) providers.get(i);
+            AudioFileWriter writer = providers.get(i);
             if (writer.isFileTypeSupported(fileType)) {
                 return true;
             }
@@ -1235,47 +1178,47 @@
         return false;
     }
 
-
     /**
-     * Obtains the file types that the system can write from the
-     * audio input stream specified.
-     * @param stream the audio input stream for which audio file type support
-     * is queried
-     * @return array of file types.  If no file types are supported,
-     * an array of length 0 is returned.
+     * Obtains the file types that the system can write from the audio input
+     * stream specified.
+     *
+     * @param  stream the audio input stream for which audio file type
+     *         support is queried
+     * @return array of file types. If no file types are supported, an array of
+     *         length 0 is returned.
      */
     public static AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) {
-        List providers = getAudioFileWriters();
-        Set returnTypesSet = new HashSet();
+        List<AudioFileWriter> providers = getAudioFileWriters();
+        Set<AudioFileFormat.Type> returnTypesSet = new HashSet<>();
 
         for(int i=0; i < providers.size(); i++) {
-            AudioFileWriter writer = (AudioFileWriter) providers.get(i);
+            AudioFileWriter writer = providers.get(i);
             AudioFileFormat.Type[] fileTypes = writer.getAudioFileTypes(stream);
             for(int j=0; j < fileTypes.length; j++) {
                 returnTypesSet.add(fileTypes[j]);
             }
         }
-        AudioFileFormat.Type returnTypes[] = (AudioFileFormat.Type[])
+        AudioFileFormat.Type returnTypes[] =
             returnTypesSet.toArray(new AudioFileFormat.Type[0]);
         return returnTypes;
     }
 
-
     /**
      * Indicates whether an audio file of the specified file type can be written
      * from the indicated audio input stream.
-     * @param fileType the file type for which write capabilities are queried
-     * @param stream the stream for which file-writing support is queried
-     * @return <code>true</code> if the file type is supported for this audio input stream,
-     * otherwise <code>false</code>
+     *
+     * @param  fileType the file type for which write capabilities are queried
+     * @param  stream the stream for which file-writing support is queried
+     * @return {@code true} if the file type is supported for this audio input
+     *         stream, otherwise {@code false}
      */
     public static boolean isFileTypeSupported(AudioFileFormat.Type fileType,
                                               AudioInputStream stream) {
 
-        List providers = getAudioFileWriters();
+        List<AudioFileWriter> providers = getAudioFileWriters();
 
         for(int i=0; i < providers.size(); i++) {
-            AudioFileWriter writer = (AudioFileWriter) providers.get(i);
+            AudioFileWriter writer = providers.get(i);
             if(writer.isFileTypeSupported(fileType, stream)) {
                 return true;
             }
@@ -1283,35 +1226,34 @@
         return false;
     }
 
-
     /**
-     * Writes a stream of bytes representing an audio file of the specified file type
-     * to the output stream provided.  Some file types require that
-     * the length be written into the file header; such files cannot be written from
-     * start to finish unless the length is known in advance.  An attempt
-     * to write a file of such a type will fail with an IOException if the length in
-     * the audio file type is <code>AudioSystem.NOT_SPECIFIED</code>.
+     * Writes a stream of bytes representing an audio file of the specified file
+     * type to the output stream provided. Some file types require that the
+     * length be written into the file header; such files cannot be written from
+     * start to finish unless the length is known in advance. An attempt to
+     * write a file of such a type will fail with an IOException if the length
+     * in the audio file type is {@code AudioSystem.NOT_SPECIFIED}.
      *
-     * @param stream the audio input stream containing audio data to be
-     * written to the file
-     * @param fileType the kind of audio file to write
-     * @param out the stream to which the file data should be written
+     * @param  stream the audio input stream containing audio data to be written
+     *         to the file
+     * @param  fileType the kind of audio file to write
+     * @param  out the stream to which the file data should be written
      * @return the number of bytes written to the output stream
      * @throws IOException if an input/output exception occurs
-     * @throws IllegalArgumentException if the file type is not supported by
-     * the system
+     * @throws IllegalArgumentException if the file type is not supported by the
+     *         system
      * @see #isFileTypeSupported
-     * @see     #getAudioFileTypes
+     * @see #getAudioFileTypes
      */
     public static int write(AudioInputStream stream, AudioFileFormat.Type fileType,
                             OutputStream out) throws IOException {
 
-        List providers = getAudioFileWriters();
+        List<AudioFileWriter> providers = getAudioFileWriters();
         int bytesWritten = 0;
         boolean flag = false;
 
         for(int i=0; i < providers.size(); i++) {
-            AudioFileWriter writer = (AudioFileWriter) providers.get(i);
+            AudioFileWriter writer = providers.get(i);
             try {
                 bytesWritten = writer.write( stream, fileType, out ); // throws IOException
                 flag = true;
@@ -1328,30 +1270,30 @@
         }
     }
 
-
     /**
-     * Writes a stream of bytes representing an audio file of the specified file type
-     * to the external file provided.
-     * @param stream the audio input stream containing audio data to be
-     * written to the file
-     * @param fileType the kind of audio file to write
-     * @param out the external file to which the file data should be written
+     * Writes a stream of bytes representing an audio file of the specified file
+     * type to the external file provided.
+     *
+     * @param  stream the audio input stream containing audio data to be written
+     *         to the file
+     * @param  fileType the kind of audio file to write
+     * @param  out the external file to which the file data should be written
      * @return the number of bytes written to the file
      * @throws IOException if an I/O exception occurs
-     * @throws IllegalArgumentException if the file type is not supported by
-     * the system
+     * @throws IllegalArgumentException if the file type is not supported by the
+     *         system
      * @see #isFileTypeSupported
-     * @see     #getAudioFileTypes
+     * @see #getAudioFileTypes
      */
     public static int write(AudioInputStream stream, AudioFileFormat.Type fileType,
                             File out) throws IOException {
 
-        List providers = getAudioFileWriters();
+        List<AudioFileWriter> providers = getAudioFileWriters();
         int bytesWritten = 0;
         boolean flag = false;
 
         for(int i=0; i < providers.size(); i++) {
-            AudioFileWriter writer = (AudioFileWriter) providers.get(i);
+            AudioFileWriter writer = providers.get(i);
             try {
                 bytesWritten = writer.write( stream, fileType, out ); // throws IOException
                 flag = true;
@@ -1368,68 +1310,70 @@
         }
     }
 
-
     // METHODS FOR INTERNAL IMPLEMENTATION USE
 
     /**
      * Obtains the set of MixerProviders on the system.
      */
-    private static List getMixerProviders() {
-        return getProviders(MixerProvider.class);
+    @SuppressWarnings("unchecked")
+    private static List<MixerProvider> getMixerProviders() {
+        return (List<MixerProvider>) getProviders(MixerProvider.class);
     }
 
-
     /**
-     * Obtains the set of format converters (codecs, transcoders, etc.)
-     * that are currently installed on the system.
-     * @return an array of
-     * {@link javax.sound.sampled.spi.FormatConversionProvider
-     * FormatConversionProvider}
-     * objects representing the available format converters.  If no format
-     * converters readers are available on the system, an array of length 0 is
-     * returned.
+     * Obtains the set of format converters (codecs, transcoders, etc.) that are
+     * currently installed on the system.
+     *
+     * @return an array of {@link javax.sound.sampled.spi.FormatConversionProvider
+     *         FormatConversionProvider} objects representing the available
+     *         format converters. If no format converters readers are available
+     *         on the system, an array of length 0 is returned.
      */
-    private static List getFormatConversionProviders() {
-        return getProviders(FormatConversionProvider.class);
+    @SuppressWarnings("unchecked")
+    private static List<FormatConversionProvider> getFormatConversionProviders() {
+        return (List<FormatConversionProvider>) getProviders(FormatConversionProvider.class);
     }
 
-
     /**
-     * Obtains the set of audio file readers that are currently installed on the system.
-     * @return a List of
-     * {@link javax.sound.sampled.spi.AudioFileReader
-     * AudioFileReader}
-     * objects representing the installed audio file readers.  If no audio file
-     * readers are available on the system, an empty List is returned.
+     * Obtains the set of audio file readers that are currently installed on the
+     * system.
+     *
+     * @return a List of {@link javax.sound.sampled.spi.AudioFileReader
+     *         AudioFileReader} objects representing the installed audio file
+     *         readers. If no audio file readers are available on the system, an
+     *         empty List is returned.
      */
-    private static List getAudioFileReaders() {
-        return getProviders(AudioFileReader.class);
+    @SuppressWarnings("unchecked")
+    private static List<AudioFileReader> getAudioFileReaders() {
+        return (List<AudioFileReader>)getProviders(AudioFileReader.class);
     }
 
-
     /**
-     * Obtains the set of audio file writers that are currently installed on the system.
-     * @return a List of
-     * {@link javax.sound.samples.spi.AudioFileWriter AudioFileWriter}
-     * objects representing the available audio file writers.  If no audio file
-     * writers are available on the system, an empty List is returned.
+     * Obtains the set of audio file writers that are currently installed on the
+     * system.
+     *
+     * @return a List of {@link javax.sound.sampled.spi.AudioFileWriter
+     *         AudioFileWriter} objects representing the available audio file
+     *         writers. If no audio file writers are available on the system, an
+     *         empty List is returned.
      */
-    private static List getAudioFileWriters() {
-        return getProviders(AudioFileWriter.class);
+    @SuppressWarnings("unchecked")
+    private static List<AudioFileWriter> getAudioFileWriters() {
+        return (List<AudioFileWriter>)getProviders(AudioFileWriter.class);
     }
 
-
-
-    /** Attempts to locate and return a default Mixer that provides lines
-     * of the specified type.
+    /**
+     * Attempts to locate and return a default Mixer that provides lines of the
+     * specified type.
      *
-     * @param providers the installed mixer providers
-     * @param info The requested line type
-     * TargetDataLine.class, Clip.class or Port.class.
-     * @return a Mixer that matches the requirements, or null if no default mixer found
+     * @param  providers the installed mixer providers
+     * @param  info The requested line type TargetDataLine.class, Clip.class or
+     *         Port.class
+     * @return a Mixer that matches the requirements, or null if no default
+     *         mixer found
      */
-    private static Mixer getDefaultMixer(List providers, Line.Info info) {
-        Class lineClass = info.getLineClass();
+    private static Mixer getDefaultMixer(List<MixerProvider> providers, Line.Info info) {
+        Class<?> lineClass = info.getLineClass();
         String providerClassName = JDK13Services.getDefaultProviderClassName(lineClass);
         String instanceName = JDK13Services.getDefaultInstanceName(lineClass);
         Mixer mixer;
@@ -1469,21 +1413,18 @@
         return null;
     }
 
-
-
-    /** Return a MixerProvider of a given class from the list of
-        MixerProviders.
-
-        This method never requires the returned Mixer to do mixing.
-        @param providerClassName The class name of the provider to be returned.
-        @param providers The list of MixerProviders that is searched.
-        @return A MixerProvider of the requested class, or null if none is
-        found.
+    /**
+     * Return a MixerProvider of a given class from the list of MixerProviders.
+     * This method never requires the returned Mixer to do mixing.
+     *
+     * @param  providerClassName The class name of the provider to be returned
+     * @param  providers The list of MixerProviders that is searched
+     * @return A MixerProvider of the requested class, or null if none is found
      */
     private static MixerProvider getNamedProvider(String providerClassName,
-                                                  List providers) {
+                                                  List<MixerProvider> providers) {
         for(int i = 0; i < providers.size(); i++) {
-            MixerProvider provider = (MixerProvider) providers.get(i);
+            MixerProvider provider = providers.get(i);
             if (provider.getClass().getName().equals(providerClassName)) {
                 return provider;
             }
@@ -1491,15 +1432,14 @@
         return null;
     }
 
-
-    /** Return a Mixer with a given name from a given MixerProvider.
-      This method never requires the returned Mixer to do mixing.
-      @param mixerName The name of the Mixer to be returned.
-      @param provider The MixerProvider to check for Mixers.
-      @param info The type of line the returned Mixer is required to
-      support.
-
-      @return A Mixer matching the requirements, or null if none is found.
+    /**
+     * Return a Mixer with a given name from a given MixerProvider. This method
+     * never requires the returned Mixer to do mixing.
+     *
+     * @param  mixerName The name of the Mixer to be returned
+     * @param  provider The MixerProvider to check for Mixers
+     * @param  info The type of line the returned Mixer is required to support
+     * @return A Mixer matching the requirements, or null if none is found
      */
     private static Mixer getNamedMixer(String mixerName,
                                        MixerProvider provider,
@@ -1516,20 +1456,20 @@
         return null;
     }
 
-
-    /** From a List of MixerProviders, return a Mixer with a given name.
-        This method never requires the returned Mixer to do mixing.
-        @param mixerName The name of the Mixer to be returned.
-        @param providers The List of MixerProviders to check for Mixers.
-        @param info The type of line the returned Mixer is required to
-        support.
-        @return A Mixer matching the requirements, or null if none is found.
+    /**
+     * From a List of MixerProviders, return a Mixer with a given name. This
+     * method never requires the returned Mixer to do mixing.
+     *
+     * @param  mixerName The name of the Mixer to be returned
+     * @param  providers The List of MixerProviders to check for Mixers
+     * @param  info The type of line the returned Mixer is required to support
+     * @return A Mixer matching the requirements, or null if none is found
      */
     private static Mixer getNamedMixer(String mixerName,
-                                       List providers,
+                                       List<MixerProvider> providers,
                                        Line.Info info) {
         for(int i = 0; i < providers.size(); i++) {
-            MixerProvider provider = (MixerProvider) providers.get(i);
+            MixerProvider provider = providers.get(i);
             Mixer mixer = getNamedMixer(mixerName, provider, info);
             if (mixer != null) {
                 return mixer;
@@ -1538,16 +1478,14 @@
         return null;
     }
 
-
-    /** From a given MixerProvider, return the first appropriate Mixer.
-        @param provider The MixerProvider to check for Mixers.
-        @param info The type of line the returned Mixer is required to
-        support.
-        @param isMixingRequired If true, only Mixers that support mixing are
-        returned for line types of SourceDataLine and Clip.
-
-        @return A Mixer that is considered appropriate, or null
-        if none is found.
+    /**
+     * From a given MixerProvider, return the first appropriate Mixer.
+     *
+     * @param  provider The MixerProvider to check for Mixers
+     * @param  info The type of line the returned Mixer is required to support
+     * @param  isMixingRequired If true, only Mixers that support mixing are
+     *         returned for line types of SourceDataLine and Clip
+     * @return A Mixer that is considered appropriate, or null if none is found
      */
     private static Mixer getFirstMixer(MixerProvider provider,
                                        Line.Info info,
@@ -1562,15 +1500,14 @@
         return null;
     }
 
-
-    /** Checks if a Mixer is appropriate.
-        A Mixer is considered appropriate if it support the given line type.
-        If isMixingRequired is true and the line type is an output one
-        (SourceDataLine, Clip), the mixer is appropriate if it supports
-        at least 2 (concurrent) lines of the given type.
-
-        @return true if the mixer is considered appropriate according to the
-        rules given above, false otherwise.
+    /**
+     * Checks if a Mixer is appropriate. A Mixer is considered appropriate if it
+     * support the given line type. If isMixingRequired is true and the line
+     * type is an output one (SourceDataLine, Clip), the mixer is appropriate if
+     * it supports at least 2 (concurrent) lines of the given type.
+     *
+     * @return {@code true} if the mixer is considered appropriate according to
+     *         the rules given above, {@code false} otherwise
      */
     private static boolean isAppropriateMixer(Mixer mixer,
                                               Line.Info lineInfo,
@@ -1578,7 +1515,7 @@
         if (! mixer.isLineSupported(lineInfo)) {
             return false;
         }
-        Class lineClass = lineInfo.getLineClass();
+        Class<?> lineClass = lineInfo.getLineClass();
         if (isMixingRequired
             && (SourceDataLine.class.isAssignableFrom(lineClass) ||
                 Clip.class.isAssignableFrom(lineClass))) {
@@ -1588,28 +1525,25 @@
         return true;
     }
 
-
-
     /**
-     * Like getMixerInfo, but return List
+     * Like getMixerInfo, but return List.
      */
-    private static List getMixerInfoList() {
-        List providers = getMixerProviders();
+    private static List<Mixer.Info> getMixerInfoList() {
+        List<MixerProvider> providers = getMixerProviders();
         return getMixerInfoList(providers);
     }
 
-
     /**
-     * Like getMixerInfo, but return List
+     * Like getMixerInfo, but return List.
      */
-    private static List getMixerInfoList(List providers) {
-        List infos = new ArrayList();
+    private static List<Mixer.Info> getMixerInfoList(List<MixerProvider> providers) {
+        List<Mixer.Info> infos = new ArrayList<>();
 
         Mixer.Info[] someInfos; // per-mixer
         Mixer.Info[] allInfos;  // for all mixers
 
         for(int i = 0; i < providers.size(); i++ ) {
-            someInfos = ((MixerProvider)providers.get(i)).getMixerInfo();
+            someInfos = providers.get(i).getMixerInfo();
 
             for (int j = 0; j < someInfos.length; j++) {
                 infos.add(someInfos[j]);
@@ -1619,14 +1553,14 @@
         return infos;
     }
 
-
     /**
-     * Obtains the set of services currently installed on the system
-     * using the SPI mechanism in 1.3.
-     * @return a List of instances of providers for the requested service.
-     * If no providers are available, a vector of length 0 will be returned.
+     * Obtains the set of services currently installed on the system using the
+     * SPI mechanism in 1.3.
+     *
+     * @return a List of instances of providers for the requested service. If no
+     *         providers are available, a vector of length 0 will be returned.
      */
-    private static List getProviders(Class providerClass) {
+    private static List<?> getProviders(Class<?> providerClass) {
         return JDK13Services.getProviders(providerClass);
     }
 }
--- a/src/share/classes/javax/sound/sampled/BooleanControl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/BooleanControl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,34 +26,29 @@
 package javax.sound.sampled;
 
 /**
- * A <code>BooleanControl</code> provides the ability to switch between
- * two possible settings that affect a line's audio.  The settings are boolean
- * values (<code>true</code> and <code>false</code>).  A graphical user interface
- * might represent the control by a two-state button, an on/off switch, two
- * mutually exclusive buttons, or a checkbox (among other possibilities).
- * For example, depressing a button might activate a
- * <code>{@link BooleanControl.Type#MUTE MUTE}</code> control to silence
- * the line's audio.
+ * A {@code BooleanControl} provides the ability to switch between two possible
+ * settings that affect a line's audio. The settings are boolean values
+ * ({@code true} and {@code false}). A graphical user interface might represent
+ * the control by a two-state button, an on/off switch, two mutually exclusive
+ * buttons, or a checkbox (among other possibilities). For example, depressing a
+ * button might activate a {@link BooleanControl.Type#MUTE MUTE} control to
+ * silence the line's audio.
  * <p>
- * As with other <code>{@link Control}</code> subclasses, a method is
- * provided that returns string labels for the values, suitable for
- * display in the user interface.
+ * As with other {@code Control} subclasses, a method is provided that returns
+ * string labels for the values, suitable for display in the user interface.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public abstract class BooleanControl extends Control {
 
-
-    // INSTANCE VARIABLES
-
     /**
-     * The <code>true</code> state label, such as "true" or "on."
+     * The {@code true} state label, such as "true" or "on".
      */
     private final String trueStateLabel;
 
     /**
-     * The <code>false</code> state label, such as "false" or "off."
+     * The {@code false} state label, such as "false" or "off".
      */
     private final String falseStateLabel;
 
@@ -62,19 +57,15 @@
      */
     private boolean value;
 
-
-    // CONSTRUCTORS
-
-
     /**
      * Constructs a new boolean control object with the given parameters.
      *
-     * @param type the type of control represented this float control object
-     * @param initialValue the initial control value
-     * @param trueStateLabel the label for the state represented by <code>true</code>,
-     * such as "true" or "on."
-     * @param falseStateLabel the label for the state represented by <code>false</code>,
-     * such as "false" or "off."
+     * @param  type the type of control represented this float control object
+     * @param  initialValue the initial control value
+     * @param  trueStateLabel the label for the state represented by
+     *         {@code true}, such as "true" or "on"
+     * @param  falseStateLabel the label for the state represented by
+     *         {@code false}, such as "false" or "off"
      */
     protected BooleanControl(Type type, boolean initialValue, String trueStateLabel, String falseStateLabel) {
 
@@ -84,110 +75,88 @@
         this.falseStateLabel = falseStateLabel;
     }
 
-
     /**
-     * Constructs a new boolean control object with the given parameters.
-     * The labels for the <code>true</code> and <code>false</code> states
-     * default to "true" and "false."
+     * Constructs a new boolean control object with the given parameters. The
+     * labels for the {@code true} and {@code false} states default to "true"
+     * and "false".
      *
-     * @param type the type of control represented by this float control object
-     * @param initialValue the initial control value
+     * @param  type the type of control represented by this float control object
+     * @param  initialValue the initial control value
      */
     protected BooleanControl(Type type, boolean initialValue) {
         this(type, initialValue, "true", "false");
     }
 
-
-    // METHODS
-
-
     /**
-     * Sets the current value for the control.  The default
-     * implementation simply sets the value as indicated.
-     * Some controls require that their line be open before they can be affected
-     * by setting a value.
-     * @param value desired new value.
+     * Sets the current value for the control. The default implementation simply
+     * sets the value as indicated. Some controls require that their line be
+     * open before they can be affected by setting a value.
+     *
+     * @param  value desired new value
      */
     public void setValue(boolean value) {
         this.value = value;
     }
 
-
-
     /**
      * Obtains this control's current value.
-     * @return current value.
+     *
+     * @return current value
      */
     public boolean getValue() {
         return value;
     }
 
-
     /**
      * Obtains the label for the specified state.
-     * @param state the state whose label will be returned
-     * @return the label for the specified state, such as "true" or "on"
-     * for <code>true</code>, or "false" or "off" for <code>false</code>.
+     *
+     * @param  state the state whose label will be returned
+     * @return the label for the specified state, such as "true" or "on" for
+     *         {@code true}, or "false" or "off" for {@code false}
      */
     public String getStateLabel(boolean state) {
         return ((state == true) ? trueStateLabel : falseStateLabel);
     }
 
-
-
-    // ABSTRACT METHOD IMPLEMENTATIONS: CONTROL
-
-
     /**
-     * Provides a string representation of the control
+     * Provides a string representation of the control.
+     *
      * @return a string description
      */
+    @Override
     public String toString() {
         return new String(super.toString() + " with current value: " + getStateLabel(getValue()));
     }
 
-
-    // INNER CLASSES
-
-
     /**
-     * An instance of the <code>BooleanControl.Type</code> class identifies one kind of
-     * boolean control.  Static instances are provided for the
-     * common types.
+     * An instance of the {@code BooleanControl.Type} class identifies one kind
+     * of boolean control. Static instances are provided for the common types.
      *
      * @author Kara Kytle
      * @since 1.3
      */
     public static class Type extends Control.Type {
 
-
-        // TYPE DEFINES
-
-
         /**
-         * Represents a control for the mute status of a line.
-         * Note that mute status does not affect gain.
+         * Represents a control for the mute status of a line. Note that mute
+         * status does not affect gain.
          */
         public static final Type MUTE                           = new Type("Mute");
 
         /**
-         * Represents a control for whether reverberation is applied
-         * to a line.  Note that the status of this control not affect
-         * the reverberation settings for a line, but does affect whether
-         * these settings are used.
+         * Represents a control for whether reverberation is applied to a line.
+         * Note that the status of this control not affect the reverberation
+         * settings for a line, but does affect whether these settings are used.
          */
         public static final Type APPLY_REVERB           = new Type("Apply Reverb");
 
-
-        // CONSTRUCTOR
-
-
         /**
          * Constructs a new boolean control type.
-         * @param name  the name of the new boolean control type
+         *
+         * @param name the name of the new boolean control type
          */
-        protected Type(String name) {
+        protected Type(final String name) {
             super(name);
         }
-    } // class Type
+    }
 }
--- a/src/share/classes/javax/sound/sampled/Clip.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/Clip.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,188 +25,184 @@
 
 package javax.sound.sampled;
 
-import java.io.InputStream;
 import java.io.IOException;
 
 /**
- * The <code>Clip</code> interface represents a special kind of data line whose
- * audio data can be loaded prior to playback, instead of being streamed in
- * real time.
+ * The {@code Clip} interface represents a special kind of data line whose audio
+ * data can be loaded prior to playback, instead of being streamed in real time.
  * <p>
- * Because the data is pre-loaded and has a known length, you can set a clip
- * to start playing at any position in its audio data.  You can also create a
- * loop, so that when the clip is played it will cycle repeatedly.  Loops are
- * specified with a starting and ending sample frame, along with the number of
- * times that the loop should be played.
+ * Because the data is pre-loaded and has a known length, you can set a clip to
+ * start playing at any position in its audio data. You can also create a loop,
+ * so that when the clip is played it will cycle repeatedly. Loops are specified
+ * with a starting and ending sample frame, along with the number of times that
+ * the loop should be played.
  * <p>
- * Clips may be obtained from a <code>{@link Mixer}</code> that supports lines
- * of this type.  Data is loaded into a clip when it is opened.
+ * Clips may be obtained from a {@link Mixer} that supports lines of this type.
+ * Data is loaded into a clip when it is opened.
  * <p>
- * Playback of an audio clip may be started and stopped using the <code>start</code>
- * and <code>stop</code> methods.  These methods do not reset the media position;
- * <code>start</code> causes playback to continue from the position where playback
- * was last stopped.  To restart playback from the beginning of the clip's audio
- * data, simply follow the invocation of <code>{@link DataLine#stop stop}</code>
- * with setFramePosition(0), which rewinds the media to the beginning
- * of the clip.
+ * Playback of an audio clip may be started and stopped using the
+ * {@link #start start} and {@link #stop stop} methods. These methods do not
+ * reset the media position; {@code start} causes playback to continue from the
+ * position where playback was last stopped. To restart playback from the
+ * beginning of the clip's audio data, simply follow the invocation of
+ * {@code stop} with {@code setFramePosition(0)}, which rewinds the media to the
+ * beginning of the clip.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public interface Clip extends DataLine {
 
-
     /**
      * A value indicating that looping should continue indefinitely rather than
      * complete after a specific number of loops.
+     *
      * @see #loop
      */
-    public static final int LOOP_CONTINUOUSLY = -1;
+    int LOOP_CONTINUOUSLY = -1;
 
     /**
-     * Opens the clip, meaning that it should acquire any required
-     * system resources and become operational.  The clip is opened
-     * with the format and audio data indicated.
-     * If this operation succeeds, the line is marked as open and an
-     * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched
-     * to the line's listeners.
+     * Opens the clip, meaning that it should acquire any required system
+     * resources and become operational. The clip is opened with the format and
+     * audio data indicated. If this operation succeeds, the line is marked as
+     * open and an {@link LineEvent.Type#OPEN OPEN} event is dispatched to the
+     * line's listeners.
      * <p>
-     * Invoking this method on a line which is already open is illegal
-     * and may result in an IllegalStateException.
+     * Invoking this method on a line which is already open is illegal and may
+     * result in an {@code IllegalStateException}.
      * <p>
-     * Note that some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in a
-     * <code>{@link LineUnavailableException}</code>.
+     * Note that some lines, once closed, cannot be reopened. Attempts to reopen
+     * such a line will always result in a {@code LineUnavailableException}.
      *
-     * @param format the format of the supplied audio data
-     * @param data a byte array containing audio data to load into the clip
-     * @param offset the point at which to start copying, expressed in
-     * <em>bytes</em> from the beginning of the array
-     * @param bufferSize the number of <em>bytes</em>
-     * of data to load into the clip from the array.
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions
-     * @throws IllegalArgumentException if the buffer size does not represent
-     * an integral number of sample frames,
-     * or if <code>format</code> is not fully specified or invalid
+     * @param  format the format of the supplied audio data
+     * @param  data a byte array containing audio data to load into the clip
+     * @param  offset the point at which to start copying, expressed in
+     *         <em>bytes</em> from the beginning of the array
+     * @param  bufferSize the number of <em>bytes</em> of data to load into the
+     *         clip from the array
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws IllegalArgumentException if the buffer size does not represent an
+     *         integral number of sample frames, or if {@code format} is not
+     *         fully specified or invalid
      * @throws IllegalStateException if the line is already open
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions
-     *
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #close
      * @see #isOpen
      * @see LineListener
      */
-    public void open(AudioFormat format, byte[] data, int offset, int bufferSize) throws LineUnavailableException;
+    void open(AudioFormat format, byte[] data, int offset, int bufferSize)
+            throws LineUnavailableException;
 
     /**
-     * Opens the clip with the format and audio data present in the provided audio
-     * input stream.  Opening a clip means that it should acquire any required
-     * system resources and become operational.  If this operation
-     * input stream.  If this operation
-     * succeeds, the line is marked open and an
-     * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched
-     * to the line's listeners.
+     * Opens the clip with the format and audio data present in the provided
+     * audio input stream. Opening a clip means that it should acquire any
+     * required system resources and become operational. If this operation input
+     * stream. If this operation succeeds, the line is marked open and an
+     * {@link LineEvent.Type#OPEN OPEN} event is dispatched to the line's
+     * listeners.
      * <p>
-     * Invoking this method on a line which is already open is illegal
-     * and may result in an IllegalStateException.
+     * Invoking this method on a line which is already open is illegal and may
+     * result in an {@code IllegalStateException}.
      * <p>
-     * Note that some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in a
-     * <code>{@link LineUnavailableException}</code>.
+     * Note that some lines, once closed, cannot be reopened. Attempts to reopen
+     * such a line will always result in a {@code LineUnavailableException}.
      *
-     * @param stream an audio input stream from which audio data will be read into
-     * the clip
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions
-     * @throws IOException if an I/O exception occurs during reading of
-     * the stream
-     * @throws IllegalArgumentException if the stream's audio format
-     * is not fully specified or invalid
+     * @param  stream an audio input stream from which audio data will be read
+     *         into the clip
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws IOException if an I/O exception occurs during reading of the
+     *         stream
+     * @throws IllegalArgumentException if the stream's audio format is not
+     *         fully specified or invalid
      * @throws IllegalStateException if the line is already open
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions
-     *
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #close
      * @see #isOpen
      * @see LineListener
      */
-    public void open(AudioInputStream stream) throws LineUnavailableException, IOException;
+    void open(AudioInputStream stream)
+            throws LineUnavailableException, IOException;
 
     /**
      * Obtains the media length in sample frames.
-     * @return the media length, expressed in sample frames,
-     * or <code>AudioSystem.NOT_SPECIFIED</code> if the line is not open.
+     *
+     * @return the media length, expressed in sample frames, or
+     *         {@code AudioSystem.NOT_SPECIFIED} if the line is not open
      * @see AudioSystem#NOT_SPECIFIED
      */
-    public int getFrameLength();
+    int getFrameLength();
 
     /**
-     * Obtains the media duration in microseconds
-     * @return the media duration, expressed in microseconds,
-     * or <code>AudioSystem.NOT_SPECIFIED</code> if the line is not open.
+     * Obtains the media duration in microseconds.
+     *
+     * @return the media duration, expressed in microseconds, or
+     *         {@code AudioSystem.NOT_SPECIFIED} if the line is not open
      * @see AudioSystem#NOT_SPECIFIED
      */
-    public long getMicrosecondLength();
+    long getMicrosecondLength();
 
     /**
-     * Sets the media position in sample frames.  The position is zero-based;
-     * the first frame is frame number zero.  When the clip begins playing the
-     * next time, it will start by playing the frame at this position.
+     * Sets the media position in sample frames. The position is zero-based; the
+     * first frame is frame number zero. When the clip begins playing the next
+     * time, it will start by playing the frame at this position.
      * <p>
      * To obtain the current position in sample frames, use the
-     * <code>{@link DataLine#getFramePosition getFramePosition}</code>
-     * method of <code>DataLine</code>.
+     * {@link DataLine#getFramePosition getFramePosition} method of
+     * {@code DataLine}.
      *
-     * @param frames the desired new media position, expressed in sample frames
+     * @param  frames the desired new media position, expressed in sample frames
      */
-    public void setFramePosition(int frames);
+    void setFramePosition(int frames);
 
     /**
-     * Sets the media position in microseconds.  When the clip begins playing the
-     * next time, it will start at this position.
-     * The level of precision is not guaranteed.  For example, an implementation
-     * might calculate the microsecond position from the current frame position
-     * and the audio sample frame rate.  The precision in microseconds would
-     * then be limited to the number of microseconds per sample frame.
+     * Sets the media position in microseconds. When the clip begins playing the
+     * next time, it will start at this position. The level of precision is not
+     * guaranteed. For example, an implementation might calculate the
+     * microsecond position from the current frame position and the audio sample
+     * frame rate. The precision in microseconds would then be limited to the
+     * number of microseconds per sample frame.
      * <p>
      * To obtain the current position in microseconds, use the
-     * <code>{@link DataLine#getMicrosecondPosition getMicrosecondPosition}</code>
-     * method of <code>DataLine</code>.
+     * {@link DataLine#getMicrosecondPosition getMicrosecondPosition} method of
+     * {@code DataLine}.
      *
-     * @param microseconds the desired new media position, expressed in microseconds
+     * @param  microseconds the desired new media position, expressed in
+     *         microseconds
      */
-    public void setMicrosecondPosition(long microseconds);
+    void setMicrosecondPosition(long microseconds);
 
     /**
-     * Sets the first and last sample frames that will be played in
-     * the loop.  The ending point must be greater than
-     * or equal to the starting point, and both must fall within the
-     * the size of the loaded media.  A value of 0 for the starting
-     * point means the beginning of the loaded media.  Similarly, a value of -1
-     * for the ending point indicates the last frame of the media.
-     * @param start the loop's starting position, in sample frames (zero-based)
-     * @param end the loop's ending position, in sample frames (zero-based), or
-     * -1 to indicate the final frame
-     * @throws IllegalArgumentException if the requested
-     * loop points cannot be set, usually because one or both falls outside
-     * the media's duration or because the ending point is
-     * before the starting point
+     * Sets the first and last sample frames that will be played in the loop.
+     * The ending point must be greater than or equal to the starting point, and
+     * both must fall within the the size of the loaded media. A value of 0 for
+     * the starting point means the beginning of the loaded media. Similarly, a
+     * value of -1 for the ending point indicates the last frame of the media.
+     *
+     * @param  start the loop's starting position, in sample frames (zero-based)
+     * @param  end the loop's ending position, in sample frames (zero-based),
+     *         or -1 to indicate the final frame
+     * @throws IllegalArgumentException if the requested loop points cannot be
+     *         set, usually because one or both falls outside the media's
+     *         duration or because the ending point is before the starting point
      */
-    public void setLoopPoints(int start, int end);
+    void setLoopPoints(int start, int end);
 
     /**
-     * Starts looping playback from the current position.   Playback will
-     * continue to the loop's end point, then loop back to the loop start point
-     * <code>count</code> times, and finally continue playback to the end of
-     * the clip.
+     * Starts looping playback from the current position. Playback will continue
+     * to the loop's end point, then loop back to the loop start point
+     * {@code count} times, and finally continue playback to the end of the
+     * clip.
      * <p>
      * If the current position when this method is invoked is greater than the
-     * loop end point, playback simply continues to the
-     * end of the clip without looping.
+     * loop end point, playback simply continues to the end of the clip without
+     * looping.
      * <p>
-     * A <code>count</code> value of 0 indicates that any current looping should
-     * cease and playback should continue to the end of the clip.  The behavior
+     * A {@code count} value of 0 indicates that any current looping should
+     * cease and playback should continue to the end of the clip. The behavior
      * is undefined when this method is invoked with any other value during a
      * loop operation.
      * <p>
@@ -214,10 +210,10 @@
      * cleared; the behavior of subsequent loop and start requests is not
      * affected by an interrupted loop operation.
      *
-     * @param count the number of times playback should loop back from the
-     * loop's end position to the loop's  start position, or
-     * <code>{@link #LOOP_CONTINUOUSLY}</code> to indicate that looping should
-     * continue until interrupted
+     * @param  count the number of times playback should loop back from the
+     *         loop's end position to the loop's start position, or
+     *         {@link #LOOP_CONTINUOUSLY} to indicate that looping should
+     *         continue until interrupted
      */
-    public void loop(int count);
+    void loop(int count);
 }
--- a/src/share/classes/javax/sound/sampled/CompoundControl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/CompoundControl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,55 +26,37 @@
 package javax.sound.sampled;
 
 /**
- * A <code>CompoundControl</code>, such as a graphic equalizer, provides control
- * over two or more related properties, each of which is itself represented as
- * a <code>Control</code>.
+ * A {@code CompoundControl}, such as a graphic equalizer, provides control over
+ * two or more related properties, each of which is itself represented as a
+ * {@code Control}.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public abstract class CompoundControl extends Control {
 
-
-    // TYPE DEFINES
-
-
-    // INSTANCE VARIABLES
-
-
     /**
      * The set of member controls.
      */
     private Control[] controls;
 
-
-
-    // CONSTRUCTORS
-
-
     /**
      * Constructs a new compound control object with the given parameters.
      *
-     * @param type the type of control represented this compound control object
-     * @param memberControls the set of member controls
+     * @param  type the type of control represented this compound control object
+     * @param  memberControls the set of member controls
      */
     protected CompoundControl(Type type, Control[] memberControls) {
-
         super(type);
         this.controls = memberControls;
     }
 
-
-
-    // METHODS
-
-
     /**
      * Returns the set of member controls that comprise the compound control.
-     * @return the set of member controls.
+     *
+     * @return the set of member controls
      */
     public Control[] getMemberControls() {
-
         Control[] localArray = new Control[controls.length];
 
         for (int i = 0; i < controls.length; i++) {
@@ -84,14 +66,12 @@
         return localArray;
     }
 
-
-    // ABSTRACT METHOD IMPLEMENTATIONS: CONTROL
-
-
     /**
-     * Provides a string representation of the control
+     * Provides a string representation of the control.
+     *
      * @return a string description
      */
+    @Override
     public String toString() {
 
         StringBuilder sb = new StringBuilder();
@@ -108,13 +88,9 @@
         return new String(getType() + " Control containing " + sb + " Controls.");
     }
 
-
-    // INNER CLASSES
-
-
     /**
-     * An instance of the <code>CompoundControl.Type</code> inner class identifies one kind of
-     * compound control.  Static instances are provided for the
+     * An instance of the {@code CompoundControl.Type} inner class identifies
+     * one kind of compound control. Static instances are provided for the
      * common types.
      *
      * @author Kara Kytle
@@ -122,19 +98,13 @@
      */
     public static class Type extends Control.Type {
 
-
-        // TYPE DEFINES
-
-        // CONSTRUCTOR
-
-
         /**
          * Constructs a new compound control type.
-         * @param name  the name of the new compound control type
+         *
+         * @param  name the name of the new compound control type
          */
-        protected Type(String name) {
+        protected Type(final String name) {
             super(name);
         }
-    } // class Type
-
-} // class CompoundControl
+    }
+}
--- a/src/share/classes/javax/sound/sampled/Control.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/Control.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,121 +26,102 @@
 package javax.sound.sampled;
 
 /**
- * {@link Line Lines} often have a set of controls, such as gain and pan, that affect
- * the audio signal passing through the line.  Java Sound's <code>Line</code> objects
- * let you obtain a particular control object by passing its class as the
- * argument to a {@link Line#getControl(Control.Type) getControl} method.
+ * {@link Line Lines} often have a set of controls, such as gain and pan, that
+ * affect the audio signal passing through the line. Java Sound's {@code Line}
+ * objects let you obtain a particular control object by passing its class as
+ * the argument to a {@link Line#getControl(Control.Type) getControl} method.
  * <p>
  * Because the various types of controls have different purposes and features,
- * all of their functionality is accessed from the subclasses that define
- * each kind of control.
+ * all of their functionality is accessed from the subclasses that define each
+ * kind of control.
  *
  * @author Kara Kytle
- *
  * @see Line#getControls
  * @see Line#isControlSupported
  * @since 1.3
  */
 public abstract class Control {
 
-
-    // INSTANCE VARIABLES
-
     /**
      * The control type.
      */
     private final Type type;
 
-
-
-    // CONSTRUCTORS
-
     /**
      * Constructs a Control with the specified type.
-     * @param type the kind of control desired
+     *
+     * @param  type the kind of control desired
      */
     protected Control(Type type) {
         this.type = type;
     }
 
-
-    // METHODS
-
     /**
      * Obtains the control's type.
-     * @return the control's type.
+     *
+     * @return the control's type
      */
     public Type getType() {
         return type;
     }
 
-
-    // ABSTRACT METHODS
-
     /**
      * Obtains a String describing the control type and its current state.
-     * @return a String representation of the Control.
+     *
+     * @return a String representation of the Control
      */
+    @Override
     public String toString() {
         return new String(getType() + " Control");
     }
 
-
     /**
-     * An instance of the <code>Type</code> class represents the type of
-     * the control.  Static instances are provided for the
-     * common types.
+     * An instance of the {@code Type} class represents the type of the control.
+     * Static instances are provided for the common types.
      */
     public static class Type {
 
-        // CONTROL TYPE DEFINES
-
-        // INSTANCE VARIABLES
-
         /**
          * Type name.
          */
         private String name;
 
-
-        // CONSTRUCTOR
-
         /**
-         * Constructs a new control type with the name specified.
-         * The name should be a descriptive string appropriate for
-         * labelling the control in an application, such as "Gain" or "Balance."
-         * @param name  the name of the new control type.
+         * Constructs a new control type with the name specified. The name
+         * should be a descriptive string appropriate for labelling the control
+         * in an application, such as "Gain" or "Balance".
+         *
+         * @param  name the name of the new control type
          */
         protected Type(String name) {
             this.name = name;
         }
 
-
-        // METHODS
-
         /**
-         * Finalizes the equals method
+         * Finalizes the equals method.
          */
+        @Override
         public final boolean equals(Object obj) {
             return super.equals(obj);
         }
 
         /**
-         * Finalizes the hashCode method
+         * Finalizes the hashCode method.
          */
+        @Override
         public final int hashCode() {
             return super.hashCode();
         }
 
         /**
-         * Provides the <code>String</code> representation of the control type.  This <code>String</code> is
-         * the same name that was passed to the constructor.
+         * Provides the {@code String} representation of the control type. This
+         * {@code String} is the same name that was passed to the constructor.
          *
          * @return the control type name
          */
+        @Override
         public final String toString() {
             return name;
         }
-    } // class Type
-
-} // class Control
+    }
+}
--- a/src/share/classes/javax/sound/sampled/DataLine.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/DataLine.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,40 +28,35 @@
 import java.util.Arrays;
 
 /**
- * <code>DataLine</code> adds media-related functionality to its
- * superinterface, <code>{@link Line}</code>.  This functionality includes
- * transport-control methods that start, stop, drain, and flush
- * the audio data that passes through the line.  A data line can also
- * report the current position, volume, and audio format of the media.
- * Data lines are used for output of audio by means of the
- * subinterfaces <code>{@link SourceDataLine}</code> or
- * <code>{@link Clip}</code>, which allow an application program to write data.  Similarly,
- * audio input is handled by the subinterface <code>{@link TargetDataLine}</code>,
- * which allows data to be read.
+ * {@code DataLine} adds media-related functionality to its superinterface,
+ * {@code Line}. This functionality includes transport-control methods that
+ * start, stop, drain, and flush the audio data that passes through the line. A
+ * data line can also report the current position, volume, and audio format of
+ * the media. Data lines are used for output of audio by means of the
+ * subinterfaces {@link SourceDataLine} or {@link Clip}, which allow an
+ * application program to write data. Similarly, audio input is handled by the
+ * subinterface {@link TargetDataLine}, which allows data to be read.
  * <p>
- * A data line has an internal buffer in which
- * the incoming or outgoing audio data is queued.  The
- * <code>{@link #drain()}</code> method blocks until this internal buffer
- * becomes empty, usually because all queued data has been processed.  The
- * <code>{@link #flush()}</code> method discards any available queued data
- * from the internal buffer.
+ * A data line has an internal buffer in which the incoming or outgoing audio
+ * data is queued. The {@link #drain()} method blocks until this internal buffer
+ * becomes empty, usually because all queued data has been processed. The
+ * {@link #flush()} method discards any available queued data from the internal
+ * buffer.
  * <p>
- * A data line produces <code>{@link LineEvent.Type#START START}</code> and
- * <code>{@link LineEvent.Type#STOP STOP}</code> events whenever
- * it begins or ceases active presentation or capture of data.  These events
- * can be generated in response to specific requests, or as a result of
- * less direct state changes.  For example, if <code>{@link #start()}</code> is called
- * on an inactive data line, and data is available for capture or playback, a
- * <code>START</code> event will be generated shortly, when data playback
- * or capture actually begins.  Or, if the flow of data to an active data
- * line is constricted so that a gap occurs in the presentation of data,
- * a <code>STOP</code> event is generated.
+ * A data line produces {@link LineEvent.Type#START START} and
+ * {@link LineEvent.Type#STOP STOP} events whenever it begins or ceases active
+ * presentation or capture of data. These events can be generated in response to
+ * specific requests, or as a result of less direct state changes. For example,
+ * if {@link #start()} is called on an inactive data line, and data is available
+ * for capture or playback, a {@code START} event will be generated shortly,
+ * when data playback or capture actually begins. Or, if the flow of data to an
+ * active data line is constricted so that a gap occurs in the presentation of
+ * data, a {@code STOP} event is generated.
  * <p>
  * Mixers often support synchronized control of multiple data lines.
  * Synchronization can be established through the Mixer interface's
- * <code>{@link Mixer#synchronize synchronize}</code> method.
- * See the description of the <code>{@link Mixer Mixer}</code> interface
- * for a more complete description.
+ * {@link Mixer#synchronize synchronize} method. See the description of the
+ * {@link Mixer Mixer} interface for a more complete description.
  *
  * @author Kara Kytle
  * @see LineEvent
@@ -69,220 +64,217 @@
  */
 public interface DataLine extends Line {
 
-
     /**
-     * Drains queued data from the line by continuing data I/O until the
-     * data line's internal buffer has been emptied.
-     * This method blocks until the draining is complete.  Because this is a
-     * blocking method, it should be used with care.  If <code>drain()</code>
-     * is invoked on a stopped line that has data in its queue, the method will
-     * block until the line is running and the data queue becomes empty.  If
-     * <code>drain()</code> is invoked by one thread, and another continues to
-     * fill the data queue, the operation will not complete.
-     * This method always returns when the data line is closed.
+     * Drains queued data from the line by continuing data I/O until the data
+     * line's internal buffer has been emptied. This method blocks until the
+     * draining is complete. Because this is a blocking method, it should be
+     * used with care. If {@code drain()} is invoked on a stopped line that has
+     * data in its queue, the method will block until the line is running and
+     * the data queue becomes empty. If {@code drain()} is invoked by one
+     * thread, and another continues to fill the data queue, the operation will
+     * not complete. This method always returns when the data line is closed.
      *
      * @see #flush()
      */
-    public void drain();
+    void drain();
 
     /**
-     * Flushes queued data from the line.  The flushed data is discarded.
-     * In some cases, not all queued data can be discarded.  For example, a
-     * mixer can flush data from the buffer for a specific input line, but any
-     * unplayed data already in the output buffer (the result of the mix) will
-     * still be played.  You can invoke this method after pausing a line (the
-     * normal case) if you want to skip the "stale" data when you restart
-     * playback or capture. (It is legal to flush a line that is not stopped,
-     * but doing so on an active line is likely to cause a discontinuity in the
-     * data, resulting in a perceptible click.)
+     * Flushes queued data from the line. The flushed data is discarded. In some
+     * cases, not all queued data can be discarded. For example, a mixer can
+     * flush data from the buffer for a specific input line, but any unplayed
+     * data already in the output buffer (the result of the mix) will still be
+     * played. You can invoke this method after pausing a line (the normal case)
+     * if you want to skip the "stale" data when you restart playback or
+     * capture. (It is legal to flush a line that is not stopped, but doing so
+     * on an active line is likely to cause a discontinuity in the data,
+     * resulting in a perceptible click.)
      *
      * @see #stop()
      * @see #drain()
      */
-    public void flush();
+    void flush();
 
     /**
-     * Allows a line to engage in data I/O.  If invoked on a line
-     * that is already running, this method does nothing.  Unless the data in
-     * the buffer has been flushed, the line resumes I/O starting
-     * with the first frame that was unprocessed at the time the line was
-     * stopped. When audio capture or playback starts, a
-     * <code>{@link LineEvent.Type#START START}</code> event is generated.
+     * Allows a line to engage in data I/O. If invoked on a line that is already
+     * running, this method does nothing. Unless the data in the buffer has been
+     * flushed, the line resumes I/O starting with the first frame that was
+     * unprocessed at the time the line was stopped. When audio capture or
+     * playback starts, a {@link LineEvent.Type#START START} event is generated.
      *
      * @see #stop()
      * @see #isRunning()
      * @see LineEvent
      */
-    public void start();
+    void start();
 
     /**
-     * Stops the line.  A stopped line should cease I/O activity.
-     * If the line is open and running, however, it should retain the resources required
-     * to resume activity.  A stopped line should retain any audio data in its buffer
-     * instead of discarding it, so that upon resumption the I/O can continue where it left off,
-     * if possible.  (This doesn't guarantee that there will never be discontinuities beyond the
-     * current buffer, of course; if the stopped condition continues
-     * for too long, input or output samples might be dropped.)  If desired, the retained data can be
-     * discarded by invoking the <code>flush</code> method.
-     * When audio capture or playback stops, a <code>{@link LineEvent.Type#STOP STOP}</code> event is generated.
+     * Stops the line. A stopped line should cease I/O activity. If the line is
+     * open and running, however, it should retain the resources required to
+     * resume activity. A stopped line should retain any audio data in its
+     * buffer instead of discarding it, so that upon resumption the I/O can
+     * continue where it left off, if possible. (This doesn't guarantee that
+     * there will never be discontinuities beyond the current buffer, of course;
+     * if the stopped condition continues for too long, input or output samples
+     * might be dropped.) If desired, the retained data can be discarded by
+     * invoking the {@code flush} method. When audio capture or playback stops,
+     * a {@link LineEvent.Type#STOP STOP} event is generated.
      *
      * @see #start()
      * @see #isRunning()
      * @see #flush()
      * @see LineEvent
      */
-    public void stop();
+    void stop();
 
     /**
-     * Indicates whether the line is running.  The default is <code>false</code>.
-     * An open line begins running when the first data is presented in response to an
-     * invocation of the <code>start</code> method, and continues
-     * until presentation ceases in response to a call to <code>stop</code> or
-     * because playback completes.
-     * @return <code>true</code> if the line is running, otherwise <code>false</code>
+     * Indicates whether the line is running. The default is {@code false}. An
+     * open line begins running when the first data is presented in response to
+     * an invocation of the {@code start} method, and continues until
+     * presentation ceases in response to a call to {@code stop} or because
+     * playback completes.
+     *
+     * @return {@code true} if the line is running, otherwise {@code false}
      * @see #start()
      * @see #stop()
      */
-    public boolean isRunning();
+    boolean isRunning();
 
     /**
-     * Indicates whether the line is engaging in active I/O (such as playback
-     * or capture).  When an inactive line becomes active, it sends a
-     * <code>{@link LineEvent.Type#START START}</code> event to its listeners.  Similarly, when
-     * an active line becomes inactive, it sends a
-     * <code>{@link LineEvent.Type#STOP STOP}</code> event.
-     * @return <code>true</code> if the line is actively capturing or rendering
-     * sound, otherwise <code>false</code>
+     * Indicates whether the line is engaging in active I/O (such as playback or
+     * capture). When an inactive line becomes active, it sends a
+     * {@link LineEvent.Type#START START} event to its listeners. Similarly,
+     * when an active line becomes inactive, it sends a
+     * {@link LineEvent.Type#STOP STOP} event.
+     *
+     * @return {@code true} if the line is actively capturing or rendering
+     *         sound, otherwise {@code false}
      * @see #isOpen
      * @see #addLineListener
      * @see #removeLineListener
      * @see LineEvent
      * @see LineListener
      */
-    public boolean isActive();
+    boolean isActive();
 
     /**
      * Obtains the current format (encoding, sample rate, number of channels,
      * etc.) of the data line's audio data.
-     *
-     * <p>If the line is not open and has never been opened, it returns
-     * the default format. The default format is an implementation
-     * specific audio format, or, if the <code>DataLine.Info</code>
-     * object, which was used to retrieve this <code>DataLine</code>,
-     * specifies at least one fully qualified audio format, the
-     * last one will be used as the default format. Opening the
-     * line with a specific audio format (e.g.
-     * {@link SourceDataLine#open(AudioFormat)}) will override the
-     * default format.
+     * <p>
+     * If the line is not open and has never been opened, it returns the default
+     * format. The default format is an implementation specific audio format,
+     * or, if the {@code DataLine.Info} object, which was used to retrieve this
+     * {@code DataLine}, specifies at least one fully qualified audio format,
+     * the last one will be used as the default format. Opening the line with a
+     * specific audio format (e.g. {@link SourceDataLine#open(AudioFormat)})
+     * will override the default format.
      *
      * @return current audio data format
      * @see AudioFormat
      */
-    public AudioFormat getFormat();
+    AudioFormat getFormat();
 
     /**
-     * Obtains the maximum number of bytes of data that will fit in the data line's
-     * internal buffer.  For a source data line, this is the size of the buffer to
-     * which data can be written.  For a target data line, it is the size of
-     * the buffer from which data can be read.  Note that
-     * the units used are bytes, but will always correspond to an integral
-     * number of sample frames of audio data.
+     * Obtains the maximum number of bytes of data that will fit in the data
+     * line's internal buffer. For a source data line, this is the size of the
+     * buffer to which data can be written. For a target data line, it is the
+     * size of the buffer from which data can be read. Note that the units used
+     * are bytes, but will always correspond to an integral number of sample
+     * frames of audio data.
      *
      * @return the size of the buffer in bytes
      */
-    public int getBufferSize();
+    int getBufferSize();
 
     /**
      * Obtains the number of bytes of data currently available to the
-     * application for processing in the data line's internal buffer.  For a
+     * application for processing in the data line's internal buffer. For a
      * source data line, this is the amount of data that can be written to the
-     * buffer without blocking.  For a target data line, this is the amount of data
-     * available to be read by the application.  For a clip, this value is always
-     * 0 because the audio data is loaded into the buffer when the clip is opened,
-     * and persists without modification until the clip is closed.
+     * buffer without blocking. For a target data line, this is the amount of
+     * data available to be read by the application. For a clip, this value is
+     * always 0 because the audio data is loaded into the buffer when the clip
+     * is opened, and persists without modification until the clip is closed.
      * <p>
-     * Note that the units used are bytes, but will always
-     * correspond to an integral number of sample frames of audio data.
+     * Note that the units used are bytes, but will always correspond to an
+     * integral number of sample frames of audio data.
      * <p>
-     * An application is guaranteed that a read or
-     * write operation of up to the number of bytes returned from
-     * <code>available()</code> will not block; however, there is no guarantee
-     * that attempts to read or write more data will block.
+     * An application is guaranteed that a read or write operation of up to the
+     * number of bytes returned from {@code available()} will not block;
+     * however, there is no guarantee that attempts to read or write more data
+     * will block.
      *
      * @return the amount of data available, in bytes
      */
-    public int available();
+    int available();
 
     /**
-     * Obtains the current position in the audio data, in sample frames.
-     * The frame position measures the number of sample
-     * frames captured by, or rendered from, the line since it was opened.
-     * This return value will wrap around after 2^31 frames. It is recommended
-     * to use <code>getLongFramePosition</code> instead.
+     * Obtains the current position in the audio data, in sample frames. The
+     * frame position measures the number of sample frames captured by, or
+     * rendered from, the line since it was opened. This return value will wrap
+     * around after 2^31 frames. It is recommended to use
+     * {@code getLongFramePosition} instead.
      *
      * @return the number of frames already processed since the line was opened
      * @see #getLongFramePosition()
      */
-    public int getFramePosition();
-
+    int getFramePosition();
 
     /**
-     * Obtains the current position in the audio data, in sample frames.
-     * The frame position measures the number of sample
-     * frames captured by, or rendered from, the line since it was opened.
+     * Obtains the current position in the audio data, in sample frames. The
+     * frame position measures the number of sample frames captured by, or
+     * rendered from, the line since it was opened.
      *
      * @return the number of frames already processed since the line was opened
      * @since 1.5
      */
-    public long getLongFramePosition();
-
+    long getLongFramePosition();
 
     /**
-     * Obtains the current position in the audio data, in microseconds.
-     * The microsecond position measures the time corresponding to the number
-     * of sample frames captured by, or rendered from, the line since it was opened.
-     * The level of precision is not guaranteed.  For example, an implementation
-     * might calculate the microsecond position from the current frame position
-     * and the audio sample frame rate.  The precision in microseconds would
-     * then be limited to the number of microseconds per sample frame.
+     * Obtains the current position in the audio data, in microseconds. The
+     * microsecond position measures the time corresponding to the number of
+     * sample frames captured by, or rendered from, the line since it was
+     * opened. The level of precision is not guaranteed. For example, an
+     * implementation might calculate the microsecond position from the current
+     * frame position and the audio sample frame rate. The precision in
+     * microseconds would then be limited to the number of microseconds per
+     * sample frame.
      *
-     * @return the number of microseconds of data processed since the line was opened
+     * @return the number of microseconds of data processed since the line was
+     *         opened
      */
-    public long getMicrosecondPosition();
+    long getMicrosecondPosition();
 
     /**
-     * Obtains the current volume level for the line.  This level is a measure
-     * of the signal's current amplitude, and should not be confused with the
-     * current setting of a gain control. The range is from 0.0 (silence) to
-     * 1.0 (maximum possible amplitude for the sound waveform).  The units
-     * measure linear amplitude, not decibels.
+     * Obtains the current volume level for the line. This level is a measure of
+     * the signal's current amplitude, and should not be confused with the
+     * current setting of a gain control. The range is from 0.0 (silence) to 1.0
+     * (maximum possible amplitude for the sound waveform). The units measure
+     * linear amplitude, not decibels.
      *
      * @return the current amplitude of the signal in this line, or
-     * <code>{@link AudioSystem#NOT_SPECIFIED}</code>
+     *         {@link AudioSystem#NOT_SPECIFIED}
      */
-    public float getLevel();
+    float getLevel();
 
     /**
      * Besides the class information inherited from its superclass,
-     * <code>DataLine.Info</code> provides additional information specific to data lines.
-     * This information includes:
+     * {@code DataLine.Info} provides additional information specific to data
+     * lines. This information includes:
      * <ul>
      * <li> the audio formats supported by the data line
      * <li> the minimum and maximum sizes of its internal buffer
      * </ul>
-     * Because a <code>Line.Info</code> knows the class of the line its describes, a
-     * <code>DataLine.Info</code> object can describe <code>DataLine</code>
-     * subinterfaces such as <code>{@link SourceDataLine}</code>,
-     * <code>{@link TargetDataLine}</code>, and <code>{@link Clip}</code>.
-     * You can query a mixer for lines of any of these types, passing an appropriate
-     * instance of <code>DataLine.Info</code> as the argument to a method such as
-     * <code>{@link Mixer#getLine Mixer.getLine(Line.Info)}</code>.
+     * Because a {@code Line.Info} knows the class of the line its describes, a
+     * {@code DataLine.Info} object can describe {@code DataLine} subinterfaces
+     * such as {@link SourceDataLine}, {@link TargetDataLine}, and {@link Clip}.
+     * You can query a mixer for lines of any of these types, passing an
+     * appropriate instance of {@code DataLine.Info} as the argument to a method
+     * such as {@link Mixer#getLine(Line.Info)}.
      *
      * @see Line.Info
      * @author Kara Kytle
      * @since 1.3
      */
-    public static class Info extends Line.Info {
+    class Info extends Line.Info {
 
         private final AudioFormat[] formats;
         private final int minBufferSize;
@@ -290,14 +282,17 @@
 
         /**
          * Constructs a data line's info object from the specified information,
-         * which includes a set of supported audio formats and a range for the buffer size.
-         * This constructor is typically used by mixer implementations
-         * when returning information about a supported line.
+         * which includes a set of supported audio formats and a range for the
+         * buffer size. This constructor is typically used by mixer
+         * implementations when returning information about a supported line.
          *
-         * @param lineClass the class of the data line described by the info object
-         * @param formats set of formats supported
-         * @param minBufferSize minimum buffer size supported by the data line, in bytes
-         * @param maxBufferSize maximum buffer size supported by the data line, in bytes
+         * @param  lineClass the class of the data line described by the info
+         *         object
+         * @param  formats set of formats supported
+         * @param  minBufferSize minimum buffer size supported by the data
+         *         line, in bytes
+         * @param  maxBufferSize maximum buffer size supported by the data
+         *         line, in bytes
          */
         public Info(Class<?> lineClass, AudioFormat[] formats, int minBufferSize, int maxBufferSize) {
 
@@ -313,16 +308,16 @@
             this.maxBufferSize = maxBufferSize;
         }
 
-
         /**
          * Constructs a data line's info object from the specified information,
-         * which includes a single audio format and a desired buffer size.
-         * This constructor is typically used by an application to
-         * describe a desired line.
+         * which includes a single audio format and a desired buffer size. This
+         * constructor is typically used by an application to describe a desired
+         * line.
          *
-         * @param lineClass the class of the data line described by the info object
-         * @param format desired format
-         * @param bufferSize desired buffer size in bytes
+         * @param  lineClass the class of the data line described by the info
+         *         object
+         * @param  format desired format
+         * @param  bufferSize desired buffer size in bytes
          */
         public Info(Class<?> lineClass, AudioFormat format, int bufferSize) {
 
@@ -338,39 +333,36 @@
             this.maxBufferSize = bufferSize;
         }
 
-
         /**
          * Constructs a data line's info object from the specified information,
-         * which includes a single audio format.
-         * This constructor is typically used by an application to
-         * describe a desired line.
+         * which includes a single audio format. This constructor is typically
+         * used by an application to describe a desired line.
          *
-         * @param lineClass the class of the data line described by the info object
-         * @param format desired format
+         * @param  lineClass the class of the data line described by the info
+         *         object
+         * @param  format desired format
          */
         public Info(Class<?> lineClass, AudioFormat format) {
             this(lineClass, format, AudioSystem.NOT_SPECIFIED);
         }
 
-
         /**
-         * Obtains a set of audio formats supported by the data line.
-         * Note that <code>isFormatSupported(AudioFormat)</code> might return
-         * <code>true</code> for certain additional formats that are missing from
-         * the set returned by <code>getFormats()</code>.  The reverse is not
-         * the case: <code>isFormatSupported(AudioFormat)</code> is guaranteed to return
-         * <code>true</code> for all formats returned by <code>getFormats()</code>.
-         *
+         * Obtains a set of audio formats supported by the data line. Note that
+         * {@code isFormatSupported(AudioFormat)} might return {@code true} for
+         * certain additional formats that are missing from the set returned by
+         * {@code getFormats()}. The reverse is not the case:
+         * {@code isFormatSupported(AudioFormat)} is guaranteed to return
+         * {@code true} for all formats returned by {@code getFormats()}.
+         * <p>
          * Some fields in the AudioFormat instances can be set to
          * {@link javax.sound.sampled.AudioSystem#NOT_SPECIFIED NOT_SPECIFIED}
-         * if that field does not apply to the format,
-         * or if the format supports a wide range of values for that field.
-         * For example, a multi-channel device supporting up to
-         * 64 channels, could set the channel field in the
-         * <code>AudioFormat</code> instances returned by this
-         * method to <code>NOT_SPECIFIED</code>.
+         * if that field does not apply to the format, or if the format supports
+         * a wide range of values for that field. For example, a multi-channel
+         * device supporting up to 64 channels, could set the channel field in
+         * the {@code AudioFormat} instances returned by this method to
+         * {@code NOT_SPECIFIED}.
          *
-         * @return a set of supported audio formats.
+         * @return a set of supported audio formats
          * @see #isFormatSupported(AudioFormat)
          */
         public AudioFormat[] getFormats() {
@@ -379,11 +371,12 @@
 
         /**
          * Indicates whether this data line supports a particular audio format.
-         * The default implementation of this method simply returns <code>true</code> if
-         * the specified format matches any of the supported formats.
+         * The default implementation of this method simply returns {@code true}
+         * if the specified format matches any of the supported formats.
          *
-         * @param format the audio format for which support is queried.
-         * @return <code>true</code> if the format is supported, otherwise <code>false</code>
+         * @param  format the audio format for which support is queried
+         * @return {@code true} if the format is supported, otherwise
+         *         {@code false}
          * @see #getFormats
          * @see AudioFormat#matches
          */
@@ -400,32 +393,36 @@
 
         /**
          * Obtains the minimum buffer size supported by the data line.
-         * @return minimum buffer size in bytes, or <code>AudioSystem.NOT_SPECIFIED</code>
+         *
+         * @return minimum buffer size in bytes, or
+         *         {@code AudioSystem.NOT_SPECIFIED}
          */
         public int getMinBufferSize() {
             return minBufferSize;
         }
 
-
         /**
          * Obtains the maximum buffer size supported by the data line.
-         * @return maximum buffer size in bytes, or <code>AudioSystem.NOT_SPECIFIED</code>
+         *
+         * @return maximum buffer size in bytes, or
+         *         {@code AudioSystem.NOT_SPECIFIED}
          */
         public int getMaxBufferSize() {
             return maxBufferSize;
         }
 
-
         /**
-         * Determines whether the specified info object matches this one.
-         * To match, the superclass match requirements must be met.  In
-         * addition, this object's minimum buffer size must be at least as
-         * large as that of the object specified, its maximum buffer size must
-         * be at most as large as that of the object specified, and all of its
-         * formats must match formats supported by the object specified.
-         * @return <code>true</code> if this object matches the one specified,
-         * otherwise <code>false</code>.
+         * Determines whether the specified info object matches this one. To
+         * match, the superclass match requirements must be met. In addition,
+         * this object's minimum buffer size must be at least as large as that
+         * of the object specified, its maximum buffer size must be at most as
+         * large as that of the object specified, and all of its formats must
+         * match formats supported by the object specified.
+         *
+         * @return {@code true} if this object matches the one specified,
+         *         otherwise {@code false}
          */
+        @Override
         public boolean matches(Line.Info info) {
 
             if (! (super.matches(info)) ) {
@@ -467,8 +464,10 @@
 
         /**
          * Obtains a textual description of the data line info.
+         *
          * @return a string description
          */
+        @Override
         public String toString() {
 
             StringBuilder sb = new StringBuilder();
@@ -489,6 +488,5 @@
 
             return new String(super.toString() + sb);
         }
-    } // class Info
-
-} // interface DataLine
+    }
+}
--- a/src/share/classes/javax/sound/sampled/EnumControl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/EnumControl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,83 +26,63 @@
 package javax.sound.sampled;
 
 /**
- * A <code>EnumControl</code> provides control over a set of
- * discrete possible values, each represented by an object.  In a
- * graphical user interface, such a control might be represented
- * by a set of buttons, each of which chooses one value or setting.  For
- * example, a reverb control might provide several preset reverberation
- * settings, instead of providing continuously adjustable parameters
- * of the sort that would be represented by <code>{@link FloatControl}</code>
+ * A {@code EnumControl} provides control over a set of discrete possible values
+ * , each represented by an object. In a graphical user interface, such a
+ * control might be represented by a set of buttons, each of which chooses one
+ * value or setting. For example, a reverb control might provide several preset
+ * reverberation settings, instead of providing continuously adjustable
+ * parameters of the sort that would be represented by {@link FloatControl}
  * objects.
  * <p>
- * Controls that provide a choice between only two settings can often be implemented
- * instead as a <code>{@link BooleanControl}</code>, and controls that provide
- * a set of values along some quantifiable dimension might be implemented
- * instead as a <code>FloatControl</code> with a coarse resolution.
- * However, a key feature of <code>EnumControl</code> is that the returned values
- * are arbitrary objects, rather than numerical or boolean values.  This means that each
- * returned object can provide further information.  As an example, the settings
- * of a <code>{@link EnumControl.Type#REVERB REVERB}</code> control are instances of
- * <code>{@link ReverbType}</code> that can be queried for the parameter values
- * used for each setting.
+ * Controls that provide a choice between only two settings can often be
+ * implemented instead as a {@link BooleanControl}, and controls that provide a
+ * set of values along some quantifiable dimension might be implemented instead
+ * as a {@code FloatControl} with a coarse resolution. However, a key feature of
+ * {@code EnumControl} is that the returned values are arbitrary objects, rather
+ * than numerical or boolean values. This means that each returned object can
+ * provide further information. As an example, the settings of a
+ * {@link EnumControl.Type#REVERB REVERB} control are instances of
+ * {@link ReverbType} that can be queried for the parameter values used for each
+ * setting.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public abstract class EnumControl extends Control {
 
-
-    // TYPE DEFINES
-
-
-    // INSTANCE VARIABLES
-
-
     /**
      * The set of possible values.
      */
     private Object[] values;
 
-
     /**
      * The current value.
      */
     private Object value;
 
-
-
-    // CONSTRUCTORS
-
-
     /**
      * Constructs a new enumerated control object with the given parameters.
      *
-     * @param type the type of control represented this enumerated control object
-     * @param values the set of possible values for the control
-     * @param value the initial control value
+     * @param  type the type of control represented this enumerated control
+     *         object
+     * @param  values the set of possible values for the control
+     * @param  value the initial control value
      */
     protected EnumControl(Type type, Object[] values, Object value) {
-
         super(type);
-
         this.values = values;
         this.value = value;
     }
 
-
-
-    // METHODS
-
-
     /**
-     * Sets the current value for the control.  The default implementation
-     * simply sets the value as indicated.  If the value indicated is not
-     * supported, an IllegalArgumentException is thrown.
-     * Some controls require that their line be open before they can be affected
-     * by setting a value.
-     * @param value the desired new value
+     * Sets the current value for the control. The default implementation simply
+     * sets the value as indicated. If the value indicated is not supported, an
+     * {@code IllegalArgumentException} is thrown. Some controls require that
+     * their line be open before they can be affected by setting a value.
+     *
+     * @param  value the desired new value
      * @throws IllegalArgumentException if the value indicated does not fall
-     * within the allowable range
+     *         within the allowable range
      */
     public void setValue(Object value) {
         if (!isValueSupported(value)) {
@@ -112,18 +92,18 @@
         this.value = value;
     }
 
-
     /**
      * Obtains this control's current value.
+     *
      * @return the current value
      */
     public Object getValue() {
         return value;
     }
 
-
     /**
      * Returns the set of possible values for this control.
+     *
      * @return the set of possible values
      */
     public Object[] getValues() {
@@ -137,12 +117,11 @@
         return localArray;
     }
 
-
     /**
      * Indicates whether the value specified is supported.
-     * @param value the value for which support is queried
-     * @return <code>true</code> if the value is supported,
-     * otherwise <code>false</code>
+     *
+     * @param  value the value for which support is queried
+     * @return {@code true} if the value is supported, otherwise {@code false}
      */
     private boolean isValueSupported(Object value) {
 
@@ -157,58 +136,43 @@
         return false;
     }
 
-
-
-    // ABSTRACT METHOD IMPLEMENTATIONS: CONTROL
-
-
     /**
      * Provides a string representation of the control.
+     *
      * @return a string description
      */
+    @Override
     public String toString() {
         return new String(getType() + " with current value: " + getValue());
     }
 
-
-    // INNER CLASSES
-
-
     /**
-     * An instance of the <code>EnumControl.Type</code> inner class identifies one kind of
-     * enumerated control.  Static instances are provided for the
-     * common types.
-     *
-     * @see EnumControl
+     * An instance of the {@code EnumControl.Type} inner class identifies one
+     * kind of enumerated control. Static instances are provided for the common
+     * types.
      *
      * @author Kara Kytle
+     * @see EnumControl
      * @since 1.3
      */
     public static class Type extends Control.Type {
 
-
-        // TYPE DEFINES
-
         /**
          * Represents a control over a set of possible reverberation settings.
          * Each reverberation setting is described by an instance of the
-         * {@link ReverbType} class.  (To access these settings,
-         * invoke <code>{@link EnumControl#getValues}</code> on an
-         * enumerated control of type <code>REVERB</code>.)
+         * {@link ReverbType} class. (To access these settings, invoke
+         * {@link EnumControl#getValues} on an enumerated control of type
+         * {@code REVERB}.)
          */
         public static final Type REVERB         = new Type("Reverb");
 
-
-        // CONSTRUCTOR
-
-
         /**
          * Constructs a new enumerated control type.
-         * @param name  the name of the new enumerated control type
+         *
+         * @param  name the name of the new enumerated control type
          */
-        protected Type(String name) {
+        protected Type(final String name) {
             super(name);
         }
-    } // class Type
-
-} // class EnumControl
+    }
+}
--- a/src/share/classes/javax/sound/sampled/FloatControl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/FloatControl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,39 +26,31 @@
 package javax.sound.sampled;
 
 /**
- * A <code>FloatControl</code> object provides control over a range of
- * floating-point values.  Float controls are often
- * represented in graphical user interfaces by continuously
- * adjustable objects such as sliders or rotary knobs.  Concrete subclasses
- * of <code>FloatControl</code> implement controls, such as gain and pan, that
- * affect a line's audio signal in some way that an application can manipulate.
- * The <code>{@link FloatControl.Type}</code>
- * inner class provides static instances of types that are used to
- * identify some common kinds of float control.
+ * A {@code FloatControl} object provides control over a range of floating-point
+ * values. Float controls are often represented in graphical user interfaces by
+ * continuously adjustable objects such as sliders or rotary knobs. Concrete
+ * subclasses of {@code FloatControl} implement controls, such as gain and pan,
+ * that affect a line's audio signal in some way that an application can
+ * manipulate. The {@link FloatControl.Type} inner class provides static
+ * instances of types that are used to identify some common kinds of float
+ * control.
  * <p>
- * The <code>FloatControl</code> abstract class provides methods to set and get
- * the control's current floating-point value.  Other methods obtain the possible
+ * The {@code FloatControl} abstract class provides methods to set and get the
+ * control's current floating-point value. Other methods obtain the possible
  * range of values and the control's resolution (the smallest increment between
- * returned values).  Some float controls allow ramping to a
- * new value over a specified period of time.  <code>FloatControl</code> also
- * includes methods that return string labels for the minimum, maximum, and midpoint
- * positions of the control.
- *
- * @see Line#getControls
- * @see Line#isControlSupported
+ * returned values). Some float controls allow ramping to a new value over a
+ * specified period of time. {@code FloatControl} also includes methods that
+ * return string labels for the minimum, maximum, and midpoint positions of the
+ * control.
  *
  * @author David Rivas
  * @author Kara Kytle
+ * @see Line#getControls
+ * @see Line#isControlSupported
  * @since 1.3
  */
 public abstract class FloatControl extends Control {
 
-
-    // INSTANCE VARIABLES
-
-
-    // FINAL VARIABLES
-
     /**
      * The minimum supported value.
      */
@@ -75,66 +67,60 @@
     private float precision;
 
     /**
-     * The smallest time increment in which a value change
-     * can be effected during a value shift, in microseconds.
+     * The smallest time increment in which a value change can be effected
+     * during a value shift, in microseconds.
      */
     private int updatePeriod;
 
-
     /**
-     * A label for the units in which the control values are expressed,
-     * such as "dB" for decibels.
+     * A label for the units in which the control values are expressed, such as
+     * "dB" for decibels.
      */
     private final String units;
 
     /**
-     * A label for the minimum value, such as "Left."
+     * A label for the minimum value, such as "Left".
      */
     private final String minLabel;
 
     /**
-     * A label for the maximum value, such as "Right."
+     * A label for the maximum value, such as "Right".
      */
     private final String maxLabel;
 
     /**
-     * A label for the mid-point value, such as "Center."
+     * A label for the mid-point value, such as "Center".
      */
     private final String midLabel;
 
-
-    // STATE VARIABLES
-
     /**
      * The current value.
      */
     private float value;
 
-
-
-    // CONSTRUCTORS
-
-
     /**
-     * Constructs a new float control object with the given parameters
+     * Constructs a new float control object with the given parameters.
      *
-     * @param type the kind of control represented by this float control object
-     * @param minimum the smallest value permitted for the control
-     * @param maximum the largest value permitted for the control
-     * @param precision the resolution or granularity of the control.
-     * This is the size of the increment between discrete valid values.
-     * @param updatePeriod the smallest time interval, in microseconds, over which the control
-     * can change from one discrete value to the next during a {@link #shift(float,float,int) shift}
-     * @param initialValue the value that the control starts with when constructed
-     * @param units the label for the units in which the control's values are expressed,
-     * such as "dB" or "frames per second"
-     * @param minLabel the label for the minimum value, such as "Left" or "Off"
-     * @param midLabel the label for the midpoint value, such as "Center" or "Default"
-     * @param maxLabel the label for the maximum value, such as "Right" or "Full"
-     *
-     * @throws IllegalArgumentException if {@code minimum} is greater
-     *     than {@code maximum} or {@code initialValue} does not fall
-     *     within the allowable range
+     * @param  type the kind of control represented by this float control object
+     * @param  minimum the smallest value permitted for the control
+     * @param  maximum the largest value permitted for the control
+     * @param  precision the resolution or granularity of the control. This is
+     *         the size of the increment between discrete valid values.
+     * @param  updatePeriod the smallest time interval, in microseconds, over
+     *         which the control can change from one discrete value to the next
+     *         during a {@link #shift(float,float,int) shift}
+     * @param  initialValue the value that the control starts with when
+     *         constructed
+     * @param  units the label for the units in which the control's values are
+     *         expressed, such as "dB" or "frames per second"
+     * @param  minLabel the label for the minimum value, such as "Left" or "Off"
+     * @param  midLabel the label for the midpoint value, such as "Center" or
+     *         "Default"
+     * @param  maxLabel the label for the maximum value, such as "Right" or
+     *         "Full"
+     * @throws IllegalArgumentException if {@code minimum} is greater than
+     *         {@code maximum} or {@code initialValue} does not fall within the
+     *         allowable range
      */
     protected FloatControl(Type type, float minimum, float maximum,
             float precision, int updatePeriod, float initialValue,
@@ -169,26 +155,26 @@
         this.maxLabel = ( (maxLabel == null) ? "" : maxLabel);
     }
 
-
     /**
-     * Constructs a new float control object with the given parameters.
-     * The labels for the minimum, maximum, and mid-point values are set
-     * to zero-length strings.
+     * Constructs a new float control object with the given parameters. The
+     * labels for the minimum, maximum, and mid-point values are set to
+     * zero-length strings.
      *
-     * @param type the kind of control represented by this float control object
-     * @param minimum the smallest value permitted for the control
-     * @param maximum the largest value permitted for the control
-     * @param precision the resolution or granularity of the control.
-     * This is the size of the increment between discrete valid values.
-     * @param updatePeriod the smallest time interval, in microseconds, over which the control
-     * can change from one discrete value to the next during a {@link #shift(float,float,int) shift}
-     * @param initialValue the value that the control starts with when constructed
-     * @param units the label for the units in which the control's values are expressed,
-     * such as "dB" or "frames per second"
-     *
-     * @throws IllegalArgumentException if {@code minimum} is greater
-     *     than {@code maximum} or {@code initialValue} does not fall
-     *     within the allowable range
+     * @param  type the kind of control represented by this float control object
+     * @param  minimum the smallest value permitted for the control
+     * @param  maximum the largest value permitted for the control
+     * @param  precision the resolution or granularity of the control. This is
+     *         the size of the increment between discrete valid values.
+     * @param  updatePeriod the smallest time interval, in microseconds, over
+     *         which the control can change from one discrete value to the next
+     *         during a {@link #shift(float,float,int) shift}
+     * @param  initialValue the value that the control starts with when
+     *         constructed
+     * @param  units the label for the units in which the control's values are
+     *         expressed, such as "dB" or "frames per second"
+     * @throws IllegalArgumentException if {@code minimum} is greater than
+     *         {@code maximum} or {@code initialValue} does not fall within the
+     *         allowable range
      */
     protected FloatControl(Type type, float minimum, float maximum,
             float precision, int updatePeriod, float initialValue, String units) {
@@ -196,21 +182,16 @@
                 initialValue, units, "", "", "");
     }
 
-
-
-    // METHODS
-
-
     /**
-     * Sets the current value for the control.  The default implementation
-     * simply sets the value as indicated.  If the value indicated is greater
-     * than the maximum value, or smaller than the minimum value, an
-     * IllegalArgumentException is thrown.
-     * Some controls require that their line be open before they can be affected
-     * by setting a value.
-     * @param newValue desired new value
+     * Sets the current value for the control. The default implementation simply
+     * sets the value as indicated. If the value indicated is greater than the
+     * maximum value, or smaller than the minimum value, an
+     * {@code IllegalArgumentException} is thrown. Some controls require that
+     * their line be open before they can be affected by setting a value.
+     *
+     * @param  newValue desired new value
      * @throws IllegalArgumentException if the value indicated does not fall
-     * within the allowable range
+     *         within the allowable range
      */
     public void setValue(float newValue) {
 
@@ -225,113 +206,114 @@
         value = newValue;
     }
 
-
     /**
      * Obtains this control's current value.
+     *
      * @return the current value
      */
     public float getValue() {
         return value;
     }
 
-
     /**
      * Obtains the maximum value permitted.
+     *
      * @return the maximum allowable value
      */
     public float getMaximum() {
         return maximum;
     }
 
-
     /**
      * Obtains the minimum value permitted.
+     *
      * @return the minimum allowable value
      */
     public float getMinimum() {
         return minimum;
     }
 
-
     /**
-     * Obtains the label for the units in which the control's values are expressed,
-     * such as "dB" or "frames per second."
+     * Obtains the label for the units in which the control's values are
+     * expressed, such as "dB" or "frames per second."
+     *
      * @return the units label, or a zero-length string if no label
      */
     public String getUnits() {
         return units;
     }
 
-
     /**
-     * Obtains the label for the minimum value, such as "Left" or "Off."
-     * @return the minimum value label, or a zero-length string if no label      * has been set
+     * Obtains the label for the minimum value, such as "Left" or "Off".
+     *
+     * @return the minimum value label, or a zero-length string if no label has
+     *         been set
      */
     public String getMinLabel() {
         return minLabel;
     }
 
-
     /**
-     * Obtains the label for the mid-point value, such as "Center" or "Default."
-     * @return the mid-point value label, or a zero-length string if no label    * has been set
+     * Obtains the label for the mid-point value, such as "Center" or "Default".
+     *
+     * @return the mid-point value label, or a zero-length string if no label
+     *         has been set
      */
     public String getMidLabel() {
         return midLabel;
     }
 
-
     /**
-     * Obtains the label for the maximum value, such as "Right" or "Full."
-     * @return the maximum value label, or a zero-length string if no label      * has been set
+     * Obtains the label for the maximum value, such as "Right" or "Full".
+     *
+     * @return the maximum value label, or a zero-length string if no label has
+     *         been set
      */
     public String getMaxLabel() {
         return maxLabel;
     }
 
-
     /**
-     * Obtains the resolution or granularity of the control, in the units
-     * that the control measures.
-     * The precision is the size of the increment between discrete valid values
-     * for this control, over the set of supported floating-point values.
+     * Obtains the resolution or granularity of the control, in the units that
+     * the control measures. The precision is the size of the increment between
+     * discrete valid values for this control, over the set of supported
+     * floating-point values.
+     *
      * @return the control's precision
      */
     public float getPrecision() {
         return precision;
     }
 
-
     /**
-     * Obtains the smallest time interval, in microseconds, over which the control's value can
-     * change during a shift.  The update period is the inverse of the frequency with which
-     * the control updates its value during a shift.  If the implementation does not support value shifting over
-     * time, it should set the control's value to the final value immediately
-     * and return -1 from this method.
+     * Obtains the smallest time interval, in microseconds, over which the
+     * control's value can change during a shift. The update period is the
+     * inverse of the frequency with which the control updates its value during
+     * a shift. If the implementation does not support value shifting over time,
+     * it should set the control's value to the final value immediately and
+     * return -1 from this method.
      *
-     * @return update period in microseconds, or -1 if shifting over time is unsupported
+     * @return update period in microseconds, or -1 if shifting over time is
+     *         unsupported
      * @see #shift
      */
     public int getUpdatePeriod() {
         return updatePeriod;
     }
 
-
     /**
-     * Changes the control value from the initial value to the final
-     * value linearly over the specified time period, specified in microseconds.
-     * This method returns without blocking; it does not wait for the shift
-     * to complete.  An implementation should complete the operation within the time
-     * specified.  The default implementation simply changes the value
-     * to the final value immediately.
+     * Changes the control value from the initial value to the final value
+     * linearly over the specified time period, specified in microseconds. This
+     * method returns without blocking; it does not wait for the shift to
+     * complete. An implementation should complete the operation within the time
+     * specified. The default implementation simply changes the value to the
+     * final value immediately.
      *
-     * @param from initial value at the beginning of the shift
-     * @param to final value after the shift
-     * @param microseconds maximum duration of the shift in microseconds
-     *
+     * @param  from initial value at the beginning of the shift
+     * @param  to final value after the shift
+     * @param  microseconds maximum duration of the shift in microseconds
      * @throws IllegalArgumentException if either {@code from} or {@code to}
-     *     value does not fall within the allowable range
-     *
+     *         value does not fall within the allowable range
      * @see #getUpdatePeriod
      */
     public void shift(float from, float to, int microseconds) {
@@ -347,12 +329,9 @@
         setValue(to);
     }
 
-
-    // ABSTRACT METHOD IMPLEMENTATIONS: CONTROL
-
-
     /**
-     * Provides a string representation of the control
+     * Provides a string representation of the control.
+     *
      * @return a string description
      */
     public String toString() {
@@ -360,55 +339,45 @@
                           " (range: " + minimum + " - " + maximum + ")");
     }
 
-
-    // INNER CLASSES
-
-
     /**
-     * An instance of the <code>FloatControl.Type</code> inner class identifies one kind of
-     * float control.  Static instances are provided for the
-     * common types.
+     * An instance of the {@code FloatControl.Type} inner class identifies one
+     * kind of float control. Static instances are provided for the common
+     * types.
      *
      * @author Kara Kytle
      * @since 1.3
      */
     public static class Type extends Control.Type {
 
-
-        // TYPE DEFINES
-
-
-        // GAIN TYPES
-
         /**
          * Represents a control for the overall gain on a line.
          * <p>
          * Gain is a quantity in decibels (dB) that is added to the intrinsic
-         * decibel level of the audio signal--that is, the level of
-         * the signal before it is altered by the gain control.  A positive
-         * gain amplifies (boosts) the signal's volume, and a negative gain
-         * attenuates (cuts) it.
+         * decibel level of the audio signal--that is, the level of the signal
+         * before it is altered by the gain control. A positive gain amplifies
+         * (boosts) the signal's volume, and a negative gain attenuates(cuts)it.
          * The gain setting defaults to a value of 0.0 dB, meaning the signal's
-         * loudness is unaffected.   Note that gain measures dB, not amplitude.
+         * loudness is unaffected. Note that gain measures dB, not amplitude.
          * The relationship between a gain in decibels and the corresponding
          * linear amplitude multiplier is:
          *
-         *<CENTER><CODE> linearScalar = pow(10.0, gainDB/20.0) </CODE></CENTER>
+         * <CENTER>{@code linearScalar = pow(10.0, gainDB/20.0)}</CENTER>
          * <p>
-         * The <code>FloatControl</code> class has methods to impose a maximum and
-         * minimum allowable value for gain.  However, because an audio signal might
-         * already be at a high amplitude, the maximum setting does not guarantee
-         * that the signal will be undistorted when the gain is applied to it (unless
-         * the maximum is zero or negative). To avoid numeric overflow from excessively
-         * large gain settings, a gain control can implement
-         * clipping, meaning that the signal's amplitude will be limited to the maximum
-         * value representable by its audio format, instead of wrapping around.
+         * The {@code FloatControl} class has methods to impose a maximum and
+         * minimum allowable value for gain. However, because an audio signal
+         * might already be at a high amplitude, the maximum setting does not
+         * guarantee that the signal will be undistorted when the gain is
+         * applied to it (unless the maximum is zero or negative). To avoid
+         * numeric overflow from excessively large gain settings, a gain control
+         * can implement clipping, meaning that the signal's amplitude will be
+         * limited to the maximum value representable by its audio format,
+         * instead of wrapping around.
          * <p>
-         * These comments apply to gain controls in general, not just master gain controls.
-         * A line can have more than one gain control.  For example, a mixer (which is
-         * itself a line) might have a master gain control, an auxiliary return control,
-         * a reverb return control, and, on each of its source lines, an individual aux
-         * send and reverb send.
+         * These comments apply to gain controls in general, not just master
+         * gain controls. A line can have more than one gain control. For
+         * example, a mixer (which is itself a line) might have a master gain
+         * control, an auxiliary return control, a reverb return control, and,
+         * on each of its source lines, an individual aux send and reverb send.
          *
          * @see #AUX_SEND
          * @see #AUX_RETURN
@@ -435,9 +404,9 @@
         public static final Type AUX_RETURN                     = new Type("AUX Return");
 
         /**
-         * Represents a control for the pre-reverb gain on a line.
-         * This control may be used to affect how much
-         * of a line's signal is directed to a mixer's internal reverberation unit.
+         * Represents a control for the pre-reverb gain on a line. This control
+         * may be used to affect how much of a line's signal is directed to a
+         * mixer's internal reverberation unit.
          *
          * @see #MASTER_GAIN
          * @see #REVERB_RETURN
@@ -446,18 +415,15 @@
         public static final Type REVERB_SEND            = new Type("Reverb Send");
 
         /**
-         * Represents a control for the post-reverb gain on a line.
-         * This control may be used to control the relative amplitude
-         * of the signal returned from an internal reverberation unit.
+         * Represents a control for the post-reverb gain on a line. This control
+         * may be used to control the relative amplitude of the signal returned
+         * from an internal reverberation unit.
          *
          * @see #MASTER_GAIN
          * @see #REVERB_SEND
          */
         public static final Type REVERB_RETURN          = new Type("Reverb Return");
 
-
-        // VOLUME
-
         /**
          * Represents a control for the volume on a line.
          */
@@ -466,64 +432,52 @@
          */
         public static final Type VOLUME                         = new Type("Volume");
 
-
-        // PAN
-
         /**
-         * Represents a control for the relative pan (left-right positioning)
-         * of the signal.  The signal may be mono; the pan setting affects how
-         * it is distributed by the mixer in a stereo mix.  The valid range of values is -1.0
-         * (left channel only) to 1.0 (right channel
-         * only).  The default is 0.0 (centered).
+         * Represents a control for the relative pan (left-right positioning) of
+         * the signal. The signal may be mono; the pan setting affects how it is
+         * distributed by the mixer in a stereo mix. The valid range of values
+         * is -1.0 (left channel only) to 1.0 (right channel only). The default
+         * is 0.0 (centered).
          *
          * @see #BALANCE
          */
         public static final Type PAN                            = new Type("Pan");
 
-
-        // BALANCE
-
         /**
          * Represents a control for the relative balance of a stereo signal
-         * between two stereo speakers.  The valid range of values is -1.0 (left channel only) to 1.0 (right channel
-         * only).  The default is 0.0 (centered).
+         * between two stereo speakers. The valid range of values is -1.0 (left
+         * channel only) to 1.0 (right channel only). The default is 0.0
+         * (centered).
          *
          * @see #PAN
          */
         public static final Type BALANCE                        = new Type("Balance");
 
-
-        // SAMPLE RATE
-
         /**
-         * Represents a control that changes the sample rate of audio playback.  The net effect
-         * of changing the sample rate depends on the relationship between
-         * the media's natural rate and the rate that is set via this control.
-         * The natural rate is the sample rate that is specified in the data line's
-         * <code>AudioFormat</code> object.  For example, if the natural rate
-         * of the media is 11025 samples per second and the sample rate is set
-         * to 22050 samples per second, the media will play back at twice the
-         * normal speed.
+         * Represents a control that changes the sample rate of audio playback.
+         * The net effect of changing the sample rate depends on the
+         * relationship between the media's natural rate and the rate that is
+         * set via this control. The natural rate is the sample rate that is
+         * specified in the data line's {@code AudioFormat} object. For example,
+         * if the natural rate of the media is 11025 samples per second and the
+         * sample rate is set to 22050 samples per second, the media will play
+         * back at twice the normal speed.
          * <p>
-         * Changing the sample rate with this control does not affect the data line's
-         * audio format.  Also note that whenever you change a sound's sample rate, a
-         * change in the sound's pitch results.  For example, doubling the sample
-         * rate has the effect of doubling the frequencies in the sound's spectrum,
-         * which raises the pitch by an octave.
+         * Changing the sample rate with this control does not affect the data
+         * line's audio format. Also note that whenever you change a sound's
+         * sample rate, a change in the sound's pitch results. For example,
+         * doubling the sample rate has the effect of doubling the frequencies
+         * in the sound's spectrum, which raises the pitch by an octave.
          */
         public static final Type SAMPLE_RATE            = new Type("Sample Rate");
 
-
-        // CONSTRUCTOR
-
         /**
          * Constructs a new float control type.
-         * @param name  the name of the new float control type
+         *
+         * @param name the name of the new float control type
          */
-        protected Type(String name) {
+        protected Type(final String name) {
             super(name);
         }
-
-    } // class Type
-
-} // class FloatControl
+    }
+}
--- a/src/share/classes/javax/sound/sampled/Line.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/Line.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,96 +26,90 @@
 package javax.sound.sampled;
 
 /**
- * The <code>Line</code> interface represents a mono or multi-channel
- * audio feed. A line is an element of the digital audio
- * "pipeline," such as a mixer, an input or output port,
- * or a data path into or out of a mixer.
+ * The {@code Line} interface represents a mono or multi-channel audio feed. A
+ * line is an element of the digital audio "pipeline," such as a mixer, an input
+ * or output port, or a data path into or out of a mixer.
  * <p>
- * A line can have controls, such as gain, pan, and reverb.
- * The controls themselves are instances of classes that extend the
- * base <code>{@link Control}</code> class.
- * The <code>Line</code> interface provides two accessor methods for
- * obtaining the line's controls: <code>{@link #getControls getControls}</code> returns the
- * entire set, and <code>{@link #getControl getControl}</code> returns a single control of
- * specified type.
+ * A line can have controls, such as gain, pan, and reverb. The controls
+ * themselves are instances of classes that extend the base {@link Control}
+ * class. The {@code Line} interface provides two accessor methods for obtaining
+ * the line's controls: {@link #getControls getControls} returns the entire set,
+ * and {@link #getControl getControl} returns a single control of specified
+ * type.
  * <p>
- * Lines exist in various states at different times.  When a line opens, it reserves system
- * resources for itself, and when it closes, these resources are freed for
- * other objects or applications. The <code>{@link #isOpen()}</code> method lets
- * you discover whether a line is open or closed.
- * An open line need not be processing data, however.  Such processing is
- * typically initiated by subinterface methods such as
- * <code>{@link SourceDataLine#write SourceDataLine.write}</code> and
- * <code>{@link TargetDataLine#read TargetDataLine.read}</code>.
- *<p>
- * You can register an object to receive notifications whenever the line's
- * state changes.  The object must implement the <code>{@link LineListener}</code>
- * interface, which consists of the single method
- * <code>{@link LineListener#update update}</code>.
- * This method will be invoked when a line opens and closes (and, if it's a
- * {@link DataLine}, when it starts and stops).
- *<p>
- * An object can be registered to listen to multiple lines.  The event it
- * receives in its <code>update</code> method will specify which line created
- * the event, what type of event it was
- * (<code>OPEN</code>, <code>CLOSE</code>, <code>START</code>, or <code>STOP</code>),
- * and how many sample frames the line had processed at the time the event occurred.
+ * Lines exist in various states at different times. When a line opens, it
+ * reserves system resources for itself, and when it closes, these resources are
+ * freed for other objects or applications. The {@link #isOpen()} method lets
+ * you discover whether a line is open or closed. An open line need not be
+ * processing data, however. Such processing is typically initiated by
+ * subinterface methods such as
+ * {@link SourceDataLine#write SourceDataLine.write} and
+ * {@link TargetDataLine#read TargetDataLine.read}.
+ * <p>
+ * You can register an object to receive notifications whenever the line's state
+ * changes. The object must implement the {@link LineListener} interface, which
+ * consists of the single method {@link LineListener#update update}. This method
+ * will be invoked when a line opens and closes (and, if it's a {@link DataLine}
+ * , when it starts and stops).
+ * <p>
+ * An object can be registered to listen to multiple lines. The event it
+ * receives in its {@code update} method will specify which line created the
+ * event, what type of event it was ({@code OPEN}, {@code CLOSE}, {@code START},
+ * or {@code STOP}), and how many sample frames the line had processed at the
+ * time the event occurred.
  * <p>
  * Certain line operations, such as open and close, can generate security
  * exceptions if invoked by unprivileged code when the line is a shared audio
  * resource.
  *
  * @author Kara Kytle
- *
  * @see LineEvent
  * @since 1.3
  */
 public interface Line extends AutoCloseable {
 
     /**
-     * Obtains the <code>Line.Info</code> object describing this
-     * line.
+     * Obtains the {@code Line.Info} object describing this line.
+     *
      * @return description of the line
      */
-    public Line.Info getLineInfo();
+    Line.Info getLineInfo();
 
     /**
-     * Opens the line, indicating that it should acquire any required
-     * system resources and become operational.
-     * If this operation
-     * succeeds, the line is marked as open, and an <code>OPEN</code> event is dispatched
-     * to the line's listeners.
+     * Opens the line, indicating that it should acquire any required system
+     * resources and become operational. If this operation succeeds, the line is
+     * marked as open, and an {@code OPEN} event is dispatched to the line's
+     * listeners.
      * <p>
-     * Note that some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in an <code>LineUnavailableException</code>.
+     * Note that some lines, once closed, cannot be reopened. Attempts to reopen
+     * such a line will always result in an {@code LineUnavailableException}.
      * <p>
-     * Some types of lines have configurable properties that may affect
-     * resource allocation.   For example, a <code>DataLine</code> must
-     * be opened with a particular format and buffer size.  Such lines
-     * should provide a mechanism for configuring these properties, such
-     * as an additional <code>open</code> method or methods which allow
-     * an application to specify the desired settings.
+     * Some types of lines have configurable properties that may affect resource
+     * allocation. For example, a {@code DataLine} must be opened with a
+     * particular format and buffer size. Such lines should provide a mechanism
+     * for configuring these properties, such as an additional {@code open}
+     * method or methods which allow an application to specify the desired
+     * settings.
      * <p>
      * This method takes no arguments, and opens the line with the current
-     * settings.  For <code>{@link SourceDataLine}</code> and
-     * <code>{@link TargetDataLine}</code> objects, this means that the line is
-     * opened with default settings.  For a <code>{@link Clip}</code>, however,
-     * the buffer size is determined when data is loaded.  Since this method does not
-     * allow the application to specify any data to load, an IllegalArgumentException
-     * is thrown. Therefore, you should instead use one of the <code>open</code> methods
-     * provided in the <code>Clip</code> interface to load data into the <code>Clip</code>.
+     * settings. For {@link SourceDataLine} and {@link TargetDataLine} objects,
+     * this means that the line is opened with default settings. For a
+     * {@link Clip}, however, the buffer size is determined when data is loaded.
+     * Since this method does not allow the application to specify any data to
+     * load, an {@code IllegalArgumentException} is thrown. Therefore, you
+     * should instead use one of the {@code open} methods provided in the
+     * {@code Clip} interface to load data into the {@code Clip}.
      * <p>
-     * For <code>DataLine</code>'s, if the <code>DataLine.Info</code>
-     * object which was used to retrieve the line, specifies at least
-     * one fully qualified audio format, the last one will be used
-     * as the default format.
+     * For {@code DataLine}'s, if the {@code DataLine.Info} object which was
+     * used to retrieve the line, specifies at least one fully qualified audio
+     * format, the last one will be used as the default format.
      *
-     * @throws IllegalArgumentException if this method is called on a Clip instance.
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions.
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions.
-     *
+     * @throws IllegalArgumentException if this method is called on a Clip
+     *         instance
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #close
      * @see #isOpen
      * @see LineEvent
@@ -123,133 +117,128 @@
      * @see Clip#open(AudioFormat, byte[], int, int)
      * @see Clip#open(AudioInputStream)
      */
-    public void open() throws LineUnavailableException;
-
+    void open() throws LineUnavailableException;
 
     /**
-     * Closes the line, indicating that any system resources
-     * in use by the line can be released.  If this operation
-     * succeeds, the line is marked closed and a <code>CLOSE</code> event is dispatched
-     * to the line's listeners.
-     * @throws SecurityException if the line cannot be
-     * closed due to security restrictions.
+     * Closes the line, indicating that any system resources in use by the line
+     * can be released. If this operation succeeds, the line is marked closed
+     * and a {@code CLOSE} event is dispatched to the line's listeners.
      *
+     * @throws SecurityException if the line cannot be closed due to security
+     *         restrictions
      * @see #open
      * @see #isOpen
      * @see LineEvent
      */
-    public void close();
-
-
+    @Override
+    void close();
 
     /**
-     * Indicates whether the line is open, meaning that it has reserved
-     * system resources and is operational, although it might not currently be
-     * playing or capturing sound.
-     * @return <code>true</code> if the line is open, otherwise <code>false</code>
+     * Indicates whether the line is open, meaning that it has reserved system
+     * resources and is operational, although it might not currently be playing
+     * or capturing sound.
      *
+     * @return {@code true} if the line is open, otherwise {@code false}
      * @see #open()
      * @see #close()
      */
-    public boolean isOpen();
-
+    boolean isOpen();
 
     /**
-     * Obtains the set of controls associated with this line.
-     * Some controls may only be available when the line is open.
-     * If there are no controls, this method returns an array of length 0.
+     * Obtains the set of controls associated with this line. Some controls may
+     * only be available when the line is open. If there are no controls, this
+     * method returns an array of length 0.
+     *
      * @return the array of controls
      * @see #getControl
      */
-    public Control[] getControls();
+    Control[] getControls();
 
     /**
-     * Indicates whether the line supports a control of the specified type.
-     * Some controls may only be available when the line is open.
-     * @param control the type of the control for which support is queried
-     * @return <code>true</code> if at least one control of the specified type is
-     * supported, otherwise <code>false</code>.
+     * Indicates whether the line supports a control of the specified type. Some
+     * controls may only be available when the line is open.
+     *
+     * @param  control the type of the control for which support is queried
+     * @return {@code true} if at least one control of the specified type is
+     *         supported, otherwise {@code false}
      */
-    public boolean isControlSupported(Control.Type control);
-
+    boolean isControlSupported(Control.Type control);
 
     /**
-     * Obtains a control of the specified type,
-     * if there is any.
-     * Some controls may only be available when the line is open.
-     * @param control the type of the requested control
+     * Obtains a control of the specified type, if there is any. Some controls
+     * may only be available when the line is open.
+     *
+     * @param  control the type of the requested control
      * @return a control of the specified type
-     * @throws IllegalArgumentException if a control of the specified type
-     * is not supported
+     * @throws IllegalArgumentException if a control of the specified type is
+     *         not supported
      * @see #getControls
      * @see #isControlSupported(Control.Type control)
      */
-    public Control getControl(Control.Type control);
-
+    Control getControl(Control.Type control);
 
     /**
-     * Adds a listener to this line.  Whenever the line's status changes, the
-     * listener's <code>update()</code> method is called with a <code>LineEvent</code> object
-     * that describes the change.
-     * @param listener the object to add as a listener to this line
+     * Adds a listener to this line. Whenever the line's status changes, the
+     * listener's {@code update()} method is called with a {@code LineEvent}
+     * object that describes the change.
+     *
+     * @param  listener the object to add as a listener to this line
      * @see #removeLineListener
      * @see LineListener#update
      * @see LineEvent
      */
-    public void addLineListener(LineListener listener);
-
+    void addLineListener(LineListener listener);
 
     /**
      * Removes the specified listener from this line's list of listeners.
-     * @param listener listener to remove
+     *
+     * @param  listener listener to remove
      * @see #addLineListener
      */
-    public void removeLineListener(LineListener listener);
-
+    void removeLineListener(LineListener listener);
 
     /**
-     * A <code>Line.Info</code> object contains information about a line.
-     * The only information provided by <code>Line.Info</code> itself
-     * is the Java class of the line.
-     * A subclass of <code>Line.Info</code> adds other kinds of information
-     * about the line.  This additional information depends on which <code>Line</code>
-     * subinterface is implemented by the kind of line that the <code>Line.Info</code>
-     * subclass describes.
+     * A {@code Line.Info} object contains information about a line. The only
+     * information provided by {@code Line.Info} itself is the Java class of the
+     * line. A subclass of {@code Line.Info} adds other kinds of information
+     * about the line. This additional information depends on which {@code Line}
+     * subinterface is implemented by the kind of line that the
+     * {@code Line.Info} subclass describes.
      * <p>
-     * A <code>Line.Info</code> can be retrieved using various methods of
-     * the <code>Line</code>, <code>Mixer</code>, and <code>AudioSystem</code>
-     * interfaces.  Other such methods let you pass a <code>Line.Info</code> as
-     * an argument, to learn whether lines matching the specified configuration
-     * are available and to obtain them.
+     * A {@code Line.Info} can be retrieved using various methods of the
+     * {@code Line}, {@code Mixer}, and {@code AudioSystem} interfaces. Other
+     * such methods let you pass a {@code Line.Info} as an argument, to learn
+     * whether lines matching the specified configuration are available and to
+     * obtain them.
      *
      * @author Kara Kytle
-     *
-     * @see Line#getLineInfo
-     * @see Mixer#getSourceLineInfo
-     * @see Mixer#getTargetLineInfo
-     * @see Mixer#getLine <code>Mixer.getLine(Line.Info)</code>
-     * @see Mixer#getSourceLineInfo(Line.Info) <code>Mixer.getSourceLineInfo(Line.Info)</code>
-     * @see Mixer#getSourceLineInfo(Line.Info) <code>Mixer.getTargetLineInfo(Line.Info)</code>
-     * @see Mixer#isLineSupported <code>Mixer.isLineSupported(Line.Info)</code>
-     * @see AudioSystem#getLine <code>AudioSystem.getLine(Line.Info)</code>
-     * @see AudioSystem#getSourceLineInfo <code>AudioSystem.getSourceLineInfo(Line.Info)</code>
-     * @see AudioSystem#getTargetLineInfo <code>AudioSystem.getTargetLineInfo(Line.Info)</code>
-     * @see AudioSystem#isLineSupported <code>AudioSystem.isLineSupported(Line.Info)</code>
+     * @see Line#getLineInfo()
+     * @see Mixer#getSourceLineInfo()
+     * @see Mixer#getTargetLineInfo()
+     * @see Mixer#getLine(Line.Info)
+     * @see Mixer#getSourceLineInfo(Line.Info)
+     * @see Mixer#getTargetLineInfo(Line.Info)
+     * @see Mixer#isLineSupported(Line.Info)
+     * @see AudioSystem#getLine(Line.Info)
+     * @see AudioSystem#getSourceLineInfo(Line.Info)
+     * @see AudioSystem#getTargetLineInfo(Line.Info)
+     * @see AudioSystem#isLineSupported(Line.Info)
      * @since 1.3
      */
-    public static class Info {
+    class Info {
 
         /**
          * The class of the line described by the info object.
          */
-        private final Class lineClass;
-
+        private final Class<?> lineClass;
 
         /**
-         * Constructs an info object that describes a line of the specified class.
-         * This constructor is typically used by an application to
+         * Constructs an info object that describes a line of the specified
+         * class. This constructor is typically used by an application to
          * describe a desired line.
-         * @param lineClass the class of the line that the new Line.Info object describes
+         *
+         * @param  lineClass the class of the line that the new Line.Info object
+         *         describes
          */
         public Info(Class<?> lineClass) {
 
@@ -260,33 +249,29 @@
             }
         }
 
-
-
         /**
          * Obtains the class of the line that this Line.Info object describes.
+         *
          * @return the described line's class
          */
         public Class<?> getLineClass() {
             return lineClass;
         }
 
-
         /**
-         * Indicates whether the specified info object matches this one.
-         * To match, the specified object must be identical to or
-         * a special case of this one.  The specified info object
-         * must be either an instance of the same class as this one,
-         * or an instance of a sub-type of this one.  In addition, the
-         * attributes of the specified object must be compatible with the
-         * capabilities of this one.  Specifically, the routing configuration
-         * for the specified info object must be compatible with that of this
-         * one.
-         * Subclasses may add other criteria to determine whether the two objects
-         * match.
+         * Indicates whether the specified info object matches this one. To
+         * match, the specified object must be identical to or a special case of
+         * this one. The specified info object must be either an instance of
+         * the same class as this one, or an instance of a sub-type of this one.
+         * In addition, the attributes of the specified object must be
+         * compatible with the capabilities of this one. Specifically, the
+         * routing configuration for the specified info object must be
+         * compatible with that of this one. Subclasses may add other criteria
+         * to determine whether the two objects match.
          *
-         * @param info the info object which is being compared to this one
-         * @return <code>true</code> if the specified object matches this one,
-         * <code>false</code> otherwise
+         * @param  info the info object which is being compared to this one
+         * @return {@code true} if the specified object matches this one,
+         *         {@code false} otherwise
          */
         public boolean matches(Info info) {
 
@@ -320,7 +305,6 @@
                 return false;
             }
 
-
             // this.isAssignableFrom(that)  =>  this is same or super to that
             //                                                          =>      this is at least as general as that
             //                                                          =>      that may be subtype of this
@@ -332,11 +316,12 @@
             return true;
         }
 
-
         /**
          * Obtains a textual description of the line info.
+         *
          * @return a string description
          */
+        @Override
         public String toString() {
 
             String fullPackagePath = "javax.sound.sampled.";
@@ -353,7 +338,5 @@
 
             return finalString;
         }
-
-    } // class Info
-
-} // interface Line
+    }
+}
--- a/src/share/classes/javax/sound/sampled/LineEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/LineEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,61 +25,64 @@
 
 package javax.sound.sampled;
 
+import java.util.EventObject;
+
 /**
- * The <code>LineEvent</code> class encapsulates information that a line
- * sends its listeners whenever the line opens, closes, starts, or stops.
- * Each of these four state changes is represented by a corresponding
- * type of event.  A listener receives the event as a parameter to its
- * {@link LineListener#update update} method.  By querying the event,
- * the listener can learn the type of event, the line responsible for
- * the event, and how much data the line had processed when the event occurred.
- *
- * <p>Although this class implements Serializable, attempts to
- * serialize a <code>LineEvent</code> object will fail.
+ * The {@code LineEvent} class encapsulates information that a line sends its
+ * listeners whenever the line opens, closes, starts, or stops. Each of these
+ * four state changes is represented by a corresponding type of event. A
+ * listener receives the event as a parameter to its
+ * {@link LineListener#update update} method. By querying the event, the
+ * listener can learn the type of event, the line responsible for the event, and
+ * how much data the line had processed when the event occurred.
+ * <p>
+ * Although this class implements Serializable, attempts to serialize a
+ * {@code LineEvent} object will fail.
  *
  * @author Kara Kytle
- *
  * @see Line
  * @see LineListener#update
  * @since 1.3
  *
  * @serial exclude
  */
-public class LineEvent extends java.util.EventObject {
+public class LineEvent extends EventObject {
+
     private static final long serialVersionUID = -1274246333383880410L;
 
-    // INSTANCE VARIABLES
-
     /**
-     * The kind of line event (<code>OPEN</code>, <code>CLOSE</code>,
-     * <code>START</code>, or <code>STOP</code>).
+     * The kind of line event ({@code OPEN}, {@code CLOSE}, {@code START}, or
+     * {@code STOP}).
+     *
+     * @serial
      * @see #getType
-     * @serial
      */
     private final Type type;
 
     /**
      * The media position when the event occurred, expressed in sample frames.
-     * Note that this field is only relevant to certain events generated by
-     * data lines, such as <code>START</code> and <code>STOP</code>.  For
-     * events generated by lines that do not count sample frames, and for any
-     * other events for which this value is not known, the position value
-     * should be {@link AudioSystem#NOT_SPECIFIED}.
+     * Note that this field is only relevant to certain events generated by data
+     * lines, such as {@code START} and {@code STOP}. For events generated by
+     * lines that do not count sample frames, and for any other events for which
+     * this value is not known, the position value should be
+     * {@link AudioSystem#NOT_SPECIFIED}.
+     *
      * @serial
      * @see #getFramePosition
      */
     private final long position;
 
-
     /**
-     * Constructs a new event of the specified type, originating from the specified line.
-     * @param line the source of this event
-     * @param type the event type (<code>OPEN</code>, <code>CLOSE</code>, <code>START</code>, or <code>STOP</code>)
-     * @param position the number of sample frames that the line had already processed when the event occurred,
-     * or {@link AudioSystem#NOT_SPECIFIED}
+     * Constructs a new event of the specified type, originating from the
+     * specified line.
      *
-     * @throws IllegalArgumentException if <code>line</code> is
-     * <code>null</code>.
+     * @param  line the source of this event
+     * @param  type the event type ({@code OPEN}, {@code CLOSE}, {@code START},
+     *         or {@code STOP})
+     * @param  position the number of sample frames that the line had already
+     *         processed when the event occurred, or
+     *         {@link AudioSystem#NOT_SPECIFIED}
+     * @throws IllegalArgumentException if {@code line} is {@code null}.
      */
     public LineEvent(Line line, Type type, long position) {
 
@@ -90,6 +93,7 @@
 
     /**
      * Obtains the audio line that is the source of this event.
+     *
      * @return the line responsible for this event
      */
     public final Line getLine() {
@@ -97,11 +101,11 @@
         return (Line)getSource();
     }
 
-
     /**
      * Obtains the event's type.
+     *
      * @return this event's type ({@link Type#OPEN}, {@link Type#CLOSE},
-     * {@link Type#START}, or {@link Type#STOP})
+     *         {@link Type#START}, or {@link Type#STOP})
      */
     public final Type getType() {
 
@@ -109,21 +113,24 @@
     }
 
     /**
-     * Obtains the position in the line's audio data when the event occurred, expressed in sample frames.
-     * For example, if a source line had already played back 14 sample frames at the time it was
-     * paused, the pause event would report the line's position as 14.  The next frame to be processed
-     * would be frame number 14 using zero-based numbering, or 15 using one-based numbering.
+     * Obtains the position in the line's audio data when the event occurred,
+     * expressed in sample frames. For example, if a source line had already
+     * played back 14 sample frames at the time it was paused, the pause event
+     * would report the line's position as 14. The next frame to be processed
+     * would be frame number 14 using zero-based numbering, or 15 using
+     * one-based numbering.
      * <p>
-     * Note that this field is relevant only to certain events generated by
-     * data lines, such as <code>START</code> and <code>STOP</code>.  For
-     * events generated by lines that do not count sample frames, and for any
-     * other events for which this value is not known, the position value
-     * should be {@link AudioSystem#NOT_SPECIFIED}.
+     * Note that this field is relevant only to certain events generated by data
+     * lines, such as {@code START} and {@code STOP}. For events generated by
+     * lines that do not count sample frames, and for any other events for which
+     * this value is not known, the position value should be
+     * {@link AudioSystem#NOT_SPECIFIED}.
      *
      * @return the line's position as a sample frame number
      */
     /*
-     * $$kk: 04.20.99: note to myself: should make sure our implementation is consistent with this.
+     * $$kk: 04.20.99: note to myself: should make sure our implementation is
+     * consistent with this.
      * which is a reasonable definition....
      */
     public final long getFramePosition() {
@@ -132,10 +139,12 @@
     }
 
     /**
-     * Obtains a string representation of the event.  The contents of the string may vary
-     * between implementations of Java Sound.
-     * @return a string describing the event.
+     * Obtains a string representation of the event. The contents of the string
+     * may vary between implementations of Java Sound.
+     *
+     * @return a string describing the event
      */
+    @Override
     public String toString() {
         String sType = "";
         if (type != null) sType = type.toString()+" ";
@@ -148,16 +157,15 @@
         return new String(sType + "event from line " + sLine);
     }
 
-
     /**
-     * The LineEvent.Type inner class identifies what kind of event occurred on a line.
-     * Static instances are provided for the common types (OPEN, CLOSE, START, and STOP).
+     * The LineEvent.Type inner class identifies what kind of event occurred on
+     * a line. Static instances are provided for the common types (OPEN, CLOSE,
+     * START, and STOP).
      *
      * @see LineEvent#getType()
      */
     public static class Type {
 
-
         /**
          * Type name.
          */
@@ -166,82 +174,84 @@
 
         /**
          * Constructs a new event type.
-         * @param name name of the type
+         *
+         * @param  name name of the type
          */
         protected Type(String name) {
             this.name = name;
         }
 
+        //$$fb 2002-11-26: fix for 4695001: SPEC: description of equals() method contains typo
 
-        //$$fb 2002-11-26: fix for 4695001: SPEC: description of equals() method contains typo
         /**
          * Indicates whether the specified object is equal to this event type,
-         * returning <code>true</code> if the objects are identical.
-         * @param obj the reference object with which to compare
-         * @return <code>true</code> if this event type is the same as
-         * <code>obj</code>; <code>false</code> otherwise
+         * returning {@code true} if the objects are identical.
+         *
+         * @param  obj the reference object with which to compare
+         * @return {@code true} if this event type is the same as {@code obj};
+         *         {@code false} otherwise
          */
+        @Override
         public final boolean equals(Object obj) {
             return super.equals(obj);
         }
 
-
         /**
          * Finalizes the hashcode method.
          */
+        @Override
         public final int hashCode() {
             return super.hashCode();
         }
 
-
         /**
          * Returns the type name as the string representation.
          */
+        @Override
         public String toString() {
             return name;
         }
 
-
         // LINE EVENT TYPE DEFINES
 
         /**
          * A type of event that is sent when a line opens, reserving system
          * resources for itself.
+         *
          * @see #CLOSE
          * @see Line#open
          */
         public static final Type OPEN   = new Type("Open");
 
-
         /**
          * A type of event that is sent when a line closes, freeing the system
          * resources it had obtained when it was opened.
+         *
          * @see #OPEN
          * @see Line#close
          */
         public static final Type CLOSE  = new Type("Close");
 
-
         /**
          * A type of event that is sent when a line begins to engage in active
          * input or output of audio data in response to a
          * {@link DataLine#start start} request.
+         *
          * @see #STOP
          * @see DataLine#start
          */
         public static final Type START  = new Type("Start");
 
-
         /**
-         * A type of event that is sent when a line ceases active input or output
-         * of audio data in response to a {@link DataLine#stop stop} request,
-         * or because the end of media has been reached.
+         * A type of event that is sent when a line ceases active input or
+         * output of audio data in response to a {@link DataLine#stop stop}
+         * request, or because the end of media has been reached.
+         *
          * @see #START
          * @see DataLine#stop
          */
         public static final Type STOP   = new Type("Stop");
 
-
         /**
          * A type of event that is sent when a line ceases to engage in active
          * input or output of audio data because the end of media has been reached.
@@ -255,7 +265,6 @@
          */
         //public static final Type EOM  = new Type("EOM");
 
-
         /**
          * A type of event that is sent when a line begins to engage in active
          * input or output of audio data.  Examples of when this happens are
@@ -268,7 +277,6 @@
          */
         //public static final Type ACTIVE       = new Type("ACTIVE");
 
-
         /**
          * A type of event that is sent when a line ceases active input or output
          * of audio data.
@@ -276,7 +284,5 @@
          * @see DataLine#stop
          */
         //public static final Type INACTIVE     = new Type("INACTIVE");
-
-    } // class Type
-
-} // class LineEvent
+    }
+}
--- a/src/share/classes/javax/sound/sampled/LineListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/LineListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,44 +25,27 @@
 
 package javax.sound.sampled;
 
-
+import java.util.EventListener;
 
 /**
- * Instances of classes that implement the <code>LineListener</code> interface can register to
- * receive events when a line's status changes.
+ * Instances of classes that implement the {@code LineListener} interface can
+ * register to receive events when a line's status changes.
  *
  * @author Kara Kytle
- *
  * @see Line
  * @see Line#addLineListener
  * @see Line#removeLineListener
  * @see LineEvent
- *
  * @since 1.3
  */
-/*
- * Instances of classes that implement the <code>LineListener</code> interface can register to
- * receive events when a line's status changes.
- *
- * @see Line
- * @see Line#addLineListener
- * @see Line#removeLineListener
- * @see LineEvent
- *
- * @author Kara Kytle
- */
-public interface LineListener extends java.util.EventListener {
+public interface LineListener extends EventListener {
 
     /**
-     * Informs the listener that a line's state has changed.  The listener can then invoke
-     * <code>LineEvent</code> methods to obtain information about the event.
-     * @param event a line event that describes the change
+     * Informs the listener that a line's state has changed. The listener can
+     * then invoke {@code LineEvent} methods to obtain information about the
+     * event.
+     *
+     * @param  event a line event that describes the change
      */
-    /*
-     * Informs the listener that a line's state has changed.  The listener can then invoke
-     * <code>LineEvent</code> methods to obtain information about the event.
-     * @param event a line event that describes the change
-     */
-    public void update(LineEvent event);
-
-} // interface LineListener
+    void update(LineEvent event);
+}
--- a/src/share/classes/javax/sound/sampled/LineUnavailableException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/LineUnavailableException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,43 +26,32 @@
 package javax.sound.sampled;
 
 /**
- * A <code>LineUnavailableException</code> is an exception indicating that a
- * line cannot be opened because it is unavailable.  This situation
- * arises most commonly when a requested line is already in use
- * by another application.
+ * A {@code LineUnavailableException} is an exception indicating that a line
+ * cannot be opened because it is unavailable. This situation arises most
+ * commonly when a requested line is already in use by another application.
  *
  * @author Kara Kytle
  * @since 1.3
  */
-/*
- * A <code>LinenavailableException</code> is an exception indicating that a
- * line annot be opened because it is unavailable.  This situation
- * arises most commonly when a line is requested when it is already in use
- * by another application.
- *
- * @author Kara Kytle
- */
+public class LineUnavailableException extends Exception {
 
-public class LineUnavailableException extends Exception {
     private static final long serialVersionUID = -2046718279487432130L;
 
     /**
-     * Constructs a <code>LineUnavailableException</code> that has
-     * <code>null</code> as its error detail message.
+     * Constructs a {@code LineUnavailableException} that has {@code null} as
+     * its error detail message.
      */
     public LineUnavailableException() {
-
         super();
     }
 
     /**
-     * Constructs a <code>LineUnavailableException</code> that has
-     * the specified detail message.
+     * Constructs a {@code LineUnavailableException} that has the specified
+     * detail message.
      *
-     * @param message a string containing the error detail message
+     * @param  message a string containing the error detail message
      */
-    public LineUnavailableException(String message) {
-
+    public LineUnavailableException(final String message) {
         super(message);
     }
 }
--- a/src/share/classes/javax/sound/sampled/Mixer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/Mixer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,30 +25,27 @@
 
 package javax.sound.sampled;
 
-
 /**
- * A mixer is an audio device with one or more lines.  It need not be
- * designed for mixing audio signals.  A mixer that actually mixes audio
- * has multiple input (source) lines and at least one output (target) line.
- * The former are often instances of classes that implement
- * <code>{@link SourceDataLine}</code>,
- * and the latter, <code>{@link TargetDataLine}</code>.  <code>{@link Port}</code>
- * objects, too, are either source lines or target lines.
- * A mixer can accept prerecorded, loopable sound as input, by having
- * some of its source lines be instances of objects that implement the
- * <code>{@link Clip}</code> interface.
+ * A mixer is an audio device with one or more lines. It need not be designed
+ * for mixing audio signals. A mixer that actually mixes audio has multiple
+ * input (source) lines and at least one output (target) line. The former are
+ * often instances of classes that implement {@link SourceDataLine}, and the
+ * latter, {@link TargetDataLine}. {@link Port} objects, too, are either source
+ * lines or target lines. A mixer can accept prerecorded, loopable sound as
+ * input, by having some of its source lines be instances of objects that
+ * implement the {@link Clip} interface.
  * <p>
- * Through methods of the <code>Line</code> interface, which <code>Mixer</code> extends,
- * a mixer might provide a set of controls that are global to the mixer.  For example,
- * the mixer can have a master gain control.  These global controls are distinct
- * from the controls belonging to each of the mixer's individual lines.
+ * Through methods of the {@code Line} interface, which {@code Mixer} extends, a
+ * mixer might provide a set of controls that are global to the mixer. For
+ * example, the mixer can have a master gain control. These global controls are
+ * distinct from the controls belonging to each of the mixer's individual lines.
  * <p>
- * Some mixers, especially
- * those with internal digital mixing capabilities, may provide
- * additional capabilities by implementing the <code>DataLine</code> interface.
+ * Some mixers, especially those with internal digital mixing capabilities, may
+ * provide additional capabilities by implementing the {@code DataLine}
+ * interface.
  * <p>
- * A mixer can support synchronization of its lines.  When one line in
- * a synchronized group is started or stopped, the other lines in the group
+ * A mixer can support synchronization of its lines. When one line in a
+ * synchronized group is started or stopped, the other lines in the group
  * automatically start or stop simultaneously with the explicitly affected one.
  *
  * @author Kara Kytle
@@ -59,198 +56,201 @@
     /**
      * Obtains information about this mixer, including the product's name,
      * version, vendor, etc.
+     *
      * @return a mixer info object that describes this mixer
      * @see Mixer.Info
      */
-    public Info getMixerInfo();
-
+    Info getMixerInfo();
 
     /**
-     * Obtains information about the set of source lines supported
-     * by this mixer.
-     * Some source lines may only be available when this mixer is open.
-     * @return array of <code>Line.Info</code> objects representing source lines
-     * for this mixer.  If no source lines are supported,
-     * an array of length 0 is returned.
+     * Obtains information about the set of source lines supported by this
+     * mixer. Some source lines may only be available when this mixer is open.
+     *
+     * @return array of {@code Line.Info} objects representing source lines for
+     *         this mixer. If no source lines are supported, an array of length
+     *         0 is returned.
      */
-    public Line.Info[] getSourceLineInfo();
+    Line.Info[] getSourceLineInfo();
 
     /**
-     * Obtains information about the set of target lines supported
-     * by this mixer.
-     * Some target lines may only be available when this mixer is open.
-     * @return array of <code>Line.Info</code> objects representing target lines
-     * for this mixer.  If no target lines are supported,
-     * an array of length 0 is returned.
+     * Obtains information about the set of target lines supported by this
+     * mixer. Some target lines may only be available when this mixer is open.
+     *
+     * @return array of {@code Line.Info} objects representing target lines for
+     *         this mixer. If no target lines are supported, an array of length
+     *         0 is returned.
      */
-    public Line.Info[] getTargetLineInfo();
-
+    Line.Info[] getTargetLineInfo();
 
     /**
-     * Obtains information about source lines of a particular type supported
-     * by the mixer.
-     * Some source lines may only be available when this mixer is open.
-     * @param info a <code>Line.Info</code> object describing lines about which information
-     * is queried
-     * @return an array of <code>Line.Info</code> objects describing source lines matching
-     * the type requested.  If no matching source lines are supported, an array of length 0
-     * is returned.
+     * Obtains information about source lines of a particular type supported by
+     * the mixer. Some source lines may only be available when this mixer is
+     * open.
+     *
+     * @param  info a {@code Line.Info} object describing lines about which
+     *         information is queried
+     * @return an array of {@code Line.Info} objects describing source lines
+     *         matching the type requested. If no matching source lines are
+     *         supported, an array of length 0 is returned.
      */
-    public Line.Info[] getSourceLineInfo(Line.Info info);
-
+    Line.Info[] getSourceLineInfo(Line.Info info);
 
     /**
-     * Obtains information about target lines of a particular type supported
-     * by the mixer.
-     * Some target lines may only be available when this mixer is open.
-     * @param info a <code>Line.Info</code> object describing lines about which information
-     * is queried
-     * @return an array of <code>Line.Info</code> objects describing target lines matching
-     * the type requested.  If no matching target lines are supported, an array of length 0
-     * is returned.
+     * Obtains information about target lines of a particular type supported by
+     * the mixer. Some target lines may only be available when this mixer is
+     * open.
+     *
+     * @param  info a {@code Line.Info} object describing lines about which
+     *         information is queried
+     * @return an array of {@code Line.Info} objects describing target lines
+     *         matching the type requested. If no matching target lines are
+     *         supported, an array of length 0 is returned.
      */
-    public Line.Info[] getTargetLineInfo(Line.Info info);
-
+    Line.Info[] getTargetLineInfo(Line.Info info);
 
     /**
-     * Indicates whether the mixer supports a line (or lines) that match
-     * the specified <code>Line.Info</code> object.
-     * Some lines may only be supported when this mixer is open.
-     * @param info describes the line for which support is queried
-     * @return <code>true</code> if at least one matching line is
-     * supported, <code>false</code> otherwise
+     * Indicates whether the mixer supports a line (or lines) that match the
+     * specified {@code Line.Info} object. Some lines may only be supported when
+     * this mixer is open.
+     *
+     * @param  info describes the line for which support is queried
+     * @return {@code true} if at least one matching line is supported,
+     *         {@code false} otherwise
      */
-    public boolean isLineSupported(Line.Info info);
+    boolean isLineSupported(Line.Info info);
 
     /**
      * Obtains a line that is available for use and that matches the description
-     * in the specified <code>Line.Info</code> object.
+     * in the specified {@code Line.Info} object.
+     * <p>
+     * If a {@code DataLine} is requested, and {@code info} is an instance of
+     * {@code DataLine.Info} specifying at least one fully qualified audio
+     * format, the last one will be used as the default format of the returned
+     * {@code DataLine}.
      *
-     * <p>If a <code>DataLine</code> is requested, and <code>info</code>
-     * is an instance of <code>DataLine.Info</code> specifying at
-     * least one fully qualified audio format, the last one
-     * will be used as the default format of the returned
-     * <code>DataLine</code>.
-     *
-     * @param info describes the desired line
+     * @param  info describes the desired line
      * @return a line that is available for use and that matches the description
-     * in the specified {@code Line.Info} object
-     * @throws LineUnavailableException if a matching line
-     * is not available due to resource restrictions
-     * @throws IllegalArgumentException if this mixer does
-     * not support any lines matching the description
-     * @throws SecurityException if a matching line
-     * is not available due to security restrictions
+     *         in the specified {@code Line.Info} object
+     * @throws LineUnavailableException if a matching line is not available due
+     *         to resource restrictions
+     * @throws IllegalArgumentException if this mixer does not support any lines
+     *         matching the description
+     * @throws SecurityException if a matching line is not available due to
+     *         security restrictions
      */
-    public Line getLine(Line.Info info) throws LineUnavailableException;
+    Line getLine(Line.Info info) throws LineUnavailableException;
 
     //$$fb 2002-04-12: fix for 4667258: behavior of Mixer.getMaxLines(Line.Info) method doesn't match the spec
     /**
-     * Obtains the approximate maximum number of lines of the requested type that can be open
-     * simultaneously on the mixer.
+     * Obtains the approximate maximum number of lines of the requested type
+     * that can be open simultaneously on the mixer.
      *
-     * Certain types of mixers do not have a hard bound and may allow opening more lines.
-     * Since certain lines are a shared resource, a mixer may not be able to open the maximum
-     * number of lines if another process has opened lines of this mixer.
+     * Certain types of mixers do not have a hard bound and may allow opening
+     * more lines. Since certain lines are a shared resource, a mixer may not be
+     * able to open the maximum number of lines if another process has opened
+     * lines of this mixer.
      *
-     * The requested type is any line that matches the description in
-     * the provided <code>Line.Info</code> object.  For example, if the info
-     * object represents a speaker
-     * port, and the mixer supports exactly one speaker port, this method
-     * should return 1.  If the info object represents a source data line
-     * and the mixer supports the use of 32 source data lines simultaneously,
-     * the return value should be 32.
-     * If there is no limit, this function returns <code>AudioSystem.NOT_SPECIFIED</code>.
-     * @param info a <code>Line.Info</code> that describes the line for which
-     * the number of supported instances is queried
-     * @return the maximum number of matching lines supported, or <code>AudioSystem.NOT_SPECIFIED</code>
+     * The requested type is any line that matches the description in the
+     * provided {@code Line.Info} object. For example, if the info object
+     * represents a speaker port, and the mixer supports exactly one speaker
+     * port, this method should return 1. If the info object represents a
+     * source data line and the mixer supports the use of 32 source data lines
+     * simultaneously, the return value should be 32. If there is no limit, this
+     * function returns {@code AudioSystem.NOT_SPECIFIED}.
+     *
+     * @param  info a {@code Line.Info} that describes the line for which the
+     *         number of supported instances is queried
+     * @return the maximum number of matching lines supported, or
+     *         {@code AudioSystem.NOT_SPECIFIED}
      */
-    public int getMaxLines(Line.Info info);
-
+    int getMaxLines(Line.Info info);
 
     /**
      * Obtains the set of all source lines currently open to this mixer.
      *
-     * @return the source lines currently open to the mixer.
-     * If no source lines are currently open to this mixer,  an
-     * array of length 0 is returned.
-     * @throws SecurityException if the matching lines
-     * are not available due to security restrictions
+     * @return the source lines currently open to the mixer. If no source lines
+     *         are currently open to this mixer, an array of length 0 is
+     *         returned.
+     * @throws SecurityException if the matching lines are not available due to
+     *         security restrictions
      */
-    public Line[] getSourceLines();
+    Line[] getSourceLines();
 
     /**
      * Obtains the set of all target lines currently open from this mixer.
      *
-     * @return target lines currently open from the mixer.
-     * If no target lines are currently open from this mixer, an
-     * array of length 0 is returned.
-     * @throws SecurityException if the matching lines
-     * are not available due to security restrictions
+     * @return target lines currently open from the mixer. If no target lines
+     *         are currently open from this mixer, an array of length 0 is
+     *         returned.
+     * @throws SecurityException if the matching lines are not available due to
+     *         security restrictions
      */
-    public Line[] getTargetLines();
+    Line[] getTargetLines();
 
     /**
-     * Synchronizes two or more lines.  Any subsequent command that starts or stops
-     * audio playback or capture for one of these lines will exert the
-     * same effect on the other lines in the group, so that they start or stop playing or
-     * capturing data simultaneously.
+     * Synchronizes two or more lines. Any subsequent command that starts or
+     * stops audio playback or capture for one of these lines will exert the
+     * same effect on the other lines in the group, so that they start or stop
+     * playing or capturing data simultaneously.
      *
-     * @param lines the lines that should be synchronized
-     * @param maintainSync <code>true</code> if the synchronization
-     * must be precisely maintained (i.e., the synchronization must be sample-accurate)
-     * at all times during operation of the lines , or <code>false</code>
-     * if precise synchronization is required only during start and stop operations
-     *
+     * @param  lines the lines that should be synchronized
+     * @param  maintainSync {@code true} if the synchronization must be
+     *         precisely maintained (i.e., the synchronization must be
+     *         sample-accurate) at all times during operation of the lines, or
+     *         {@code false} if precise synchronization is required only during
+     *         start and stop operations
      * @throws IllegalArgumentException if the lines cannot be synchronized.
-     * This may occur if the lines are of different types or have different
-     * formats for which this mixer does not support synchronization, or if
-     * all lines specified do not belong to this mixer.
+     *         This may occur if the lines are of different types or have
+     *         different formats for which this mixer does not support
+     *         synchronization, or if all lines specified do not belong to this
+     *         mixer.
      */
-    public void synchronize(Line[] lines, boolean maintainSync);
+    void synchronize(Line[] lines, boolean maintainSync);
 
     /**
-     * Releases synchronization for the specified lines.  The array must
-     * be identical to one for which synchronization has already been
-     * established; otherwise an exception may be thrown.  However, <code>null</code>
-     * may be specified, in which case all currently synchronized lines that belong
-     * to this mixer are unsynchronized.
-     * @param lines the synchronized lines for which synchronization should be
-     * released, or <code>null</code> for all this mixer's synchronized lines
+     * Releases synchronization for the specified lines. The array must be
+     * identical to one for which synchronization has already been established;
+     * otherwise an exception may be thrown. However, {@code null} may be
+     * specified, in which case all currently synchronized lines that belong to
+     * this mixer are unsynchronized.
      *
+     * @param  lines the synchronized lines for which synchronization should be
+     *         released, or {@code null} for all this mixer's synchronized
+     *         lines
      * @throws IllegalArgumentException if the lines cannot be unsynchronized.
-     * This may occur if the argument specified does not exactly match a set
-     * of lines for which synchronization has already been established.
+     *         This may occur if the argument specified does not exactly match
+     *         a set of lines for which synchronization has already been
+     *         established.
      */
-    public void unsynchronize(Line[] lines);
-
+    void unsynchronize(Line[] lines);
 
     /**
-     * Reports whether this mixer supports synchronization of the specified set of lines.
+     * Reports whether this mixer supports synchronization of the specified set
+     * of lines.
      *
-     * @param lines the set of lines for which synchronization support is queried
-     * @param maintainSync <code>true</code> if the synchronization
-     * must be precisely maintained (i.e., the synchronization must be sample-accurate)
-     * at all times during operation of the lines , or <code>false</code>
-     * if precise synchronization is required only during start and stop operations
-     *
-     * @return <code>true</code> if the lines can be synchronized, <code>false</code>
-     * otherwise
+     * @param  lines the set of lines for which synchronization support is
+     *         queried
+     * @param  maintainSync {@code true} if the synchronization must be
+     *         precisely maintained (i.e., the synchronization must be
+     *         sample-accurate) at all times during operation of the lines, or
+     *         {@code false} if precise synchronization is required only during
+     *         start and stop operations
+     * @return {@code true} if the lines can be synchronized, {@code false}
+     *         otherwise
      */
-    public boolean isSynchronizationSupported(Line[] lines, boolean maintainSync);
-
+    boolean isSynchronizationSupported(Line[] lines, boolean maintainSync);
 
     /**
-     * The <code>Mixer.Info</code> class represents information about an audio mixer,
+     * The {@code Mixer.Info} class represents information about an audio mixer,
      * including the product's name, version, and vendor, along with a textual
-     * description.  This information may be retrieved through the
-     * {@link Mixer#getMixerInfo() getMixerInfo}
-     * method of the <code>Mixer</code> interface.
+     * description. This information may be retrieved through the
+     * {@link Mixer#getMixerInfo() getMixerInfo} method of the {@code Mixer}
+     * interface.
      *
      * @author Kara Kytle
      * @since 1.3
      */
-    public static class Info {
+    class Info {
 
         /**
          * Mixer name.
@@ -273,13 +273,14 @@
         private final String version;
 
         /**
-         * Constructs a mixer's info object, passing it the given
-         * textual information.
-         * @param name the name of the mixer
-         * @param vendor the company who manufactures or creates the hardware
-         * or software mixer
-         * @param description descriptive text about the mixer
-         * @param version version information for the mixer
+         * Constructs a mixer's info object, passing it the given textual
+         * information.
+         *
+         * @param  name the name of the mixer
+         * @param  vendor the company who manufactures or creates the
+         *         hardware or software mixer
+         * @param  description descriptive text about the mixer
+         * @param  version version information for the mixer
          */
         protected Info(String name, String vendor, String description, String version) {
 
@@ -289,15 +290,16 @@
             this.version = version;
         }
 
-
         /**
-         * Indicates whether two info objects are equal, returning <code>true</code> if
-         * they are identical.
-         * @param obj the reference object with which to compare this info
-         * object
-         * @return <code>true</code> if this info object is the same as the
-         * <code>obj</code> argument; <code>false</code> otherwise
+         * Indicates whether two info objects are equal, returning {@code true}
+         * if they are identical.
+         *
+         * @param  obj the reference object with which to compare this info
+         *         object
+         * @return {@code true} if this info object is the same as the
+         *         {@code obj} argument; {@code false} otherwise
          */
+        @Override
         public final boolean equals(Object obj) {
             return super.equals(obj);
         }
@@ -307,12 +309,14 @@
          *
          * @return the hashcode for this object
          */
+        @Override
         public final int hashCode() {
             return super.hashCode();
         }
 
         /**
          * Obtains the name of the mixer.
+         *
          * @return a string that names the mixer
          */
         public final String getName() {
@@ -321,6 +325,7 @@
 
         /**
          * Obtains the vendor of the mixer.
+         *
          * @return a string that names the mixer's vendor
          */
         public final String getVendor() {
@@ -329,6 +334,7 @@
 
         /**
          * Obtains the description of the mixer.
+         *
          * @return a textual description of the mixer
          */
         public final String getDescription() {
@@ -337,6 +343,7 @@
 
         /**
          * Obtains the version of the mixer.
+         *
          * @return textual version information for the mixer
          */
         public final String getVersion() {
@@ -345,10 +352,12 @@
 
         /**
          * Provides a string representation of the mixer info.
+         *
          * @return a string describing the info object
          */
+        @Override
         public final String toString() {
             return (name + ", version " + version);
         }
-    } // class Info
+    }
 }
--- a/src/share/classes/javax/sound/sampled/Port.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/Port.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,41 +25,36 @@
 
 package javax.sound.sampled;
 
-
 /**
  * Ports are simple lines for input or output of audio to or from audio devices.
- * Common examples of ports that act as source lines (mixer inputs) include the microphone,
- * line input, and CD-ROM drive.  Ports that act as target lines (mixer outputs) include the
- * speaker, headphone, and line output.  You can access port using a <code>{@link Port.Info}</code>
- * object.
+ * Common examples of ports that act as source lines (mixer inputs) include the
+ * microphone, line input, and CD-ROM drive. Ports that act as target lines
+ * (mixer outputs) include the speaker, headphone, and line output. You can
+ * access port using a {@link Port.Info} object.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public interface Port extends Line {
 
-
-    // INNER CLASSES
-
-
     /**
-     * The <code>Port.Info</code> class extends <code>{@link Line.Info}</code>
-     * with additional information specific to ports, including the port's name
-     * and whether it is a source or a target for its mixer.
-     * By definition, a port acts as either a source or a target to its mixer,
-     * but not both.  (Audio input ports are sources; audio output ports are targets.)
+     * The {@code Port.Info} class extends {@code Line.Info} with additional
+     * information specific to ports, including the port's name and whether it
+     * is a source or a target for its mixer. By definition, a port acts as
+     * either a source or a target to its mixer, but not both. (Audio input
+     * ports are sources; audio output ports are targets.)
      * <p>
-     * To learn what ports are available, you can retrieve port info objects through the
-     * <code>{@link Mixer#getSourceLineInfo getSourceLineInfo}</code> and
-     * <code>{@link Mixer#getTargetLineInfo getTargetLineInfo}</code>
-     * methods of the <code>Mixer</code> interface.  Instances of the
-     * <code>Port.Info</code> class may also be constructed and used to obtain
-     * lines matching the parameters specified in the <code>Port.Info</code> object.
+     * To learn what ports are available, you can retrieve port info objects
+     * through the {@link Mixer#getSourceLineInfo getSourceLineInfo} and
+     * {@link Mixer#getTargetLineInfo getTargetLineInfo} methods of the
+     * {@code Mixer} interface. Instances of the {@code Port.Info} class may
+     * also be constructed and used to obtain lines matching the parameters
+     * specified in the {@code Port.Info} object.
      *
      * @author Kara Kytle
      * @since 1.3
      */
-    public static class Info extends Line.Info {
+    class Info extends Line.Info {
 
 
         // AUDIO PORT TYPE DEFINES
@@ -68,7 +63,8 @@
         // SOURCE PORTS
 
         /**
-         * A type of port that gets audio from a built-in microphone or a microphone jack.
+         * A type of port that gets audio from a built-in microphone or a
+         * microphone jack.
          */
         public static final Info MICROPHONE = new Info(Port.class,"MICROPHONE", true);
 
@@ -86,7 +82,8 @@
         // TARGET PORTS
 
         /**
-         * A type of port that sends audio to a built-in speaker or a speaker jack.
+         * A type of port that sends audio to a built-in speaker or a speaker
+         * jack.
          */
         public static final Info SPEAKER = new Info(Port.class,"SPEAKER", false);
 
@@ -113,19 +110,16 @@
         private String name;
         private boolean isSource;
 
-
-        // CONSTRUCTOR
-
         /**
-         * Constructs a port's info object from the information given.
-         * This constructor is typically used by an implementation
-         * of Java Sound to describe a supported line.
+         * Constructs a port's info object from the information given. This
+         * constructor is typically used by an implementation of Java Sound to
+         * describe a supported line.
          *
-         * @param lineClass the class of the port described by the info object.
-         * @param name the string that names the port
-         * @param isSource <code>true</code> if the port is a source port (such
-         * as a microphone), <code>false</code> if the port is a target port
-         * (such as a speaker).
+         * @param  lineClass the class of the port described by the info object
+         * @param  name the string that names the port
+         * @param  isSource {@code true} if the port is a source port (such as a
+         *         microphone), {@code false} if the port is a target port
+         *         (such as a speaker)
          */
         public Info(Class<?> lineClass, String name, boolean isSource) {
 
@@ -134,11 +128,9 @@
             this.isSource = isSource;
         }
 
-
-        // METHODS
-
         /**
          * Obtains the name of the port.
+         *
          * @return the string that names the port
          */
         public String getName() {
@@ -147,20 +139,23 @@
 
         /**
          * Indicates whether the port is a source or a target for its mixer.
-         * @return <code>true</code> if the port is a source port (such
-         * as a microphone), <code>false</code> if the port is a target port
-         * (such as a speaker).
+         *
+         * @return {@code true} if the port is a source port (such as a
+         *         microphone), {@code false} if the port is a target port
+         *         (such as a speaker)
          */
         public boolean isSource() {
             return isSource;
         }
 
         /**
-         * Indicates whether this info object specified matches this one.
-         * To match, the match requirements of the superclass must be
-         * met and the types must be equal.
-         * @param info the info object for which the match is queried
+         * Indicates whether this info object specified matches this one. To
+         * match, the match requirements of the superclass must be met and the
+         * types must be equal.
+         *
+         * @param  info the info object for which the match is queried
          */
+        @Override
         public boolean matches(Line.Info info) {
 
             if (! (super.matches(info)) ) {
@@ -178,31 +173,30 @@
             return true;
         }
 
-
         /**
-         * Finalizes the equals method
+         * Finalizes the equals method.
          */
+        @Override
         public final boolean equals(Object obj) {
             return super.equals(obj);
         }
 
         /**
-         * Finalizes the hashCode method
+         * Finalizes the hashCode method.
          */
+        @Override
         public final int hashCode() {
             return super.hashCode();
         }
 
-
-
         /**
-         * Provides a <code>String</code> representation
-         * of the port.
-         * @return  a string that describes the port
+         * Provides a {@code String} representation of the port.
+         *
+         * @return a string that describes the port
          */
+        @Override
         public final String toString() {
             return (name + ((isSource == true) ? " source" : " target") + " port");
         }
-
-    } // class Info
+    }
 }
--- a/src/share/classes/javax/sound/sampled/ReverbType.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/ReverbType.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,46 +25,41 @@
 
 package javax.sound.sampled;
 
-
 /**
- * The <code>ReverbType</code> class provides methods for
- * accessing various reverberation settings to be applied to
- * an audio signal.
+ * The {@code ReverbType} class provides methods for accessing various
+ * reverberation settings to be applied to an audio signal.
  * <p>
- * Reverberation simulates the reflection of sound off of
- * the walls, ceiling, and floor of a room.  Depending on
- * the size of the room, and how absorbent or reflective the materials in the
- * room's surfaces are, the sound might bounce around for a
- * long time before dying away.
+ * Reverberation simulates the reflection of sound off of the walls, ceiling,
+ * and floor of a room. Depending on the size of the room, and how absorbent or
+ * reflective the materials in the room's surfaces are, the sound might bounce
+ * around for a long time before dying away.
  * <p>
- * The reverberation parameters provided by <code>ReverbType</code> consist
- * of the delay time and intensity of early reflections, the delay time and
- * intensity of late reflections, and an overall decay time.
- * Early reflections are the initial individual low-order reflections of the
- * direct signal off the surfaces in the room.
- * The late Reflections are the dense, high-order reflections that characterize
- * the room's reverberation.
- * The delay times for the start of these two reflection types give the listener
- * a sense of the overall size and complexity of the room's shape and contents.
- * The larger the room, the longer the reflection delay times.
- * The early and late reflections' intensities define the gain (in decibels) of the reflected
- * signals as compared to the direct signal.  These intensities give the
- * listener an impression of the absorptive nature of the surfaces and objects
- * in the room.
+ * The reverberation parameters provided by {@code ReverbType} consist of the
+ * delay time and intensity of early reflections, the delay time and intensity
+ * of late reflections, and an overall decay time. Early reflections are the
+ * initial individual low-order reflections of the direct signal off the
+ * surfaces in the room. The late Reflections are the dense, high-order
+ * reflections that characterize the room's reverberation. The delay times for
+ * the start of these two reflection types give the listener a sense of the
+ * overall size and complexity of the room's shape and contents. The larger the
+ * room, the longer the reflection delay times. The early and late reflections'
+ * intensities define the gain (in decibels) of the reflected signals as
+ * compared to the direct signal. These intensities give the listener an
+ * impression of the absorptive nature of the surfaces and objects in the room.
  * The decay time defines how long the reverberation takes to exponentially
- * decay until it is no longer perceptible ("effective zero").
- * The larger and less absorbent the surfaces, the longer the decay time.
+ * decay until it is no longer perceptible ("effective zero"). The larger and
+ * less absorbent the surfaces, the longer the decay time.
  * <p>
- * The set of parameters defined here may not include all aspects of reverberation
- * as specified by some systems.  For example, the Midi Manufacturer's Association
- * (MMA) has an Interactive Audio Special Interest Group (IASIG), which has a
- * 3-D Working Group that has defined a Level 2 Spec (I3DL2).  I3DL2
- * supports filtering of reverberation and
- * control of reverb density.  These properties are not included in the JavaSound 1.0
- * definition of a reverb control.  In such a case, the implementing system
- * should either extend the defined reverb control to include additional
- * parameters, or else interpret the system's additional capabilities in a way that fits
- * the model described here.
+ * The set of parameters defined here may not include all aspects of
+ * reverberation as specified by some systems. For example, the Midi
+ * Manufacturer's Association (MMA) has an Interactive Audio Special Interest
+ * Group (IASIG), which has a 3-D Working Group that has defined a Level 2 Spec
+ * (I3DL2). I3DL2 supports filtering of reverberation and control of reverb
+ * density. These properties are not included in the JavaSound 1.0 definition of
+ * a reverb control. In such a case, the implementing system should either
+ * extend the defined reverb control to include additional parameters, or else
+ * interpret the system's additional capabilities in a way that fits the model
+ * described here.
  * <p>
  * If implementing JavaSound on a I3DL2-compliant device:
  * <ul>
@@ -72,8 +67,8 @@
  * <li>Density parameters are set to midway between minimum and maximum
  * </ul>
  * <p>
- * The following table shows what parameter values an implementation might use for a
- * representative set of reverberation settings.
+ * The following table shows what parameter values an implementation might use
+ * for a representative set of reverberation settings.
  * <p>
  *
  * <b>Reverberation Types and Parameters</b>
@@ -142,7 +137,7 @@
 public class ReverbType {
 
     /**
-     * Descriptive name of the reverb type..
+     * Descriptive name of the reverb type.
      */
     private String name;
 
@@ -167,20 +162,25 @@
     private float lateReflectionIntensity;
 
     /**
-     * Total decay time
+     * Total decay time.
      */
     private int decayTime;
 
-
     /**
      * Constructs a new reverb type that has the specified reverberation
      * parameter values.
-     * @param name the name of the new reverb type, or a zero-length <code>String</code>
-     * @param earlyReflectionDelay the new type's early reflection delay time in microseconds
-     * @param earlyReflectionIntensity the new type's early reflection intensity in dB
-     * @param lateReflectionDelay the new type's late reflection delay time in microseconds
-     * @param lateReflectionIntensity the new type's late reflection intensity in dB
-     * @param decayTime the new type's decay time in microseconds
+     *
+     * @param  name the name of the new reverb type, or a zero-length
+     *         {@code String}
+     * @param  earlyReflectionDelay the new type's early reflection delay time
+     *         in microseconds
+     * @param  earlyReflectionIntensity the new type's early reflection
+     *         intensity in dB
+     * @param  lateReflectionDelay the new type's late reflection delay time in
+     *         microseconds
+     * @param  lateReflectionIntensity the new type's late reflection intensity
+     *         in dB
+     * @param  decayTime the new type's decay time in microseconds
      */
     protected ReverbType(String name, int earlyReflectionDelay, float earlyReflectionIntensity, int lateReflectionDelay, float lateReflectionIntensity, int decayTime) {
 
@@ -192,9 +192,9 @@
         this.decayTime = decayTime;
     }
 
-
     /**
      * Obtains the name of this reverb type.
+     *
      * @return the name of this reverb type
      * @since 1.5
      */
@@ -202,89 +202,88 @@
             return name;
     }
 
-
     /**
-     * Returns the early reflection delay time in microseconds.
-     * This is the amount of time between when the direct signal is
-     * heard and when the first early reflections are heard.
-     * @return  early reflection delay time for this reverb type, in microseconds
+     * Returns the early reflection delay time in microseconds. This is the
+     * amount of time between when the direct signal is heard and when the first
+     * early reflections are heard.
+     *
+     * @return early reflection delay time for this reverb type, in microseconds
      */
     public final int getEarlyReflectionDelay() {
         return earlyReflectionDelay;
     }
 
-
     /**
-     * Returns the early reflection intensity in decibels.
-     * This is the amplitude attenuation of the first early reflections
-     * relative to the direct signal.
-     * @return  early reflection intensity for this reverb type, in dB
+     * Returns the early reflection intensity in decibels. This is the amplitude
+     * attenuation of the first early reflections relative to the direct signal.
+     *
+     * @return early reflection intensity for this reverb type, in dB
      */
     public final float getEarlyReflectionIntensity() {
         return earlyReflectionIntensity;
     }
 
-
     /**
-     * Returns the late reflection delay time in microseconds.
-     * This is the amount of time between when the first early reflections
-     * are heard and when the first late reflections are heard.
-     * @return  late reflection delay time for this reverb type, in microseconds
+     * Returns the late reflection delay time in microseconds. This is the
+     * amount of time between when the first early reflections are heard and
+     * when the first late reflections are heard.
+     *
+     * @return late reflection delay time for this reverb type, in microseconds
      */
     public final int getLateReflectionDelay() {
         return lateReflectionDelay;
     }
 
-
     /**
-     * Returns the late reflection intensity in decibels.
-     * This is the amplitude attenuation of the first late reflections
-     * relative to the direct signal.
-     * @return  late reflection intensity for this reverb type, in dB
+     * Returns the late reflection intensity in decibels. This is the amplitude
+     * attenuation of the first late reflections relative to the direct signal.
+     *
+     * @return late reflection intensity for this reverb type, in dB
      */
     public final float getLateReflectionIntensity() {
         return lateReflectionIntensity;
     }
 
-
     /**
-     * Obtains the decay time, which is the amount of time over which the
-     * late reflections attenuate to effective zero.  The effective zero
-     * value is implementation-dependent.
-     * @return  the decay time of the late reflections, in microseconds
+     * Obtains the decay time, which is the amount of time over which the late
+     * reflections attenuate to effective zero. The effective zero value is
+     * implementation-dependent.
+     *
+     * @return the decay time of the late reflections, in microseconds
      */
     public final int getDecayTime() {
         return decayTime;
     }
 
-
     /**
      * Indicates whether the specified object is equal to this reverb type,
-     * returning <code>true</code> if the objects are identical.
-     * @param obj the reference object with which to compare
-     * @return <code>true</code> if this reverb type is the same as
-     * <code>obj</code>; <code>false</code> otherwise
+     * returning {@code true} if the objects are identical.
+     *
+     * @param  obj the reference object with which to compare
+     * @return {@code true} if this reverb type is the same as {@code obj};
+     *         {@code false} otherwise
      */
+    @Override
     public final boolean equals(Object obj) {
         return super.equals(obj);
     }
 
-
     /**
      * Finalizes the hashcode method.
      */
+    @Override
     public final int hashCode() {
         return super.hashCode();
     }
 
-
     /**
-     * Provides a <code>String</code> representation of the reverb type,
-     * including its name and its parameter settings.
-     * The exact contents of the string may vary between implementations of
-     * Java Sound.
+     * Provides a {@code String} representation of the reverb type, including
+     * its name and its parameter settings. The exact contents of the string may
+     * vary between implementations of Java Sound.
+     *
      * @return reverberation type name and description
      */
+    @Override
     public final String toString() {
 
         //$$fb2001-07-20: fix for bug 4385060: The "name" attribute of class "ReverbType" is not accessible.
@@ -295,5 +294,4 @@
                 " ns, late reflection intensity " + lateReflectionIntensity +
                 " dB, decay time " +  decayTime);
     }
-
-} // class ReverbType
+}
--- a/src/share/classes/javax/sound/sampled/SourceDataLine.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/SourceDataLine.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,36 +25,35 @@
 
 package javax.sound.sampled;
 
-
 /**
- * A source data line is a data line to which data may be written.  It acts as
- * a source to its mixer. An application writes audio bytes to a source data line,
- * which handles the buffering of the bytes and delivers them to the mixer.
- * The mixer may mix the samples with those from other sources and then deliver
- * the mix to a target such as an output port (which may represent an audio output
+ * A source data line is a data line to which data may be written. It acts as a
+ * source to its mixer. An application writes audio bytes to a source data line,
+ * which handles the buffering of the bytes and delivers them to the mixer. The
+ * mixer may mix the samples with those from other sources and then deliver the
+ * mix to a target such as an output port (which may represent an audio output
  * device on a sound card).
  * <p>
  * Note that the naming convention for this interface reflects the relationship
- * between the line and its mixer.  From the perspective of an application,
- * a source data line may act as a target for audio data.
+ * between the line and its mixer. From the perspective of an application, a
+ * source data line may act as a target for audio data.
  * <p>
  * A source data line can be obtained from a mixer by invoking the
- * <code>{@link Mixer#getLine getLine}</code> method of <code>Mixer</code> with
- * an appropriate <code>{@link DataLine.Info}</code> object.
+ * {@link Mixer#getLine getLine} method of {@code Mixer} with an appropriate
+ * {@link DataLine.Info} object.
  * <p>
- * The <code>SourceDataLine</code> interface provides a method for writing
- * audio data to the data line's buffer. Applications that play or mix
- * audio should write data to the source data line quickly enough to keep the
- * buffer from underflowing (emptying), which could cause discontinuities in
- * the audio that are perceived as clicks.  Applications can use the
- * <code>{@link DataLine#available available}</code> method defined in the
- * <code>DataLine</code> interface to determine the amount of data currently
- * queued in the data line's buffer.  The amount of data which can be written
- * to the buffer without blocking is the difference between the buffer size
- * and the amount of queued data.  If the delivery of audio output
- * stops due to underflow, a <code>{@link LineEvent.Type#STOP STOP}</code> event is
- * generated.  A <code>{@link LineEvent.Type#START START}</code> event is generated
- * when the audio output resumes.
+ * The {@code SourceDataLine} interface provides a method for writing audio data
+ * to the data line's buffer. Applications that play or mix audio should write
+ * data to the source data line quickly enough to keep the buffer from
+ * underflowing (emptying), which could cause discontinuities in the audio that
+ * are perceived as clicks. Applications can use the
+ * {@link DataLine#available available} method defined in the {@code DataLine}
+ * interface to determine the amount of data currently queued in the data line's
+ * buffer. The amount of data which can be written to the buffer without
+ * blocking is the difference between the buffer size and the amount of queued
+ * data. If the delivery of audio output stops due to underflow, a
+ * {@link LineEvent.Type#STOP STOP} event is generated. A
+ * {@link LineEvent.Type#START START} event is generated when the audio output
+ * resumes.
  *
  * @author Kara Kytle
  * @see Mixer
@@ -64,138 +63,130 @@
  */
 public interface SourceDataLine extends DataLine {
 
-
     /**
      * Opens the line with the specified format and suggested buffer size,
-     * causing the line to acquire any required
-     * system resources and become operational.
+     * causing the line to acquire any required system resources and become
+     * operational.
      * <p>
      * The buffer size is specified in bytes, but must represent an integral
-     * number of sample frames.  Invoking this method with a requested buffer
+     * number of sample frames. Invoking this method with a requested buffer
      * size that does not meet this requirement may result in an
-     * IllegalArgumentException.  The actual buffer size for the open line may
-     * differ from the requested buffer size.  The value actually set may be
-     * queried by subsequently calling <code>{@link DataLine#getBufferSize}</code>.
+     * {@code IllegalArgumentException}. The actual buffer size for the open
+     * line may differ from the requested buffer size. The value actually set
+     * may be queried by subsequently calling {@link DataLine#getBufferSize}.
      * <p>
      * If this operation succeeds, the line is marked as open, and an
-     * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched to the
-     * line's listeners.
+     * {@link LineEvent.Type#OPEN OPEN} event is dispatched to the line's
+     * listeners.
      * <p>
-     * Invoking this method on a line which is already open is illegal
-     * and may result in an <code>IllegalStateException</code>.
+     * Invoking this method on a line which is already open is illegal and may
+     * result in an {@code IllegalStateException}.
      * <p>
-     * Note that some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in a
-     * <code>LineUnavailableException</code>.
+     * Note that some lines, once closed, cannot be reopened. Attempts to reopen
+     * such a line will always result in a {@code LineUnavailableException}.
      *
-     * @param format the desired audio format
-     * @param bufferSize the desired buffer size
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions
-     * @throws IllegalArgumentException if the buffer size does not represent
-     * an integral number of sample frames,
-     * or if <code>format</code> is not fully specified or invalid
+     * @param  format the desired audio format
+     * @param  bufferSize the desired buffer size
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws IllegalArgumentException if the buffer size does not represent an
+     *         integral number of sample frames, or if {@code format} is not
+     *         fully specified or invalid
      * @throws IllegalStateException if the line is already open
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions
-     *
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #open(AudioFormat)
      * @see Line#open
      * @see Line#close
      * @see Line#isOpen
      * @see LineEvent
      */
-    public void open(AudioFormat format, int bufferSize) throws LineUnavailableException;
-
+    void open(AudioFormat format, int bufferSize)
+            throws LineUnavailableException;
 
     /**
      * Opens the line with the specified format, causing the line to acquire any
      * required system resources and become operational.
-     *
      * <p>
      * The implementation chooses a buffer size, which is measured in bytes but
-     * which encompasses an integral number of sample frames.  The buffer size
+     * which encompasses an integral number of sample frames. The buffer size
      * that the system has chosen may be queried by subsequently calling
-     * <code>{@link DataLine#getBufferSize}</code>.
+     * {@link DataLine#getBufferSize}.
      * <p>
      * If this operation succeeds, the line is marked as open, and an
-     * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched to the
-     * line's listeners.
+     * {@link LineEvent.Type#OPEN OPEN} event is dispatched to the line's
+     * listeners.
      * <p>
-     * Invoking this method on a line which is already open is illegal
-     * and may result in an <code>IllegalStateException</code>.
+     * Invoking this method on a line which is already open is illegal and may
+     * result in an {@code IllegalStateException}.
      * <p>
-     * Note that some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in a
-     * <code>LineUnavailableException</code>.
+     * Note that some lines, once closed, cannot be reopened. Attempts to reopen
+     * such a line will always result in a {@code LineUnavailableException}.
      *
-     * @param format the desired audio format
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions
-     * @throws IllegalArgumentException if <code>format</code>
-     * is not fully specified or invalid
+     * @param  format the desired audio format
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws IllegalArgumentException if {@code format} is not fully specified
+     *         or invalid
      * @throws IllegalStateException if the line is already open
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions
-     *
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #open(AudioFormat, int)
      * @see Line#open
      * @see Line#close
      * @see Line#isOpen
      * @see LineEvent
      */
-    public void open(AudioFormat format) throws LineUnavailableException;
-
+    void open(AudioFormat format) throws LineUnavailableException;
 
     /**
-     * Writes audio data to the mixer via this source data line.  The requested
-     * number of bytes of data are read from the specified array,
-     * starting at the given offset into the array, and written to the data
-     * line's buffer.  If the caller attempts to write more data than can
-     * currently be written (see <code>{@link DataLine#available available}</code>),
-     * this method blocks until the requested amount of data has been written.
-     * This applies even if the requested amount of data to write is greater
-     * than the data line's buffer size.  However, if the data line is closed,
-     * stopped, or flushed before the requested amount has been written,
-     * the method no longer blocks, but returns the number of bytes
-     * written thus far.
+     * Writes audio data to the mixer via this source data line. The requested
+     * number of bytes of data are read from the specified array, starting at
+     * the given offset into the array, and written to the data line's buffer.
+     * If the caller attempts to write more data than can currently be written
+     * (see {@link DataLine#available available}), this method blocks until the
+     * requested amount of data has been written. This applies even if the
+     * requested amount of data to write is greater than the data line's buffer
+     * size. However, if the data line is closed, stopped, or flushed before the
+     * requested amount has been written, the method no longer blocks, but
+     * returns the number of bytes written thus far.
      * <p>
-     * The number of bytes that can be written without blocking can be ascertained
-     * using the <code>{@link DataLine#available available}</code> method of the
-     * <code>DataLine</code> interface.  (While it is guaranteed that
-     * this number of bytes can be written without blocking, there is no guarantee
-     * that attempts to write additional data will block.)
+     * The number of bytes that can be written without blocking can be
+     * ascertained using the {@link DataLine#available available} method of the
+     * {@code DataLine} interface. (While it is guaranteed that this number of
+     * bytes can be written without blocking, there is no guarantee that
+     * attempts to write additional data will block.)
      * <p>
-     * The number of bytes to write must represent an integral number of
-     * sample frames, such that:
+     * The number of bytes to write must represent an integral number of sample
+     * frames, such that:
      * <br>
-     * <center><code>[ bytes written ] % [frame size in bytes ] == 0</code></center>
+     * <center>{@code [ bytes written ] % [frame size in bytes ] == 0}</center>
      * <br>
-     * The return value will always meet this requirement.  A request to write a
-     * number of bytes representing a non-integral number of sample frames cannot
-     * be fulfilled and may result in an <code>IllegalArgumentException</code>.
+     * The return value will always meet this requirement. A request to write a
+     * number of bytes representing a non-integral number of sample frames
+     * cannot be fulfilled and may result in an
+     * {@code IllegalArgumentException}.
      *
-     * @param b a byte array containing data to be written to the data line
-     * @param len the length, in bytes, of the valid data in the array
-     * (in other words, the requested amount of data to write, in bytes)
-     * @param off the offset from the beginning of the array, in bytes
+     * @param  b a byte array containing data to be written to the data line
+     * @param  len the length, in bytes, of the valid data in the array (in
+     *         other words, the requested amount of data to write, in bytes)
+     * @param  off the offset from the beginning of the array, in bytes
      * @return the number of bytes actually written
      * @throws IllegalArgumentException if the requested number of bytes does
-     * not represent an integral number of sample frames,
-     * or if <code>len</code> is negative
-     * @throws ArrayIndexOutOfBoundsException if <code>off</code> is negative,
-     * or <code>off+len</code> is greater than the length of the array
-     * <code>b</code>.
-     *
+     *         not represent an integral number of sample frames, or if
+     *         {@code len} is negative
+     * @throws ArrayIndexOutOfBoundsException if {@code off} is negative, or
+     *         {@code off+len} is greater than the length of the array {@code b}
      * @see TargetDataLine#read
      * @see DataLine#available
      */
-    public int write(byte[] b, int off, int len);
+    int write(byte[] b, int off, int len);
 
     /**
      * Obtains the number of sample frames of audio data that can be written to
-     * the mixer, via this data line, without blocking.  Note that the return
+     * the mixer, via this data line, without blocking. Note that the return
      * value measures sample frames, not bytes.
+     *
      * @return the number of sample frames currently available for writing
      * @see TargetDataLine#availableRead
      */
--- a/src/share/classes/javax/sound/sampled/TargetDataLine.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/TargetDataLine.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,29 +26,28 @@
 package javax.sound.sampled;
 
 /**
- * A target data line is a type of <code>{@link DataLine}</code> from which
- * audio data can be read.  The most common example is a data line that gets
- * its data from an audio capture device.  (The device is implemented as a
- * mixer that writes to the target data line.)
+ * A target data line is a type of {@link DataLine} from which audio data can be
+ * read. The most common example is a data line that gets its data from an audio
+ * capture device. (The device is implemented as a mixer that writes to the
+ * target data line.)
  * <p>
  * Note that the naming convention for this interface reflects the relationship
- * between the line and its mixer.  From the perspective of an application,
- * a target data line may act as a source for audio data.
+ * between the line and its mixer. From the perspective of an application, a
+ * target data line may act as a source for audio data.
  * <p>
  * The target data line can be obtained from a mixer by invoking the
- * <code>{@link Mixer#getLine getLine}</code>
- * method of <code>Mixer</code> with an appropriate
- * <code>{@link DataLine.Info}</code> object.
+ * {@link Mixer#getLine getLine} method of {@code Mixer} with an appropriate
+ * {@link DataLine.Info} object.
  * <p>
- * The <code>TargetDataLine</code> interface provides a method for reading the
- * captured data from the target data line's buffer.Applications
- * that record audio should read data from the target data line quickly enough
- * to keep the buffer from overflowing, which could cause discontinuities in
- * the captured data that are perceived as clicks.  Applications can use the
- * <code>{@link DataLine#available available}</code> method defined in the
- * <code>DataLine</code> interface to determine the amount of data currently
- * queued in the data line's buffer.  If the buffer does overflow,
- * the oldest queued data is discarded and replaced by new data.
+ * The {@code TargetDataLine} interface provides a method for reading the
+ * captured data from the target data line's buffer. Applications that record
+ * audio should read data from the target data line quickly enough to keep the
+ * buffer from overflowing, which could cause discontinuities in the captured
+ * data that are perceived as clicks. Applications can use the
+ * {@link DataLine#available available} method defined in the {@code DataLine}
+ * interface to determine the amount of data currently queued in the data line's
+ * buffer. If the buffer does overflow, the oldest queued data is discarded and
+ * replaced by new data.
  *
  * @author Kara Kytle
  * @see Mixer
@@ -58,133 +57,126 @@
  */
 public interface TargetDataLine extends DataLine {
 
-
     /**
      * Opens the line with the specified format and requested buffer size,
      * causing the line to acquire any required system resources and become
      * operational.
      * <p>
      * The buffer size is specified in bytes, but must represent an integral
-     * number of sample frames.  Invoking this method with a requested buffer
+     * number of sample frames. Invoking this method with a requested buffer
      * size that does not meet this requirement may result in an
-     * IllegalArgumentException.  The actual buffer size for the open line may
-     * differ from the requested buffer size.  The value actually set may be
-     * queried by subsequently calling <code>{@link DataLine#getBufferSize}</code>
+     * {@code IllegalArgumentException}. The actual buffer size for the open
+     * line may differ from the requested buffer size. The value actually set
+     * may be queried by subsequently calling {@link DataLine#getBufferSize}
      * <p>
      * If this operation succeeds, the line is marked as open, and an
-     * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched to the
-     * line's listeners.
+     * {@link LineEvent.Type#OPEN OPEN} event is dispatched to the line's
+     * listeners.
      * <p>
-     * Invoking this method on a line that is already open is illegal
-     * and may result in an <code>IllegalStateException</code>.
+     * Invoking this method on a line that is already open is illegal and may
+     * result in an {@code IllegalStateException}.
      * <p>
-     * Some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in a
-     * <code>LineUnavailableException</code>.
+     * Some lines, once closed, cannot be reopened. Attempts to reopen such a
+     * line will always result in a {@code LineUnavailableException}.
      *
-     * @param format the desired audio format
-     * @param bufferSize the desired buffer size, in bytes.
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions
-     * @throws IllegalArgumentException if the buffer size does not represent
-     * an integral number of sample frames,
-     * or if <code>format</code> is not fully specified or invalid
+     * @param  format the desired audio format
+     * @param  bufferSize the desired buffer size, in bytes
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws IllegalArgumentException if the buffer size does not represent an
+     *         integral number of sample frames, or if {@code format} is not
+     *         fully specified or invalid
      * @throws IllegalStateException if the line is already open
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions
-     *
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #open(AudioFormat)
      * @see Line#open
      * @see Line#close
      * @see Line#isOpen
      * @see LineEvent
      */
-    public void open(AudioFormat format, int bufferSize) throws LineUnavailableException;
-
+    void open(AudioFormat format, int bufferSize) throws LineUnavailableException;
 
     /**
      * Opens the line with the specified format, causing the line to acquire any
      * required system resources and become operational.
-     *
      * <p>
      * The implementation chooses a buffer size, which is measured in bytes but
-     * which encompasses an integral number of sample frames.  The buffer size
-     * that the system has chosen may be queried by subsequently calling <code>{@link DataLine#getBufferSize}</code>
+     * which encompasses an integral number of sample frames. The buffer size
+     * that the system has chosen may be queried by subsequently calling
+     * {@link DataLine#getBufferSize}
      * <p>
      * If this operation succeeds, the line is marked as open, and an
-     * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched to the
-     * line's listeners.
+     * {@link LineEvent.Type#OPEN OPEN} event is dispatched to the line's
+     * listeners.
      * <p>
-     * Invoking this method on a line that is already open is illegal
-     * and may result in an <code>IllegalStateException</code>.
+     * Invoking this method on a line that is already open is illegal and may
+     * result in an {@code IllegalStateException}.
      * <p>
-     * Some lines, once closed, cannot be reopened.  Attempts
-     * to reopen such a line will always result in a
-     * <code>LineUnavailableException</code>.
+     * Some lines, once closed, cannot be reopened. Attempts to reopen such a
+     * line will always result in a {@code LineUnavailableException}.
      *
-     * @param format the desired audio format
-     * @throws LineUnavailableException if the line cannot be
-     * opened due to resource restrictions
-     * @throws IllegalArgumentException if <code>format</code>
-     * is not fully specified or invalid
+     * @param  format the desired audio format
+     * @throws LineUnavailableException if the line cannot be opened due to
+     *         resource restrictions
+     * @throws IllegalArgumentException if {@code format} is not fully specified
+     *         or invalid
      * @throws IllegalStateException if the line is already open
-     * @throws SecurityException if the line cannot be
-     * opened due to security restrictions
-     *
+     * @throws SecurityException if the line cannot be opened due to security
+     *         restrictions
      * @see #open(AudioFormat, int)
      * @see Line#open
      * @see Line#close
      * @see Line#isOpen
      * @see LineEvent
      */
-    public void open(AudioFormat format) throws LineUnavailableException;
-
+    void open(AudioFormat format) throws LineUnavailableException;
 
     /**
-     * Reads audio data from the data line's input buffer.   The requested
-     * number of bytes is read into the specified array, starting at
-     * the specified offset into the array in bytes.  This method blocks until
-     * the requested amount of data has been read.  However, if the data line
-     * is closed, stopped, drained, or flushed before the requested amount has
-     * been read, the method no longer blocks, but returns the number of bytes
-     * read thus far.
+     * Reads audio data from the data line's input buffer. The requested number
+     * of bytes is read into the specified array, starting at the specified
+     * offset into the array in bytes. This method blocks until the requested
+     * amount of data has been read. However, if the data line is closed,
+     * stopped, drained, or flushed before the requested amount has been read,
+     * the method no longer blocks, but returns the number of bytes read thus
+     * far.
      * <p>
      * The number of bytes that can be read without blocking can be ascertained
-     * using the <code>{@link DataLine#available available}</code> method of the
-     * <code>DataLine</code> interface.  (While it is guaranteed that
-     * this number of bytes can be read without blocking, there is no guarantee
-     * that attempts to read additional data will block.)
+     * using the {@link DataLine#available available} method of the
+     * {@code DataLine} interface. (While it is guaranteed that this number of
+     * bytes can be read without blocking, there is no guarantee that attempts
+     * to read additional data will block.)
      * <p>
      * The number of bytes to be read must represent an integral number of
      * sample frames, such that:
      * <br>
-     * <center><code>[ bytes read ] % [frame size in bytes ] == 0</code></center>
+     * <center>{@code [ bytes read ] % [frame size in bytes ] == 0}</center>
      * <br>
-     * The return value will always meet this requirement.  A request to read a
-     * number of bytes representing a non-integral number of sample frames cannot
-     * be fulfilled and may result in an IllegalArgumentException.
+     * The return value will always meet this requirement. A request to read a
+     * number of bytes representing a non-integral number of sample frames
+     * cannot be fulfilled and may result in an IllegalArgumentException.
      *
-     * @param b a byte array that will contain the requested input data when
-     * this method returns
-     * @param off the offset from the beginning of the array, in bytes
-     * @param len the requested number of bytes to read
+     * @param  b a byte array that will contain the requested input data when
+     *         this method returns
+     * @param  off the offset from the beginning of the array, in bytes
+     * @param  len the requested number of bytes to read
      * @return the number of bytes actually read
      * @throws IllegalArgumentException if the requested number of bytes does
-     * not represent an integral number of sample frames.
-     * or if <code>len</code> is negative.
-     * @throws ArrayIndexOutOfBoundsException if <code>off</code> is negative,
-     * or <code>off+len</code> is greater than the length of the array
-     * <code>b</code>.
+     *         not represent an integral number of sample frames, or if
+     *         {@code len} is negative
+     * @throws ArrayIndexOutOfBoundsException if {@code off} is negative, or
+     *         {@code off+len} is greater than the length of the array {@code b}
      *
      * @see SourceDataLine#write
      * @see DataLine#available
      */
-    public int read(byte[] b, int off, int len);
+    int read(byte[] b, int off, int len);
 
     /**
      * Obtains the number of sample frames of audio data that can be read from
-     * the target data line without blocking.  Note that the return value
+     * the target data line without blocking. Note that the return value
      * measures sample frames, not bytes.
+     *
      * @return the number of sample frames currently available for reading
      * @see SourceDataLine#availableWrite
      */
--- a/src/share/classes/javax/sound/sampled/UnsupportedAudioFileException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/UnsupportedAudioFileException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,33 +26,32 @@
 package javax.sound.sampled;
 
 /**
- * An <code>UnsupportedAudioFileException</code> is an exception indicating that an
- * operation failed because a file did not contain valid data of a recognized file
- * type and format.
+ * An {@code UnsupportedAudioFileException} is an exception indicating that an
+ * operation failed because a file did not contain valid data of a recognized
+ * file type and format.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public class UnsupportedAudioFileException extends Exception {
+
     private static final long serialVersionUID = -139127412623160368L;
 
     /**
-     * Constructs a <code>UnsupportedAudioFileException</code> that has
-     * <code>null</code> as its error detail message.
+     * Constructs a {@code UnsupportedAudioFileException} that has {@code null}
+     * as its error detail message.
      */
     public UnsupportedAudioFileException() {
-
         super();
     }
 
     /**
-     * Constructs a <code>UnsupportedAudioFileException</code> that has
-     * the specified detail message.
+     * Constructs a {@code UnsupportedAudioFileException} that has the specified
+     * detail message.
      *
-     * @param message a string containing the error detail message
+     * @param  message a string containing the error detail message
      */
-    public UnsupportedAudioFileException(String message) {
-
+    public UnsupportedAudioFileException(final String message) {
         super(message);
     }
 }
--- a/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/spi/AudioFileReader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -108,7 +108,7 @@
      * @param  stream the input stream from which the {@code AudioInputStream}
      *         should be constructed
      * @return an {@code AudioInputStream} object based on the audio file data
-     *         contained in the input stream.
+     *         contained in the input stream
      * @throws UnsupportedAudioFileException if the stream does not point to
      *         valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
--- a/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Wed Jul 09 10:42:37 2014 -0700
@@ -117,7 +117,7 @@
      * are supported for this source format, an array of length 0 is returned.
      *
      * @param  sourceFormat format of the incoming data
-     * @return array of supported target format encodings.
+     * @return array of supported target format encodings
      */
     public abstract Encoding[] getTargetEncodings(AudioFormat sourceFormat);
 
@@ -150,7 +150,7 @@
      *
      * @param  targetEncoding desired encoding of the stream after processing
      * @param  sourceFormat format of the incoming data
-     * @return array of supported target formats.
+     * @return array of supported target formats
      */
     public abstract AudioFormat[] getTargetFormats(Encoding targetEncoding,
                                                    AudioFormat sourceFormat);
@@ -187,7 +187,7 @@
      * @return stream from which processed data with the specified target
      *         encoding may be read
      * @throws IllegalArgumentException if the format combination supplied is
-     *         not supported.
+     *         not supported
      */
     public abstract AudioInputStream getAudioInputStream(
             Encoding targetEncoding, AudioInputStream sourceStream);
@@ -202,7 +202,7 @@
      * @return stream from which processed data with the specified format may be
      *         read
      * @throws IllegalArgumentException if the format combination supplied is
-     *         not supported.
+     *         not supported
      */
     public abstract AudioInputStream getAudioInputStream(
             AudioFormat targetFormat, AudioInputStream sourceStream);
--- a/src/share/classes/javax/swing/AbstractAction.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/AbstractAction.java	Wed Jul 09 10:42:37 2014 -0700
@@ -55,6 +55,7 @@
  *
  * @author Georges Saab
  * @see Action
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractAction implements Action, Cloneable, Serializable
--- a/src/share/classes/javax/swing/AbstractButton.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/AbstractButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -71,6 +71,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractButton extends JComponent implements ItemSelectable, SwingConstants {
--- a/src/share/classes/javax/swing/AbstractListModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/AbstractListModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -45,6 +45,7 @@
  * @param <E> the type of the elements of this model
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractListModel<E> implements ListModel<E>, Serializable
--- a/src/share/classes/javax/swing/Action.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Action.java	Wed Jul 09 10:42:37 2014 -0700
@@ -210,6 +210,7 @@
  *
  * @author Georges Saab
  * @see AbstractAction
+ * @since 1.2
  */
 public interface Action extends ActionListener {
     /**
--- a/src/share/classes/javax/swing/BorderFactory.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/BorderFactory.java	Wed Jul 09 10:42:37 2014 -0700
@@ -40,6 +40,7 @@
  * a section in <em>The Java Tutorial</em>.
  *
  * @author David Kloba
+ * @since 1.2
  */
 public class BorderFactory
 {
--- a/src/share/classes/javax/swing/BoundedRangeModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/BoundedRangeModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -76,6 +76,7 @@
  *
  * @author Hans Muller
  * @see DefaultBoundedRangeModel
+ * @since 1.2
  */
 public interface BoundedRangeModel
 {
--- a/src/share/classes/javax/swing/Box.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Box.java	Wed Jul 09 10:42:37 2014 -0700
@@ -75,6 +75,7 @@
  * @see BoxLayout
  *
  * @author  Timothy Prinzing
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class Box extends JComponent implements Accessible {
--- a/src/share/classes/javax/swing/BoxLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/BoxLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -134,6 +134,7 @@
  * @see JComponent#getAlignmentY
  *
  * @author   Timothy Prinzing
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class BoxLayout implements LayoutManager2, Serializable {
--- a/src/share/classes/javax/swing/ButtonGroup.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ButtonGroup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -64,6 +64,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class ButtonGroup implements Serializable {
--- a/src/share/classes/javax/swing/ButtonModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ButtonModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -72,6 +72,7 @@
  * <code>ActionEvent</code> to be fired.
  *
  * @author Jeff Dinkins
+ * @since 1.2
  */
 public interface ButtonModel extends ItemSelectable {
 
--- a/src/share/classes/javax/swing/CellEditor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/CellEditor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -57,6 +57,7 @@
  * @see javax.swing.event.CellEditorListener
  *
  * @author Alan Chung
+ * @since 1.2
  */
 public interface CellEditor {
 
--- a/src/share/classes/javax/swing/CellRendererPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/CellRendererPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -62,6 +62,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class CellRendererPane extends Container implements Accessible
--- a/src/share/classes/javax/swing/ComboBoxEditor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ComboBoxEditor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,7 @@
  * The editor component used for JComboBox components.
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 public interface ComboBoxEditor {
 
--- a/src/share/classes/javax/swing/ComboBoxModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ComboBoxModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,6 +36,7 @@
  * @param <E> the type of the elements of this model
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 public interface ComboBoxModel<E> extends ListModel<E> {
 
--- a/src/share/classes/javax/swing/DebugGraphics.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DebugGraphics.java	Wed Jul 09 10:42:37 2014 -0700
@@ -45,6 +45,7 @@
  * @see RepaintManager#setDoubleBufferingEnabled
  *
  * @author Dave Karlton
+ * @since 1.2
  */
 public class DebugGraphics extends Graphics {
     Graphics                    graphics;
--- a/src/share/classes/javax/swing/DefaultBoundedRangeModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultBoundedRangeModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -44,6 +44,7 @@
  * @author David Kloba
  * @author Hans Muller
  * @see BoundedRangeModel
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable
--- a/src/share/classes/javax/swing/DefaultButtonModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultButtonModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -44,6 +44,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultButtonModel implements ButtonModel, Serializable {
--- a/src/share/classes/javax/swing/DefaultCellEditor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultCellEditor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -49,6 +49,7 @@
  *
  * @author Alan Chung
  * @author Philip Milne
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultCellEditor extends AbstractCellEditor
--- a/src/share/classes/javax/swing/DefaultComboBoxModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultComboBoxModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -35,6 +35,7 @@
  *
  * @author Arnaud Weber
  * @author Tom Santos
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class DefaultComboBoxModel<E> extends AbstractListModel<E> implements MutableComboBoxModel<E>, Serializable {
--- a/src/share/classes/javax/swing/DefaultDesktopManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultDesktopManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -46,6 +46,7 @@
   * @see JInternalFrame
   * @author David Kloba
   * @author Steve Wilson
+  * @since 1.2
   */
 @SuppressWarnings("serial") // No Interesting Non-Transient State
 public class DefaultDesktopManager implements DesktopManager, java.io.Serializable {
--- a/src/share/classes/javax/swing/DefaultFocusManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultFocusManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -45,6 +45,7 @@
  *
  * @author Arnaud Weber
  * @author David Mendenhall
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Obsolete class
 public class DefaultFocusManager extends FocusManager {
--- a/src/share/classes/javax/swing/DefaultListCellRenderer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultListCellRenderer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -69,6 +69,7 @@
  *
  * @author Philip Milne
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultListCellRenderer extends JLabel
--- a/src/share/classes/javax/swing/DefaultListModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultListModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -51,6 +51,7 @@
  * @param <E> the type of the elements of this model
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultListModel<E> extends AbstractListModel<E>
--- a/src/share/classes/javax/swing/DefaultListSelectionModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultListSelectionModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,6 +48,7 @@
  * @author Philip Milne
  * @author Hans Muller
  * @see ListSelectionModel
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultListSelectionModel implements ListSelectionModel, Cloneable, Serializable
--- a/src/share/classes/javax/swing/DefaultSingleSelectionModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DefaultSingleSelectionModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -42,6 +42,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Dave Moore
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultSingleSelectionModel implements SingleSelectionModel,
--- a/src/share/classes/javax/swing/DesktopManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/DesktopManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -43,6 +43,7 @@
   * @see JInternalFrame.JDesktopIcon
   *
   * @author David Kloba
+  * @since 1.2
   */
 public interface DesktopManager
 {
--- a/src/share/classes/javax/swing/FocusManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/FocusManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -44,6 +44,7 @@
  *
  * @author Arnaud Weber
  * @author David Mendenhall
+ * @since 1.2
  */
 public abstract class FocusManager extends DefaultKeyboardFocusManager {
 
--- a/src/share/classes/javax/swing/GrayFilter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/GrayFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,6 +36,7 @@
  * @author      Jeff Dinkins
  * @author      Tom Ball
  * @author      Jim Graham
+ * @since 1.2
  */
 public class GrayFilter extends RGBImageFilter {
     private boolean brighter;
--- a/src/share/classes/javax/swing/Icon.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Icon.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,7 @@
  * A small fixed size picture, typically used to decorate components.
  *
  * @see ImageIcon
+ * @since 1.2
  */
 
 public interface Icon
--- a/src/share/classes/javax/swing/ImageIcon.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ImageIcon.java	Wed Jul 09 10:42:37 2014 -0700
@@ -65,6 +65,7 @@
  *
  * @author Jeff Dinkins
  * @author Lynn Monsanto
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class ImageIcon implements Icon, Serializable, Accessible {
--- a/src/share/classes/javax/swing/JApplet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JApplet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -89,6 +89,7 @@
  *    description: Swing's Applet subclass.
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JApplet extends Applet implements Accessible,
--- a/src/share/classes/javax/swing/JButton.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -74,6 +74,7 @@
  * description: An implementation of a \"push\" button.
  *
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JButton extends AbstractButton implements Accessible {
--- a/src/share/classes/javax/swing/JCheckBox.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JCheckBox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -74,6 +74,7 @@
  * description: A component which can be selected or deselected.
  *
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JCheckBox extends JToggleButton implements Accessible {
--- a/src/share/classes/javax/swing/JCheckBoxMenuItem.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JCheckBoxMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -87,6 +87,7 @@
  *
  * @author Georges Saab
  * @author David Karlton
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants,
--- a/src/share/classes/javax/swing/JColorChooser.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JColorChooser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -82,6 +82,7 @@
  * @author James Gosling
  * @author Amy Fowler
  * @author Steve Wilson
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JColorChooser extends JComponent implements Accessible {
--- a/src/share/classes/javax/swing/JComboBox.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JComboBox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  *
  * @author Arnaud Weber
  * @author Mark Davidson
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JComboBox<E> extends JComponent
@@ -1318,13 +1319,15 @@
      * do not call or override.
      */
     public void actionPerformed(ActionEvent e) {
-        Object newItem = getEditor().getItem();
-        setPopupVisible(false);
-        getModel().setSelectedItem(newItem);
-        String oldCommand = getActionCommand();
-        setActionCommand("comboBoxEdited");
-        fireActionEvent();
-        setActionCommand(oldCommand);
+        ComboBoxEditor editor = getEditor();
+        if ((editor != null) && (e != null) && (editor == e.getSource())) {
+            setPopupVisible(false);
+            getModel().setSelectedItem(editor.getItem());
+            String oldCommand = getActionCommand();
+            setActionCommand("comboBoxEdited");
+            fireActionEvent();
+            setActionCommand(oldCommand);
+        }
     }
 
     /**
--- a/src/share/classes/javax/swing/JComponent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JComponent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -63,6 +63,7 @@
 import static javax.swing.ClientPropertyKey.*;
 import javax.accessibility.*;
 
+import sun.awt.SunToolkit;
 import sun.swing.SwingUtilities2;
 import sun.swing.UIClientPropertyKey;
 
@@ -178,6 +179,7 @@
  *
  * @author Hans Muller
  * @author Arnaud Weber
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class JComponent extends Container implements Serializable,
@@ -3678,8 +3680,8 @@
         private volatile transient int propertyListenersCount = 0;
 
         /**
-         * This field duplicates the one in java.awt.Component.AccessibleAWTComponent,
-         * so it has been deprecated.
+         * This field duplicates the function of the accessibleAWTFocusHandler field
+         * in java.awt.Component.AccessibleAWTComponent, so it has been deprecated.
          */
         @Deprecated
         protected FocusListener accessibleFocusHandler = null;
@@ -3737,14 +3739,10 @@
          * @param listener  the PropertyChangeListener to be added
          */
         public void addPropertyChangeListener(PropertyChangeListener listener) {
-            if (accessibleFocusHandler == null) {
-                accessibleFocusHandler = new AccessibleFocusHandler();
-            }
             if (accessibleContainerHandler == null) {
                 accessibleContainerHandler = new AccessibleContainerHandler();
             }
             if (propertyListenersCount++ == 0) {
-                JComponent.this.addFocusListener(accessibleFocusHandler);
                 JComponent.this.addContainerListener(accessibleContainerHandler);
             }
             super.addPropertyChangeListener(listener);
@@ -3759,7 +3757,6 @@
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
             if (--propertyListenersCount == 0) {
-                JComponent.this.removeFocusListener(accessibleFocusHandler);
                 JComponent.this.removeContainerListener(accessibleContainerHandler);
             }
             super.removePropertyChangeListener(listener);
@@ -4802,7 +4799,8 @@
      * @see RepaintManager#addDirtyRegion
      */
     public void repaint(long tm, int x, int y, int width, int height) {
-        RepaintManager.currentManager(this).addDirtyRegion(this, x, y, width, height);
+        RepaintManager.currentManager(SunToolkit.targetToAppContext(this))
+                      .addDirtyRegion(this, x, y, width, height);
     }
 
 
@@ -4856,7 +4854,7 @@
             // which was causing some people grief.
             return;
         }
-        if (SwingUtilities.isEventDispatchThread()) {
+        if (SunToolkit.isDispatchThreadForAppContext(this)) {
             invalidate();
             RepaintManager.currentManager(this).addInvalidComponent(this);
         }
@@ -4870,15 +4868,12 @@
                 }
                 setFlag(REVALIDATE_RUNNABLE_SCHEDULED, true);
             }
-            Runnable callRevalidate = new Runnable() {
-                public void run() {
-                    synchronized(JComponent.this) {
-                        setFlag(REVALIDATE_RUNNABLE_SCHEDULED, false);
-                    }
-                    revalidate();
+            SunToolkit.executeOnEventHandlerThread(this, () -> {
+                synchronized(JComponent.this) {
+                    setFlag(REVALIDATE_RUNNABLE_SCHEDULED, false);
                 }
-            };
-            SwingUtilities.invokeLater(callRevalidate);
+                revalidate();
+            });
         }
     }
 
--- a/src/share/classes/javax/swing/JDesktopPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JDesktopPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -85,6 +85,7 @@
  * @see DesktopManager
  *
  * @author David Kloba
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JDesktopPane extends JLayeredPane implements Accessible
--- a/src/share/classes/javax/swing/JDialog.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JDialog.java	Wed Jul 09 10:42:37 2014 -0700
@@ -94,6 +94,7 @@
  * @author David Kloba
  * @author James Gosling
  * @author Scott Violet
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JDialog extends Dialog implements WindowConstants,
@@ -647,6 +648,7 @@
         enableEvents(AWTEvent.KEY_EVENT_MASK | AWTEvent.WINDOW_EVENT_MASK);
         setLocale( JComponent.getDefaultLocale() );
         setRootPane(createRootPane());
+        setBackground(UIManager.getColor("control"));
         setRootPaneCheckingEnabled(true);
         if (JDialog.isDefaultLookAndFeelDecorated()) {
             boolean supportsWindowDecorations =
--- a/src/share/classes/javax/swing/JEditorPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JEditorPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -188,6 +188,7 @@
  * description: A text component to edit various types of content.
  *
  * @author  Timothy Prinzing
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JEditorPane extends JTextComponent {
@@ -679,8 +680,8 @@
                         }
                     });
                 }
-                return (pageLoaded ? page : old);
             }
+            return (pageLoaded ? page : old);
         }
 
         /**
@@ -965,7 +966,7 @@
         // The type could have optional info is part of it,
         // for example some charset info.  We need to strip that
         // of and save it.
-        int parm = type.indexOf(";");
+        int parm = type.indexOf(';');
         if (parm > -1) {
             // Save the paramList.
             String paramList = type.substring(parm);
--- a/src/share/classes/javax/swing/JFileChooser.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JFileChooser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -86,7 +86,7 @@
  * description: A component which allows for the interactive selection of a file.
  *
  * @author Jeff Dinkins
- *
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class JFileChooser extends JComponent implements Accessible {
--- a/src/share/classes/javax/swing/JFrame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -111,6 +111,7 @@
  * @author Jeff Dinkins
  * @author Georges Saab
  * @author David Kloba
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JFrame  extends Frame implements WindowConstants,
--- a/src/share/classes/javax/swing/JInternalFrame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JInternalFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -104,6 +104,7 @@
  *
  * @author David Kloba
  * @author Rich Schiavi
+ * @since 1.2
  * @beaninfo
  *      attribute: isContainer true
  *      attribute: containerDelegate getContentPane
--- a/src/share/classes/javax/swing/JLabel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JLabel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -103,6 +103,7 @@
  * description: A component that displays a short string and an icon.
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JLabel extends JComponent implements SwingConstants, Accessible
--- a/src/share/classes/javax/swing/JLayeredPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JLayeredPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -153,6 +153,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author David Kloba
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JLayeredPane extends JComponent implements Accessible {
--- a/src/share/classes/javax/swing/JList.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -276,6 +276,7 @@
  * description: A component which allows for the selection of one or more objects from a list.
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JList<E> extends JComponent implements Scrollable, Accessible
--- a/src/share/classes/javax/swing/JMenu.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JMenu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -108,6 +108,7 @@
  * @see JSeparator
  * @see JMenuBar
  * @see JPopupMenu
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JMenu extends JMenuItem implements Accessible,MenuElement
--- a/src/share/classes/javax/swing/JMenuBar.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JMenuBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -88,6 +88,7 @@
  * @see JMenu
  * @see JPopupMenu
  * @see JMenuItem
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JMenuBar extends JComponent implements Accessible,MenuElement
--- a/src/share/classes/javax/swing/JMenuItem.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -86,6 +86,7 @@
  * @see JMenu
  * @see JCheckBoxMenuItem
  * @see JRadioButtonMenuItem
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JMenuItem extends AbstractButton implements Accessible,MenuElement  {
--- a/src/share/classes/javax/swing/JOptionPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JOptionPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -310,6 +310,7 @@
  *
  * @author James Gosling
  * @author Scott Violet
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JOptionPane extends JComponent implements Accessible
--- a/src/share/classes/javax/swing/JPanel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JPanel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -61,6 +61,7 @@
  *
  * @author Arnaud Weber
  * @author Steve Wilson
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JPanel extends JComponent implements Accessible
--- a/src/share/classes/javax/swing/JPasswordField.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JPasswordField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -73,6 +73,7 @@
  * description: Allows the editing of a line of text but doesn't show the characters.
  *
  * @author  Timothy Prinzing
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JPasswordField extends JTextField {
--- a/src/share/classes/javax/swing/JPopupMenu.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JPopupMenu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -82,6 +82,7 @@
  * @author Georges Saab
  * @author David Karlton
  * @author Arnaud Weber
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JPopupMenu extends JComponent implements Accessible,MenuElement {
--- a/src/share/classes/javax/swing/JProgressBar.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JProgressBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -128,6 +128,7 @@
  *
  * @author Michael C. Albers
  * @author Kathy Walrath
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JProgressBar extends JComponent implements SwingConstants, Accessible
--- a/src/share/classes/javax/swing/JRadioButton.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JRadioButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -85,6 +85,7 @@
  * @see ButtonGroup
  * @see JCheckBox
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JRadioButton extends JToggleButton implements Accessible {
--- a/src/share/classes/javax/swing/JRadioButtonMenuItem.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JRadioButtonMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -82,6 +82,7 @@
  * @author Georges Saab
  * @author David Karlton
  * @see ButtonGroup
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JRadioButtonMenuItem extends JMenuItem implements Accessible {
--- a/src/share/classes/javax/swing/JRootPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JRootPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -197,6 +197,7 @@
  * Mixing Heavy and Light Components</a>
  *
  * @author David Kloba
+ * @since 1.2
  */
 /// PENDING(klobad) Who should be opaque in this component?
 @SuppressWarnings("serial")
--- a/src/share/classes/javax/swing/JScrollBar.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JScrollBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  *    description: A component that helps determine the visible content range of an area.
  *
  * @author David Kloba
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JScrollBar extends JComponent implements Adjustable, Accessible
--- a/src/share/classes/javax/swing/JScrollPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JScrollPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -167,6 +167,7 @@
  *   description: A specialized container that manages a viewport, optional scrollbars and headers
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JScrollPane extends JComponent implements ScrollPaneConstants, Accessible
--- a/src/share/classes/javax/swing/JSeparator.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JSeparator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -70,6 +70,7 @@
  *
  * @author Georges Saab
  * @author Jeff Shapiro
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JSeparator extends JComponent implements SwingConstants, Accessible
--- a/src/share/classes/javax/swing/JSlider.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JSlider.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  *    description: A component that supports selecting a integer value from a range.
  *
  * @author David Kloba
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JSlider extends JComponent implements SwingConstants, Accessible {
--- a/src/share/classes/javax/swing/JSplitPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JSplitPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -97,6 +97,7 @@
  * @see #resetToPreferredSizes
  *
  * @author Scott Violet
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JSplitPane extends JComponent implements Accessible
--- a/src/share/classes/javax/swing/JTabbedPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JTabbedPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -105,6 +105,7 @@
  * @author Amy Fowler
  *
  * @see SingleSelectionModel
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JTabbedPane extends JComponent
--- a/src/share/classes/javax/swing/JTable.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JTable.java	Wed Jul 09 10:42:37 2014 -0700
@@ -212,6 +212,7 @@
  * @author Shannon Hickey (printing support)
  * @see javax.swing.table.DefaultTableModel
  * @see javax.swing.table.TableRowSorter
+ * @since 1.2
  */
 /* The first versions of the JTable, contained in Swing-0.1 through
  * Swing-0.4, were written by Alan Chung.
--- a/src/share/classes/javax/swing/JTextArea.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JTextArea.java	Wed Jul 09 10:42:37 2014 -0700
@@ -123,6 +123,7 @@
  * @author  Timothy Prinzing
  * @see JTextPane
  * @see JEditorPane
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JTextArea extends JTextComponent {
--- a/src/share/classes/javax/swing/JTextField.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JTextField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -160,6 +160,7 @@
  * @see #setActionCommand
  * @see JPasswordField
  * @see #addActionListener
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JTextField extends JTextComponent implements SwingConstants {
--- a/src/share/classes/javax/swing/JTextPane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JTextPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -78,6 +78,7 @@
  *
  * @author  Timothy Prinzing
  * @see javax.swing.text.StyledEditorKit
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JTextPane extends JEditorPane {
--- a/src/share/classes/javax/swing/JToggleButton.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JToggleButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -75,6 +75,7 @@
  * @see JRadioButton
  * @see JCheckBox
  * @author Jeff Dinkins
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JToggleButton extends AbstractButton implements Accessible {
--- a/src/share/classes/javax/swing/JToolBar.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JToolBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -85,6 +85,7 @@
  * @author Georges Saab
  * @author Jeff Shapiro
  * @see Action
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JToolBar extends JComponent implements SwingConstants, Accessible
--- a/src/share/classes/javax/swing/JToolTip.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JToolTip.java	Wed Jul 09 10:42:37 2014 -0700
@@ -66,6 +66,7 @@
  * @see JComponent#createToolTip
  * @author Dave Moore
  * @author Rich Shiavi
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JToolTip extends JComponent implements Accessible {
--- a/src/share/classes/javax/swing/JTree.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JTree.java	Wed Jul 09 10:42:37 2014 -0700
@@ -141,6 +141,7 @@
  * @author Rob Davis
  * @author Ray Ryan
  * @author Scott Violet
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JTree extends JComponent implements Scrollable, Accessible
--- a/src/share/classes/javax/swing/JViewport.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JViewport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -97,6 +97,7 @@
  * @author Hans Muller
  * @author Philip Milne
  * @see JScrollPane
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class JViewport extends JComponent implements Accessible
--- a/src/share/classes/javax/swing/JWindow.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/JWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -89,6 +89,7 @@
  *    description: A toplevel window which has no system border or controls.
  *
  * @author David Kloba
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class JWindow extends Window implements Accessible,
--- a/src/share/classes/javax/swing/KeyStroke.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/KeyStroke.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,6 +60,7 @@
  *
  * @author Arnaud Weber
  * @author David Mendenhall
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class KeyStroke extends AWTKeyStroke {
--- a/src/share/classes/javax/swing/ListCellRenderer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ListCellRenderer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -85,6 +85,7 @@
  * @see DefaultListCellRenderer
  *
  * @author Hans Muller
+ * @since 1.2
  */
 public interface ListCellRenderer<E>
 {
--- a/src/share/classes/javax/swing/ListModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ListModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -39,6 +39,7 @@
  *
  * @author Hans Muller
  * @see JList
+ * @since 1.2
  */
 public interface ListModel<E>
 {
--- a/src/share/classes/javax/swing/ListSelectionModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ListSelectionModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -41,6 +41,7 @@
  * @author Hans Muller
  * @author Philip Milne
  * @see DefaultListSelectionModel
+ * @since 1.2
  */
 
 public interface ListSelectionModel
--- a/src/share/classes/javax/swing/LookAndFeel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/LookAndFeel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -147,6 +147,7 @@
  *
  * @author Tom Ball
  * @author Hans Muller
+ * @since 1.2
  */
 public abstract class LookAndFeel
 {
--- a/src/share/classes/javax/swing/MenuElement.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/MenuElement.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,7 @@
  * to handle selection and navigation in menu hierarchies.
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 
 public interface MenuElement {
--- a/src/share/classes/javax/swing/MenuSelectionManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/MenuSelectionManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,6 +36,7 @@
  * A MenuSelectionManager owns the selection in menu hierarchy.
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 public class MenuSelectionManager {
     private Vector<MenuElement> selection = new Vector<MenuElement>();
--- a/src/share/classes/javax/swing/MutableComboBoxModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/MutableComboBoxModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,7 @@
  * @param <E> the type of the elements of this model
  *
  * @author Tom Santos
+ * @since 1.2
  */
 
 public interface MutableComboBoxModel<E> extends ComboBoxModel<E> {
--- a/src/share/classes/javax/swing/OverlayLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/OverlayLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,6 +50,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author   Timothy Prinzing
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class OverlayLayout implements LayoutManager2,Serializable {
--- a/src/share/classes/javax/swing/Painter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Painter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -59,6 +59,7 @@
  * <p>This interface makes no guarantees of threadsafety.</p>
  *
  * @author rbair
+ * @since 1.7
  */
 public interface Painter<T> {
     /**
--- a/src/share/classes/javax/swing/PopupFactory.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/PopupFactory.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,10 +25,15 @@
 
 package javax.swing;
 
+import sun.awt.EmbeddedFrame;
+import sun.awt.OSInfo;
+import sun.swing.SwingAccessor;
+
 import java.applet.Applet;
 import java.awt.*;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
+import java.security.AccessController;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -56,6 +61,16 @@
  * @since 1.4
  */
 public class PopupFactory {
+
+    static {
+        SwingAccessor.setPopupFactoryAccessor(new SwingAccessor.PopupFactoryAccessor() {
+            @Override
+            public Popup getHeavyWeightPopup(PopupFactory factory, Component owner,
+                                             Component contents, int ownerX, int ownerY) {
+                return factory.getPopup(owner, contents, ownerX, ownerY, HEAVY_WEIGHT_POPUP);
+            }
+        });
+    }
     /**
      * The shared instanceof <code>PopupFactory</code> is per
      * <code>AppContext</code>. This is the key used in the
@@ -226,7 +241,12 @@
         case MEDIUM_WEIGHT_POPUP:
             return getMediumWeightPopup(owner, contents, ownerX, ownerY);
         case HEAVY_WEIGHT_POPUP:
-            return getHeavyWeightPopup(owner, contents, ownerX, ownerY);
+            Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
+            if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
+                OSInfo.OSType.MACOSX) && (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
+                ((HeavyWeightPopup)popup).setCacheEnabled(false);
+            }
+            return popup;
         }
         return null;
     }
@@ -294,6 +314,8 @@
         private static final Object heavyWeightPopupCacheKey =
                  new StringBuffer("PopupFactory.heavyWeightPopupCache");
 
+        private volatile boolean isCacheEnabled = true;
+
         /**
          * Returns either a new or recycled <code>Popup</code> containing
          * the specified children.
@@ -448,12 +470,23 @@
             }
         }
 
+        /**
+         * Enables or disables cache for current object.
+         */
+        void setCacheEnabled(boolean enable) {
+            isCacheEnabled = enable;
+        }
+
         //
         // Popup methods
         //
         public void hide() {
             super.hide();
-            recycleHeavyWeightPopup(this);
+            if (isCacheEnabled) {
+                recycleHeavyWeightPopup(this);
+            } else {
+                this._dispose();
+            }
         }
 
         /**
--- a/src/share/classes/javax/swing/ProgressMonitor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ProgressMonitor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  * @see ProgressMonitorInputStream
  * @author James Gosling
  * @author Lynn Monsanto (accessibility)
+ * @since 1.2
  */
 public class ProgressMonitor implements Accessible
 {
--- a/src/share/classes/javax/swing/ProgressMonitorInputStream.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ProgressMonitorInputStream.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,6 +60,7 @@
  * @see ProgressMonitor
  * @see JOptionPane
  * @author James Gosling
+ * @since 1.2
  */
 public class ProgressMonitorInputStream extends FilterInputStream
 {
--- a/src/share/classes/javax/swing/Renderer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Renderer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,7 @@
  * "rendering" (displaying) a value.
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 public interface Renderer {
     /**
--- a/src/share/classes/javax/swing/RepaintManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/RepaintManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,6 +60,7 @@
  * appropriate <code>addDirtyRegion</code> method.
  *
  * @author Arnaud Weber
+ * @since 1.2
  */
 public class RepaintManager
 {
--- a/src/share/classes/javax/swing/RootPaneContainer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/RootPaneContainer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -77,6 +77,7 @@
  * @see JInternalFrame
  *
  * @author Hans Muller
+ * @since 1.2
  */
 public interface RootPaneContainer
 {
--- a/src/share/classes/javax/swing/ScrollPaneConstants.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ScrollPaneConstants.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,7 @@
  * Constants used with the JScrollPane component.
  *
  * @author Hans Muller
+ * @since 1.2
  */
 public interface ScrollPaneConstants
 {
--- a/src/share/classes/javax/swing/ScrollPaneLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ScrollPaneLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,6 +56,7 @@
  * @see JViewport
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class ScrollPaneLayout
--- a/src/share/classes/javax/swing/Scrollable.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Scrollable.java	Wed Jul 09 10:42:37 2014 -0700
@@ -39,6 +39,7 @@
  * @see JScrollPane
  * @see JScrollBar
  * @author Hans Muller
+ * @since 1.2
  */
 public interface Scrollable
 {
--- a/src/share/classes/javax/swing/SingleSelectionModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/SingleSelectionModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,7 @@
  * A model that supports at most one indexed selection.
  *
  * @author Dave Moore
+ * @since 1.2
  */
 public interface SingleSelectionModel {
     /**
--- a/src/share/classes/javax/swing/SizeRequirements.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/SizeRequirements.java	Wed Jul 09 10:42:37 2014 -0700
@@ -92,6 +92,7 @@
  * @see Component#getAlignmentY
  *
  * @author Timothy Prinzing
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class SizeRequirements implements Serializable {
--- a/src/share/classes/javax/swing/SwingConstants.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/SwingConstants.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,7 @@
  *
  * @author Jeff Dinkins
  * @author Ralph Kar (orientation support)
+ * @since 1.2
  */
 public interface SwingConstants {
 
--- a/src/share/classes/javax/swing/SwingUtilities.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/SwingUtilities.java	Wed Jul 09 10:42:37 2014 -0700
@@ -49,6 +49,7 @@
  * A collection of utility methods for Swing.
  *
  * @author unknown
+ * @since 1.2
  */
 public class SwingUtilities implements SwingConstants
 {
--- a/src/share/classes/javax/swing/Timer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/Timer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -145,6 +145,7 @@
  *
  *
  * @author Dave Moore
+ * @since 1.2
  */
 @SuppressWarnings("serial")
 public class Timer implements Serializable
--- a/src/share/classes/javax/swing/ToolTipManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ToolTipManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -49,6 +49,7 @@
  * @see JComponent#createToolTip
  * @author Dave Moore
  * @author Rich Schiavi
+ * @since 1.2
  */
 public class ToolTipManager extends MouseAdapter implements MouseMotionListener  {
     Timer enterTimer, exitTimer, insideTimer;
--- a/src/share/classes/javax/swing/UIDefaults.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/UIDefaults.java	Wed Jul 09 10:42:37 2014 -0700
@@ -71,6 +71,7 @@
  *
  * @see UIManager
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class UIDefaults extends Hashtable<Object,Object>
--- a/src/share/classes/javax/swing/UIManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/UIManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -173,6 +173,7 @@
  *
  * @author Thomas Ball
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class UIManager implements Serializable
--- a/src/share/classes/javax/swing/UnsupportedLookAndFeelException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/UnsupportedLookAndFeelException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,6 +38,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author unattributed
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class UnsupportedLookAndFeelException extends Exception
--- a/src/share/classes/javax/swing/ViewportLayout.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/ViewportLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -55,6 +55,7 @@
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Hans Muller
+ * @since 1.2
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class ViewportLayout implements LayoutManager, Serializable
--- a/src/share/classes/javax/swing/WindowConstants.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/WindowConstants.java	Wed Jul 09 10:42:37 2014 -0700
@@ -44,6 +44,7 @@
  *
  *
  * @author Amy Fowler
+ * @since 1.2
  */
 public interface WindowConstants
 {
--- a/src/share/classes/javax/swing/event/AncestorEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/AncestorEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,6 +81,8 @@
 
     /**
      * Returns the ancestor that the event actually occurred on.
+     *
+     * @return the {@code Container} object specifying the ancestor component
      */
     public Container getAncestor() {
         return ancestor;
@@ -90,6 +92,8 @@
      * Returns the parent of the ancestor the event actually occurred on.
      * This is most interesting in an ANCESTOR_REMOVED event, as
      * the ancestor may no longer be in the component hierarchy.
+     *
+     * @return the {@code Container} object specifying the ancestor's parent
      */
     public Container getAncestorParent() {
         return ancestorParent;
@@ -97,6 +101,8 @@
 
     /**
      * Returns the component that the listener was added to.
+     *
+     * @return the {@code JComponent} on which the event occurred
      */
     public JComponent getComponent() {
         return (JComponent)getSource();
--- a/src/share/classes/javax/swing/event/AncestorListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/AncestorListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,9 @@
      * if the source has actually become visible.  For this to be true
      * all its parents must be visible and it must be in a hierarchy
      * rooted at a Window
+     *
+     * @param event an {@code AncestorEvent} signifying a change in an
+     *              ancestor-component's display-status
      */
     public void ancestorAdded(AncestorEvent event);
 
@@ -58,11 +61,17 @@
      * if the source has actually become invisible.  For this to be true
      * at least one of its parents must by invisible or it is not in
      * a hierarchy rooted at a Window
+     *
+     * @param event an {@code AncestorEvent} signifying a change in an
+     *              ancestor-component's display-status
      */
     public void ancestorRemoved(AncestorEvent event);
 
     /**
      * Called when either the source or one of its ancestors is moved.
+     *
+     * @param event an {@code AncestorEvent} signifying a change in an
+     *              ancestor-component's display-status
      */
     public void ancestorMoved(AncestorEvent event);
 
--- a/src/share/classes/javax/swing/event/CellEditorListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/CellEditorListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,9 +37,17 @@
 
 public interface CellEditorListener extends java.util.EventListener {
 
-    /** This tells the listeners the editor has ended editing */
+    /**
+     * This tells the listeners the editor has ended editing
+     *
+     * @param e the {@code ChangeEvent} containing the source of the event
+     */
     public void editingStopped(ChangeEvent e);
 
-    /** This tells the listeners the editor has canceled editing */
+    /**
+     * This tells the listeners the editor has canceled editing
+     *
+     * @param e the {@code ChangeEvent} containing the source of the event
+     */
     public void editingCanceled(ChangeEvent e);
 }
--- a/src/share/classes/javax/swing/event/EventListenerList.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/EventListenerList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -120,6 +120,8 @@
      * any such manipulation is necessary, it should be done
      * on a copy of the array returned rather than the array
      * itself.
+     *
+     * @return array of ListenerType-listener pairs
      */
     public Object[] getListenerList() {
         return listenerList;
@@ -127,6 +129,9 @@
 
     /**
      * Return an array of all the listeners of the given type.
+     *
+     * @param <T> the type of {@code EventListener} to search for
+     * @param t the type of {@code EventListener} classes to be returned
      * @return all of the listeners of the specified type.
      * @exception  ClassCastException if the supplied class
      *          is not assignable to EventListener
@@ -148,6 +153,8 @@
 
     /**
      * Returns the total number of listeners for this listener list.
+     *
+     * @return an integer count of total number of listeners
      */
     public int getListenerCount() {
         return listenerList.length/2;
@@ -156,6 +163,9 @@
     /**
      * Returns the total number of listeners of the supplied type
      * for this listener list.
+     *
+     * @param t the type of listeners to count
+     * @return the number of listeners of type {@code t}
      */
     public int getListenerCount(Class<?> t) {
         Object[] lList = listenerList;
@@ -173,7 +183,9 @@
 
     /**
      * Adds the listener as a listener of the specified type.
-     * @param t the type of the listener to be added
+     *
+     * @param <T> the type of {@code EventListener} to add
+     * @param t the type of the {@code EventListener} class to add
      * @param l the listener to be added
      */
     public synchronized <T extends EventListener> void add(Class<T> t, T l) {
@@ -206,6 +218,8 @@
 
     /**
      * Removes the listener as a listener of the specified type.
+     *
+     * @param <T> the type of {@code EventListener}
      * @param t the type of the listener to be removed
      * @param l the listener to be removed
      */
--- a/src/share/classes/javax/swing/event/HyperlinkEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/HyperlinkEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -142,6 +142,8 @@
      * This may be useful if a URL can't be formed
      * from the description, in which case the associated
      * URL would be null.
+     *
+     * @return the description of this link as a {@code String}
      */
     public String getDescription() {
         return desc;
--- a/src/share/classes/javax/swing/event/InternalFrameListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/InternalFrameListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,9 @@
 public interface InternalFrameListener extends EventListener {
     /**
      * Invoked when a internal frame has been opened.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#show
      */
     public void internalFrameOpened(InternalFrameEvent e);
@@ -49,36 +52,54 @@
     /**
      * Invoked when an internal frame is in the process of being closed.
      * The close operation can be overridden at this point.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#setDefaultCloseOperation
      */
     public void internalFrameClosing(InternalFrameEvent e);
 
     /**
      * Invoked when an internal frame has been closed.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#setClosed
      */
     public void internalFrameClosed(InternalFrameEvent e);
 
     /**
      * Invoked when an internal frame is iconified.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#setIcon
      */
     public void internalFrameIconified(InternalFrameEvent e);
 
     /**
      * Invoked when an internal frame is de-iconified.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#setIcon
      */
     public void internalFrameDeiconified(InternalFrameEvent e);
 
     /**
      * Invoked when an internal frame is activated.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#setSelected
      */
     public void internalFrameActivated(InternalFrameEvent e);
 
     /**
      * Invoked when an internal frame is de-activated.
+     *
+     * @param e an {@code InternalFrameEvent} with information about the
+     *          {@code JInteralFrame} that originated the event
      * @see javax.swing.JInternalFrame#setSelected
      */
     public void internalFrameDeactivated(InternalFrameEvent e);
--- a/src/share/classes/javax/swing/event/ListSelectionEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/ListSelectionEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -63,6 +63,7 @@
      * {@code lastIndex}. The selection of at least one index within the range will
      * have changed.
      *
+     * @param source the {@code Object} on which the event initially occurred
      * @param firstIndex the first index in the range, &lt;= lastIndex
      * @param lastIndex the last index in the range, &gt;= firstIndex
      * @param isAdjusting whether or not this is one in a series of
--- a/src/share/classes/javax/swing/event/MenuKeyListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/MenuKeyListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,16 +37,22 @@
     /**
      * Invoked when a key has been typed.
      * This event occurs when a key press is followed by a key release.
+     *
+     * @param e a {@code MenuKeyEvent}
      */
     void menuKeyTyped(MenuKeyEvent e);
 
     /**
      * Invoked when a key has been pressed.
+     *
+     * @param e a {@code MenuKeyEvent}
      */
     void menuKeyPressed(MenuKeyEvent e);
 
     /**
      * Invoked when a key has been released.
+     *
+     * @param e a {@code MenuKeyEvent}
      */
     void menuKeyReleased(MenuKeyEvent e);
 }
--- a/src/share/classes/javax/swing/event/PopupMenuEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/PopupMenuEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 import java.util.EventObject;
 
 /**
- * PopupMenuEvent only contains the source of the event which is the JPoupMenu
+ * PopupMenuEvent only contains the source of the event which is the JPopupMenu
  * sending the event
  * <p>
  * <strong>Warning:</strong>
--- a/src/share/classes/javax/swing/event/PopupMenuListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/PopupMenuListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,17 +35,23 @@
 
     /**
      *  This method is called before the popup menu becomes visible
+     *
+     * @param e a {@code PopupMenuEvent} containing the source of the event
      */
     void popupMenuWillBecomeVisible(PopupMenuEvent e);
 
     /**
      * This method is called before the popup menu becomes invisible
      * Note that a JPopupMenu can become invisible any time
+     *
+     * @param e a {@code PopupMenuEvent} containing the source of the event
      */
     void popupMenuWillBecomeInvisible(PopupMenuEvent e);
 
     /**
      * This method is called when the popup menu is canceled
+     *
+     * @param e a {@code PopupMenuEvent} containing the source of the event
      */
     void popupMenuCanceled(PopupMenuEvent e);
 }
--- a/src/share/classes/javax/swing/event/TableColumnModelEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TableColumnModelEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -83,9 +83,17 @@
 // Querying Methods
 //
 
-    /** Returns the fromIndex.  Valid for removed or moved events */
+    /**
+     * Returns the fromIndex.  Valid for removed or moved events
+     *
+     * @return int value for index from which the column was moved or removed
+     */
     public int getFromIndex() { return fromIndex; };
 
-    /** Returns the toIndex.  Valid for add and moved events */
+    /**
+     * Returns the toIndex.  Valid for add and moved events
+     *
+     * @return int value of column's new index
+     */
     public int getToIndex() { return toIndex; };
 }
--- a/src/share/classes/javax/swing/event/TableColumnModelListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TableColumnModelListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,21 +39,39 @@
 
 public interface TableColumnModelListener extends java.util.EventListener
 {
-    /** Tells listeners that a column was added to the model. */
+    /**
+     * Tells listeners that a column was added to the model.
+     *
+     * @param e a {@code TableColumnModelEvent}
+     */
     public void columnAdded(TableColumnModelEvent e);
 
-    /** Tells listeners that a column was removed from the model. */
+    /**
+     * Tells listeners that a column was removed from the model.
+     *
+     * @param e a {@code TableColumnModelEvent}
+     */
     public void columnRemoved(TableColumnModelEvent e);
 
-    /** Tells listeners that a column was repositioned. */
+    /**
+     * Tells listeners that a column was repositioned.
+     *
+     * @param e a {@code TableColumnModelEvent}
+     */
     public void columnMoved(TableColumnModelEvent e);
 
-    /** Tells listeners that a column was moved due to a margin change. */
+    /**
+     * Tells listeners that a column was moved due to a margin change.
+     *
+     * @param e a {@code ChangeEvent}
+     */
     public void columnMarginChanged(ChangeEvent e);
 
     /**
      * Tells listeners that the selection model of the
      * TableColumnModel changed.
+     *
+     * @param e a {@code ListSelectionEvent}
      */
     public void columnSelectionChanged(ListSelectionEvent e);
 }
--- a/src/share/classes/javax/swing/event/TableModelEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TableModelEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -95,13 +95,15 @@
 //
 
     /**
-     *  All row data in the table has changed, listeners should discard any state
-     *  that was based on the rows and requery the <code>TableModel</code>
-     *  to get the new row count and all the appropriate values.
-     *  The <code>JTable</code> will repaint the entire visible region on
-     *  receiving this event, querying the model for the cell values that are visible.
-     *  The structure of the table ie, the column names, types and order
-     *  have not changed.
+     * All row data in the table has changed, listeners should discard any state
+     * that was based on the rows and requery the <code>TableModel</code>
+     * to get the new row count and all the appropriate values.
+     * The <code>JTable</code> will repaint the entire visible region on
+     * receiving this event, querying the model for the cell values that are visible.
+     * The structure of the table ie, the column names, types and order
+     * have not changed.
+     *
+     * @param source the {@code TableModel} affected by this event
      */
     public TableModelEvent(TableModel source) {
         // Use Integer.MAX_VALUE instead of getRowCount() in case rows were deleted.
@@ -109,21 +111,28 @@
     }
 
     /**
-     *  This row of data has been updated.
-     *  To denote the arrival of a completely new table with a different structure
-     *  use <code>HEADER_ROW</code> as the value for the <code>row</code>.
-     *  When the <code>JTable</code> receives this event and its
-     *  <code>autoCreateColumnsFromModel</code>
-     *  flag is set it discards any TableColumns that it had and reallocates
-     *  default ones in the order they appear in the model. This is the
-     *  same as calling <code>setModel(TableModel)</code> on the <code>JTable</code>.
+     * This row of data has been updated.
+     * To denote the arrival of a completely new table with a different structure
+     * use <code>HEADER_ROW</code> as the value for the <code>row</code>.
+     * When the <code>JTable</code> receives this event and its
+     * <code>autoCreateColumnsFromModel</code>
+     * flag is set it discards any TableColumns that it had and reallocates
+     * default ones in the order they appear in the model. This is the
+     * same as calling <code>setModel(TableModel)</code> on the <code>JTable</code>.
+     *
+     * @param source the {@code TableModel} affected by this event
+     * @param row the row which has been updated
      */
     public TableModelEvent(TableModel source, int row) {
         this(source, row, row, ALL_COLUMNS, UPDATE);
     }
 
     /**
-     *  The data in rows [<I>firstRow</I>, <I>lastRow</I>] have been updated.
+     * The data in rows [<I>firstRow</I>, <I>lastRow</I>] have been updated.
+     *
+     * @param source the {@code TableModel} affected by this event
+     * @param firstRow the first row affected by this event
+     * @param lastRow  the last row affected by this event
      */
     public TableModelEvent(TableModel source, int firstRow, int lastRow) {
         this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
@@ -132,18 +141,32 @@
     /**
      *  The cells in column <I>column</I> in the range
      *  [<I>firstRow</I>, <I>lastRow</I>] have been updated.
+     *
+     * @param source the {@code TableModel} affected by this event
+     * @param firstRow the first row affected by this event
+     * @param lastRow  the last row affected by this event
+     * @param column the column index of cells changed; {@code ALL_COLUMNS}
+     *        signifies all cells in the specified range of rows are changed.
      */
     public TableModelEvent(TableModel source, int firstRow, int lastRow, int column) {
         this(source, firstRow, lastRow, column, UPDATE);
     }
 
     /**
-     *  The cells from (firstRow, column) to (lastRow, column) have been changed.
-     *  The <I>column</I> refers to the column index of the cell in the model's
-     *  co-ordinate system. When <I>column</I> is ALL_COLUMNS, all cells in the
-     *  specified range of rows are considered changed.
-     *  <p>
-     *  The <I>type</I> should be one of: INSERT, UPDATE and DELETE.
+     * The cells from (firstRow, column) to (lastRow, column) have been changed.
+     * The <I>column</I> refers to the column index of the cell in the model's
+     * co-ordinate system. When <I>column</I> is ALL_COLUMNS, all cells in the
+     * specified range of rows are considered changed.
+     * <p>
+     * The <I>type</I> should be one of: INSERT, UPDATE and DELETE.
+     *
+     * @param source the {@code TableModel} affected by this event
+     * @param firstRow the first row affected by this event
+     * @param lastRow  the last row affected by this event
+     * @param column the column index of cells changed; {@code ALL_COLUMNS}
+     *        signifies all cells in the specified range of rows are changed.
+     * @param type the type of change signified by this even, @code INSERT},
+     *        {@code DELETE } or {@code UPDATE}
      */
     public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type) {
         super(source);
@@ -157,23 +180,36 @@
 // Querying Methods
 //
 
-   /** Returns the first row that changed.  HEADER_ROW means the meta data,
+    /**
+     * Returns the first row that changed.  HEADER_ROW means the meta data,
      * ie. names, types and order of the columns.
+     *
+     * @return an integer signifying the first row changed
      */
     public int getFirstRow() { return firstRow; };
 
-    /** Returns the last row that changed. */
+    /**
+     * Returns the last row that changed.
+     *
+     * @return an integer signifying the last row changed
+     */
     public int getLastRow() { return lastRow; };
 
     /**
      *  Returns the column for the event.  If the return
      *  value is ALL_COLUMNS; it means every column in the specified
      *  rows changed.
+     *
+     * @return an integer signifying which column is affected by this event
      */
     public int getColumn() { return column; };
 
     /**
      *  Returns the type of event - one of: INSERT, UPDATE and DELETE.
+     *
+     * @return the type of change to a table model, an {@code INSERT} or
+     *         {@code DELETE } of row(s) or column(s) or {@code UPDATE}
+     *         to data
      */
     public int getType() { return type; }
 }
--- a/src/share/classes/javax/swing/event/TableModelListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TableModelListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,9 @@
     /**
      * This fine grain notification tells listeners the exact range
      * of cells, rows, or columns that changed.
+     *
+     * @param e a {@code TableModelEvent} to notify listener that a table model
+     *          has changed
      */
     public void tableChanged(TableModelEvent e);
 }
--- a/src/share/classes/javax/swing/event/TreeExpansionEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TreeExpansionEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -54,7 +54,7 @@
     /**
       * Path to the value this event represents.
       */
-    protected TreePath              path;
+    protected TreePath path;
 
     /**
      * Constructs a TreeExpansionEvent object.
@@ -71,6 +71,8 @@
 
     /**
       * Returns the path to the value that has been expanded/collapsed.
+      *
+      * @return this event's {@code TreePath} object
       */
     public TreePath getPath() { return path; }
 }
--- a/src/share/classes/javax/swing/event/TreeExpansionListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TreeExpansionListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,12 +41,18 @@
 public interface TreeExpansionListener extends EventListener
 {
     /**
-      * Called whenever an item in the tree has been expanded.
-      */
+     * Called whenever an item in the tree has been expanded.
+     *
+     * @param event a {@code TreeExpansionEvent} containing a {@code TreePath}
+     *              object for the expanded node
+     */
     public void treeExpanded(TreeExpansionEvent event);
 
     /**
-      * Called whenever an item in the tree has been collapsed.
-      */
+     * Called whenever an item in the tree has been collapsed.
+     *
+     * @param event a {@code TreeExpansionEvent} containing a {@code TreePath}
+     *              object for the collapsed node
+     */
     public void treeCollapsed(TreeExpansionEvent event);
 }
--- a/src/share/classes/javax/swing/event/TreeModelListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TreeModelListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,25 +46,26 @@
      * altered their children arrays, but other attributes have
      * changed and may affect presentation. Example: the name of a
      * file has changed, but it is in the same location in the file
-     * system.</p>
+     * system.
+     *
      * <p>To indicate the root has changed, childIndices and children
-     * will be null. </p>
+     * will be null.
      *
-     * <p>Use <code>e.getPath()</code>
-     * to get the parent of the changed node(s).
-     * <code>e.getChildIndices()</code>
-     * returns the index(es) of the changed node(s).</p>
+     * <p>Use {@code e.getPath()} to get the parent of the changed node(s).
+     * {@code e.getChildIndices()} returns the index(es) of the changed node(s).
+     *
+     * @param e a {@code TreeModelEvent} describing changes to a tree model
      */
     void treeNodesChanged(TreeModelEvent e);
 
     /**
      * <p>Invoked after nodes have been inserted into the tree.</p>
      *
-     * <p>Use <code>e.getPath()</code>
-     * to get the parent of the new node(s).
-     * <code>e.getChildIndices()</code>
-     * returns the index(es) of the new node(s)
-     * in ascending order.</p>
+     * <p>Use {@code e.getPath()} to get the parent of the new node(s).
+     * {@code e.getChildIndices()} returns the index(es) of the new node(s)
+     * in ascending order.
+     *
+     * @param e a {@code TreeModelEvent} describing changes to a tree model
      */
     void treeNodesInserted(TreeModelEvent e);
 
@@ -74,11 +75,11 @@
      * invoked once for the root of the removed subtree, not once for
      * each individual set of siblings removed.</p>
      *
-     * <p>Use <code>e.getPath()</code>
-     * to get the former parent of the deleted node(s).
-     * <code>e.getChildIndices()</code>
-     * returns, in ascending order, the index(es)
-     * the node(s) had before being deleted.</p>
+     * <p>Use {@code e.getPath()} to get the former parent of the deleted
+     * node(s). {@code e.getChildIndices()} returns, in ascending order, the
+     * index(es) the node(s) had before being deleted.
+     *
+     * @param e a {@code TreeModelEvent} describing changes to a tree model
      */
     void treeNodesRemoved(TreeModelEvent e);
 
@@ -88,10 +89,10 @@
      * one and the first element does not identify the current root node
      * the first element should become the new root of the tree.
      *
-     * <p>Use <code>e.getPath()</code>
-     * to get the path to the node.
-     * <code>e.getChildIndices()</code>
-     * returns null.</p>
+     * <p>Use {@code e.getPath()} to get the path to the node.
+     * {@code e.getChildIndices()} returns null.
+     *
+     * @param e a {@code TreeModelEvent} describing changes to a tree model
      */
     void treeStructureChanged(TreeModelEvent e);
 
--- a/src/share/classes/javax/swing/event/TreeSelectionEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TreeSelectionEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -62,12 +62,16 @@
     protected TreePath        newLeadSelectionPath;
 
     /**
-      * Represents a change in the selection of a TreeSelectionModel.
-      * paths identifies the paths that have been either added or
+      * Represents a change in the selection of a {@code TreeSelectionModel}.
+      * {@code paths} identifies the paths that have been either added or
       * removed from the selection.
       *
       * @param source source of event
       * @param paths the paths that have changed in the selection
+      * @param areNew a {@code boolean} array indicating whether the paths in
+      *               {@code paths} are new to the selection
+      * @param oldLeadSelectionPath the previous lead selection path
+      * @param newLeadSelectionPath the new lead selection path
       */
     public TreeSelectionEvent(Object source, TreePath[] paths,
                               boolean[] areNew, TreePath oldLeadSelectionPath,
@@ -81,14 +85,16 @@
     }
 
     /**
-      * Represents a change in the selection of a TreeSelectionModel.
-      * path identifies the path that have been either added or
+      * Represents a change in the selection of a {@code TreeSelectionModel}.
+      * {@code path} identifies the path that has been either added or
       * removed from the selection.
       *
       * @param source source of event
       * @param path the path that has changed in the selection
       * @param isNew whether or not the path is new to the selection, false
-      * means path was removed from the selection.
+      *              means path was removed from the selection.
+      * @param oldLeadSelectionPath the previous lead selection path
+      * @param newLeadSelectionPath the new lead selection path
       */
     public TreeSelectionEvent(Object source, TreePath path, boolean isNew,
                               TreePath oldLeadSelectionPath,
@@ -104,8 +110,9 @@
     }
 
     /**
-      * Returns the paths that have been added or removed from the
-      * selection.
+      * Returns the paths that have been added or removed from the selection.
+      *
+      * @return copy of the array of {@code TreePath} obects for this event.
       */
     public TreePath[] getPaths()
     {
@@ -120,6 +127,8 @@
 
     /**
       * Returns the first path element.
+      *
+      * @return the first {@code TreePath} element represented by this event
       */
     public TreePath getPath()
     {
@@ -187,6 +196,8 @@
 
     /**
      * Returns the path that was previously the lead path.
+     *
+     * @return a {@code TreePath} containing the old lead selection path
      */
     public TreePath getOldLeadSelectionPath() {
         return oldLeadSelectionPath;
@@ -194,6 +205,8 @@
 
     /**
      * Returns the current lead path.
+     *
+     * @return a {@code TreePath} containing the new lead selection path
      */
     public TreePath getNewLeadSelectionPath() {
         return newLeadSelectionPath;
@@ -201,10 +214,14 @@
 
     /**
      * Returns a copy of the receiver, but with the source being newSource.
+     *
+     * @param newSource source of event
+     * @return an {@code Object} which is a copy of this event with the source
+     *         being the {@code newSource} provided
      */
     public Object cloneWithSource(Object newSource) {
       // Fix for IE bug - crashing
-      return new TreeSelectionEvent(newSource, paths,areNew,
+      return new TreeSelectionEvent(newSource, paths, areNew,
                                     oldLeadSelectionPath,
                                     newLeadSelectionPath);
     }
--- a/src/share/classes/javax/swing/event/TreeWillExpandListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/TreeWillExpandListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,11 +41,19 @@
 public interface TreeWillExpandListener extends EventListener {
     /**
      * Invoked whenever a node in the tree is about to be expanded.
+     *
+     * @param event a {@code TreeExpansionEvent} containing a {@code TreePath}
+     *              object for the node
+     * @throws ExpandVetoException to signify expansion has been canceled
      */
     public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException;
 
     /**
      * Invoked whenever a node in the tree is about to be collapsed.
+     *
+     * @param event a {@code TreeExpansionEvent} containing a {@code TreePath}
+     *              object for the node
+     * @throws ExpandVetoException to signify collapse has been canceled
      */
     public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException;
 }
--- a/src/share/classes/javax/swing/event/UndoableEditListener.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/event/UndoableEditListener.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
 
     /**
      * An undoable edit happened
+     *
+     * @param e an {@code UndoableEditEvent} object
      */
     void undoableEditHappened(UndoableEditEvent e);
 }
--- a/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -380,15 +380,11 @@
         InternalFrameEvent e = new InternalFrameEvent(
             frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
         // Try posting event, unless there's a SecurityManager.
-        if (JInternalFrame.class.getClassLoader() == null) {
-            try {
-                Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
-                return;
-            } catch (SecurityException se) {
-                // Use dispatchEvent instead.
-            }
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
+        } catch (SecurityException se) {
+            frame.dispatchEvent(e);
         }
-        frame.dispatchEvent(e);
     }
 
 
--- a/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -458,7 +458,7 @@
         Integer fiveHundred = new Integer(500);
 
         // *** Shared Longs
-        Long oneThousand = new Long(1000);
+        Long oneThousand = 1000L;
 
         LazyValue dialogPlain12 = t ->
             new FontUIResource(Font.DIALOG, Font.PLAIN, 12);
--- a/src/share/classes/javax/swing/plaf/metal/MetalBorders.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalBorders.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,6 +56,9 @@
     static Object NO_BUTTON_ROLLOVER =
         new StringUIClientPropertyKey("NoButtonRollover");
 
+    /**
+     * The class represents the 3D border.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class Flush3DBorder extends AbstractBorder implements UIResource{
         public void paintBorder(Component c, Graphics g, int x, int y,
@@ -73,9 +76,15 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JButton}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ButtonBorder extends AbstractBorder implements UIResource {
 
+        /**
+         * The border insets.
+         */
         protected static Insets borderInsets = new Insets( 3, 3, 3, 3 );
 
         public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
@@ -188,6 +197,9 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JInternalFrame}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class InternalFrameBorder extends AbstractBorder implements UIResource {
         private static final int corner = 14;
@@ -470,6 +482,9 @@
         }
     }
 
+    /**
+     * The class represents the border of an option dialog.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class OptionDialogBorder extends AbstractBorder implements UIResource {
         int titleHeight = 0;
@@ -532,8 +547,15 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JMenuBar}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class MenuBarBorder extends AbstractBorder implements UIResource {
+
+        /**
+         * The border insets.
+         */
         protected static Insets borderInsets = new Insets( 1, 0, 1, 0 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
@@ -569,8 +591,15 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JMenuItem}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class MenuItemBorder extends AbstractBorder implements UIResource {
+
+        /**
+         * The border insets.
+         */
         protected static Insets borderInsets = new Insets( 2, 2, 2, 2 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
@@ -617,8 +646,15 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JPopupMenu}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class PopupMenuBorder extends AbstractBorder implements UIResource {
+
+        /**
+         * The border insets.
+         */
         protected static Insets borderInsets = new Insets( 3, 1, 2, 1 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
@@ -642,6 +678,9 @@
         }
     }
 
+    /**
+     * The class represents the border of a rollover {@code Button}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class RolloverButtonBorder extends ButtonBorder {
 
@@ -693,9 +732,15 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JToolBar}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ToolBarBorder extends AbstractBorder implements UIResource, SwingConstants
     {
+        /**
+         * The instance of {@code MetalBumps}.
+         */
         protected MetalBumps bumps = new MetalBumps( 10, 10,
                                       MetalLookAndFeel.getControlHighlight(),
                                       MetalLookAndFeel.getControlDarkShadow(),
@@ -779,7 +824,9 @@
     private static Border buttonBorder;
 
     /**
-     * Returns a border instance for a JButton
+     * Returns a border instance for a {@code JButton}.
+     *
+     * @return a border instance for a {@code JButton}
      * @since 1.3
      */
     public static Border getButtonBorder() {
@@ -794,7 +841,9 @@
     private static Border textBorder;
 
     /**
-     * Returns a border instance for a text component
+     * Returns a border instance for a text component.
+     *
+     * @return a border instance for a text component
      * @since 1.3
      */
     public static Border getTextBorder() {
@@ -809,7 +858,9 @@
     private static Border textFieldBorder;
 
     /**
-     * Returns a border instance for a JTextField
+     * Returns a border instance for a {@code JTextField}.
+     *
+     * @return a border instance for a {@code JTextField}
      * @since 1.3
      */
     public static Border getTextFieldBorder() {
@@ -821,6 +872,9 @@
         return textFieldBorder;
     }
 
+    /**
+     * The class represents the border of a {@code JTestField}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class TextFieldBorder extends Flush3DBorder {
 
@@ -846,6 +900,9 @@
         }
     }
 
+    /**
+     * The class represents the border of a {@code JScrollPane}.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ScrollPaneBorder extends AbstractBorder implements UIResource {
         public void paintBorder(Component c, Graphics g, int x, int y,
@@ -892,7 +949,9 @@
     private static Border toggleButtonBorder;
 
     /**
-     * Returns a border instance for a JToggleButton
+     * Returns a border instance for a {@code JToggleButton}.
+     *
+     * @return a border instance for a {@code JToggleButton}
      * @since 1.3
      */
     public static Border getToggleButtonBorder() {
@@ -942,6 +1001,10 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class TableHeaderBorder extends javax.swing.border.AbstractBorder {
+
+        /**
+         * The border insets.
+         */
         protected Insets editorBorderInsets = new Insets( 2, 2, 2, 0 );
 
         public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
@@ -964,7 +1027,9 @@
     }
 
     /**
-     * Returns a border instance for a Desktop Icon
+     * Returns a border instance for a Desktop Icon.
+     *
+     * @return a border instance for a Desktop Icon
      * @since 1.3
      */
     public static Border getDesktopIconBorder() {
--- a/src/share/classes/javax/swing/plaf/metal/MetalButtonUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalButtonUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -52,10 +52,22 @@
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalButtonUI extends BasicButtonUI {
+
     // NOTE: These are not really needed, but at this point we can't pull
     // them. Their values are updated purely for historical reasons.
+    /**
+     * The color of the focused button.
+     */
     protected Color focusColor;
+
+    /**
+     * The color of the selected button.
+     */
     protected Color selectColor;
+
+    /**
+     * The color of the disabled color.
+     */
     protected Color disabledTextColor;
 
     private static final Object METAL_BUTTON_UI_KEY = new Object();
@@ -63,6 +75,13 @@
     // ********************************
     //          Create PLAF
     // ********************************
+
+    /**
+     * Returns an instance of {@code MetalButtonUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code MetalButtonUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         AppContext appContext = AppContext.getAppContext();
         MetalButtonUI metalButtonUI =
@@ -96,17 +115,33 @@
     // ********************************
     //         Default Accessors
     // ********************************
+
+    /**
+     * Returns the color of the selected button.
+     *
+     * @return the color of the selected button
+     */
     protected Color getSelectColor() {
         selectColor = UIManager.getColor(getPropertyPrefix() + "select");
         return selectColor;
     }
 
+    /**
+     * Returns the color of a disabled text.
+     *
+     * @return the color of a disabled text
+     */
     protected Color getDisabledTextColor() {
         disabledTextColor = UIManager.getColor(getPropertyPrefix() +
                                                "disabledText");
         return disabledTextColor;
     }
 
+    /**
+     * Returns the color of the focused button.
+     *
+     * @return the color of the focused button
+     */
     protected Color getFocusColor() {
         focusColor = UIManager.getColor(getPropertyPrefix() + "focus");
         return focusColor;
--- a/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java	Wed Jul 09 10:42:37 2014 -0700
@@ -49,6 +49,11 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalCheckBoxIcon implements Icon, UIResource, Serializable {
 
+    /**
+     * Returns the size of the control.
+     *
+     * @return the size of the control
+     */
     protected int getControlSize() { return 13; }
 
     public void paintIcon(Component c, Graphics g, int x, int y) {
@@ -91,6 +96,14 @@
         }
     }
 
+    /**
+     * Paints {@code MetalCheckBoxIcon}.
+     *
+     * @param c a component
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     */
     protected void drawCheck(Component c, Graphics g, int x, int y) {
         int controlSize = getControlSize();
         g.fillRect( x+3, y+5, 2, controlSize-8 );
--- a/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -67,6 +67,13 @@
     // ********************************
     //         Create PlAF
     // ********************************
+
+    /**
+     * Returns an instance of {@code MetalCheckBoxUI}.
+     *
+     * @param b a component
+     * @return a new instance of {@code MetalCheckBoxUI}
+     */
     public static ComponentUI createUI(JComponent b) {
         AppContext appContext = AppContext.getAppContext();
         MetalCheckBoxUI checkboxUI =
--- a/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,19 +50,72 @@
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalComboBoxButton extends JButton {
+
+    /**
+     * The instance of {@code JComboBox}.
+     */
     protected JComboBox comboBox;
+
+    /**
+     * The instance of {@code JList}.
+     */
     protected JList listBox;
+
+    /**
+     * The instance of {@code CellRendererPane}.
+     */
     protected CellRendererPane rendererPane;
+
+    /**
+     * The icon.
+     */
     protected Icon comboIcon;
+
+    /**
+     * The {@code iconOnly} value.
+     */
     protected boolean iconOnly = false;
 
+    /**
+     * Returns the {@code JComboBox}.
+     *
+     * @return the {@code JComboBox}
+     */
     public final JComboBox getComboBox() { return comboBox;}
+
+    /**
+     * Sets the {@code JComboBox}.
+     *
+     * @param cb the {@code JComboBox}
+     */
     public final void setComboBox( JComboBox cb ) { comboBox = cb;}
 
+    /**
+     * Returns the icon of the {@code JComboBox}.
+     *
+     * @return the icon of the {@code JComboBox}
+     */
     public final Icon getComboIcon() { return comboIcon;}
+
+    /**
+     * Sets the icon of the {@code JComboBox}.
+     *
+     * @param i the icon of the {@code JComboBox}
+     */
     public final void setComboIcon( Icon i ) { comboIcon = i;}
 
+    /**
+     * Returns the {@code isIconOnly} value.
+     *
+     * @return the {@code isIconOnly} value
+     */
     public final boolean isIconOnly() { return iconOnly;}
+
+    /**
+     * If {@code isIconOnly} is {@code true} then only icon is painted.
+     *
+     * @param isIconOnly if {@code true} then only icon is painted
+     */
     public final void setIconOnly( boolean isIconOnly ) { iconOnly = isIconOnly;}
 
     MetalComboBoxButton() {
@@ -75,6 +128,14 @@
         setModel( model );
     }
 
+    /**
+     * Constructs a new instance of {@code MetalComboBoxButton}.
+     *
+     * @param cb an instance of {@code JComboBox}
+     * @param i an icon
+     * @param pane an instance of {@code CellRendererPane}
+     * @param list an instance of {@code JList}
+     */
     public MetalComboBoxButton( JComboBox cb, Icon i,
                                 CellRendererPane pane, JList list ) {
         this();
@@ -85,6 +146,15 @@
         setEnabled( comboBox.isEnabled() );
     }
 
+    /**
+     * Constructs a new instance of {@code MetalComboBoxButton}.
+     *
+     * @param cb an instance of {@code JComboBox}
+     * @param i an icon
+     * @param onlyIcon if {@code true} only icon is painted
+     * @param pane an instance of {@code CellRendererPane}
+     * @param list an instance of {@code JList}
+     */
     public MetalComboBoxButton( JComboBox cb, Icon i, boolean onlyIcon,
                                 CellRendererPane pane, JList list ) {
         this( cb, i, pane, list );
--- a/src/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,6 +50,9 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalComboBoxEditor extends BasicComboBoxEditor {
 
+    /**
+     * Constructs a new instance of {@code MetalComboBoxEditor}.
+     */
     public MetalComboBoxEditor() {
         super();
         //editor.removeFocusListener(this);
--- a/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -54,6 +54,12 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalComboBoxUI extends BasicComboBoxUI {
 
+    /**
+     * Constructs an instance of {@code MetalComboBoxUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code MetalComboBoxUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new MetalComboBoxUI();
     }
@@ -234,6 +240,7 @@
      * override. All the functionality of this method is in the
      * MetalPropertyChangeListener.
      *
+     * @param e an instance of {@code PropertyChangeEvent}
      * @deprecated As of Java 2 platform v1.4.
      */
     @Deprecated
@@ -251,11 +258,23 @@
         public void layoutContainer( Container parent ) {
             layoutComboBox( parent, this );
         }
+
+        /**
+         * Lays out the parent container.
+         *
+         * @param parent a container
+         */
         public void superLayout( Container parent ) {
             super.layoutContainer( parent );
         }
     }
 
+    /**
+     * Lays out the {@code JComboBox} in the {@code parent} container.
+     *
+     * @param parent a container
+     * @param manager an instance of {@code MetalComboBoxLayoutManager}
+     */
     // This is here because of a bug in the compiler.
     // When a protected-inner-class-savvy compiler comes out we
     // should move this into MetalComboBoxLayoutManager.
@@ -367,6 +386,11 @@
     @Deprecated
     public class MetalComboPopup extends BasicComboPopup {
 
+        /**
+         * Constructs a new instance of {@code MetalComboPopup}.
+         *
+         * @param cBox an instance of {@code JComboBox}
+         */
         public MetalComboPopup( JComboBox cBox) {
             super( cBox );
         }
--- a/src/share/classes/javax/swing/plaf/metal/MetalDesktopIconUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalDesktopIconUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,10 +48,19 @@
     TitleListener titleListener;
     private int width;
 
+    /**
+     * Constructs a new instance of {@code MetalDesktopIconUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code MetalDesktopIconUI}
+     */
     public static ComponentUI createUI(JComponent c)    {
         return new MetalDesktopIconUI();
     }
 
+    /**
+     * Constructs a new instance of {@code MetalDesktopIconUI}.
+     */
     public MetalDesktopIconUI() {
     }
 
--- a/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -138,13 +138,21 @@
         }
     }
 
-    //
-    // ComponentUI Interface Implementation methods
-    //
+    /**
+     * Constructs a new instance of {@code MetalFileChooserUI}.
+     *
+     * @param c a component
+     * @return a new instance of {@code MetalFileChooserUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new MetalFileChooserUI((JFileChooser) c);
     }
 
+    /**
+     * Constructs a new instance of {@code MetalFileChooserUI}.
+     *
+     * @param filechooser a {@code JFileChooser}
+     */
     public MetalFileChooserUI(JFileChooser filechooser) {
         super(filechooser);
     }
@@ -446,6 +454,11 @@
         groupLabels(new AlignedLabel[] { fileNameLabel, filesOfTypeLabel });
     }
 
+    /**
+     * Returns the button panel.
+     *
+     * @return the button panel
+     */
     protected JPanel getButtonPanel() {
         if (buttonPanel == null) {
             buttonPanel = new JPanel();
@@ -453,6 +466,11 @@
         return buttonPanel;
     }
 
+    /**
+     * Returns the bottom panel.
+     *
+     * @return the bottom panel
+     */
     protected JPanel getBottomPanel() {
         if(bottomPanel == null) {
             bottomPanel = new JPanel();
@@ -503,20 +521,42 @@
         SwingUtilities.replaceUIActionMap(fc, actionMap);
     }
 
+    /**
+     * Returns an instance of {@code ActionMap}.
+     *
+     * @return an instance of {@code ActionMap}
+     */
     protected ActionMap getActionMap() {
         return createActionMap();
     }
 
+    /**
+     * Constructs an instance of {@code ActionMap}.
+     *
+     * @return an instance of {@code ActionMap}
+     */
     protected ActionMap createActionMap() {
         ActionMap map = new ActionMapUIResource();
         FilePane.addActionsToMap(map, filePane.getActions());
         return map;
     }
 
+    /**
+     * Constructs a details view.
+     *
+     * @param fc a {@code JFileChooser}
+     * @return the list
+     */
     protected JPanel createList(JFileChooser fc) {
         return filePane.createList();
     }
 
+    /**
+     * Constructs a details view.
+     *
+     * @param fc a {@code JFileChooser}
+     * @return the details view
+     */
     protected JPanel createDetailsView(JFileChooser fc) {
         return filePane.createDetailsView();
     }
@@ -533,7 +573,12 @@
 
     // Obsolete class, not used in this version.
     protected class SingleClickListener extends MouseAdapter {
-        public  SingleClickListener(JList list) {
+        /**
+         * Constructs an instance of {@code SingleClickListener}.
+         *
+         * @param list an instance of {@code JList}
+         */
+        public SingleClickListener(JList list) {
         }
     }
 
@@ -788,11 +833,16 @@
         };
     }
 
-
+    /**
+     * Removes control buttons from bottom panel.
+     */
     protected void removeControlButtons() {
         getBottomPanel().remove(getButtonPanel());
     }
 
+    /**
+     * Adds control buttons to bottom panel.
+     */
     protected void addControlButtons() {
         getBottomPanel().add(getButtonPanel());
     }
@@ -842,15 +892,31 @@
         }
     }
 
+    /**
+     * Returns the directory name.
+     *
+     * @return the directory name
+     */
     public String getDirectoryName() {
         // PENDING(jeff) - get the name from the directory combobox
         return null;
     }
 
+    /**
+     * Sets the directory name.
+     *
+     * @param dirname the directory name
+     */
     public void setDirectoryName(String dirname) {
         // PENDING(jeff) - set the name in the directory combobox
     }
 
+    /**
+     * Constructs a new instance of {@code DirectoryComboBoxRenderer}.
+     *
+     * @param fc a {@code JFileChooser}
+     * @return a new instance of {@code DirectoryComboBoxRenderer}
+     */
     protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc) {
         return new DirectoryComboBoxRenderer();
     }
@@ -906,9 +972,12 @@
 
     }
 
-    //
-    // DataModel for DirectoryComboxbox
-    //
+    /**
+     * Constructs a new instance of {@code DataModel} for {@code DirectoryComboBox}.
+     *
+     * @param fc a {@code JFileChooser}
+     * @return a new instance of {@code DataModel} for {@code DirectoryComboBox}
+     */
     protected DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc) {
         return new DirectoryComboBoxModel();
     }
@@ -924,6 +993,9 @@
         JFileChooser chooser = getFileChooser();
         FileSystemView fsv = chooser.getFileSystemView();
 
+        /**
+         * Constructs an instance of {@code DirectoryComboBoxModel}.
+         */
         public DirectoryComboBoxModel() {
             // Add the current directory to the model, and make it the
             // selectedDirectory
@@ -1017,6 +1089,12 @@
             }
         }
 
+        /**
+         * Returns the depth of {@code i}-th file.
+         *
+         * @param i an index
+         * @return the depth of {@code i}-th file
+         */
         public int getDepth(int i) {
             return (depths != null && i >= 0 && i < depths.length) ? depths[i] : 0;
         }
@@ -1039,9 +1117,11 @@
         }
     }
 
-    //
-    // Renderer for Types ComboBox
-    //
+    /**
+     * Constructs a {@code Renderer} for types {@code ComboBox}.
+     *
+     * @return a {@code Renderer} for types {@code ComboBox}
+     */
     protected FilterComboBoxRenderer createFilterComboBoxRenderer() {
         return new FilterComboBoxRenderer();
     }
@@ -1065,9 +1145,11 @@
         }
     }
 
-    //
-    // DataModel for Types Comboxbox
-    //
+    /**
+     * Constructs a {@code DataModel} for types {@code ComboBox}.
+     *
+     * @return a {@code DataModel} for types {@code ComboBox}
+     */
     protected FilterComboBoxModel createFilterComboBoxModel() {
         return new FilterComboBoxModel();
     }
@@ -1077,7 +1159,15 @@
      */
     @SuppressWarnings("serial") // Same-version serialization only
     protected class FilterComboBoxModel extends AbstractListModel<Object> implements ComboBoxModel<Object>, PropertyChangeListener {
+
+        /**
+         * An array of file filters.
+         */
         protected FileFilter[] filters;
+
+        /**
+         * Constructs an instance of {@code FilterComboBoxModel}.
+         */
         protected FilterComboBoxModel() {
             super();
             filters = getFileChooser().getChoosableFileFilters();
@@ -1142,6 +1232,11 @@
         }
     }
 
+    /**
+     * Invokes when {@code ListSelectionEvent} occurs.
+     *
+     * @param e an instance of {@code ListSelectionEvent}
+     */
     public void valueChanged(ListSelectionEvent e) {
         JFileChooser fc = getFileChooser();
         File f = fc.getSelectedFile();
@@ -1155,6 +1250,10 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class DirectoryComboBoxAction extends AbstractAction {
+
+        /**
+         * Constructs a new instance of {@code DirectoryComboBoxAction}.
+         */
         protected DirectoryComboBoxAction() {
             super("DirectoryComboBoxAction");
         }
--- a/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java	Wed Jul 09 10:42:37 2014 -0700
@@ -90,10 +90,22 @@
     private static Icon oceanVerticalSliderThumb;
 
     // Constants
+    /**
+     * {@code DARK} is used for the property {@code Tree.expandedIcon}.
+     */
     public static final boolean DARK = false;
+
+    /**
+     * {@code LIGHT} is used for the property {@code Tree.collapsedIcon}.
+     */
     public static final boolean LIGHT = true;
 
     // Accessor functions for Icons. Does the caching work.
+    /**
+     * Returns the instance of {@code FileChooserDetailViewIcon}.
+     *
+     * @return the instance of {@code FileChooserDetailViewIcon}
+     */
     public static Icon getFileChooserDetailViewIcon() {
         if (fileChooserDetailViewIcon == null) {
             fileChooserDetailViewIcon = new FileChooserDetailViewIcon();
@@ -101,6 +113,11 @@
         return fileChooserDetailViewIcon;
     }
 
+    /**
+     * Returns the instance of {@code FileChooserHomeFolderIcon}.
+     *
+     * @return the instance of {@code FileChooserHomeFolderIcon}
+     */
     public static Icon getFileChooserHomeFolderIcon() {
         if (fileChooserHomeFolderIcon == null) {
             fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon();
@@ -108,6 +125,11 @@
         return fileChooserHomeFolderIcon;
     }
 
+    /**
+     * Returns the instance of {@code FileChooserListViewIcon}.
+     *
+     * @return the instance of {@code FileChooserListViewIcon}
+     */
     public static Icon getFileChooserListViewIcon() {
         if (fileChooserListViewIcon == null) {
             fileChooserListViewIcon = new FileChooserListViewIcon();
@@ -115,6 +137,11 @@
         return fileChooserListViewIcon;
     }
 
+    /**
+     * Returns the instance of {@code FileChooserNewFolderIcon}.
+     *
+     * @return the instance of {@code FileChooserNewFolderIcon}
+     */
     public static Icon getFileChooserNewFolderIcon() {
         if (fileChooserNewFolderIcon == null) {
             fileChooserNewFolderIcon = new FileChooserNewFolderIcon();
@@ -122,6 +149,11 @@
         return fileChooserNewFolderIcon;
     }
 
+    /**
+     * Returns the instance of {@code FileChooserUpFolderIcon}.
+     *
+     * @return the instance of {@code FileChooserUpFolderIcon}
+     */
     public static Icon getFileChooserUpFolderIcon() {
         if (fileChooserUpFolderIcon == null) {
             fileChooserUpFolderIcon = new FileChooserUpFolderIcon();
@@ -129,14 +161,31 @@
         return fileChooserUpFolderIcon;
     }
 
+    /**
+     * Constructs a new instance of {@code InternalFrameAltMaximizeIcon}.
+     *
+     * @param size the size of the icon
+     * @return a new instance of {@code InternalFrameAltMaximizeIcon}
+     */
     public static Icon getInternalFrameAltMaximizeIcon(int size) {
         return new InternalFrameAltMaximizeIcon(size);
     }
 
+    /**
+     * Constructs a new instance of {@code InternalFrameCloseIcon}.
+     *
+     * @param size the size of the icon
+     * @return a new instance of {@code InternalFrameCloseIcon}
+     */
     public static Icon getInternalFrameCloseIcon(int size) {
         return new InternalFrameCloseIcon(size);
     }
 
+    /**
+     * Returns the instance of {@code InternalFrameDefaultMenuIcon}.
+     *
+     * @return the instance of {@code InternalFrameDefaultMenuIcon}
+     */
     public static Icon getInternalFrameDefaultMenuIcon() {
         if (internalFrameDefaultMenuIcon == null) {
             internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon();
@@ -144,14 +193,31 @@
         return internalFrameDefaultMenuIcon;
     }
 
+    /**
+     * Constructs a new instance of {@code InternalFrameMaximizeIcon}.
+     *
+     * @param size the size of the icon
+     * @return a new instance of {@code InternalFrameMaximizeIcon}
+     */
     public static Icon getInternalFrameMaximizeIcon(int size) {
         return new InternalFrameMaximizeIcon(size);
     }
 
+    /**
+     * Constructs a new instance of {@code InternalFrameMinimizeIcon}.
+     *
+     * @param size the size of the icon
+     * @return a new instance of {@code InternalFrameMinimizeIcon}
+     */
     public static Icon getInternalFrameMinimizeIcon(int size) {
         return new InternalFrameMinimizeIcon(size);
     }
 
+    /**
+     * Returns the instance of {@code RadioButtonIcon}.
+     *
+     * @return the instance of {@code RadioButtonIcon}
+     */
     public static Icon getRadioButtonIcon() {
         if (radioButtonIcon == null) {
             radioButtonIcon = new RadioButtonIcon();
@@ -161,6 +227,8 @@
 
     /**
      * Returns a checkbox icon.
+     *
+     * @return a checkbox icon
      * @since 1.3
      */
     public static Icon getCheckBoxIcon() {
@@ -170,6 +238,11 @@
         return checkBoxIcon;
     }
 
+    /**
+     * Returns the instance of {@code TreeComputerIcon}.
+     *
+     * @return the instance of {@code TreeComputerIcon}
+     */
     public static Icon getTreeComputerIcon() {
         if ( treeComputerIcon == null ) {
             treeComputerIcon = new TreeComputerIcon();
@@ -177,6 +250,11 @@
         return treeComputerIcon;
     }
 
+    /**
+     * Returns the instance of {@code TreeFloppyDriveIcon}.
+     *
+     * @return the instance of {@code TreeFloppyDriveIcon}
+     */
     public static Icon getTreeFloppyDriveIcon() {
         if ( treeFloppyDriveIcon == null ) {
             treeFloppyDriveIcon = new TreeFloppyDriveIcon();
@@ -184,10 +262,20 @@
         return treeFloppyDriveIcon;
     }
 
+    /**
+     * Constructs a new instance of {@code TreeFolderIcon}.
+     *
+     * @return a new instance of {@code TreeFolderIcon}
+     */
     public static Icon getTreeFolderIcon() {
         return new TreeFolderIcon();
     }
 
+    /**
+     * Returns the instance of {@code TreeHardDriveIcon}.
+     *
+     * @return the instance of {@code TreeHardDriveIcon}
+     */
     public static Icon getTreeHardDriveIcon() {
         if ( treeHardDriveIcon == null ) {
             treeHardDriveIcon = new TreeHardDriveIcon();
@@ -195,14 +283,30 @@
         return treeHardDriveIcon;
     }
 
+    /**
+     * Constructs a new instance of {@code TreeLeafIcon}.
+     *
+     * @return a new instance of {@code TreeLeafIcon}
+     */
     public static Icon getTreeLeafIcon() {
         return new TreeLeafIcon();
     }
 
+    /**
+     * Constructs a new instance of {@code TreeControlIcon}.
+     *
+     * @param isCollapsed if {@code true} the icon is collapsed
+     * @return a new instance of {@code TreeControlIcon}
+     */
     public static Icon getTreeControlIcon( boolean isCollapsed ) {
             return new TreeControlIcon( isCollapsed );
     }
 
+    /**
+     * Returns an icon to be used by {@code JMenu}.
+     *
+     * @return an icon to be used by {@code JMenu}
+     */
     public static Icon getMenuArrowIcon() {
         if (menuArrowIcon == null) {
             menuArrowIcon = new MenuArrowIcon();
@@ -220,6 +324,11 @@
         return null;
     }
 
+    /**
+     * Returns an icon to be used by {@code JMenuItem}.
+     *
+     * @return an icon to be used by {@code JMenuItem}
+     */
     public static Icon getMenuItemArrowIcon() {
         if (menuItemArrowIcon == null) {
             menuItemArrowIcon = new MenuItemArrowIcon();
@@ -227,6 +336,11 @@
         return menuItemArrowIcon;
     }
 
+    /**
+     * Returns an icon to be used by {@code JCheckBoxMenuItem}.
+     *
+     * @return an icon to be used by {@code JCheckBoxMenuItem}
+     */
     public static Icon getCheckBoxMenuItemIcon() {
         if (checkBoxMenuItemIcon == null) {
             checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
@@ -234,6 +348,11 @@
         return checkBoxMenuItemIcon;
     }
 
+    /**
+     * Returns an icon to be used by {@code JRadioButtonMenuItem}.
+     *
+     * @return an icon to be used by {@code JRadioButtonMenuItem}
+     */
     public static Icon getRadioButtonMenuItemIcon() {
         if (radioButtonMenuItemIcon == null) {
             radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
@@ -241,6 +360,11 @@
         return radioButtonMenuItemIcon;
     }
 
+    /**
+     * Returns a thumb icon to be used by horizontal slider.
+     *
+     * @return a thumb icon to be used by horizontal slider
+     */
     public static Icon getHorizontalSliderThumbIcon() {
         if (MetalLookAndFeel.usingOcean()) {
             if (oceanHorizontalSliderThumb == null) {
@@ -253,6 +377,11 @@
         return new HorizontalSliderThumbIcon();
     }
 
+    /**
+     * Returns a thumb icon to be used by vertical slider.
+     *
+     * @return a thumb icon to be used by vertical slider
+     */
     public static Icon getVerticalSliderThumbIcon() {
         if (MetalLookAndFeel.usingOcean()) {
             if (oceanVerticalSliderThumb == null) {
@@ -1251,8 +1380,10 @@
             g.translate(x, y);
 
             // fill interior
-            g.setColor(interiorColor);
-            g.fillRect(2,2, 9,9);
+            if (c.isOpaque()) {
+                g.setColor(interiorColor);
+                g.fillRect(2, 2, 9, 9);
+            }
 
             // draw Dark Circle (start at top, go clockwise)
             g.setColor(darkCircle);
@@ -1619,7 +1750,18 @@
 
         }
 
+        /**
+         * Returns a shift of the icon.
+         *
+         * @return a shift of the icon
+         */
         public int getShift() { return 0; }
+
+        /**
+         * Returns an additional height of the icon.
+         *
+         * @return an additional height of the icon
+         */
         public int getAdditionalHeight() { return 0; }
 
         public int getIconWidth() { return folderIcon16Size.width; }
@@ -1717,7 +1859,18 @@
 
         }
 
+        /**
+         * Returns a shift of the icon.
+         *
+         * @return a shift of the icon
+         */
         public int getShift() { return 0; }
+
+        /**
+         * Returns an additional height of the icon.
+         *
+         * @return an additional height of the icon
+         */
         public int getAdditionalHeight() { return 0; }
 
         public int getIconWidth() { return fileIcon16Size.width; }
@@ -1725,6 +1878,9 @@
     }
 
 
+    /**
+     * The class represents a tree leaf icon.
+     */
     public static class TreeLeafIcon extends FileIcon16 {
         public int getShift() { return 2; }
         public int getAdditionalHeight() { return 4; }
@@ -1746,12 +1902,20 @@
      */
     @SuppressWarnings("serial") // Same-version serialization only
     public static class TreeControlIcon implements Icon, Serializable {
-        // This data member should not have been exposed.  It's called
-        // isLight, but now it really means isCollapsed.  Since we can't change
-        // any APIs... that's life.
+
+        /**
+         * if {@code true} the icon is collapsed.
+         * NOTE: This data member should not have been exposed. It's called
+         * {@code isLight}, but now it really means {@code isCollapsed}.
+         * Since we can't change any APIs... that's life.
+         */
         protected boolean isLight;
 
-
+        /**
+         * Constructs an instance of {@code TreeControlIcon}.
+         *
+         * @param isCollapsed if {@code true} the icon is collapsed
+         */
         public TreeControlIcon( boolean isCollapsed ) {
             isLight = isCollapsed;
         }
@@ -1809,6 +1973,14 @@
             }
         }
 
+        /**
+         * Paints the {@code TreeControlIcon}.
+         *
+         * @param c a component
+         * @param g an instance of {@code Graphics}
+         * @param x an X coordinate
+         * @param y an Y coordinate
+         */
         public void paintMe(Component c, Graphics g, int x, int y) {
 
             g.setColor( MetalLookAndFeel.getPrimaryControlInfo() );
@@ -1821,7 +1993,7 @@
             g.drawLine( xoff + 6, 4, xoff + 9, 4 );     // top
             g.drawLine( xoff + 10, 5, xoff + 10, 5 );   // top right dot
             g.drawLine( xoff + 11, 6, xoff + 11, 9 );   // right
-            g.drawLine( xoff + 10, 10, xoff + 10, 10 ); // botom right dot
+            g.drawLine( xoff + 10, 10, xoff + 10, 10 ); // bottom right dot
             g.drawLine( xoff + 6, 11, xoff + 9, 11 );   // bottom
             g.drawLine( xoff + 5, 10, xoff + 5, 10 );   // bottom left dot
 
--- a/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -46,8 +46,19 @@
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class MetalInternalFrameTitlePane  extends BasicInternalFrameTitlePane {
 
+    /**
+     * The value {@code isPalette}
+     */
     protected boolean isPalette = false;
+
+    /**
+     * The palette close icon.
+     */
     protected Icon paletteCloseIcon;
+
+    /**
+     * The height of the palette title.
+     */
     protected int paletteTitleHeight;
 
     private static final Border handyEmptyBorder = new EmptyBorder(0,0,0,0);
@@ -94,6 +105,11 @@
     private Color activeBumpsShadow = MetalLookAndFeel.
                              getPrimaryControlDarkShadow();
 
+    /**
+     * Constructs a new instance of {@code MetalInternalFrameTitlePane}
+     *
+     * @param f an instance of {@code JInternalFrame}
+     */
     public MetalInternalFrameTitlePane(JInternalFrame f) {
         super( f );
     }
@@ -307,6 +323,11 @@
         }
     }
 
+    /**
+     * Paints palette.
+     *
+     * @param g a instance of {@code Graphics}
+     */
     public void paintPalette(Graphics g)  {
         boolean leftToRight = MetalUtils.isLeftToRight(frame);
 
@@ -471,6 +492,11 @@
         bumps.paintIcon(this, g, bumpXOffset, bumpYOffset);
     }
 
+    /**
+     * If {@code b} is {@code true}, sets palette icons.
+     *
+     * @param b if {@code true}, sets palette icons
+     */
     public void setPalette(boolean b) {
         isPalette = b;
 
--- a/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalInternalFrameUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -47,6 +47,9 @@
 
   private static final Border handyEmptyBorder = new EmptyBorder(0,0,0,0);
 
+  /**
+   * The property {@code JInternalFrame.isPalette}.
+   */
   protected static String IS_PALETTE   = "JInternalFrame.isPalette";
   private static String IS_PALETTE_KEY = "JInternalFrame.isPalette";
   private static String FRAME_TYPE     = "JInternalFrame.frameType";
@@ -54,10 +57,22 @@
   private static String PALETTE_FRAME  = "palette";
   private static String OPTION_DIALOG  = "optionDialog";
 
+
+  /**
+   * Constructs a new {@code MetalInternalFrameUI} instance.
+   *
+   * @param b an internal frame
+   */
   public MetalInternalFrameUI(JInternalFrame b)   {
     super(b);
   }
 
+  /**
+   * Constructs a new {@code MetalInternalFrameUI} instance.
+   *
+   * @param c a component
+   * @return a new {@code MetalInternalFrameUI} instance
+   */
   public static ComponentUI createUI(JComponent c)    {
       return new MetalInternalFrameUI( (JInternalFrame) c);
   }
@@ -152,6 +167,11 @@
       }
   }
 
+  /**
+   * If {@code isPalette} is {@code true}, sets palette border and title
+   *
+   * @param isPalette if {@code true}, sets palette border and title
+   */
   // this should be deprecated - jcs
   public void setPalette(boolean isPalette) {
     if (isPalette) {
--- a/src/share/classes/javax/swing/plaf/metal/MetalLabelUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalLabelUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,6 +56,12 @@
 
     private static final Object METAL_LABEL_UI_KEY = new Object();
 
+    /**
+     * Returns an instance of {@code MetalLabelUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code MetalLabelUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         if (System.getSecurityManager() != null) {
             AppContext appContext = AppContext.getAppContext();
--- a/src/share/classes/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -43,6 +43,12 @@
 
 public class MetalPopupMenuSeparatorUI extends MetalSeparatorUI
 {
+    /**
+     * Constructs a new {@code MetalPopupMenuSeparatorUI} instance.
+     *
+     * @param c a component
+     * @return a new {@code MetalPopupMenuSeparatorUI} instance
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new MetalPopupMenuSeparatorUI();
--- a/src/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,6 +50,12 @@
     private Rectangle innards;
     private Rectangle box;
 
+    /**
+     * Constructs an instance of {@code MetalProgressBarUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code MetalProgressBarUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new MetalProgressBarUI();
     }
--- a/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -58,8 +58,19 @@
 
     private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object();
 
+    /**
+     * The color of the focused radio button.
+     */
     protected Color focusColor;
+
+    /**
+     * The color of the selected radio button.
+     */
     protected Color selectColor;
+
+    /**
+     * The color of a disabled text.
+     */
     protected Color disabledTextColor;
 
     private boolean defaults_initialized = false;
@@ -67,6 +78,13 @@
     // ********************************
     //        Create PlAF
     // ********************************
+
+    /**
+     * Returns an instance of {@code MetalRadioButtonUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code MetalRadioButtonUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         AppContext appContext = AppContext.getAppContext();
         MetalRadioButtonUI metalRadioButtonUI =
@@ -100,14 +118,30 @@
     // ********************************
     //         Default Accessors
     // ********************************
+
+    /**
+     * Returns the color of the selected {@code JRadioButton}.
+     *
+     * @return the color of the selected {@code JRadioButton}
+     */
     protected Color getSelectColor() {
         return selectColor;
     }
 
+    /**
+     * Returns the color of the disabled text.
+     *
+     * @return the color of the disabled text
+     */
     protected Color getDisabledTextColor() {
         return disabledTextColor;
     }
 
+    /**
+     * Returns the color of the focused {@code JRadioButton}.
+     *
+     * @return the color of the focused {@code JRadioButton}
+     */
     protected Color getFocusColor() {
         return focusColor;
     }
--- a/src/share/classes/javax/swing/plaf/metal/MetalScrollBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalScrollBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -59,17 +59,42 @@
     private static Color thumbShadow;
     private static Color thumbHighlightColor;
 
-
+    /**
+     * The metal bumps.
+     */
     protected MetalBumps bumps;
 
+    /**
+     * The increase button.
+     */
     protected MetalScrollButton increaseButton;
+
+    /**
+     * The decrease button.
+     */
     protected MetalScrollButton decreaseButton;
 
+    /**
+     * The width of the scroll bar.
+     */
     protected  int scrollBarWidth;
 
+    /**
+     * The property {@code JScrollBar.isFreeStanding}.
+     */
     public static final String FREE_STANDING_PROP = "JScrollBar.isFreeStanding";
+
+    /**
+     * The value of the property {@code JScrollBar.isFreeStanding}.
+     */
     protected boolean isFreeStanding = true;
 
+    /**
+     * Constructs a new {@code MetalScrollBarUI} instance.
+     *
+     * @param c a component
+     * @return a new {@code MetalScrollBarUI} instance
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new MetalScrollBarUI();
--- a/src/share/classes/javax/swing/plaf/metal/MetalScrollButton.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalScrollButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -59,6 +59,13 @@
 
   private int buttonWidth;
 
+        /**
+         * Constructs an instance of {@code MetalScrollButton}.
+         *
+         * @param direction the direction
+         * @param width the width
+         * @param freeStanding the free standing value
+         */
         public MetalScrollButton( int direction, int width, boolean freeStanding )
         {
             super( direction );
@@ -70,6 +77,11 @@
             isFreeStanding = freeStanding;
         }
 
+        /**
+         * Sets the free standing value.
+         *
+         * @param freeStanding the free standing value
+         */
         public void setFreeStanding( boolean freeStanding )
         {
             isFreeStanding = freeStanding;
@@ -115,14 +127,10 @@
                 g.setColor( arrowColor );
                 int startY = ((h+1) - arrowHeight) / 2;
                 int startX = (w / 2);
-                //                  System.out.println( "startX :" + startX + " startY :"+startY);
+
                 for (int line = 0; line < arrowHeight; line++) {
                     g.drawLine( startX-line, startY+line, startX +line+1, startY+line);
                 }
-        /*      g.drawLine( 7, 6, 8, 6 );
-                g.drawLine( 6, 7, 9, 7 );
-                g.drawLine( 5, 8, 10, 8 );
-                g.drawLine( 4, 9, 11, 9 );*/
 
                 if (isEnabled) {
                     g.setColor( highlightColor );
@@ -167,17 +175,10 @@
                 int startY = (((h+1) - arrowHeight) / 2)+ arrowHeight-1;
                 int startX = (w / 2);
 
-                //          System.out.println( "startX2 :" + startX + " startY2 :"+startY);
-
                 for (int line = 0; line < arrowHeight; line++) {
                     g.drawLine( startX-line, startY-line, startX +line+1, startY-line);
                 }
 
-        /*      g.drawLine( 4, 5, 11, 5 );
-                g.drawLine( 5, 6, 10, 6 );
-                g.drawLine( 6, 7, 9, 7 );
-                g.drawLine( 7, 8, 8, 8 ); */
-
                 if (isEnabled) {
                     g.setColor( highlightColor );
 
@@ -219,18 +220,10 @@
                 int startX = (((w+1) - arrowHeight) / 2) + arrowHeight-1;
                 int startY = (h / 2);
 
-                //System.out.println( "startX2 :" + startX + " startY2 :"+startY);
-
                 for (int line = 0; line < arrowHeight; line++) {
                     g.drawLine( startX-line, startY-line, startX -line, startY+line+1);
                 }
 
-
-/*              g.drawLine( 5, 4, 5, 11 );
-                g.drawLine( 6, 5, 6, 10 );
-                g.drawLine( 7, 6, 7, 9 );
-                g.drawLine( 8, 7, 8, 8 );*/
-
                 if (isEnabled) {
                     g.setColor( highlightColor );
 
@@ -274,11 +267,6 @@
                     g.drawLine( startX+line, startY-line, startX +line, startY+line+1);
                 }
 
-        /*      g.drawLine( 6, 7, 6, 8 );
-                g.drawLine( 7, 6, 7, 9 );
-                g.drawLine( 8, 5, 8, 10 );
-                g.drawLine( 9, 4, 9, 11 );*/
-
                 if (isEnabled) {
                     g.setColor( highlightColor );
 
@@ -341,6 +329,11 @@
             return new Dimension( Integer.MAX_VALUE, Integer.MAX_VALUE );
         }
 
+        /**
+         * Returns the width of the button.
+         *
+         * @return the width of the button
+         */
         public int getButtonWidth() {
             return buttonWidth;
         }
--- a/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,6 +56,12 @@
 
     private PropertyChangeListener scrollBarSwapListener;
 
+    /**
+     * Constructs a new {@code MetalScrollPaneUI}.
+     *
+     * @param x a component
+     * @return a new {@code MetalScrollPaneUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new MetalScrollPaneUI();
     }
@@ -97,6 +103,7 @@
     }
 
     /**
+     * @param scrollPane an instance of the {@code JScrollPane}
      * @deprecated - Replaced by {@link #uninstallListeners(JComponent)}
      */
     @Deprecated
@@ -136,6 +143,11 @@
         }
     }
 
+    /**
+     * Returns a new {@code PropertyChangeListener} for scroll bar swap events.
+     *
+     * @return a new {@code PropertyChangeListener} for scroll bar swap events.
+     */
     protected PropertyChangeListener createScrollBarSwapListener() {
         return new PropertyChangeListener() {
             public void propertyChange(PropertyChangeEvent e) {
--- a/src/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -53,6 +53,12 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalSeparatorUI extends BasicSeparatorUI
 {
+    /**
+     * Constructs a new {@code MetalSeparatorUI} instance.
+     *
+     * @param c a component
+     * @return a new {@code MetalSeparatorUI} instance.
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new MetalSeparatorUI();
--- a/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -53,13 +53,42 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalSliderUI extends BasicSliderUI {
 
+    /**
+     * The buffer of a tick.
+     */
     protected final int TICK_BUFFER = 4;
+
+    /**
+     * The value of the property {@code JSlider.isFilled}.
+     * By default, {@code false} if the property is not set,
+     * {@code true} for Ocean theme.
+     */
     protected boolean filledSlider = false;
+
     // NOTE: these next five variables are currently unused.
+    /**
+     * The color of a thumb
+     */
     protected static Color thumbColor;
+
+    /**
+     * The color of highlighting.
+     */
     protected static Color highlightColor;
+
+    /**
+     * The color of dark shadow.
+     */
     protected static Color darkShadowColor;
+
+    /**
+     * The width of a track.
+     */
     protected static int trackWidth;
+
+    /**
+     * The length of a tick.
+     */
     protected static int tickLength;
     private int safeLength;
 
@@ -80,13 +109,24 @@
     private static Icon SAFE_HORIZ_THUMB_ICON;
     private static Icon SAFE_VERT_THUMB_ICON;
 
-
+    /**
+     * Property for {@code JSlider.isFilled}.
+     */
     protected final String SLIDER_FILL = "JSlider.isFilled";
 
+    /**
+     * Constructs a {@code MetalSliderUI} instance.
+     *
+     * @param c a component
+     * @return a {@code MetalSliderUI} instance
+     */
     public static ComponentUI createUI(JComponent c)    {
         return new MetalSliderUI();
     }
 
+    /**
+     * Constructs a {@code MetalSliderUI} instance.
+     */
     public MetalSliderUI() {
         super( null );
     }
@@ -126,10 +166,19 @@
         prepareFilledSliderField();
     }
 
+    /**
+     * Constructs {@code MetalPropertyListener}.
+     *
+     * @param slider a {@code JSlider}
+     * @return the {@code MetalPropertyListener}
+     */
     protected PropertyChangeListener createPropertyChangeListener( JSlider slider ) {
         return new MetalPropertyListener();
     }
 
+    /**
+     * {@code PropertyListener} for {@code JSlider.isFilled}.
+     */
     protected class MetalPropertyListener extends BasicSliderUI.PropertyChangeHandler {
         public void propertyChange( PropertyChangeEvent e ) {  // listen for slider fill
             super.propertyChange( e );
@@ -485,6 +534,8 @@
 
     /**
      * Returns the shorter dimension of the track.
+     *
+     * @return the shorter dimension of the track
      */
     protected int getTrackWidth() {
         // This strange calculation is here to keep the
@@ -504,6 +555,8 @@
     /**
      * Returns the longer dimension of the slide bar.  (The slide bar is only the
      * part that runs directly under the thumb)
+     *
+     * @return the longer dimension of the slide bar
      */
     protected int getTrackLength() {
         if ( slider.getOrientation() == JSlider.HORIZONTAL ) {
@@ -514,6 +567,8 @@
 
     /**
      * Returns the amount that the thumb goes past the slide bar.
+     *
+     * @return the amount that the thumb goes past the slide bar
      */
     protected int getThumbOverhang() {
         return (int)(getThumbSize().getHeight()-getTrackWidth())/2;
--- a/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -49,15 +49,20 @@
 
 
     /**
-      * Creates a new MetalSplitPaneUI instance
-      */
+     * Creates a new {@code MetalSplitPaneUI} instance
+     *
+     * @param x a component
+     * @return a new {@code MetalSplitPaneUI} instance
+     */
     public static ComponentUI createUI(JComponent x) {
         return new MetalSplitPaneUI();
     }
 
     /**
-      * Creates the default divider.
-      */
+     * Creates the default divider.
+     *
+     * @return the default divider
+     */
     public BasicSplitPaneDivider createDefaultDivider() {
         return new MetalSplitPaneDivider(this);
     }
--- a/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,12 +50,27 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalTabbedPaneUI extends BasicTabbedPaneUI {
 
+    /**
+     * The minimum width of a pane.
+     */
     protected int minTabWidth = 40;
     // Background color for unselected tabs that don't have an explicitly
     // set color.
     private Color unselectedBackground;
+
+    /**
+     * The color of tab's background.
+     */
     protected Color tabAreaBackground;
+
+    /**
+     * The color of the selected pane.
+     */
     protected Color selectColor;
+
+    /**
+     * The color of the highlight.
+     */
     protected Color selectHighlight;
     private boolean tabsOpaque = true;
 
@@ -65,6 +80,12 @@
     // Selected border color for ocean.
     private Color oceanSelectedBorderColor;
 
+    /**
+     * Constructs {@code MetalTabbedPaneUI}.
+     *
+     * @param x a component
+     * @return an instance of {@code MetalTabbedPaneUI}
+     */
     public static ComponentUI createUI( JComponent x ) {
         return new MetalTabbedPaneUI();
     }
@@ -116,6 +137,19 @@
     }
 
 
+    /**
+     * Paints the top tab border.
+     *
+     * @param tabIndex a tab index
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param btm bottom
+     * @param rght right
+     * @param isSelected a selection
+     */
     protected void paintTopTabBorder( int tabIndex, Graphics g,
                                       int x, int y, int w, int h,
                                       int btm, int rght,
@@ -286,6 +320,15 @@
         g.translate( -x, -y );
     }
 
+    /**
+     * Returns {@code true} if the gap should be filled.
+     *
+     * @param currentRun the current run
+     * @param tabIndex the tab index
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @return {@code true} if the gap should be filled
+     */
     protected boolean shouldFillGap( int currentRun, int tabIndex, int x, int y ) {
         boolean result = false;
 
@@ -322,6 +365,14 @@
         return result;
     }
 
+    /**
+     * Returns the color of the gap.
+     *
+     * @param currentRun the current run
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @return the color of the gap
+     */
     protected Color getColorForGap( int currentRun, int x, int y ) {
         final int shadowWidth = 4;
         int selectedIndex = tabPane.getSelectedIndex();
@@ -349,6 +400,19 @@
         return tabPane.getBackground();
     }
 
+    /**
+     * Paints the left tab border.
+     *
+     * @param tabIndex a tab index
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param btm bottom
+     * @param rght right
+     * @param isSelected a selection
+     */
     protected void paintLeftTabBorder( int tabIndex, Graphics g,
                                        int x, int y, int w, int h,
                                        int btm, int rght,
@@ -466,6 +530,19 @@
     }
 
 
+    /**
+     * Paints the bottom tab border.
+     *
+     * @param tabIndex a tab index
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param btm bottom
+     * @param rght right
+     * @param isSelected a selection
+     */
     protected void paintBottomTabBorder( int tabIndex, Graphics g,
                                          int x, int y, int w, int h,
                                          int btm, int rght,
@@ -623,6 +700,19 @@
         g.translate( -x, -y );
     }
 
+    /**
+     * Paints the right tab border.
+     *
+     * @param tabIndex a tab index
+     * @param g an instance of {@code Graphics}
+     * @param x an X coordinate
+     * @param y an Y coordinate
+     * @param w a width
+     * @param h a height
+     * @param btm bottom
+     * @param rght right
+     * @param isSelected a selection
+     */
     protected void paintRightTabBorder( int tabIndex, Graphics g,
                                         int x, int y, int w, int h,
                                         int btm, int rght,
@@ -806,9 +896,8 @@
 
         // Paint the background for the tab area
         if ( tabPane.isOpaque() ) {
-            Color bg = UIManager.getColor("TabbedPane.tabAreaBackground");
-            if (bg != null) {
-                g.setColor(bg);
+            if (!c.isBackgroundSet() && (tabAreaBackground != null)) {
+                g.setColor(tabAreaBackground);
             }
             else {
                 g.setColor( c.getBackground() );
@@ -843,6 +932,9 @@
         super.paint( g, c );
     }
 
+    /**
+     * Paints highlights below tab.
+     */
     protected void paintHighlightBelowTab( ) {
 
     }
@@ -1159,7 +1251,13 @@
         return 0;
     }
 
-    // Don't rotate runs!
+    /**
+     * Returns {@code true} if tab runs should be rotated.
+     *
+     * @param tabPlacement a tab placement
+     * @param selectedRun a selected run
+     * @return {@code true} if tab runs should be rotated.
+     */
     protected boolean shouldRotateTabRuns( int tabPlacement, int selectedRun ) {
         return false;
     }
@@ -1201,6 +1299,9 @@
      */
     public class TabbedPaneLayout extends BasicTabbedPaneUI.TabbedPaneLayout {
 
+        /**
+         * Constructs {@code TabbedPaneLayout}.
+         */
         public TabbedPaneLayout() {
             MetalTabbedPaneUI.this.super();
         }
--- a/src/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,6 +50,12 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalTextFieldUI extends BasicTextFieldUI {
 
+    /**
+     * Constructs {@code MetalTextFieldUI}.
+     *
+     * @param c a component
+     * @return the instance of {@code MetalTextFieldUI}
+     */
     public static ComponentUI createUI(JComponent c) {
         return new MetalTextFieldUI();
     }
--- a/src/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,8 +60,19 @@
 
     private static final Object METAL_TOGGLE_BUTTON_UI_KEY = new Object();
 
+    /**
+     * The color of a focused toggle button.
+     */
     protected Color focusColor;
+
+    /**
+     * The color of a selected button.
+     */
     protected Color selectColor;
+
+    /**
+     * The color of a disabled text.
+     */
     protected Color disabledTextColor;
 
     private boolean defaults_initialized = false;
@@ -69,6 +80,13 @@
     // ********************************
     //        Create PLAF
     // ********************************
+
+    /**
+     * Constructs the {@code MetalToogleButtonUI}.
+     *
+     * @param b a component
+     * @return the {@code MetalToogleButtonUI}.
+     */
     public static ComponentUI createUI(JComponent b) {
         AppContext appContext = AppContext.getAppContext();
         MetalToggleButtonUI metalToggleButtonUI =
@@ -101,14 +119,29 @@
     // ********************************
     //         Default Accessors
     // ********************************
+    /**
+     * Returns the color of a selected button.
+     *
+     * @return the color of a selected button
+     */
     protected Color getSelectColor() {
         return selectColor;
     }
 
+    /**
+     * Returns the color of a disabled text.
+     *
+     * @return the color of a disabled text
+     */
     protected Color getDisabledTextColor() {
         return disabledTextColor;
     }
 
+    /**
+     * Returns the color of a focused toggle button.
+     *
+     * @return the color of a focused toggle button
+     */
     protected Color getFocusColor() {
         return focusColor;
     }
--- a/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -158,6 +158,12 @@
         return false;
     }
 
+    /**
+     * Constructs an instance of {@code MetalToolBarUI}.
+     *
+     * @param c a component
+     * @return an instance of {@code MetalToolBarUI}
+     */
     public static ComponentUI createUI( JComponent c )
     {
         return new MetalToolBarUI();
@@ -269,6 +275,11 @@
         return new MetalDockingListener( toolBar );
     }
 
+    /**
+     * Sets the offset of the mouse cursor inside the DragWindow.
+     *
+     * @param p the offset
+     */
     protected void setDragOffset(Point p) {
         if (!GraphicsEnvironment.isHeadless()) {
             if (dragWindow == null) {
@@ -346,17 +357,29 @@
         }
     }
 
-    // No longer used. Cannot remove for compatibility reasons
+    /**
+     * No longer used. The class cannot be removed for compatibility reasons.
+     */
     protected class MetalContainerListener
         extends BasicToolBarUI.ToolBarContListener {}
 
-    // No longer used. Cannot remove for compatibility reasons
+    /**
+     * No longer used. The class cannot be removed for compatibility reasons.
+     */
     protected class MetalRolloverListener
         extends BasicToolBarUI.PropertyListener {}
 
+    /**
+     * {@code DockingListener} for {@code MetalToolBarUI}.
+     */
     protected class MetalDockingListener extends DockingListener {
         private boolean pressedInBumps = false;
 
+        /**
+         * Constructs the {@code MetalDockingListener}.
+         *
+         * @param t an instance of {@code JToolBar}
+         */
         public MetalDockingListener(JToolBar t) {
             super(t);
         }
--- a/src/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -58,13 +58,26 @@
     private Font smallFont;
     // Refer to note in getAcceleratorString about this field.
     private JToolTip tip;
+
+    /**
+     * The space between strings.
+     */
     public static final int padSpaceBetweenStrings = 12;
     private String acceleratorDelimiter;
 
+    /**
+     * Constructs an instance of the {@code MetalToolTipUI}.
+     */
     public MetalToolTipUI() {
         super();
     }
 
+    /**
+     * Returns an instance of the {@code MetalToolTipUI}.
+     *
+     * @param c a component
+     * @return an instance of the {@code MetalToolTipUI}.
+     */
     public static ComponentUI createUI(JComponent c) {
         return sharedInstance;
     }
@@ -148,6 +161,12 @@
         return d;
     }
 
+    /**
+     * If the accelerator is hidden, the method returns {@code true},
+     * otherwise, returns {@code false}.
+     *
+     * @return {@code true} if the accelerator is hidden.
+     */
     protected boolean isAcceleratorHidden() {
         Boolean b = (Boolean)UIManager.get("ToolTip.hideAccelerator");
         return b != null && b.booleanValue();
@@ -162,6 +181,11 @@
         return retValue;
     }
 
+    /**
+     * Returns the accelerator string.
+     *
+     * @return the accelerator string.
+     */
     // NOTE: This requires the tip field to be set before this is invoked.
     // As MetalToolTipUI is shared between all JToolTips the tip field is
     // set appropriately before this is invoked. Unfortunately this means
--- a/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -93,20 +93,26 @@
     private int lineStyle = LEG_LINE_STYLE;
     private PropertyChangeListener lineStyleListener = new LineListener();
 
-    // Boilerplate
+    /**
+     * Constructs the {@code MetalTreeUI}.
+     *
+     * @param x a component
+     * @return the instance of the {@code MetalTreeUI}
+     */
     public static ComponentUI createUI(JComponent x) {
         return new MetalTreeUI();
     }
 
-    public MetalTreeUI()
-    {
+    /**
+     * Constructs the {@code MetalTreeUI}.
+     */
+    public MetalTreeUI() {
         super();
     }
 
-    protected int getHorizontalLegBuffer()
-      {
-          return 3;
-      }
+    protected int getHorizontalLegBuffer() {
+        return 3;
+    }
 
     public void installUI( JComponent c ) {
         super.installUI( c );
@@ -123,24 +129,36 @@
          super.uninstallUI(c);
     }
 
-    /** this function converts between the string passed into the client property
-      * and the internal representation (currently and int)
-      *
-      */
+    /**
+     * Converts between the string passed into the client property
+     * and the internal representation (currently and int)
+     *
+     * @param lineStyleFlag a flag
+     */
     protected void decodeLineStyle(Object lineStyleFlag) {
-      if ( lineStyleFlag == null ||
-                    lineStyleFlag.equals(LEG_LINE_STYLE_STRING)){
-        lineStyle = LEG_LINE_STYLE; // default case
-      } else {
-          if ( lineStyleFlag.equals(NO_STYLE_STRING) ) {
-              lineStyle = NO_LINE_STYLE;
-          } else if ( lineStyleFlag.equals(HORIZ_STYLE_STRING) ) {
-              lineStyle = HORIZ_LINE_STYLE;
-          }
-      }
-
+        if ( lineStyleFlag == null ||
+                    lineStyleFlag.equals(LEG_LINE_STYLE_STRING)) {
+            lineStyle = LEG_LINE_STYLE; // default case
+        } else {
+            if ( lineStyleFlag.equals(NO_STYLE_STRING) ) {
+                lineStyle = NO_LINE_STYLE;
+            } else if ( lineStyleFlag.equals(HORIZ_STYLE_STRING) ) {
+                lineStyle = HORIZ_LINE_STYLE;
+            }
+        }
     }
 
+    /**
+     * Returns {@code true} if a point with X coordinate {@code mouseX}
+     * and Y coordinate {@code mouseY} is in expanded control.
+     *
+     * @param row a row
+     * @param rowLevel a row level
+     * @param mouseX X coordinate
+     * @param mouseY Y coordinate
+     * @return {@code true} if a point with X coordinate {@code mouseX}
+     *         and Y coordinate {@code mouseY} is in expanded control.
+     */
     protected boolean isLocationInExpandControl(int row, int rowLevel,
                                                 int mouseX, int mouseY) {
         if(tree != null && !isLeaf(row)) {
@@ -175,6 +193,12 @@
         }
     }
 
+    /**
+     * Paints the horizontal separators.
+     *
+     * @param g an instance of {@code Graphics}
+     * @param c a component
+     */
     protected void paintHorizontalSeparators(Graphics g, JComponent c) {
         g.setColor( lineColor );
 
--- a/src/share/classes/javax/swing/plaf/multi/MultiButtonUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiButtonUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiButtonUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiColorChooserUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiColorChooserUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiColorChooserUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiComboBoxUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiComboBoxUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -138,6 +140,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiComboBoxUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiDesktopIconUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiDesktopIconUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiDesktopIconUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiDesktopPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiDesktopPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiDesktopPaneUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -181,6 +183,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiFileChooserUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiInternalFrameUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiInternalFrameUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiInternalFrameUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiLabelUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiLabelUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiLabelUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiListUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiListUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -146,6 +148,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiListUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiMenuBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiMenuBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiMenuBarUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -103,6 +105,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiMenuItemUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiOptionPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiOptionPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -123,6 +125,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiOptionPaneUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiPanelUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiPanelUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiPanelUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -133,6 +135,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiPopupMenuUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiProgressBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiProgressBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiProgressBarUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiRootPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiRootPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -99,6 +101,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiRootPaneUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiScrollBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiScrollBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiScrollBarUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiScrollPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiScrollPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiScrollPaneUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiSeparatorUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiSliderUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiSliderUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -96,8 +98,11 @@
 
     /**
      * Returns a multiplexing UI instance if any of the auxiliary
-     * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
+     * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiSliderUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiSpinnerUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiSpinnerUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -99,6 +101,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiSpinnerUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiSplitPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiSplitPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -171,6 +173,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiSplitPaneUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -145,6 +147,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiTabbedPaneUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiTableHeaderUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiTableHeaderUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiTableHeaderUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiTableUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiTableUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiTableUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiTextUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiTextUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -248,6 +250,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiTextUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiToolBarUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiToolTipUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiToolTipUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiToolTipUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -239,6 +241,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiTreeUI();
--- a/src/share/classes/javax/swing/plaf/multi/MultiViewportUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/multi/MultiViewportUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
      * Returns the list of UIs associated with this multiplexing UI.  This
      * allows processing of the UIs by an application aware of multiplexing
      * UIs on components.
+     *
+     * @return an array of the UI delegates
      */
     public ComponentUI[] getUIs() {
         return MultiLookAndFeel.uisToArray(uis);
@@ -98,6 +100,9 @@
      * Returns a multiplexing UI instance if any of the auxiliary
      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
      * UI object obtained from the default <code>LookAndFeel</code>.
+     *
+     * @param  a the component to create the UI for
+     * @return the UI delegate created
      */
     public static ComponentUI createUI(JComponent a) {
         ComponentUI mui = new MultiViewportUI();
--- a/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 import javax.swing.plaf.UIResource;
 import javax.swing.Painter;
 import java.awt.print.PrinterGraphics;
+import sun.reflect.misc.MethodUtil;
 
 /**
  * Convenient base class for defining Painter instances for rendering a
@@ -420,6 +421,13 @@
      * @param property The name of a bean style property or client property
      * @param defaultColor The color to return if no color was obtained from
      *        the component.
+     * @param saturationOffset additively modifies the HSB saturation component
+     * of the color returned (ignored if default color is returned).
+     * @param brightnessOffset additively modifies the HSB brightness component
+     * of the color returned (ignored if default color is returned).
+     * @param alphaOffset additively modifies the ARGB alpha component of the
+     * color returned (ignored if default color is returned).
+     *
      * @return The color that was obtained from the component or defaultColor
      */
     protected final Color getComponentColor(JComponent c, String property,
@@ -445,8 +453,8 @@
             } else {
                 String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
                 try {
-                    Method method = c.getClass().getMethod(s);
-                    color = (Color) method.invoke(c);
+                    Method method = MethodUtil.getMethod(c.getClass(), s, null);
+                    color = (Color) MethodUtil.invoke(method, c, null);
                 } catch (Exception e) {
                     //don't do anything, it just didn't work, that's all.
                     //This could be a normal occurance if you use a property
--- a/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java	Wed Jul 09 10:42:37 2014 -0700
@@ -653,7 +653,7 @@
 
         // strip off the prefix, if there is one.
         String fullKey = key.toString();
-        String partialKey = fullKey.substring(fullKey.indexOf(".") + 1);
+        String partialKey = fullKey.substring(fullKey.indexOf('.') + 1);
 
         Object obj = null;
         int xstate = getExtendedState(ctx, v);
--- a/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -138,9 +138,7 @@
     }
 
     SynthContext getContext(JComponent c, int state) {
-        Region region = SynthLookAndFeel.getRegion(c);
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
@@ -515,6 +513,13 @@
     /**
      * Returns the Icon used in calculating the
      * preferred/minimum/maximum size.
+     *
+     * @param b specifies the {@code AbstractButton}
+     * used when calculating the preferred/minimum/maximum
+     * size.
+     *
+     * @return the Icon used in calculating the
+     * preferred/minimum/maximum size.
      */
     protected Icon getSizingIcon(AbstractButton b) {
         Icon icon = getEnabledIcon(b, b.getIcon());
--- a/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -128,8 +128,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -208,8 +208,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthContext.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthContext.java	Wed Jul 09 10:42:37 2014 -0700
@@ -24,8 +24,9 @@
  */
 package javax.swing.plaf.synth;
 
-import javax.swing.*;
-import java.util.*;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import javax.swing.JComponent;
 
 /**
  * An immutable transient object containing contextual information about
@@ -39,59 +40,32 @@
  * @author Scott Violet
  */
 public class SynthContext {
-    private static final Map<Class, List<SynthContext>> contextMap;
+    private static final Queue<SynthContext> queue = new ConcurrentLinkedQueue<>();
 
     private JComponent component;
     private Region region;
     private SynthStyle style;
     private int state;
 
-
-    static {
-        contextMap = new HashMap<Class, List<SynthContext>>();
+    static SynthContext getContext(JComponent c, SynthStyle style, int state) {
+        return getContext(c, SynthLookAndFeel.getRegion(c), style, state);
     }
 
-
-    static SynthContext getContext(Class type, JComponent component,
+    static SynthContext getContext(JComponent component,
                                    Region region, SynthStyle style,
                                    int state) {
-        SynthContext context = null;
-
-        synchronized(contextMap) {
-            List<SynthContext> instances = contextMap.get(type);
-
-            if (instances != null) {
-                int size = instances.size();
-
-                if (size > 0) {
-                    context = instances.remove(size - 1);
-                }
-            }
-        }
+        SynthContext context = queue.poll();
         if (context == null) {
-            try {
-                context = (SynthContext)type.newInstance();
-            } catch (IllegalAccessException iae) {
-            } catch (InstantiationException ie) {
-            }
+            context = new SynthContext();
         }
         context.reset(component, region, style, state);
         return context;
     }
 
     static void releaseContext(SynthContext context) {
-        synchronized(contextMap) {
-            List<SynthContext> instances = contextMap.get(context.getClass());
-
-            if (instances == null) {
-                instances = new ArrayList<SynthContext>(5);
-                contextMap.put(context.getClass(), instances);
-            }
-            instances.add(context);
-        }
+        queue.offer(context);
     }
 
-
     SynthContext() {
     }
 
--- a/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -144,9 +144,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        Region region = SynthLookAndFeel.getRegion(c);
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -432,8 +432,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                     SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -139,8 +139,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -137,6 +137,9 @@
      * @param iconR Rectangle to place icon bounds in
      * @param textR Rectangle to place text in
      * @param iconTextGap gap between icon and text
+     *
+     * @return by reference, the location to
+     * place the icon and text.
      */
     public String layoutText(SynthContext ss, FontMetrics fm,
                          String text, Icon icon, int hAlign,
@@ -166,6 +169,8 @@
      * @param font Font to use
      * @param metrics FontMetrics, may be ignored
      * @param text Text to get size of.
+     *
+     * @return the size of the passed in string.
      */
     public int computeStringWidth(SynthContext ss, Font font,
                                   FontMetrics metrics, String text) {
@@ -187,6 +192,8 @@
      * @param iconTextGap gap between icon and text
      * @param mnemonicIndex Index into text to render the mnemonic at, -1
      *        indicates no mnemonic.
+     *
+     * @return the minimum size needed to properly render an icon and text.
      */
     public Dimension getMinimumSize(SynthContext ss, Font font, String text,
                       Icon icon, int hAlign, int vAlign, int hTextPosition,
@@ -218,6 +225,8 @@
      * @param iconTextGap gap between icon and text
      * @param mnemonicIndex Index into text to render the mnemonic at, -1
      *        indicates no mnemonic.
+     *
+     * @return the maximum size needed to properly render an icon and text.
      */
     public Dimension getMaximumSize(SynthContext ss, Font font, String text,
                       Icon icon, int hAlign, int vAlign, int hTextPosition,
@@ -263,6 +272,8 @@
      * @param iconTextGap gap between icon and text
      * @param mnemonicIndex Index into text to render the mnemonic at, -1
      *        indicates no mnemonic.
+     *
+     * @return the preferred size needed to properly render an icon and text.
      */
     public Dimension getPreferredSize(SynthContext ss, Font font, String text,
                       Icon icon, int hAlign, int vAlign, int hTextPosition,
--- a/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -68,8 +68,7 @@
     }
 
     public SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private Region getRegion(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -141,8 +141,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                            SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -91,8 +91,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthListUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthListUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -188,8 +188,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -116,8 +116,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -170,8 +170,7 @@
     }
 
     SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     SynthContext getContext(JComponent c, Region region) {
@@ -179,8 +178,7 @@
     }
 
     private SynthContext getContext(JComponent c, Region region, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       region, accStyle, state);
+        return SynthContext.getContext(c, region, accStyle, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -170,9 +170,7 @@
     }
 
     SynthContext getContext(JComponent c, int state) {
-        Region region = SynthLookAndFeel.getRegion(c);
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     SynthContext getContext(JComponent c, Region region) {
@@ -180,8 +178,7 @@
     }
 
     private SynthContext getContext(JComponent c, Region region, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       region, accStyle, state);
+        return SynthContext.getContext(c, region, accStyle, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -140,8 +140,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -127,8 +127,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -67,6 +67,7 @@
 import org.xml.sax.helpers.DefaultHandler;
 
 import com.sun.beans.decoder.DocumentHandler;
+import sun.reflect.misc.ReflectUtil;
 
 class SynthParser extends DefaultHandler {
     //
@@ -648,7 +649,7 @@
                     }
                     else {
                         try {
-                            typeClass = Class.forName(typeName.substring(
+                            typeClass = ReflectUtil.forName(typeName.substring(
                                                       0, classIndex));
                         } catch (ClassNotFoundException cnfe) {
                             throw new SAXException("Unknown class: " +
--- a/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -123,8 +123,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -138,8 +138,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                            SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -80,8 +80,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -185,8 +185,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region region) {
@@ -199,8 +198,7 @@
         if (region == Region.SCROLL_BAR_THUMB) {
             style = thumbStyle;
         }
-        return SynthContext.getContext(SynthContext.class, c, region, style,
-                                       state);
+        return SynthContext.getContext(c, region, style, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -211,8 +211,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,6 +78,9 @@
     /**
      * Installs default setting. This method is called when a
      * {@code LookAndFeel} is installed.
+     *
+     * @param c specifies the {@code JSeparator} for the installed
+     * {@code LookAndFeel}.
      */
     public void installDefaults(JSeparator c) {
         updateStyle(c);
@@ -109,6 +112,9 @@
     /**
      * Uninstalls default setting. This method is called when a
      * {@code LookAndFeel} is uninstalled.
+     *
+     * @param c specifies the {@code JSeparator} for the (un)installed
+     * {@code LookAndFeel}.
      */
     public void uninstallDefaults(JSeparator c) {
         SynthContext context = getContext(c, ENABLED);
@@ -121,6 +127,9 @@
     /**
      * Installs listeners. This method is called when a
      * {@code LookAndFeel} is installed.
+     *
+     * @param c specifies the {@code JSeparator} for the installed
+     * {@code LookAndFeel}.
      */
     public void installListeners(JSeparator c) {
         c.addPropertyChangeListener(this);
@@ -129,6 +138,9 @@
     /**
      * Uninstalls listeners. This method is called when a
      * {@code LookAndFeel} is uninstalled.
+     *
+     * @param c specifies the {@code JSeparator} for the (un)installed
+     * {@code LookAndFeel}.
      */
     public void uninstallListeners(JSeparator c) {
         c.removePropertyChangeListener(this);
@@ -248,8 +260,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     public void propertyChange(PropertyChangeEvent evt) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -722,8 +722,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                            SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region subregion) {
@@ -732,14 +731,13 @@
 
     private SynthContext getContext(JComponent c, Region subregion, int state) {
         SynthStyle style = null;
-        Class klass = SynthContext.class;
 
         if (subregion == Region.SLIDER_TRACK) {
             style = sliderTrackStyle;
         } else if (subregion == Region.SLIDER_THUMB) {
             style = sliderThumbStyle;
         }
-        return SynthContext.getContext(klass, c, subregion, style, state);
+        return SynthContext.getContext(c, subregion, style, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -278,8 +278,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -209,8 +209,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     SynthContext getContext(JComponent c, Region region) {
@@ -219,11 +218,9 @@
 
     private SynthContext getContext(JComponent c, Region region, int state) {
         if (region == Region.SPLIT_PANE_DIVIDER) {
-            return SynthContext.getContext(SynthContext.class, c, region,
-                                           dividerStyle, state);
+            return SynthContext.getContext(c, region, dividerStyle, state);
         }
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, region, style, state);
     }
 
     private int getComponentState(JComponent c, Region subregion) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -235,13 +235,11 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c),style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region subregion, int state){
         SynthStyle style = null;
-        Class klass = SynthContext.class;
 
         if (subregion == Region.TABBED_PANE_TAB) {
             style = tabStyle;
@@ -252,7 +250,7 @@
         else if (subregion == Region.TABBED_PANE_CONTENT) {
             style = tabContentStyle;
         }
-        return SynthContext.getContext(klass, c, subregion, style, state);
+        return SynthContext.getContext(c, subregion, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -193,8 +193,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -246,8 +246,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
 //
--- a/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -119,8 +119,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -157,8 +157,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -178,19 +178,17 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region region, SynthStyle style) {
-        return SynthContext.getContext(SynthContext.class, c, region,
+        return SynthContext.getContext(c, region,
                                        style, getComponentState(c, region));
     }
 
     private SynthContext getContext(JComponent c, Region region,
                                     SynthStyle style, int state) {
-        return SynthContext.getContext(SynthContext.class, c, region,
-                                       style, state);
+        return SynthContext.getContext(c, region, style, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -107,8 +107,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private int getComponentState(JComponent c) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -173,8 +173,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                    SynthLookAndFeel.getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private SynthContext getContext(JComponent c, Region region) {
@@ -182,8 +181,7 @@
     }
 
     private SynthContext getContext(JComponent c, Region region, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       region, cellStyle, state);
+        return SynthContext.getContext(c, region, cellStyle, state);
     }
 
     private int getComponentState(JComponent c, Region region) {
--- a/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -141,8 +141,7 @@
     }
 
     private SynthContext getContext(JComponent c, int state) {
-        return SynthContext.getContext(SynthContext.class, c,
-                                       getRegion(c), style, state);
+        return SynthContext.getContext(c, style, state);
     }
 
     private Region getRegion(JComponent c) {
--- a/src/share/classes/javax/swing/table/DefaultTableColumnModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/table/DefaultTableColumnModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -716,6 +716,8 @@
 
     /**
      * Creates a new default list selection model.
+     *
+     * @return a newly created default list selection model.
      */
     protected ListSelectionModel createSelectionModel() {
         return new DefaultListSelectionModel();
--- a/src/share/classes/javax/swing/table/DefaultTableModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/table/DefaultTableModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -335,6 +335,8 @@
      *
      *  @see #setColumnCount
      * @since 1.3
+     *
+     * @param rowCount  number of rows in the model
      */
     public void setRowCount(int rowCount) {
         setNumRows(rowCount);
@@ -577,6 +579,9 @@
      *  element going to row 0, etc.  This method will send a
      *  <code>tableChanged</code> notification message to all the listeners.
      *
+     * @param columnName  identifier of the newly created column
+     * @param columnData  new data to be added to the column
+     *
      * @see #addColumn(Object, Vector)
      */
     public void addColumn(Object columnName, Object[] columnData) {
--- a/src/share/classes/javax/swing/table/JTableHeader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/table/JTableHeader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -336,6 +336,10 @@
      * Returns the index of the column that <code>point</code> lies in, or -1 if it
      * lies out of bounds.
      *
+     * @param point  if this <code>point</code> lies within a column, the index of
+     *               that column will be returned; otherwise it is out of bounds
+     *               and -1 is returned
+     *
      * @return  the index of the column that <code>point</code> lies in, or -1 if it
      *          lies out of bounds
      */
@@ -352,6 +356,8 @@
      * When the <code>column</code> parameter is out of bounds this method uses the
      * same conventions as the <code>JTable</code> method <code>getCellRect</code>.
      *
+     * @param column  index of the column
+     *
      * @return  the rectangle containing the header tile at <code>column</code>
      * @see JTable#getCellRect
      */
@@ -883,6 +889,10 @@
             /**
              *  Constructs an AccessiblJTableHeaaderEntry
              * @since 1.4
+             *
+             * @param c  the column index
+             * @param p  the parent <code>JTableHeader</code>
+             * @param t  the table <code>JTable</code>
              */
             public AccessibleJTableHeaderEntry(int c, JTableHeader p, JTable t) {
                 parent = p;
--- a/src/share/classes/javax/swing/table/TableCellRenderer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/table/TableCellRenderer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,6 +86,9 @@
      *                          drawing the header, the value of
      *                          <code>row</code> is -1
      * @param   column          the column index of the cell being drawn
+     *
+     * @return                  the component used for drawing the cell.
+     *
      * @see javax.swing.JComponent#isPaintingForPrint()
      */
     Component getTableCellRendererComponent(JTable table, Object value,
--- a/src/share/classes/javax/swing/table/TableColumn.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/table/TableColumn.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -201,6 +201,11 @@
      *  Cover method, using a default width of 75, a <code>null</code>
      *  renderer and a <code>null</code> editor.
      *  @see #TableColumn(int, int, TableCellRenderer, TableCellEditor)
+     *
+     *  @param modelIndex  the index of the column in the model
+     *  that supplies the data for this column in the table;
+     *  the model index remains the same even when columns
+     *  are reordered in the view
      */
     public TableColumn(int modelIndex) {
         this(modelIndex, 75, null, null);
@@ -210,6 +215,12 @@
      *  Cover method, using a <code>null</code> renderer and a
      *  <code>null</code> editor.
      *  @see #TableColumn(int, int, TableCellRenderer, TableCellEditor)
+     *
+     *  @param modelIndex  the index of the column in the model
+     *  that supplies the data for this column in the table;
+     *  the model index remains the same even when columns
+     *  are reordered in the view
+     *  @param width  this column's preferred width and initial width
      */
     public TableColumn(int modelIndex, int width) {
         this(modelIndex, width, null, null);
--- a/src/share/classes/javax/swing/table/TableColumnModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/table/TableColumnModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -162,6 +162,9 @@
      * model.  If the column index for a given X coordinate in 2D space is
      * required, <code>JTable.columnAtPoint</code> can be used instead.
      *
+     * @param xPosition  width from the start of the first column in
+     * the model.
+     *
      * @return  the index of the column; or -1 if no column is found
      * @see javax.swing.JTable#columnAtPoint
      */
--- a/src/share/classes/javax/swing/text/AbstractDocument.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/AbstractDocument.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1809,7 +1809,7 @@
             if (getAttributeCount() > 0) {
                 out.println("");
                 // dump the attributes
-                Enumeration names = attributes.getAttributeNames();
+                Enumeration<?> names = attributes.getAttributeNames();
                 while (names.hasMoreElements()) {
                     Object name = names.nextElement();
                     indent(out, indentAmount + 1);
@@ -2193,7 +2193,7 @@
          * <code>Enumeration</code>.
          * @return the children of the receiver as an <code>Enumeration</code>
          */
-        public abstract Enumeration children();
+        public abstract Enumeration<?> children();
 
 
         // --- serialization ---------------------------------------------
@@ -2456,7 +2456,7 @@
          * <code>Enumeration</code>.
          * @return the children of the receiver
          */
-        public Enumeration children() {
+        public Enumeration<AbstractElement> children() {
             if(nchildren == 0)
                 return null;
 
@@ -2610,7 +2610,7 @@
          * <code>Enumeration</code>.
          * @return the children of the receiver
          */
-        public Enumeration children() {
+        public Enumeration<?> children() {
             return null;
         }
 
--- a/src/share/classes/javax/swing/text/AbstractWriter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/AbstractWriter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -668,7 +668,7 @@
      */
     protected void writeAttributes(AttributeSet attr) throws IOException {
 
-        Enumeration names = attr.getAttributeNames();
+        Enumeration<?> names = attr.getAttributeNames();
         while (names.hasMoreElements()) {
             Object name = names.nextElement();
             write(" " + name + "=" + attr.getAttribute(name));
--- a/src/share/classes/javax/swing/text/DateFormatter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/DateFormatter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -108,8 +108,8 @@
     /**
      * Returns the field that will be adjusted by adjustValue.
      */
-    Object getAdjustField(int start, Map attributes) {
-        Iterator attrs = attributes.keySet().iterator();
+    Object getAdjustField(int start, Map<?, ?> attributes) {
+        Iterator<?> attrs = attributes.keySet().iterator();
 
         while (attrs.hasNext()) {
             Object key = attrs.next();
@@ -127,7 +127,7 @@
      * Adjusts the Date if FieldPosition identifies a known calendar
      * field.
      */
-    Object adjustValue(Object value, Map attributes, Object key,
+    Object adjustValue(Object value, Map<?, ?> attributes, Object key,
                            int direction) throws
                       BadLocationException, ParseException {
         if (key != null) {
--- a/src/share/classes/javax/swing/text/DefaultFormatter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/DefaultFormatter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -246,12 +246,12 @@
             }
         }
         if (vc != null) {
-            Constructor cons;
+            Constructor<?> cons;
 
             try {
                 ReflectUtil.checkPackageAccess(vc);
                 SwingUtilities2.checkAccess(vc.getModifiers());
-                cons = vc.getConstructor(new Class[]{String.class});
+                cons = vc.getConstructor(new Class<?>[]{String.class});
 
             } catch (NoSuchMethodException nsme) {
                 cons = null;
--- a/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1048,8 +1048,9 @@
                 styleChangeListener = createStyleChangeListener();
             }
             if (styleChangeListener != null && styles != null) {
-                Enumeration styleNames = styles.getStyleNames();
-                Vector v = (Vector)listeningStyles.clone();
+                Enumeration<?> styleNames = styles.getStyleNames();
+                @SuppressWarnings("unchecked")
+                Vector<Style> v = (Vector<Style>)listeningStyles.clone();
                 listeningStyles.removeAllElements();
                 List<ChangeListener> staleListeners =
                     AbstractChangeHandler.getStaleListeners(styleChangeListener);
@@ -1069,7 +1070,7 @@
                     }
                 }
                 for (int counter = v.size() - 1; counter >= 0; counter--) {
-                    Style aStyle = (Style)v.elementAt(counter);
+                    Style aStyle = v.elementAt(counter);
                     aStyle.removeChangeListener(styleChangeListener);
                 }
                 if (listeningStyles.size() == 0) {
@@ -2630,14 +2631,14 @@
         }
 
         /** Class-specific reference queues.  */
-        private final static Map<Class, ReferenceQueue<DefaultStyledDocument>> queueMap
-                = new HashMap<Class, ReferenceQueue<DefaultStyledDocument>>();
+        private final static Map<Class<?>, ReferenceQueue<DefaultStyledDocument>> queueMap
+                = new HashMap<Class<?>, ReferenceQueue<DefaultStyledDocument>>();
 
         /** A weak reference to the document object.  */
         private DocReference doc;
 
         AbstractChangeHandler(DefaultStyledDocument d) {
-            Class c = getClass();
+            Class<?> c = getClass();
             ReferenceQueue<DefaultStyledDocument> q;
             synchronized (queueMap) {
                 q = queueMap.get(c);
--- a/src/share/classes/javax/swing/text/ElementIterator.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/ElementIterator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -361,7 +361,7 @@
                 System.out.println("elem: " + elem.getName());
                 AttributeSet attr = elem.getAttributes();
                 String s = "";
-                Enumeration names = attr.getAttributeNames();
+                Enumeration<?> names = attr.getAttributeNames();
                 while (names.hasMoreElements()) {
                     Object key = names.nextElement();
                     Object value = attr.getAttribute(key);
--- a/src/share/classes/javax/swing/text/GapContent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/GapContent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -710,7 +710,8 @@
      * @param length the length &gt;= 0
      * @return the set of instances
      */
-    protected Vector getPositionsInRange(Vector v, int offset, int length) {
+    protected Vector<UndoPosRef> getPositionsInRange(Vector<UndoPosRef> v,
+                                                     int offset, int length) {
         int endOffset = offset + length;
         int startIndex;
         int endIndex;
@@ -738,8 +739,9 @@
             endIndex = findMarkAdjustIndex(endOffset + (g1 - g0) + 1);
         }
 
-        Vector placeIn = (v == null) ? new Vector(Math.max(1, endIndex -
-                                                           startIndex)) : v;
+        Vector<UndoPosRef> placeIn = (v == null) ?
+            new Vector<>(Math.max(1, endIndex - startIndex)) :
+            v;
 
         for (int counter = startIndex; counter < endIndex; counter++) {
             placeIn.addElement(new UndoPosRef(marks.elementAt(counter)));
@@ -756,7 +758,7 @@
      *
      * @param positions the UndoPosRef instances to reset
      */
-    protected void updateUndoPositions(Vector positions, int offset,
+    protected void updateUndoPositions(Vector<UndoPosRef> positions, int offset,
                                        int length) {
         // Find the indexs of the end points.
         int endOffset = offset + length;
@@ -773,7 +775,7 @@
 
         // Reset the location of the refenences.
         for(int counter = positions.size() - 1; counter >= 0; counter--) {
-            UndoPosRef ref = (UndoPosRef)positions.elementAt(counter);
+            UndoPosRef ref = positions.elementAt(counter);
             ref.resetLocation(endOffset, g1);
         }
         // We have to resort the marks in the range startIndex to endIndex.
@@ -900,7 +902,7 @@
         protected String string;
         /** An array of instances of UndoPosRef for the Positions in the
          * range that was removed, valid after undo. */
-        protected Vector posRefs;
+        protected Vector<UndoPosRef> posRefs;
     } // GapContent.InsertUndo
 
 
@@ -952,6 +954,6 @@
         protected String string;
         /** An array of instances of UndoPosRef for the Positions in the
          * range that was removed, valid before undo. */
-        protected Vector posRefs;
+        protected Vector<UndoPosRef> posRefs;
     } // GapContent.RemoveUndo
 }
--- a/src/share/classes/javax/swing/text/GlyphView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/GlyphView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -253,7 +253,7 @@
                 // the classname should probably come from a property file.
                 String classname = "javax.swing.text.GlyphPainter1";
                 try {
-                    Class c;
+                    Class<?> c;
                     ClassLoader loader = getClass().getClassLoader();
                     if (loader != null) {
                         c = loader.loadClass(classname);
--- a/src/share/classes/javax/swing/text/InternationalFormatter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/InternationalFormatter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -106,11 +106,11 @@
     /**
      * Can be used to impose a maximum value.
      */
-    private Comparable max;
+    private Comparable<?> max;
     /**
      * Can be used to impose a minimum value.
      */
-    private Comparable min;
+    private Comparable<?> min;
 
     /**
      * <code>InternationalFormatter</code>'s behavior is dicatated by a
@@ -211,7 +211,7 @@
      * @param minimum Minimum legal value that can be input
      * @see #setValueClass
      */
-    public void setMinimum(Comparable minimum) {
+    public void setMinimum(Comparable<?> minimum) {
         if (getValueClass() == null && minimum != null) {
             setValueClass(minimum.getClass());
         }
@@ -223,7 +223,7 @@
      *
      * @return Minimum legal value that can be input
      */
-    public Comparable getMinimum() {
+    public Comparable<?> getMinimum() {
         return min;
     }
 
@@ -236,7 +236,7 @@
      * @param max Maximum legal value that can be input
      * @see #setValueClass
      */
-    public void setMaximum(Comparable max) {
+    public void setMaximum(Comparable<?> max) {
         if (getValueClass() == null && max != null) {
             setValueClass(max.getClass());
         }
@@ -248,7 +248,7 @@
      *
      * @return Maximum legal value that can be input
      */
-    public Comparable getMaximum() {
+    public Comparable<?> getMaximum() {
         return max;
     }
 
@@ -411,7 +411,8 @@
      *                 false is returned.
      */
     boolean isValidValue(Object value, boolean wantsCCE) {
-        Comparable min = getMinimum();
+        @SuppressWarnings("unchecked")
+        Comparable<Object> min = (Comparable<Object>)getMinimum();
 
         try {
             if (min != null && min.compareTo(value) > 0) {
@@ -424,7 +425,8 @@
             return false;
         }
 
-        Comparable max = getMaximum();
+        @SuppressWarnings("unchecked")
+        Comparable<Object> max = (Comparable<Object>)getMaximum();
         try {
             if (max != null && max.compareTo(value) < 0) {
                 return false;
@@ -770,7 +772,7 @@
     /**
      * Returns true if <code>attributes</code> is null or empty.
      */
-    boolean isLiteral(Map attributes) {
+    boolean isLiteral(Map<?, ?> attributes) {
         return ((attributes == null) || attributes.size() == 0);
     }
 
@@ -797,7 +799,7 @@
 
             iterator.first();
             while (iterator.current() != CharacterIterator.DONE) {
-                Map attributes = iterator.getAttributes();
+                Map<Attribute,Object> attributes = iterator.getAttributes();
                 boolean set = isLiteral(attributes);
                 int start = iterator.getIndex();
                 int end = iterator.getRunLimit();
@@ -858,7 +860,7 @@
     /**
      * Returns the field that will be adjusted by adjustValue.
      */
-    Object getAdjustField(int start, Map attributes) {
+    Object getAdjustField(int start, Map<?, ?> attributes) {
         return null;
     }
 
@@ -900,7 +902,7 @@
      * null depending upon <code>canIncrement</code>) and
      * <code>direction</code> is the amount to increment by.
      */
-    Object adjustValue(Object value, Map attributes, Object field,
+    Object adjustValue(Object value, Map<?, ?> attributes, Object field,
                            int direction) throws
                       BadLocationException, ParseException {
         return null;
@@ -1023,7 +1025,7 @@
 
                         iterator.setIndex(start);
 
-                        Map attributes = iterator.getAttributes();
+                        Map<Attribute,Object> attributes = iterator.getAttributes();
                         Object field = getAdjustField(start, attributes);
 
                         if (canIncrement(field, start)) {
--- a/src/share/classes/javax/swing/text/JTextComponent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/JTextComponent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1091,6 +1091,7 @@
     private static HashMap<String,Keymap> getKeymapTable() {
         synchronized (KEYMAP_TABLE) {
             AppContext appContext = AppContext.getAppContext();
+            @SuppressWarnings("unchecked")
             HashMap<String,Keymap> keymapTable =
                 (HashMap<String,Keymap>)appContext.get(KEYMAP_TABLE);
             if (keymapTable == null) {
--- a/src/share/classes/javax/swing/text/NumberFormatter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/NumberFormatter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -173,7 +173,8 @@
      * <code>Byte</code> or <code>Short</code> and <code>value</code>
      * is an instanceof <code>Number</code>.
      */
-    private Object convertValueToValueClass(Object value, Class valueClass) {
+    private Object convertValueToValueClass(Object value,
+                                            Class<?> valueClass) {
         if (valueClass != null && (value instanceof Number)) {
             Number numberValue = (Number)value;
             if (valueClass == Integer.class) {
@@ -266,7 +267,7 @@
      * Subclassed to treat the decimal separator, grouping separator,
      * exponent symbol, percent, permille, currency and sign as literals.
      */
-    boolean isLiteral(Map attrs) {
+    boolean isLiteral(Map<?, ?> attrs) {
         if (!super.isLiteral(attrs)) {
             if (attrs == null) {
                 return false;
@@ -327,7 +328,7 @@
             while (index >= 0 && index < max) {
                 iterator.setIndex(index);
 
-                Map attrs = iterator.getAttributes();
+                Map<?,?> attrs = iterator.getAttributes();
 
                 if (attrs != null && attrs.size() > 0) {
                     for (Object key : attrs.keySet()) {
@@ -432,8 +433,8 @@
                     try {
                         ReflectUtil.checkPackageAccess(valueClass);
                         SwingUtilities2.checkAccess(valueClass.getModifiers());
-                        Constructor cons = valueClass.getConstructor(
-                                              new Class[] { String.class });
+                        Constructor<?> cons = valueClass.getConstructor(
+                                              new Class<?>[] { String.class });
                         if (cons != null) {
                             SwingUtilities2.checkAccess(cons.getModifiers());
                             return cons.newInstance(new Object[]{string});
--- a/src/share/classes/javax/swing/text/ParagraphView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/ParagraphView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -806,7 +806,7 @@
     /**
      * Used to create an i18n-based layout strategy
      */
-    static Class i18nStrategy;
+    static Class<?> i18nStrategy;
 
     /** Used for searching for a tab. */
     static char[] tabChars;
--- a/src/share/classes/javax/swing/text/SimpleAttributeSet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/SimpleAttributeSet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -172,7 +172,7 @@
     public boolean containsAttributes(AttributeSet attributes) {
         boolean result = true;
 
-        Enumeration names = attributes.getAttributeNames();
+        Enumeration<?> names = attributes.getAttributeNames();
         while (result && names.hasMoreElements()) {
             Object name = names.nextElement();
             result = attributes.getAttribute(name).equals(getAttribute(name));
@@ -197,7 +197,7 @@
      * @param attributes the set of attributes to add
      */
     public void addAttributes(AttributeSet attributes) {
-        Enumeration names = attributes.getAttributeNames();
+        Enumeration<?> names = attributes.getAttributeNames();
         while (names.hasMoreElements()) {
             Object name = names.nextElement();
             addAttribute(name, attributes.getAttribute(name));
@@ -233,7 +233,7 @@
             table.clear();
         }
         else {
-            Enumeration names = attributes.getAttributeNames();
+            Enumeration<?> names = attributes.getAttributeNames();
             while (names.hasMoreElements()) {
                 Object name = names.nextElement();
                 Object value = attributes.getAttribute(name);
@@ -272,6 +272,7 @@
      *
      * @return the new set of attributes
      */
+    @SuppressWarnings("unchecked") // Cast of result of clone
     public Object clone() {
         SimpleAttributeSet attr;
         try {
@@ -317,7 +318,7 @@
      */
     public String toString() {
         String s = "";
-        Enumeration names = getAttributeNames();
+        Enumeration<?> names = getAttributeNames();
         while (names.hasMoreElements()) {
             Object key = names.nextElement();
             Object value = getAttribute(key);
@@ -364,7 +365,7 @@
         public Object getAttribute(Object key) {
             return null;
         }
-        public Enumeration getAttributeNames() {
+        public Enumeration<?> getAttributeNames() {
             return Collections.emptyEnumeration();
         }
         public boolean containsAttribute(Object name, Object value) {
--- a/src/share/classes/javax/swing/text/StringContent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/StringContent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -271,11 +271,11 @@
      * @param length the length &gt;= 0
      * @return the set of instances
      */
-    protected Vector getPositionsInRange(Vector v, int offset,
+    protected Vector<UndoPosRef> getPositionsInRange(Vector<UndoPosRef> v, int offset,
                                                       int length) {
         int n = marks.size();
         int end = offset + length;
-        Vector placeIn = (v == null) ? new Vector() : v;
+        Vector<UndoPosRef> placeIn = (v == null) ? new Vector<>() : v;
         for (int i = 0; i < n; i++) {
             PosRec mark = marks.elementAt(i);
             if (mark.unused) {
@@ -298,9 +298,9 @@
      *
      * @param positions the positions of the instances
      */
-    protected void updateUndoPositions(Vector positions) {
+    protected void updateUndoPositions(Vector<UndoPosRef> positions) {
         for(int counter = positions.size() - 1; counter >= 0; counter--) {
-            UndoPosRef ref = (UndoPosRef)positions.elementAt(counter);
+            UndoPosRef ref = positions.elementAt(counter);
             // Check if the Position is still valid.
             if(ref.rec.unused) {
                 positions.removeElementAt(counter);
@@ -437,7 +437,7 @@
         protected String string;
         // An array of instances of UndoPosRef for the Positions in the
         // range that was removed, valid after undo.
-        protected Vector posRefs;
+        protected Vector<UndoPosRef> posRefs;
     }
 
 
@@ -494,6 +494,6 @@
         protected String string;
         // An array of instances of UndoPosRef for the Positions in the
         // range that was removed, valid before undo.
-        protected Vector posRefs;
+        protected Vector<UndoPosRef> posRefs;
     }
 }
--- a/src/share/classes/javax/swing/text/StyleContext.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/StyleContext.java	Wed Jul 09 10:42:37 2014 -0700
@@ -589,7 +589,7 @@
                                          AttributeSet a) throws IOException {
         int n = a.getAttributeCount();
         out.writeInt(n);
-        Enumeration keys = a.getAttributeNames();
+        Enumeration<?> keys = a.getAttributeNames();
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
             if (key instanceof Serializable) {
@@ -771,7 +771,7 @@
         public SmallAttributeSet(AttributeSet attrs) {
             int n = attrs.getAttributeCount();
             Object[] tbl = new Object[2 * n];
-            Enumeration names = attrs.getAttributeNames();
+            Enumeration<?> names = attrs.getAttributeNames();
             int i = 0;
             while (names.hasMoreElements()) {
                 tbl[i] = names.nextElement();
@@ -971,7 +971,7 @@
         public boolean containsAttributes(AttributeSet attrs) {
             boolean result = true;
 
-            Enumeration names = attrs.getAttributeNames();
+            Enumeration<?> names = attrs.getAttributeNames();
             while (result && names.hasMoreElements()) {
                 Object name = names.nextElement();
                 result = attrs.getAttribute(name).equals(getAttribute(name));
@@ -1051,7 +1051,7 @@
             } else {
                 keys.removeAllElements();
                 data.removeAllElements();
-                Enumeration names = a.getAttributeNames();
+                Enumeration<?> names = a.getAttributeNames();
                 while (names.hasMoreElements()) {
                     Object name = names.nextElement();
                     addAttribute(name, a.getAttribute(name));
@@ -1117,7 +1117,7 @@
                     addAttribute(tbl[i], tbl[i+1]);
                 }
             } else {
-                Enumeration names = attr.getAttributeNames();
+                Enumeration<?> names = attr.getAttributeNames();
                 while (names.hasMoreElements()) {
                     Object name = names.nextElement();
                     addAttribute(name, attr.getAttribute(name));
@@ -1142,7 +1142,7 @@
         /**
          * Removes the set of keys from the set.
          */
-        public void removeAttributes(Enumeration names) {
+        public void removeAttributes(Enumeration<?> names) {
             while (names.hasMoreElements()) {
                 Object name = names.nextElement();
                 removeAttribute(name);
@@ -1153,7 +1153,7 @@
          * Removes the set of matching attributes from the set.
          */
         public void removeAttributes(AttributeSet attr) {
-            Enumeration names = attr.getAttributeNames();
+            Enumeration<?> names = attr.getAttributeNames();
             while (names.hasMoreElements()) {
                 Object name = names.nextElement();
                 Object value = attr.getAttribute(name);
--- a/src/share/classes/javax/swing/text/TextAction.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/TextAction.java	Wed Jul 09 10:42:37 2014 -0700
@@ -115,8 +115,8 @@
         }
         Action[] actions = new Action[h.size()];
         int index = 0;
-        for (Enumeration e = h.elements() ; e.hasMoreElements() ;) {
-            actions[index++] = (Action) e.nextElement();
+        for (Enumeration<Action> e = h.elements() ; e.hasMoreElements() ;) {
+            actions[index++] = e.nextElement();
         }
         return actions;
     }
--- a/src/share/classes/javax/swing/text/html/AccessibleHTML.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/AccessibleHTML.java	Wed Jul 09 10:42:37 2014 -0700
@@ -2740,7 +2740,7 @@
          * <code>child</code> isn't a valid child.
          */
         public int indexOf(ElementInfo child) {
-            ArrayList children = this.children;
+            ArrayList<ElementInfo> children = this.children;
 
             if (children != null) {
                 return children.indexOf(child);
--- a/src/share/classes/javax/swing/text/html/BlockView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/BlockView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -417,6 +417,11 @@
         cssHeight = (CSS.LengthValue) attr.getAttribute(CSS.Attribute.HEIGHT);
     }
 
+    /**
+     * Convenient method to get the StyleSheet.
+     *
+     * @return the StyleSheet
+     */
     protected StyleSheet getStyleSheet() {
         HTMLDocument doc = (HTMLDocument) getDocument();
         return doc.getStyleSheet();
--- a/src/share/classes/javax/swing/text/html/CSS.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/CSS.java	Wed Jul 09 10:42:37 2014 -0700
@@ -175,144 +175,285 @@
         private boolean inherited;
 
 
+        /**
+         * CSS attribute "background".
+         */
         public static final Attribute BACKGROUND =
             new Attribute("background", null, false);
 
+        /**
+         * CSS attribute "background-attachment".
+         */
         public static final Attribute BACKGROUND_ATTACHMENT =
             new Attribute("background-attachment", "scroll", false);
 
+        /**
+         * CSS attribute "background-color".
+         */
         public static final Attribute BACKGROUND_COLOR =
             new Attribute("background-color", "transparent", false);
 
+        /**
+         * CSS attribute "background-image".
+         */
         public static final Attribute BACKGROUND_IMAGE =
             new Attribute("background-image", "none", false);
 
+        /**
+         * CSS attribute "background-position".
+         */
         public static final Attribute BACKGROUND_POSITION =
             new Attribute("background-position", null, false);
 
+        /**
+         * CSS attribute "background-repeat".
+         */
         public static final Attribute BACKGROUND_REPEAT =
             new Attribute("background-repeat", "repeat", false);
 
+        /**
+         * CSS attribute "border".
+         */
         public static final Attribute BORDER =
             new Attribute("border", null, false);
 
+        /**
+         * CSS attribute "border-bottom".
+         */
         public static final Attribute BORDER_BOTTOM =
             new Attribute("border-bottom", null, false);
 
+        /**
+         * CSS attribute "border-bottom-color".
+         */
         public static final Attribute BORDER_BOTTOM_COLOR =
             new Attribute("border-bottom-color", null, false);
 
+        /**
+         * CSS attribute "border-bottom-style".
+         */
         public static final Attribute BORDER_BOTTOM_STYLE =
             new Attribute("border-bottom-style", "none", false);
 
+        /**
+         * CSS attribute "border-bottom-width".
+         */
         public static final Attribute BORDER_BOTTOM_WIDTH =
             new Attribute("border-bottom-width", "medium", false);
 
+        /**
+         * CSS attribute "border-color".
+         */
         public static final Attribute BORDER_COLOR =
             new Attribute("border-color", null, false);
 
+        /**
+         * CSS attribute "border-left".
+         */
         public static final Attribute BORDER_LEFT =
             new Attribute("border-left", null, false);
 
+        /**
+         * CSS attribute "margin-right".
+         */
         public static final Attribute BORDER_LEFT_COLOR =
             new Attribute("border-left-color", null, false);
 
+        /**
+         * CSS attribute "border-left-style".
+         */
         public static final Attribute BORDER_LEFT_STYLE =
             new Attribute("border-left-style", "none", false);
 
+        /**
+         * CSS attribute "border-left-width".
+         */
         public static final Attribute BORDER_LEFT_WIDTH =
             new Attribute("border-left-width", "medium", false);
 
+        /**
+         * CSS attribute "border-right".
+         */
         public static final Attribute BORDER_RIGHT =
             new Attribute("border-right", null, false);
 
+        /**
+         * CSS attribute "border-right-color".
+         */
         public static final Attribute BORDER_RIGHT_COLOR =
             new Attribute("border-right-color", null, false);
 
+        /**
+         * CSS attribute "border-right-style".
+         */
         public static final Attribute BORDER_RIGHT_STYLE =
             new Attribute("border-right-style", "none", false);
 
+        /**
+         * CSS attribute "border-right-width".
+         */
         public static final Attribute BORDER_RIGHT_WIDTH =
             new Attribute("border-right-width", "medium", false);
 
+        /**
+         * CSS attribute "border-style".
+         */
         public static final Attribute BORDER_STYLE =
             new Attribute("border-style", "none", false);
 
+        /**
+         * CSS attribute "border-top".
+         */
         public static final Attribute BORDER_TOP =
             new Attribute("border-top", null, false);
 
+        /**
+         * CSS attribute "border-top-color".
+         */
         public static final Attribute BORDER_TOP_COLOR =
             new Attribute("border-top-color", null, false);
 
+        /**
+         * CSS attribute "border-top-style".
+         */
         public static final Attribute BORDER_TOP_STYLE =
             new Attribute("border-top-style", "none", false);
 
+        /**
+         * CSS attribute "border-top-width".
+         */
         public static final Attribute BORDER_TOP_WIDTH =
             new Attribute("border-top-width", "medium", false);
 
+        /**
+         * CSS attribute "border-width".
+         */
         public static final Attribute BORDER_WIDTH =
             new Attribute("border-width", "medium", false);
 
+        /**
+         * CSS attribute "clear".
+         */
         public static final Attribute CLEAR =
             new Attribute("clear", "none", false);
 
+        /**
+         * CSS attribute "color".
+         */
         public static final Attribute COLOR =
             new Attribute("color", "black", true);
 
+        /**
+         * CSS attribute "display".
+         */
         public static final Attribute DISPLAY =
             new Attribute("display", "block", false);
 
+        /**
+         * CSS attribute "float".
+         */
         public static final Attribute FLOAT =
             new Attribute("float", "none", false);
 
+        /**
+         * CSS attribute "font".
+         */
         public static final Attribute FONT =
             new Attribute("font", null, true);
 
+        /**
+         * CSS attribute "font-family".
+         */
         public static final Attribute FONT_FAMILY =
             new Attribute("font-family", null, true);
 
+        /**
+         * CSS attribute "font-size".
+         */
         public static final Attribute FONT_SIZE =
             new Attribute("font-size", "medium", true);
 
+        /**
+         * CSS attribute "font-style".
+         */
         public static final Attribute FONT_STYLE =
             new Attribute("font-style", "normal", true);
 
+        /**
+         * CSS attribute "font-variant".
+         */
         public static final Attribute FONT_VARIANT =
             new Attribute("font-variant", "normal", true);
 
+        /**
+         * CSS attribute "font-weight".
+         */
         public static final Attribute FONT_WEIGHT =
             new Attribute("font-weight", "normal", true);
 
+        /**
+         * CSS attribute "height".
+         */
         public static final Attribute HEIGHT =
             new Attribute("height", "auto", false);
 
+        /**
+         * CSS attribute "letter-spacing".
+         */
         public static final Attribute LETTER_SPACING =
             new Attribute("letter-spacing", "normal", true);
 
+        /**
+         * CSS attribute "line-height".
+         */
         public static final Attribute LINE_HEIGHT =
             new Attribute("line-height", "normal", true);
 
+        /**
+         * CSS attribute "list-style".
+         */
         public static final Attribute LIST_STYLE =
             new Attribute("list-style", null, true);
 
+        /**
+         * CSS attribute "list-style-image".
+         */
         public static final Attribute LIST_STYLE_IMAGE =
             new Attribute("list-style-image", "none", true);
 
+        /**
+         * CSS attribute "list-style-position".
+         */
         public static final Attribute LIST_STYLE_POSITION =
             new Attribute("list-style-position", "outside", true);
 
+        /**
+         * CSS attribute "list-style-type".
+         */
         public static final Attribute LIST_STYLE_TYPE =
             new Attribute("list-style-type", "disc", true);
 
+        /**
+         * CSS attribute "margin".
+         */
         public static final Attribute MARGIN =
             new Attribute("margin", null, false);
 
+        /**
+         * CSS attribute "margin-bottom".
+         */
         public static final Attribute MARGIN_BOTTOM =
             new Attribute("margin-bottom", "0", false);
 
+        /**
+         * CSS attribute "margin-left".
+         */
         public static final Attribute MARGIN_LEFT =
             new Attribute("margin-left", "0", false);
 
+        /**
+         * CSS attribute "margin-right".
+         */
         public static final Attribute MARGIN_RIGHT =
             new Attribute("margin-right", "0", false);
 
@@ -338,45 +479,87 @@
                           Integer.toString(Integer.MIN_VALUE), false);
 
 
+        /**
+         * CSS attribute "margin-top".
+         */
         public static final Attribute MARGIN_TOP =
             new Attribute("margin-top", "0", false);
 
+        /**
+         * CSS attribute "padding".
+         */
         public static final Attribute PADDING =
             new Attribute("padding", null, false);
 
+        /**
+         * CSS attribute "padding-bottom".
+         */
         public static final Attribute PADDING_BOTTOM =
             new Attribute("padding-bottom", "0", false);
 
+        /**
+         * CSS attribute "padding-left".
+         */
         public static final Attribute PADDING_LEFT =
             new Attribute("padding-left", "0", false);
 
+        /**
+         * CSS attribute "padding-right".
+         */
         public static final Attribute PADDING_RIGHT =
             new Attribute("padding-right", "0", false);
 
+        /**
+         * CSS attribute "padding-top".
+         */
         public static final Attribute PADDING_TOP =
             new Attribute("padding-top", "0", false);
 
+        /**
+         * CSS attribute "text-align".
+         */
         public static final Attribute TEXT_ALIGN =
             new Attribute("text-align", null, true);
 
+        /**
+         * CSS attribute "text-decoration".
+         */
         public static final Attribute TEXT_DECORATION =
             new Attribute("text-decoration", "none", true);
 
+        /**
+         * CSS attribute "text-indent".
+         */
         public static final Attribute TEXT_INDENT =
             new Attribute("text-indent", "0", true);
 
+        /**
+         * CSS attribute "text-transform".
+         */
         public static final Attribute TEXT_TRANSFORM =
             new Attribute("text-transform", "none", true);
 
+        /**
+         * CSS attribute "vertical-align".
+         */
         public static final Attribute VERTICAL_ALIGN =
             new Attribute("vertical-align", "baseline", false);
 
+        /**
+         * CSS attribute "word-spacing".
+         */
         public static final Attribute WORD_SPACING =
             new Attribute("word-spacing", "normal", true);
 
+        /**
+         * CSS attribute "white-space".
+         */
         public static final Attribute WHITE_SPACE =
             new Attribute("white-space", "normal", true);
 
+        /**
+         * CSS attribute "width".
+         */
         public static final Attribute WIDTH =
             new Attribute("width", "auto", false);
 
@@ -480,6 +663,9 @@
         };
     }
 
+    /**
+     * Constructs a CSS object.
+     */
     public CSS() {
         baseFontSize = baseFontSizeIndex + 1;
         // setup the css conversion table
@@ -1370,7 +1556,7 @@
 
     private void translateEmbeddedAttributes(AttributeSet htmlAttrSet,
                                              MutableAttributeSet cssAttrSet) {
-        Enumeration keys = htmlAttrSet.getAttributeNames();
+        Enumeration<?> keys = htmlAttrSet.getAttributeNames();
         if (htmlAttrSet.getAttribute(StyleConstants.NameAttribute) ==
             HTML.Tag.HR) {
             // HR needs special handling due to us treating it as a leaf.
@@ -1393,7 +1579,7 @@
     private void translateAttributes(HTML.Tag tag,
                                             AttributeSet htmlAttrSet,
                                             MutableAttributeSet cssAttrSet) {
-        Enumeration names = htmlAttrSet.getAttributeNames();
+        Enumeration<?> names = htmlAttrSet.getAttributeNames();
         while (names.hasMoreElements()) {
             Object name = names.nextElement();
 
@@ -3342,7 +3528,7 @@
         s.defaultWriteObject();
 
         // Determine what values in valueConvertor need to be written out.
-        Enumeration keys = valueConvertor.keys();
+        Enumeration<?> keys = valueConvertor.keys();
         s.writeInt(valueConvertor.size());
         if (keys != null) {
             while (keys.hasMoreElements()) {
--- a/src/share/classes/javax/swing/text/html/FormSubmitEvent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/FormSubmitEvent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -40,19 +40,30 @@
     /**
      * Represents an HTML form method type.
      * <UL>
-     * <LI><code>GET</code> corresponds to the GET form method</LI>
-     * <LI><code>POST</code> corresponds to the POST from method</LI>
+     * <LI>{@code GET} corresponds to the GET form method</LI>
+     * <LI>{@code POST} corresponds to the POST from method</LI>
      * </UL>
      * @since 1.5
      */
-    public enum MethodType { GET, POST };
+    public enum MethodType {
+
+        /**
+         * {@code GET} corresponds to the GET form method
+         */
+        GET,
+
+        /**
+         * {@code POST} corresponds to the POST from method
+         */
+        POST
+    }
 
     /**
      * Creates a new object representing an html form submit event.
      *
      * @param source the object responsible for the event
      * @param type the event type
-     * @param actionURL the form action URL
+     * @param targetURL the form action URL
      * @param sourceElement the element that corresponds to the source
      *                      of the event
      * @param targetFrame the Frame to display the document in
--- a/src/share/classes/javax/swing/text/html/FormView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/FormView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -168,8 +168,8 @@
         } else if (t == HTML.Tag.SELECT) {
 
             if (model instanceof OptionListModel) {
-
-                JList list = new JList((ListModel) model);
+                @SuppressWarnings("unchecked")
+                JList<?> list = new JList<>((ListModel) model);
                 int size = HTML.getIntegerAttributeValue(attr,
                                                          HTML.Attribute.SIZE,
                                                          1);
@@ -177,7 +177,9 @@
                 list.setSelectionModel((ListSelectionModel)model);
                 c = new JScrollPane(list);
             } else {
-                c = new JComboBox((ComboBoxModel) model);
+                @SuppressWarnings("unchecked")
+                JComboBox<?> tmp = new JComboBox<>((ComboBoxModel) model);
+                c = tmp;
                 maxIsPreferred = 3;
             }
         } else if (t == HTML.Tag.TEXTAREA) {
@@ -342,7 +344,8 @@
             // BasicListUI$Handler.
             // For JComboBox, there are 2 stale ListDataListeners, which are
             // BasicListUI$Handler and BasicComboBoxUI$Handler.
-            AbstractListModel listModel = (AbstractListModel) model;
+            @SuppressWarnings("unchecked")
+            AbstractListModel<?> listModel = (AbstractListModel) model;
             String listenerClass1 =
                     "javax.swing.plaf.basic.BasicListUI$Handler";
             String listenerClass2 =
@@ -788,6 +791,7 @@
         }
         Object m = attr.getAttribute(StyleConstants.ModelAttribute);
         if (m instanceof OptionListModel) {
+            @SuppressWarnings("unchecked")
             OptionListModel<Option> model = (OptionListModel<Option>) m;
 
             for (int i = 0; i < model.getSize(); i++) {
@@ -797,7 +801,8 @@
                 }
             }
         } else if (m instanceof ComboBoxModel) {
-            ComboBoxModel model = (ComboBoxModel)m;
+            @SuppressWarnings("unchecked")
+            ComboBoxModel<?> model = (ComboBoxModel)m;
             Option option = (Option)model.getSelectedItem();
             if (option != null) {
                 appendBuffer(buffer, name, option.getValue());
@@ -904,7 +909,8 @@
                         } catch (BadLocationException e) {
                         }
                     } else if (m instanceof OptionListModel) {
-                        OptionListModel model = (OptionListModel) m;
+                        @SuppressWarnings("unchecked")
+                        OptionListModel<?> model = (OptionListModel) m;
                         int size = model.getSize();
                         for (int i = 0; i < size; i++) {
                             model.removeIndexInterval(i, i);
@@ -916,7 +922,8 @@
                             }
                         }
                     } else if (m instanceof OptionComboBoxModel) {
-                        OptionComboBoxModel model = (OptionComboBoxModel) m;
+                        @SuppressWarnings("unchecked")
+                        OptionComboBoxModel<?> model = (OptionComboBoxModel) m;
                         Option option = model.getInitialSelection();
                         if (option != null) {
                             model.setSelectedItem(option);
--- a/src/share/classes/javax/swing/text/html/HTML.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/HTML.java	Wed Jul 09 10:42:37 2014 -0700
@@ -156,79 +156,369 @@
 
         // --- Tag Names -----------------------------------
 
+        /**
+         * Tag &lt;a&gt;
+         */
         public static final Tag A = new Tag("a");
+
+        /**
+         * Tag &lt;address&gt;
+         */
         public static final Tag ADDRESS = new Tag("address");
+        /**
+         * Tag &lt;applet&gt;
+         */
         public static final Tag APPLET = new Tag("applet");
+
+        /**
+         * Tag &lt;area&gt;
+         */
         public static final Tag AREA = new Tag("area");
+
+        /**
+         * Tag &lt;b&gt;
+         */
         public static final Tag B = new Tag("b");
+
+        /**
+         * Tag &lt;base&gt;
+         */
         public static final Tag BASE = new Tag("base");
+
+        /**
+         * Tag &lt;basefont&gt;
+         */
         public static final Tag BASEFONT = new Tag("basefont");
+
+        /**
+         * Tag &lt;big&gt;
+         */
         public static final Tag BIG = new Tag("big");
+
+        /**
+         * Tag &lt;blockquote&gt;
+         */
         public static final Tag BLOCKQUOTE = new Tag("blockquote", true, true);
+
+        /**
+         * Tag &lt;body&gt;
+         */
         public static final Tag BODY = new Tag("body", true, true);
+
+        /**
+         * Tag &lt;br&gt;
+         */
         public static final Tag BR = new Tag("br", true, false);
+
+        /**
+         * Tag &lt;caption&gt;
+         */
         public static final Tag CAPTION = new Tag("caption");
+
+        /**
+         * Tag &lt;center&gt;
+         */
         public static final Tag CENTER = new Tag("center", true, false);
+
+        /**
+         * Tag &lt;cite&gt;
+         */
         public static final Tag CITE = new Tag("cite");
+
+        /**
+         * Tag &lt;code&gt;
+         */
         public static final Tag CODE = new Tag("code");
+
+        /**
+         * Tag &lt;dd&gt;
+         */
         public static final Tag DD = new Tag("dd", true, true);
+
+        /**
+         * Tag &lt;dfn&gt;
+         */
         public static final Tag DFN = new Tag("dfn");
+
+        /**
+         * Tag &lt;dir&gt;
+         */
         public static final Tag DIR = new Tag("dir", true, true);
+
+        /**
+         * Tag &lt;div&gt;
+         */
         public static final Tag DIV = new Tag("div", true, true);
+
+        /**
+         * Tag &lt;dl&gt;
+         */
         public static final Tag DL = new Tag("dl", true, true);
+
+        /**
+         * Tag &lt;dt&gt;
+         */
         public static final Tag DT = new Tag("dt", true, true);
+
+        /**
+         * Tag &lt;em&gt;
+         */
         public static final Tag EM = new Tag("em");
+
+        /**
+         * Tag &lt;font&gt;
+         */
         public static final Tag FONT = new Tag("font");
+
+        /**
+         * Tag &lt;form&gt;
+         */
         public static final Tag FORM = new Tag("form", true, false);
+
+        /**
+         * Tag &lt;frame&gt;
+         */
         public static final Tag FRAME = new Tag("frame");
+
+        /**
+         * Tag &lt;frameset&gt;
+         */
         public static final Tag FRAMESET = new Tag("frameset");
+
+        /**
+         * Tag &lt;h1&gt;
+         */
         public static final Tag H1 = new Tag("h1", true, true);
+
+        /**
+         * Tag &lt;h2&gt;
+         */
         public static final Tag H2 = new Tag("h2", true, true);
+
+        /**
+         * Tag &lt;h3&gt;
+         */
         public static final Tag H3 = new Tag("h3", true, true);
+
+        /**
+         * Tag &lt;h4&gt;
+         */
         public static final Tag H4 = new Tag("h4", true, true);
+
+        /**
+         * Tag &lt;h5&gt;
+         */
         public static final Tag H5 = new Tag("h5", true, true);
+
+        /**
+         * Tag &lt;h6&gt;
+         */
         public static final Tag H6 = new Tag("h6", true, true);
+
+        /**
+         * Tag &lt;head&gt;
+         */
         public static final Tag HEAD = new Tag("head", true, true);
+
+        /**
+         * Tag &lt;hr&gt;
+         */
         public static final Tag HR = new Tag("hr", true, false);
+
+        /**
+         * Tag &lt;html&gt;
+         */
         public static final Tag HTML = new Tag("html", true, false);
+
+        /**
+         * Tag &lt;i&gt;
+         */
         public static final Tag I = new Tag("i");
+
+        /**
+         * Tag &lt;img&gt;
+         */
         public static final Tag IMG = new Tag("img");
+
+        /**
+         * Tag &lt;input&gt;
+         */
         public static final Tag INPUT = new Tag("input");
+
+        /**
+         * Tag &lt;isindex&gt;
+         */
         public static final Tag ISINDEX = new Tag("isindex", true, false);
+
+        /**
+         * Tag &lt;kbd&gt;
+         */
         public static final Tag KBD = new Tag("kbd");
+
+        /**
+         * Tag &lt;li&gt;
+         */
         public static final Tag LI = new Tag("li", true, true);
+
+        /**
+         * Tag &lt;link&gt;
+         */
         public static final Tag LINK = new Tag("link");
+
+        /**
+         * Tag &lt;map&gt;
+         */
         public static final Tag MAP = new Tag("map");
+
+        /**
+         * Tag &lt;menu&gt;
+         */
         public static final Tag MENU = new Tag("menu", true, true);
+
+        /**
+         * Tag &lt;meta&gt;
+         */
         public static final Tag META = new Tag("meta");
         /*public*/ static final Tag NOBR = new Tag("nobr");
+
+        /**
+         * Tag &lt;noframes&gt;
+         */
         public static final Tag NOFRAMES = new Tag("noframes", true, true);
+
+        /**
+         * Tag &lt;object&gt;
+         */
         public static final Tag OBJECT = new Tag("object");
+
+        /**
+         * Tag &lt;ol&gt;
+         */
         public static final Tag OL = new Tag("ol", true, true);
+
+        /**
+         * Tag &lt;option&gt;
+         */
         public static final Tag OPTION = new Tag("option");
+
+        /**
+         * Tag &lt;p&gt;
+         */
         public static final Tag P = new Tag("p", true, true);
+
+        /**
+         * Tag &lt;param&gt;
+         */
         public static final Tag PARAM = new Tag("param");
+
+        /**
+         * Tag &lt;pre&gt;
+         */
         public static final Tag PRE = new Tag("pre", true, true);
+
+        /**
+         * Tag &lt;samp&gt;
+         */
         public static final Tag SAMP = new Tag("samp");
+
+        /**
+         * Tag &lt;script&gt;
+         */
         public static final Tag SCRIPT = new Tag("script");
+
+        /**
+         * Tag &lt;select&gt;
+         */
         public static final Tag SELECT = new Tag("select");
+
+        /**
+         * Tag &lt;small&gt;
+         */
         public static final Tag SMALL = new Tag("small");
+
+        /**
+         * Tag &lt;span&gt;
+         */
         public static final Tag SPAN = new Tag("span");
+
+        /**
+         * Tag &lt;strike&gt;
+         */
         public static final Tag STRIKE = new Tag("strike");
+
+        /**
+         * Tag &lt;s&gt;
+         */
         public static final Tag S = new Tag("s");
+
+        /**
+         * Tag &lt;strong&gt;
+         */
         public static final Tag STRONG = new Tag("strong");
+
+        /**
+         * Tag &lt;style&gt;
+         */
         public static final Tag STYLE = new Tag("style");
+
+        /**
+         * Tag &lt;sub&gt;
+         */
         public static final Tag SUB = new Tag("sub");
+
+        /**
+         * Tag &lt;sup&gt;
+         */
         public static final Tag SUP = new Tag("sup");
+
+        /**
+         * Tag &lt;table&gt;
+         */
         public static final Tag TABLE = new Tag("table", false, true);
+
+        /**
+         * Tag &lt;td&gt;
+         */
         public static final Tag TD = new Tag("td", true, true);
+
+        /**
+         * Tag &lt;textarea&gt;
+         */
         public static final Tag TEXTAREA = new Tag("textarea");
+
+        /**
+         * Tag &lt;th&gt;
+         */
         public static final Tag TH = new Tag("th", true, true);
+
+        /**
+         * Tag &lt;title&gt;
+         */
         public static final Tag TITLE = new Tag("title", true, true);
+
+        /**
+         * Tag &lt;tr&gt;
+         */
         public static final Tag TR = new Tag("tr", false, true);
+
+        /**
+         * Tag &lt;tt&gt;
+         */
         public static final Tag TT = new Tag("tt");
+
+        /**
+         * Tag &lt;u&gt;
+         */
         public static final Tag U = new Tag("u");
+
+        /**
+         * Tag &lt;ul&gt;
+         */
         public static final Tag UL = new Tag("ul", true, true);
+
+        /**
+         * Tag &lt;var&gt;
+         */
         public static final Tag VAR = new Tag("var");
 
         /**
@@ -281,6 +571,9 @@
         }
     }
 
+    /**
+     * Class represents unknown HTML tag.
+     */
     // There is no unique instance of UnknownTag, so we allow it to be
     // Serializable.
     @SuppressWarnings("serial") // Same-version serialization only
@@ -365,85 +658,405 @@
 
         private String name;
 
+
+        /**
+         * Attribute "size"
+         */
         public static final Attribute SIZE = new Attribute("size");
+
+        /**
+         * Attribute "color"
+         */
         public static final Attribute COLOR = new Attribute("color");
+
+        /**
+         * Attribute "clear"
+         */
         public static final Attribute CLEAR = new Attribute("clear");
+
+        /**
+         * Attribute "background"
+         */
         public static final Attribute BACKGROUND = new Attribute("background");
+
+        /**
+         * Attribute "bgcolor"
+         */
         public static final Attribute BGCOLOR = new Attribute("bgcolor");
+
+        /**
+         * Attribute "text"
+         */
         public static final Attribute TEXT = new Attribute("text");
+
+        /**
+         * Attribute "link"
+         */
         public static final Attribute LINK = new Attribute("link");
+
+        /**
+         * Attribute "vlink"
+         */
         public static final Attribute VLINK = new Attribute("vlink");
+
+        /**
+         * Attribute "alink"
+         */
         public static final Attribute ALINK = new Attribute("alink");
+
+        /**
+         * Attribute "width"
+         */
         public static final Attribute WIDTH = new Attribute("width");
+
+        /**
+         * Attribute "height"
+         */
         public static final Attribute HEIGHT = new Attribute("height");
+
+        /**
+         * Attribute "align"
+         */
         public static final Attribute ALIGN = new Attribute("align");
+
+        /**
+         * Attribute "name"
+         */
         public static final Attribute NAME = new Attribute("name");
+
+        /**
+         * Attribute "href"
+         */
         public static final Attribute HREF = new Attribute("href");
+
+        /**
+         * Attribute "rel"
+         */
         public static final Attribute REL = new Attribute("rel");
+
+        /**
+         * Attribute "rev"
+         */
         public static final Attribute REV = new Attribute("rev");
+
+        /**
+         * Attribute "title"
+         */
         public static final Attribute TITLE = new Attribute("title");
+
+        /**
+         * Attribute "target"
+         */
         public static final Attribute TARGET = new Attribute("target");
+
+        /**
+         * Attribute "shape"
+         */
         public static final Attribute SHAPE = new Attribute("shape");
+
+        /**
+         * Attribute "coords"
+         */
         public static final Attribute COORDS = new Attribute("coords");
+
+        /**
+         * Attribute "ismap"
+         */
         public static final Attribute ISMAP = new Attribute("ismap");
+
+        /**
+         * Attribute "nohref"
+         */
         public static final Attribute NOHREF = new Attribute("nohref");
+
+        /**
+         * Attribute "alt"
+         */
         public static final Attribute ALT = new Attribute("alt");
+
+        /**
+         * Attribute "id"
+         */
         public static final Attribute ID = new Attribute("id");
+
+        /**
+         * Attribute "src"
+         */
         public static final Attribute SRC = new Attribute("src");
+
+        /**
+         * Attribute "hspace"
+         */
         public static final Attribute HSPACE = new Attribute("hspace");
+
+        /**
+         * Attribute "vspace"
+         */
         public static final Attribute VSPACE = new Attribute("vspace");
+
+        /**
+         * Attribute "usemap"
+         */
         public static final Attribute USEMAP = new Attribute("usemap");
+
+        /**
+         * Attribute "lowsrc"
+         */
         public static final Attribute LOWSRC = new Attribute("lowsrc");
+
+        /**
+         * Attribute "codebase"
+         */
         public static final Attribute CODEBASE = new Attribute("codebase");
+
+        /**
+         * Attribute "code"
+         */
         public static final Attribute CODE = new Attribute("code");
+
+        /**
+         * Attribute "archive"
+         */
         public static final Attribute ARCHIVE = new Attribute("archive");
+
+        /**
+         * Attribute "value"
+         */
         public static final Attribute VALUE = new Attribute("value");
+
+        /**
+         * Attribute "valuetype"
+         */
         public static final Attribute VALUETYPE = new Attribute("valuetype");
+
+        /**
+         * Attribute "type"
+         */
         public static final Attribute TYPE = new Attribute("type");
+
+        /**
+         * Attribute "class"
+         */
         public static final Attribute CLASS = new Attribute("class");
+
+        /**
+         * Attribute "style"
+         */
         public static final Attribute STYLE = new Attribute("style");
+
+        /**
+         * Attribute "lang"
+         */
         public static final Attribute LANG = new Attribute("lang");
+
+        /**
+         * Attribute "face"
+         */
         public static final Attribute FACE = new Attribute("face");
+
+        /**
+         * Attribute "dir"
+         */
         public static final Attribute DIR = new Attribute("dir");
+
+        /**
+         * Attribute "declare"
+         */
         public static final Attribute DECLARE = new Attribute("declare");
+
+        /**
+         * Attribute "classid"
+         */
         public static final Attribute CLASSID = new Attribute("classid");
+
+        /**
+         * Attribute "data"
+         */
         public static final Attribute DATA = new Attribute("data");
+
+        /**
+         * Attribute "codetype"
+         */
         public static final Attribute CODETYPE = new Attribute("codetype");
+
+        /**
+         * Attribute "standby"
+         */
         public static final Attribute STANDBY = new Attribute("standby");
+
+        /**
+         * Attribute "border"
+         */
         public static final Attribute BORDER = new Attribute("border");
+
+        /**
+         * Attribute "shapes"
+         */
         public static final Attribute SHAPES = new Attribute("shapes");
+
+        /**
+         * Attribute "noshade"
+         */
         public static final Attribute NOSHADE = new Attribute("noshade");
+
+        /**
+         * Attribute "compact"
+         */
         public static final Attribute COMPACT = new Attribute("compact");
+
+        /**
+         * Attribute "start"
+         */
         public static final Attribute START = new Attribute("start");
+
+        /**
+         * Attribute "action"
+         */
         public static final Attribute ACTION = new Attribute("action");
+
+        /**
+         * Attribute "method"
+         */
         public static final Attribute METHOD = new Attribute("method");
+
+        /**
+         * Attribute "enctype"
+         */
         public static final Attribute ENCTYPE = new Attribute("enctype");
+
+        /**
+         * Attribute "checked"
+         */
         public static final Attribute CHECKED = new Attribute("checked");
+
+        /**
+         * Attribute "maxlength"
+         */
         public static final Attribute MAXLENGTH = new Attribute("maxlength");
+
+        /**
+         * Attribute "multiple"
+         */
         public static final Attribute MULTIPLE = new Attribute("multiple");
+
+        /**
+         * Attribute "selected"
+         */
         public static final Attribute SELECTED = new Attribute("selected");
+
+        /**
+         * Attribute "rows"
+         */
         public static final Attribute ROWS = new Attribute("rows");
+
+        /**
+         * Attribute "cols"
+         */
         public static final Attribute COLS = new Attribute("cols");
+
+        /**
+         * Attribute "dummy"
+         */
         public static final Attribute DUMMY = new Attribute("dummy");
+
+        /**
+         * Attribute "cellspacing"
+         */
         public static final Attribute CELLSPACING = new Attribute("cellspacing");
+
+        /**
+         * Attribute "cellpadding"
+         */
         public static final Attribute CELLPADDING = new Attribute("cellpadding");
+
+        /**
+         * Attribute "valign"
+         */
         public static final Attribute VALIGN = new Attribute("valign");
+
+        /**
+         * Attribute "halign"
+         */
         public static final Attribute HALIGN = new Attribute("halign");
+
+        /**
+         * Attribute "nowrap"
+         */
         public static final Attribute NOWRAP = new Attribute("nowrap");
+
+        /**
+         * Attribute "rowspan"
+         */
         public static final Attribute ROWSPAN = new Attribute("rowspan");
+
+        /**
+         * Attribute "colspan"
+         */
         public static final Attribute COLSPAN = new Attribute("colspan");
+
+        /**
+         * Attribute "prompt"
+         */
         public static final Attribute PROMPT = new Attribute("prompt");
+
+        /**
+         * Attribute "http-equiv"
+         */
         public static final Attribute HTTPEQUIV = new Attribute("http-equiv");
+
+        /**
+         * Attribute "content"
+         */
         public static final Attribute CONTENT = new Attribute("content");
+
+        /**
+         * Attribute "language"
+         */
         public static final Attribute LANGUAGE = new Attribute("language");
+
+        /**
+         * Attribute "version"
+         */
         public static final Attribute VERSION = new Attribute("version");
+
+        /**
+         * Attribute "n"
+         */
         public static final Attribute N = new Attribute("n");
+
+        /**
+         * Attribute "frameborder"
+         */
         public static final Attribute FRAMEBORDER = new Attribute("frameborder");
+
+        /**
+         * Attribute "marginwidth"
+         */
         public static final Attribute MARGINWIDTH = new Attribute("marginwidth");
+
+        /**
+         * Attribute "marginheight"
+         */
         public static final Attribute MARGINHEIGHT = new Attribute("marginheight");
+
+        /**
+         * Attribute "scrolling"
+         */
         public static final Attribute SCROLLING = new Attribute("scrolling");
+
+        /**
+         * Attribute "noresize"
+         */
         public static final Attribute NORESIZE = new Attribute("noresize");
+
+        /**
+         * Attribute "endtag"
+         */
         public static final Attribute ENDTAG = new Attribute("endtag");
+
+        /**
+         * Attribute "comment"
+         */
         public static final Attribute COMMENT = new Attribute("comment");
         static final Attribute MEDIA = new Attribute("media");
 
@@ -645,9 +1258,10 @@
         return value;
     }
 
-    //  This is used in cases where the value for the attribute has not
-    //  been specified.
-    //
+    /**
+     *  {@code NULL_ATTRIBUTE_VALUE} used in cases where the value for the attribute has not
+     *  been specified.
+     */
     public static final String NULL_ATTRIBUTE_VALUE = "#DEFAULT";
 
     // size determined similar to size of tagHashtable
--- a/src/share/classes/javax/swing/text/html/HTMLDocument.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Jul 09 10:42:37 2014 -0700
@@ -863,11 +863,13 @@
             Object     maps = getProperty(MAP_PROPERTY);
 
             if (maps == null) {
-                maps = new Hashtable(11);
+                maps = new Hashtable<>(11);
                 putProperty(MAP_PROPERTY, maps);
             }
             if (maps instanceof Hashtable) {
-                ((Hashtable)maps).put("#" + name, map);
+                @SuppressWarnings("unchecked")
+                Hashtable<Object, Object> tmp = (Hashtable)maps;
+                tmp.put("#" + name, map);
             }
         }
     }
@@ -910,11 +912,13 @@
      * @return the enumerated list of maps, or <code>null</code>
      *          if the maps are not an instance of <code>Hashtable</code>
      */
-    Enumeration getMaps() {
+    Enumeration<Object> getMaps() {
         Object     maps = getProperty(MAP_PROPERTY);
 
         if (maps instanceof Hashtable) {
-            return ((Hashtable)maps).elements();
+            @SuppressWarnings("unchecked")
+            Hashtable<Object, Object> tmp = (Hashtable) maps;
+            return tmp.elements();
         }
         return null;
     }
@@ -1493,7 +1497,7 @@
         else if (searchLeafAttributes && attr != null) {
             // For some leaf elements we store the actual attributes inside
             // the AttributeSet of the Element (such as anchors).
-            Enumeration names = attr.getAttributeNames();
+            Enumeration<?> names = attr.getAttributeNames();
             if (names != null) {
                 while (names.hasMoreElements()) {
                     Object name = names.nextElement();
@@ -2694,10 +2698,12 @@
                 return;
             }
             if (comments == null) {
-                comments = new Vector();
+                comments = new Vector<>();
                 putProperty(AdditionalComments, comments);
             }
-            ((Vector)comments).addElement(comment);
+            @SuppressWarnings("unchecked")
+            Vector<Object> v = (Vector<Object>)comments;
+            v.addElement(comment);
         }
 
         /**
@@ -2888,6 +2894,9 @@
 
         }
 
+        /**
+         * Action assigned by default to handle the Isindex task of the reader.
+         */
         public class IsindexAction extends TagAction {
 
             public void start(HTML.Tag t, MutableAttributeSet a) {
@@ -3128,7 +3137,9 @@
             }
         }
 
-
+        /**
+         * Action assigned by default to handle the Pre block task of the reader.
+         */
         public class PreAction extends BlockAction {
 
             public void start(HTML.Tag t, MutableAttributeSet attr) {
@@ -3439,6 +3450,7 @@
                     option = new Option(attr);
 
                     if (selectModel instanceof OptionListModel) {
+                        @SuppressWarnings("unchecked")
                         OptionListModel<Option> m = (OptionListModel<Option>) selectModel;
                         m.addElement(option);
                         if (option.isSelected()) {
@@ -3446,6 +3458,7 @@
                             m.setInitialSelection(optionCount);
                         }
                     } else if (selectModel instanceof OptionComboBoxModel) {
+                        @SuppressWarnings("unchecked")
                         OptionComboBoxModel<Option> m = (OptionComboBoxModel<Option>) selectModel;
                         m.addElement(option);
                         if (option.isSelected()) {
--- a/src/share/classes/javax/swing/text/html/HTMLEditorKit.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/HTMLEditorKit.java	Wed Jul 09 10:42:37 2014 -0700
@@ -238,7 +238,7 @@
      * be thrown. When inserting into a non-empty document all tags outside
      * of the body (head, title) will be dropped.
      *
-     * @param in  the stream to read from
+     * @param in the stream to read from
      * @param doc the destination for the insertion
      * @param pos the location in the document to place the
      *   content
@@ -269,14 +269,18 @@
     /**
      * Inserts HTML into an existing document.
      *
-     * @param doc       the document to insert into
-     * @param offset    the offset to insert HTML at
-     * @param popDepth  the number of ElementSpec.EndTagTypes to generate before
-     *        inserting
+     * @param doc the document to insert into
+     * @param offset the offset to insert HTML at
+     * @param popDepth the number of ElementSpec.EndTagTypes to generate
+     *                  before inserting
+     * @param html the HTML string
      * @param pushDepth the number of ElementSpec.StartTagTypes with a direction
-     *        of ElementSpec.JoinNextDirection that should be generated
-     *        before inserting, but after the end tags have been generated
+     *                  of ElementSpec.JoinNextDirection that should be generated
+     *                  before inserting, but after the end tags have been generated
      * @param insertTag the first tag to start inserting into document
+     *
+     * @throws BadLocationException if {@code offset} is invalid
+     * @throws IOException on I/O error
      * @exception RuntimeException (will eventually be a BadLocationException)
      *            if pos is invalid
      */
@@ -302,13 +306,13 @@
      * Write content from a document to the given stream
      * in a format appropriate for this kind of content handler.
      *
-     * @param out  the stream to write to
-     * @param doc  the source for the write
-     * @param pos  the location in the document to fetch the
+     * @param out the stream to write to
+     * @param doc the source for the write
+     * @param pos the location in the document to fetch the
      *   content
-     * @param len  the amount to write out
+     * @param len the amount to write out
      * @exception IOException on any I/O error
-     * @exception BadLocationException if pos represents an invalid
+     * @exception BadLocationException if {@code pos} represents an invalid
      *   location within the document
      */
     public void write(Writer out, Document doc, int pos, int len)
@@ -369,6 +373,8 @@
      * specified is shared by all HTMLEditorKit instances.
      * This should be reimplemented to provide a finer granularity
      * if desired.
+     *
+     * @param s a StyleSheet
      */
     public void setStyleSheet(StyleSheet s) {
         if (s == null) {
@@ -383,6 +389,8 @@
      * HTML elements.  By default the resource specified by
      * DEFAULT_CSS gets loaded, and is shared by all HTMLEditorKit
      * instances.
+     *
+     * @return the StyleSheet
      */
     public StyleSheet getStyleSheet() {
         AppContext appContext = AppContext.getAppContext();
@@ -412,7 +420,7 @@
      * to function when used in an applet.
      *
      * @param name the name of the resource, relative to the
-     *  HTMLEditorKit class
+     *             HTMLEditorKit class
      * @return a stream representing the resource
      */
     static InputStream getResourceAsStream(final String name) {
@@ -506,6 +514,8 @@
     /**
      * Sets the default cursor.
      *
+     * @param cursor a cursor
+     *
      * @since 1.3
      */
     public void setDefaultCursor(Cursor cursor) {
@@ -515,6 +525,8 @@
     /**
      * Returns the default cursor.
      *
+     * @return the cursor
+     *
      * @since 1.3
      */
     public Cursor getDefaultCursor() {
@@ -524,6 +536,8 @@
     /**
      * Sets the cursor to use over links.
      *
+     * @param cursor a cursor
+     *
      * @since 1.3
      */
     public void setLinkCursor(Cursor cursor) {
@@ -532,6 +546,9 @@
 
     /**
      * Returns the cursor to use over hyper links.
+     *
+     * @return the cursor
+     *
      * @since 1.3
      */
     public Cursor getLinkCursor() {
@@ -557,6 +574,8 @@
      * automatically or only <code>FormSubmitEvent</code> is fired.
      * By default it is set to true.
      *
+     * @param isAuto if {@code true}, html form submission is processed automatically.
+     *
      * @see #isAutoFormSubmission()
      * @see FormSubmitEvent
      * @since 1.5
@@ -586,11 +605,13 @@
      * to avoid the overhead of loading the default parser if
      * it's not used.  The default parser is the HotJava parser
      * using an HTML 3.2 DTD.
+     *
+     * @return the parser
      */
     protected Parser getParser() {
         if (defaultParser == null) {
             try {
-                Class c = Class.forName("javax.swing.text.html.parser.ParserDelegator");
+                Class<?> c = Class.forName("javax.swing.text.html.parser.ParserDelegator");
                 defaultParser = (Parser) c.newInstance();
             } catch (Throwable e) {
             }
@@ -972,6 +993,9 @@
          * with the results of the parse.  This method should
          * be implemented to be thread-safe.
          *
+         * @param r a reader
+         * @param cb a parser callback
+         * @param ignoreCharSet if {@code true} charset is ignoring
          * @throws IOException if an I/O exception occurs
          */
         public abstract void parse(Reader r, ParserCallback cb, boolean ignoreCharSet) throws IOException;
@@ -1000,26 +1024,78 @@
          */
         public static final Object IMPLIED = "_implied_";
 
-
+        /**
+         * The last method called on the reader. It allows
+         * any pending changes to be flushed into the document.
+         * Since this is currently loading synchronously, the entire
+         * set of changes are pushed in at this point.
+         *
+         * @throws BadLocationException if the given position does not
+         *   represent a valid location in the associated document.
+         */
         public void flush() throws BadLocationException {
         }
 
+        /**
+         * Called by the parser to indicate a block of text was
+         * encountered.
+         *
+         * @param data a data
+         * @param pos a position
+         */
         public void handleText(char[] data, int pos) {
         }
 
+        /**
+         * Called by the parser to indicate a block of comment was
+         * encountered.
+         *
+         * @param data a data
+         * @param pos a position
+         */
         public void handleComment(char[] data, int pos) {
         }
 
+        /**
+         * Callback from the parser. Route to the appropriate
+         * handler for the tag.
+         *
+         * @param t an HTML tag
+         * @param a a set of attributes
+         * @param pos a position
+         */
         public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) {
         }
 
+        /**
+         * Callback from the parser. Route to the appropriate
+         * handler for the tag.
+         *
+         * @param t an HTML tag
+         * @param pos a position
+         */
         public void handleEndTag(HTML.Tag t, int pos) {
         }
 
+        /**
+         * Callback from the parser. Route to the appropriate
+         * handler for the tag.
+         *
+         * @param t an HTML tag
+         * @param a a set of attributes
+         * @param pos a position
+         */
         public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos) {
         }
 
-        public void handleError(String errorMsg, int pos){
+        /**
+         * Callback from the parser. Route to the appropriate
+         * handler for the error.
+         *
+         * @param errorMsg a error message
+         * @param pos a position
+         */
+        public void handleError(String errorMsg, int pos) {
         }
 
         /**
@@ -1489,6 +1565,12 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static abstract class HTMLTextAction extends StyledTextAction {
+
+        /**
+         * Creates a new HTMLTextAction from a string action name.
+         *
+         * @param name the name of the action
+         */
         public HTMLTextAction(String name) {
             super(name);
         }
@@ -1575,6 +1657,12 @@
         /**
          * Returns the deepest element at <code>offset</code> matching
          * <code>tag</code>.
+         *
+         * @param doc an instance of HTMLDocument
+         * @param offset the specified offset &gt;= 0
+         * @param tag an instance of HTML.Tag
+         *
+         * @return the deepest element
          */
         protected Element findElementMatchingTag(HTMLDocument doc, int offset,
                                                  HTML.Tag tag) {
@@ -1611,11 +1699,30 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class InsertHTMLTextAction extends HTMLTextAction {
+
+        /**
+         * Creates a new InsertHTMLTextAction.
+         *
+         * @param name a name of the action
+         * @param html an HTML string
+         * @param parentTag a parent tag
+         * @param addTag the first tag to start inserting into document
+         */
         public InsertHTMLTextAction(String name, String html,
                                     HTML.Tag parentTag, HTML.Tag addTag) {
             this(name, html, parentTag, addTag, null, null);
         }
 
+        /**
+         * Creates a new InsertHTMLTextAction.
+         *
+         * @param name a name of the action
+         * @param html an HTML string
+         * @param parentTag a parent tag
+         * @param addTag the first tag to start inserting into document
+         * @param alternateParentTag an alternative parent tag
+         * @param alternateAddTag an alternative tag
+         */
         public InsertHTMLTextAction(String name, String html,
                                     HTML.Tag parentTag,
                                     HTML.Tag addTag,
@@ -1644,6 +1751,17 @@
         /**
          * A cover for HTMLEditorKit.insertHTML. If an exception it
          * thrown it is wrapped in a RuntimeException and thrown.
+         *
+         * @param editor an instance of JEditorPane
+         * @param doc the document to insert into
+         * @param offset the offset to insert HTML at
+         * @param html an HTML string
+         * @param popDepth the number of ElementSpec.EndTagTypes to generate
+         *                  before inserting
+         * @param pushDepth the number of ElementSpec.StartTagTypes with a direction
+         *                  of ElementSpec.JoinNextDirection that should be generated
+         *                  before inserting, but after the end tags have been generated
+         * @param addTag the first tag to start inserting into document
          */
         protected void insertHTML(JEditorPane editor, HTMLDocument doc,
                                   int offset, String html, int popDepth,
@@ -1663,7 +1781,17 @@
          * This is invoked when inserting at a boundary. It determines
          * the number of pops, and then the number of pushes that need
          * to be performed, and then invokes insertHTML.
+         *
+         * @param editor an instance of JEditorPane
+         * @param doc an instance of HTMLDocument
+         * @param offset an offset to start from
+         * @param insertElement an instance of Element
+         * @param html an HTML string
+         * @param parentTag a parent tag
+         * @param addTag the first tag to start inserting into document
+         *
          * @since 1.3
+         *
          */
         protected void insertAtBoundary(JEditorPane editor, HTMLDocument doc,
                                         int offset, Element insertElement,
@@ -1678,6 +1806,14 @@
          * the number of pops, and then the number of pushes that need
          * to be performed, and then invokes insertHTML.
          * @deprecated As of Java 2 platform v1.3, use insertAtBoundary
+         *
+         * @param editor an instance of JEditorPane
+         * @param doc an instance of HTMLDocument
+         * @param offset an offset to start from
+         * @param insertElement an instance of Element
+         * @param html an HTML string
+         * @param parentTag a parent tag
+         * @param addTag the first tag to start inserting into document
          */
         @Deprecated
         protected void insertAtBoundry(JEditorPane editor, HTMLDocument doc,
@@ -1874,7 +2010,7 @@
      * Returns the object in an AttributeSet matching a key
      */
     static private Object getAttrValue(AttributeSet attr, HTML.Attribute key) {
-        Enumeration names = attr.getAttributeNames();
+        Enumeration<?> names = attr.getAttributeNames();
         while (names.hasMoreElements()) {
             Object nextKey = names.nextElement();
             Object nextVal = attr.getAttribute(nextKey);
@@ -2050,7 +2186,7 @@
              * @param offs0 the starting model offset &ge; 0
              * @param offs1 the ending model offset &ge; offs1
              * @param bounds the bounding box of the view, which is not
-             *        necessarily the region to paint.
+             *               necessarily the region to paint.
              * @param c the editor
              * @param view View painting for
              * @return region in which drawing occurred
--- a/src/share/classes/javax/swing/text/html/HTMLWriter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/HTMLWriter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -254,7 +254,7 @@
         convAttr.removeAttributes(convAttr);
         convertToHTML32(attr, convAttr);
 
-        Enumeration names = convAttr.getAttributeNames();
+        Enumeration<?> names = convAttr.getAttributeNames();
         while (names.hasMoreElements()) {
             Object name = names.nextElement();
             if (name instanceof HTML.Tag ||
@@ -361,8 +361,10 @@
      * Writes out a start tag for the element.
      * Ignores all synthesized elements.
      *
-     * @param elem   an Element
-     * @exception IOException on any I/O error
+     * @param elem an Element
+     * @throws IOException on any I/O error
+     * @throws BadLocationException if pos represents an invalid
+     *            location within the document.
      */
     protected void startTag(Element elem) throws IOException, BadLocationException {
 
@@ -527,6 +529,7 @@
         Object model = attr.getAttribute(StyleConstants.ModelAttribute);
         incrIndent();
         if (model instanceof OptionListModel) {
+            @SuppressWarnings("unchecked")
             OptionListModel<Option> listModel = (OptionListModel<Option>) model;
             int size = listModel.getSize();
             for (int i = 0; i < size; i++) {
@@ -534,6 +537,7 @@
                 writeOption(option);
             }
         } else if (model instanceof OptionComboBoxModel) {
+            @SuppressWarnings("unchecked")
             OptionComboBoxModel<Option> comboBoxModel = (OptionComboBoxModel<Option>) model;
             int size = comboBoxModel.getSize();
             for (int i = 0; i < size; i++) {
@@ -657,7 +661,7 @@
                                         (HTMLDocument.AdditionalComments);
 
         if (comments instanceof Vector) {
-            Vector v = (Vector)comments;
+            Vector<?> v = (Vector)comments;
             for (int counter = 0, maxCounter = v.size(); counter < maxCounter;
                  counter++) {
                 writeComment(v.elementAt(counter).toString());
@@ -667,9 +671,12 @@
 
 
     /**
-     * Returns true if the element is a
+     * Returns {@code true} if the element is a
      * synthesized element.  Currently we are only testing
      * for the p-implied tag.
+     *
+     * @param elem an element
+     * @return {@code true} if the element is a synthesized element.
      */
     protected boolean synthesizedElement(Element elem) {
         if (matchNameAttribute(elem.getAttributes(), HTML.Tag.IMPLIED)) {
@@ -682,6 +689,10 @@
     /**
      * Returns true if the StyleConstants.NameAttribute is
      * equal to the tag that is passed in as a parameter.
+     *
+     * @param attr a set of attributes
+     * @param tag an HTML tag
+     * @return {@code true} if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter.
      */
     protected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag) {
         Object o = attr.getAttribute(StyleConstants.NameAttribute);
@@ -700,6 +711,7 @@
      * so that when appropriate the corresponding end tags can be
      * written out.
      *
+     * @param attr a set of attributes
      * @exception IOException on any I/O error
      */
     protected void writeEmbeddedTags(AttributeSet attr) throws IOException {
@@ -707,7 +719,7 @@
         // translate css attributes to html
         attr = convertToHTML(attr, oConvAttr);
 
-        Enumeration names = attr.getAttributeNames();
+        Enumeration<?> names = attr.getAttributeNames();
         while (names.hasMoreElements()) {
             Object name = names.nextElement();
             if (name instanceof HTML.Tag) {
@@ -754,6 +766,7 @@
      * then the tag is removed from the vector and a corresponding
      * end tag is written out.
      *
+     * @param attr a set of attributes
      * @exception IOException on any I/O error
      */
     protected void closeOutUnwantedEmbeddedTags(AttributeSet attr) throws IOException {
@@ -848,7 +861,7 @@
      * Outputs the maps as elements. Maps are not stored as elements in
      * the document, and as such this is used to output them.
      */
-    void writeMaps(Enumeration maps) throws IOException {
+    void writeMaps(Enumeration<?> maps) throws IOException {
         if (maps != null) {
             while(maps.hasMoreElements()) {
                 Map map = (Map)maps.nextElement();
@@ -896,7 +909,7 @@
      */
     void writeStyles(StyleSheet sheet) throws IOException {
         if (sheet != null) {
-            Enumeration styles = sheet.getStyleNames();
+            Enumeration<?> styles = sheet.getStyleNames();
             if (styles != null) {
                 boolean outputStyle = false;
                 while (styles.hasMoreElements()) {
@@ -922,7 +935,7 @@
     boolean writeStyle(String name, Style style, boolean outputStyle)
                  throws IOException{
         boolean didOutputStyle = false;
-        Enumeration attributes = style.getAttributeNames();
+        Enumeration<?> attributes = style.getAttributeNames();
         if (attributes != null) {
             while (attributes.hasMoreElements()) {
                 Object attribute = attributes.nextElement();
@@ -1032,7 +1045,7 @@
         if (from == null) {
             return;
         }
-        Enumeration keys = from.getAttributeNames();
+        Enumeration<?> keys = from.getAttributeNames();
         String value = "";
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
@@ -1139,7 +1152,7 @@
      * attribute.
      */
     private static void convertToHTML40(AttributeSet from, MutableAttributeSet to) {
-        Enumeration keys = from.getAttributeNames();
+        Enumeration<?> keys = from.getAttributeNames();
         String value = "";
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
--- a/src/share/classes/javax/swing/text/html/ImageView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/ImageView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -141,9 +141,11 @@
     }
 
     /**
-     * Returns the text to display if the image can't be loaded. This is
+     * Returns the text to display if the image cannot be loaded. This is
      * obtained from the Elements attribute set with the attribute name
      * <code>HTML.Attribute.ALT</code>.
+     *
+     * @return the test to display if the image cannot be loaded.
      */
     public String getAltText() {
         return (String)getElement().getAttributes().getAttribute
@@ -153,6 +155,8 @@
     /**
      * Return a URL for the image source,
      * or null if it could not be determined.
+     *
+     * @return the URL for the image source, or null if it could not be determined.
      */
     public URL getImageURL() {
         String src = (String)getElement().getAttributes().
@@ -171,7 +175,9 @@
     }
 
     /**
-     * Returns the icon to use if the image couldn't be found.
+     * Returns the icon to use if the image could not be found.
+     *
+     * @return the icon to use if the image could not be found.
      */
     public Icon getNoImageIcon() {
         return (Icon) UIManager.getLookAndFeelDefaults().get(MISSING_IMAGE);
@@ -179,6 +185,8 @@
 
     /**
      * Returns the icon to use while in the process of loading the image.
+     *
+     * @return the icon to use while in the process of loading the image.
      */
     public Icon getLoadingImageIcon() {
         return (Icon) UIManager.getLookAndFeelDefaults().get(PENDING_IMAGE);
@@ -186,6 +194,8 @@
 
     /**
      * Returns the image to render.
+     *
+     * @return the image to render.
      */
     public Image getImage() {
         sync();
@@ -205,9 +215,12 @@
 
     /**
      * Sets how the image is loaded. If <code>newValue</code> is true,
-     * the image we be loaded when first asked for, otherwise it will
+     * the image will be loaded when first asked for, otherwise it will
      * be loaded asynchronously. The default is to not load synchronously,
      * that is to load the image asynchronously.
+     *
+     * @param newValue if {@code true} the image will be loaded when first asked for,
+     *                 otherwise it will be asynchronously.
      */
     public void setLoadsSynchronously(boolean newValue) {
         synchronized(this) {
@@ -221,14 +234,18 @@
     }
 
     /**
-     * Returns true if the image should be loaded when first asked for.
+     * Returns {@code true} if the image should be loaded when first asked for.
+     *
+     * @return {@code true} if the image should be loaded when first asked for.
      */
     public boolean getLoadsSynchronously() {
         return ((state & SYNC_LOAD_FLAG) != 0);
     }
 
     /**
-     * Convenience method to get the StyleSheet.
+     * Convenient method to get the StyleSheet.
+     *
+     * @return the StyleSheet
      */
     protected StyleSheet getStyleSheet() {
         HTMLDocument doc = (HTMLDocument) getDocument();
@@ -613,7 +630,7 @@
     }
 
     /**
-     * Convenience method for getting an integer attribute from the elements
+     * Convenient method for getting an integer attribute from the elements
      * AttributeSet.
      */
     private int getIntAttr(HTML.Attribute name, int deflt) {
@@ -691,10 +708,11 @@
         URL src = getImageURL();
         Image newImage = null;
         if (src != null) {
-            Dictionary cache = (Dictionary)getDocument().
-                                    getProperty(IMAGE_CACHE_PROPERTY);
+            @SuppressWarnings("unchecked")
+            Dictionary<URL, Image> cache = (Dictionary)getDocument().
+                getProperty(IMAGE_CACHE_PROPERTY);
             if (cache != null) {
-                newImage = (Image)cache.get(src);
+                newImage = cache.get(src);
             }
             else {
                 newImage = Toolkit.getDefaultToolkit().createImage(src);
--- a/src/share/classes/javax/swing/text/html/InlineView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/InlineView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -214,7 +214,11 @@
         }
     }
 
-
+    /**
+     * Convenient method to get the StyleSheet.
+     *
+     * @return the StyleSheet
+     */
     protected StyleSheet getStyleSheet() {
         HTMLDocument doc = (HTMLDocument) getDocument();
         return doc.getStyleSheet();
--- a/src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -155,7 +155,7 @@
      * @exception IOException on any I/O error
      */
     protected void writeAttributes(AttributeSet attr) throws IOException {
-        Enumeration attributeNames = attr.getAttributeNames();
+        Enumeration<?> attributeNames = attr.getAttributeNames();
         while (attributeNames.hasMoreElements()) {
             Object name = attributeNames.nextElement();
             if ((name instanceof StyleConstants.ParagraphConstants) ||
@@ -195,6 +195,7 @@
      * Writes out a start tag appropriately
      * indented.  Also increments the indent level.
      *
+     * @param tag a start tag
      * @exception IOException on any I/O error
      */
     protected void writeStartTag(String tag) throws IOException {
@@ -209,6 +210,7 @@
      * Writes out an end tag appropriately
      * indented.  Also decrements the indent level.
      *
+     * @param endTag an end tag
      * @exception IOException on any I/O error
      */
     protected void writeEndTag(String endTag) throws IOException {
@@ -255,7 +257,7 @@
          *  stylenames.
          */
         DefaultStyledDocument styledDoc =  ((DefaultStyledDocument)getDocument());
-        Enumeration styleNames = styledDoc.getStyleNames();
+        Enumeration<?> styleNames = styledDoc.getStyleNames();
 
         while (styleNames.hasMoreElements()) {
             Style s = styledDoc.getStyle((String)styleNames.nextElement());
@@ -284,7 +286,9 @@
      * branch elements or leaf elements.  This method specially handles
      * leaf elements that are text.
      *
-     * @exception IOException on any I/O error
+     * @throws IOException on any I/O error
+     * @throws BadLocationException if we are in an invalid
+     *            location within the document.
      */
     protected void writeBody() throws IOException, BadLocationException {
         ElementIterator it = getElementIterator();
@@ -354,6 +358,7 @@
      * &lt;p&gt; tag and sets its value to be the name of the
      * style.
      *
+     * @param elem an element
      * @exception IOException on any I/O error
      */
     protected void writeStartParagraph(Element elem) throws IOException {
@@ -371,6 +376,7 @@
      * Responsible for writing out other non-text leaf
      * elements.
      *
+     * @param elem an element
      * @exception IOException on any I/O error
      */
     protected void writeLeaf(Element elem) throws IOException {
@@ -392,7 +398,8 @@
      * In certain cases it could be a URL, in others it could
      * be read from a stream.
      *
-     * @param elem element of type StyleConstants.IconElementName
+     * @param elem an element of type StyleConstants.IconElementName
+     * @throws IOException if I/O error occured.
      */
     protected void writeImage(Element elem) throws IOException {
     }
@@ -402,6 +409,9 @@
      * Responsible for handling Component Elements;
      * deliberately unimplemented.
      * How this method is implemented is a matter of policy.
+     *
+     * @param elem an element of type StyleConstants.ComponentElementName
+     * @throws IOException if I/O error occured.
      */
     protected void writeComponent(Element elem) throws IOException {
     }
@@ -410,6 +420,8 @@
     /**
      * Returns true if the element is a text element.
      *
+     * @param elem an element
+     * @return {@code true} if the element is a text element.
      */
     protected boolean isText(Element elem) {
         return (elem.getName() == AbstractDocument.ContentElementName);
@@ -420,6 +432,8 @@
      * Writes out the attribute set
      * in an HTML-compliant manner.
      *
+     * @param elem an element
+     * @param needsIndenting indention will be added if {@code needsIndenting} is {@code true}
      * @exception IOException on any I/O error
      * @exception BadLocationException if pos represents an invalid
      *            location within the document.
@@ -442,6 +456,7 @@
      * bold &lt;b&gt;, italic &lt;i&gt;, and &lt;u&gt; tags for the
      * text based on its attribute settings.
      *
+     * @param attr a set of attributes
      * @exception IOException on any I/O error
      */
 
@@ -553,6 +568,7 @@
      * style attribute is set to contain the list of remaining
      * attributes just like inline styles.
      *
+     * @param attr a set of attributes
      * @exception IOException on any I/O error
      */
     protected void writeNonHTMLAttributes(AttributeSet attr) throws IOException {
@@ -608,6 +624,8 @@
 
     /**
      * Returns true if we are currently in a &lt;font&gt; tag.
+     *
+     * @return {@code true} if we are currently in a &lt;font&gt; tag.
      */
     protected boolean inFontTag() {
         return (fontAttributes != null);
@@ -636,6 +654,7 @@
      * any enclosing font tag before writing out a
      * new start tag.
      *
+     * @param style a font style
      * @exception IOException on any I/O error
      */
     protected void startFontTag(String style) throws IOException {
--- a/src/share/classes/javax/swing/text/html/MuxingAttributeSet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/MuxingAttributeSet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -213,7 +213,7 @@
      * @return the attribute names
      * @see AttributeSet#getAttributeNames
      */
-    public Enumeration getAttributeNames() {
+    public Enumeration<?> getAttributeNames() {
         return new MuxingAttributeNameEnumeration();
     }
 
@@ -240,7 +240,7 @@
     public boolean containsAttributes(AttributeSet attrs) {
         boolean result = true;
 
-        Enumeration names = attrs.getAttributeNames();
+        Enumeration<?> names = attrs.getAttributeNames();
         while (result && names.hasMoreElements()) {
             Object name = names.nextElement();
             result = attrs.getAttribute(name).equals(getAttribute(name));
@@ -268,7 +268,7 @@
      * An Enumeration of the Attribute names in a MuxingAttributeSet.
      * This may return the same name more than once.
      */
-    private class MuxingAttributeNameEnumeration implements Enumeration {
+    private class MuxingAttributeNameEnumeration implements Enumeration<Object> {
 
         MuxingAttributeNameEnumeration() {
             updateEnum();
@@ -307,6 +307,6 @@
         /** Index into attrs the current Enumeration came from. */
         private int attrIndex;
         /** Enumeration from attrs. */
-        private Enumeration currentEnum;
+        private Enumeration<?> currentEnum;
     }
 }
--- a/src/share/classes/javax/swing/text/html/ObjectView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/ObjectView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -91,8 +91,8 @@
         String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID);
         try {
             ReflectUtil.checkPackageAccess(classname);
-            Class c = Class.forName(classname, true,Thread.currentThread().
-                                    getContextClassLoader());
+            Class<?> c = Class.forName(classname, true,Thread.currentThread().
+                                       getContextClassLoader());
             Object o = c.newInstance();
             if (o instanceof Component) {
                 Component comp = (Component) o;
@@ -125,7 +125,7 @@
      * &lt;object&gt; element.
      */
     private void setParameters(Component comp, AttributeSet attr) {
-        Class k = comp.getClass();
+        Class<?> k = comp.getClass();
         BeanInfo bi;
         try {
             bi = Introspector.getBeanInfo(k);
@@ -145,7 +145,7 @@
                     // read-only property. ignore
                     return;     // for now
                 }
-                Class[] params = writer.getParameterTypes();
+                Class<?>[] params = writer.getParameterTypes();
                 if (params.length != 1) {
                     // zero or more than one argument, ignore
                     return;     // for now
--- a/src/share/classes/javax/swing/text/html/Option.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/Option.java	Wed Jul 09 10:42:37 2014 -0700
@@ -61,6 +61,8 @@
 
     /**
      * Sets the label to be used for the option.
+     *
+     * @param label a label.
      */
     public void setLabel(String label) {
         this.label = label;
@@ -68,6 +70,8 @@
 
     /**
      * Fetch the label associated with the option.
+     *
+     * @return the label associated with the option.
      */
     public String getLabel() {
         return label;
@@ -75,6 +79,8 @@
 
     /**
      * Fetch the attributes associated with this option.
+     *
+     * @return the attributes associated with this option.
      */
     public AttributeSet getAttributes() {
         return attr;
@@ -89,6 +95,8 @@
 
     /**
      * Sets the selected state.
+     *
+     * @param state a selection state
      */
     protected void setSelection(boolean state) {
         selected = state;
@@ -96,16 +104,21 @@
 
     /**
      * Fetches the selection state associated with this option.
+     *
+     * @return the selection state.
      */
     public boolean isSelected() {
         return selected;
     }
 
     /**
-     * Convenience method to return the string associated
-     * with the <code>value</code> attribute.  If the
-     * value has not been specified, the label will be
+     * Convenient method to return the string associated
+     * with the {@code value} attribute. If the
+     * {@code value} has not been specified, the {@code label} will be
      * returned.
+     *
+     * @return the string associated with the {@code value} attribute,
+     * or {@code label} if the value has been not specified.
      */
     public String getValue() {
         String value = (String) attr.getAttribute(HTML.Attribute.VALUE);
--- a/src/share/classes/javax/swing/text/html/OptionListModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/OptionListModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -40,7 +40,7 @@
  * It also stores the initial state of the JList, to ensure an
  * accurate reset, if the user requests a reset of the form.
  *
-  @author Sunita Mani
+ * @author Sunita Mani
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 class OptionListModel<E> extends DefaultListModel<E> implements ListSelectionModel, Serializable {
@@ -469,7 +469,8 @@
      *    and (b) define a <code>clone</code> method
      */
     public Object clone() throws CloneNotSupportedException {
-        OptionListModel clone = (OptionListModel)super.clone();
+        @SuppressWarnings("unchecked")
+        OptionListModel<E> clone = (OptionListModel)super.clone();
         clone.value = (BitSet)value.clone();
         clone.listenerList = new EventListenerList();
         return clone;
--- a/src/share/classes/javax/swing/text/html/ParagraphView.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/ParagraphView.java	Wed Jul 09 10:42:37 2014 -0700
@@ -128,6 +128,11 @@
         }
     }
 
+    /**
+     * Convenient method to get the StyleSheet.
+     *
+     * @return the StyleSheet
+     */
     protected StyleSheet getStyleSheet() {
         HTMLDocument doc = (HTMLDocument) getDocument();
         return doc.getStyleSheet();
--- a/src/share/classes/javax/swing/text/html/StyleSheet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/StyleSheet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -156,7 +156,7 @@
     // . When one of the AttributeSets is mutated by way of a
     //   StyleConstants key, all the associated CSS keys are removed. This is
     //   done so that the two representations don't get out of sync. For
-    //   example, if the developer adds StyleConsants.BOLD, FALSE to an
+    //   example, if the developer adds StyleConstants.BOLD, FALSE to an
     //   AttributeSet that contains HTML.Tag.B, the HTML.Tag.B entry will
     //   be removed.
 
@@ -192,6 +192,7 @@
 
         try {
             // Build an array of all the parent elements.
+            @SuppressWarnings("unchecked")
             Vector<Element> searchContext = sb.getVector();
 
             for (Element p = e; p != null; p = p.getParentElement()) {
@@ -270,6 +271,9 @@
      * with a selector "table p" and a new rule was added with a selector
      * of "p" the returned Style would include the new attributes from
      * the rule "p".
+     *
+     * @param selector a space separated String of the element names.
+     * @return the rule that best matches the selector.
      */
     public Style getRule(String selector) {
         selector = cleanSelectorString(selector);
@@ -284,6 +288,8 @@
      * Adds a set of rules to the sheet.  The rules are expected to
      * be in valid CSS format.  Typically this would be called as
      * a result of parsing a &lt;style&gt; tag.
+     *
+     * @param rule a set of rules
      */
     public void addRule(String rule) {
         if (rule != null) {
@@ -315,6 +321,9 @@
      * Translates a CSS declaration to an AttributeSet that represents
      * the CSS declaration.  Typically this would be called as a
      * result of encountering an HTML style attribute.
+     *
+     * @param decl a CSS declaration
+     * @return a set of attributes that represents the CSS declaration.
      */
     public AttributeSet getDeclaration(String decl) {
         if (decl == null) {
@@ -334,6 +343,7 @@
      *  location of the stream and may be null.  All relative
      *  URLs specified in the stream will be based upon this
      *  parameter.
+     * @throws java.io.IOException if I/O error occured.
      */
     public void loadRules(Reader in, URL ref) throws IOException {
         CssParser parser = new CssParser();
@@ -344,6 +354,9 @@
      * Fetches a set of attributes to use in the view for
      * displaying.  This is basically a set of attributes that
      * can be used for View.getAttributes.
+     *
+     * @param v a view
+     * @return the of attributes
      */
     public AttributeSet getViewAttributes(View v) {
         return new ViewAttributeSet(v);
@@ -388,6 +401,7 @@
      * any previously added style sheets. An added StyleSheet will never
      * override the rules of the receiving style sheet.
      *
+     * @param ss a StyleSheet
      * @since 1.3
      */
     public void addStyleSheet(StyleSheet ss) {
@@ -410,6 +424,7 @@
     /**
      * Removes the StyleSheet <code>ss</code> from those of the receiver.
      *
+     * @param ss a StyleSheet
      * @since 1.3
      */
     public void removeStyleSheet(StyleSheet ss) {
@@ -435,6 +450,7 @@
      * Returns an array of the linked StyleSheets. Will return null
      * if there are no linked StyleSheets.
      *
+     * @return an array of StyleSheets.
      * @since 1.3
      */
     public StyleSheet[] getStyleSheets() {
@@ -458,6 +474,7 @@
      * to become part of the receiver, create a new StyleSheet and use
      * addStyleSheet to link it in.
      *
+     * @param url an url
      * @since 1.3
      */
     public void importStyleSheet(URL url) {
@@ -480,6 +497,7 @@
      * Sets the base. All import statements that are relative, will be
      * relative to <code>base</code>.
      *
+     * @param base a base.
      * @since 1.3
      */
     public void setBase(URL base) {
@@ -489,6 +507,7 @@
     /**
      * Returns the base.
      *
+     * @return the base.
      * @since 1.3
      */
     public URL getBase() {
@@ -498,6 +517,9 @@
     /**
      * Adds a CSS attribute to the given set.
      *
+     * @param attr a set of attributes
+     * @param key a CSS property
+     * @param value an HTML attribute value
      * @since 1.3
      */
     public void addCSSAttribute(MutableAttributeSet attr, CSS.Attribute key,
@@ -508,6 +530,11 @@
     /**
      * Adds a CSS attribute to the given set.
      *
+     * @param attr a set of attributes
+     * @param key a CSS property
+     * @param value an HTML attribute value
+     * @return {@code true} if an HTML attribute {@code value} can be converted
+     *         to a CSS attribute, false otherwise.
      * @since 1.3
      */
     public boolean addCSSAttributeFromHTML(MutableAttributeSet attr,
@@ -527,6 +554,7 @@
      * set of CSS attributes.
      *
      * @param htmlAttrSet AttributeSet containing the HTML attributes.
+     * @return the set of CSS attributes.
      */
     public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet) {
         AttributeSet cssAttrSet = css.translateHTMLToCSS(htmlAttrSet);
@@ -693,7 +721,7 @@
     private AttributeSet removeHTMLTags(AttributeSet old, AttributeSet attr) {
         if (!(attr instanceof LargeConversionSet) &&
             !(attr instanceof SmallConversionSet)) {
-            Enumeration names = attr.getAttributeNames();
+            Enumeration<?> names = attr.getAttributeNames();
 
             while (names.hasMoreElements()) {
                 Object key = names.nextElement();
@@ -726,14 +754,14 @@
         // in most cases, there are no StyleConstants attributes
         // so we iterate the collection of keys to avoid creating
         // a new set.
-        Enumeration names = a.getAttributeNames();
+        Enumeration<?> names = a.getAttributeNames();
         while (names.hasMoreElements()) {
             Object name = names.nextElement();
             if (name instanceof StyleConstants) {
                 // we really need to do a conversion, iterate again
                 // building a new set.
                 MutableAttributeSet converted = new LargeConversionSet();
-                Enumeration keys = a.getAttributeNames();
+                Enumeration<?> keys = a.getAttributeNames();
                 while (keys.hasMoreElements()) {
                     Object key = keys.nextElement();
                     Object cssValue = null;
@@ -917,6 +945,9 @@
     /**
      * Fetches the box formatter to use for the given set
      * of CSS attributes.
+     *
+     * @param a a set of CSS attributes
+     * @return the box formatter.
      */
     public BoxPainter getBoxPainter(AttributeSet a) {
         return new BoxPainter(a, css, this);
@@ -925,6 +956,9 @@
     /**
      * Fetches the list formatter to use for the given set
      * of CSS attributes.
+     *
+     * @param a a set of CSS attributes
+     * @return the list formatter.
      */
     public ListPainter getListPainter(AttributeSet a) {
         return new ListPainter(a, this);
@@ -932,6 +966,8 @@
 
     /**
      * Sets the base font size, with valid values between 1 and 7.
+     *
+     * @param sz a font size.
      */
     public void setBaseFontSize(int sz) {
         css.setBaseFontSize(sz);
@@ -941,17 +977,29 @@
      * Sets the base font size from the passed in String. The string
      * can either identify a specific font size, with legal values between
      * 1 and 7, or identify a relative font size such as +1 or -2.
+     *
+     * @param size a font size.
      */
     public void setBaseFontSize(String size) {
         css.setBaseFontSize(size);
     }
 
+    /**
+     *
+     * Returns the index of HTML/CSS size model.
+     *
+     * @param pt a size of point
+     * @return the index of HTML/CSS size model.
+     */
     public static int getIndexOfSize(float pt) {
         return CSS.getIndexOfSize(pt, sizeMapDefault);
     }
 
     /**
      * Returns the point size, given a size index.
+     *
+     * @param index a size index
+     * @return the point size value.
      */
     public float getPointSize(int index) {
         return css.getPointSize(index, this);
@@ -960,6 +1008,9 @@
     /**
      *  Given a string such as "+2", "-2", or "2",
      *  returns a point size value.
+     *
+     * @param size a CSS string describing font size
+     * @return the point size value.
      */
     public float getPointSize(String size) {
         return css.getPointSize(size, this);
@@ -970,6 +1021,9 @@
      * Note: This will only convert the HTML3.2 color strings
      *       or a string of length 7;
      *       otherwise, it will return null.
+     *
+     * @param string color string such as "RED" or "#NNNNNN"
+     * @return the color
      */
     public Color stringToColor(String string) {
         return CSS.stringToColor(string);
@@ -1078,6 +1132,7 @@
     String[] getSimpleSelectors(String selector) {
         selector = cleanSelectorString(selector);
         SearchBuffer sb = SearchBuffer.obtainSearchBuffer();
+        @SuppressWarnings("unchecked")
         Vector<String> selectors = sb.getVector();
         int lastIndex = 0;
         int length = selector.length();
@@ -1256,7 +1311,7 @@
      * create the resolved style, if necessary.
      */
     private synchronized Style getResolvedStyle(String selector,
-                                                Vector elements,
+                                                Vector<Element> elements,
                                                 HTML.Tag t) {
         Style retStyle = resolvedStyles.get(selector);
         if (retStyle == null) {
@@ -1368,7 +1423,9 @@
                                       String[] tags,
                                       String[] ids, String[] classes) {
         SearchBuffer sb = SearchBuffer.obtainSearchBuffer();
+        @SuppressWarnings("unchecked")
         Vector<SelectorMapping> tempVector = sb.getVector();
+        @SuppressWarnings("unchecked")
         Hashtable<SelectorMapping, SelectorMapping> tempHashtable = sb.getHashtable();
         // Determine all the Styles that are appropriate, placing them
         // in tempVector
@@ -1452,7 +1509,7 @@
      * @param t         the Tag to use for
      *                  the first Element in <code>elements</code>
      */
-    private Style createResolvedStyle(String selector, Vector elements,
+    private Style createResolvedStyle(String selector, Vector<Element> elements,
                                       HTML.Tag t) {
         int numElements = elements.size();
         // Build three arrays, one for tags, one for class's, and one for
@@ -1461,7 +1518,7 @@
         String ids[] = new String[numElements];
         String classes[] = new String[numElements];
         for (int counter = 0; counter < numElements; counter++) {
-            Element e = (Element)elements.elementAt(counter);
+            Element e = elements.elementAt(counter);
             AttributeSet attr = e.getAttributes();
             if (counter == 0 && e.isLeaf()) {
                 // For leafs, we use the second tier attributes.
@@ -1513,6 +1570,7 @@
     private Style createResolvedStyle(String selector) {
         SearchBuffer sb = SearchBuffer.obtainSearchBuffer();
         // Will contain the tags, ids, and classes, in that order.
+        @SuppressWarnings("unchecked")
         Vector<String> elements = sb.getVector();
         try {
             boolean done;
@@ -1678,6 +1736,7 @@
      * releaseSearchBuffer to get a SearchBuffer, and release it when
      * done.
      */
+    @SuppressWarnings("rawtypes")
     private static class SearchBuffer {
         /** A stack containing instances of SearchBuffer. Used in getting
          * rules. */
@@ -1816,6 +1875,7 @@
          * @param v the view making the request.  This is
          *  used to get the AttributeSet, and may be used to
          *  resolve percentage arguments.
+         * @return the inset needed for the margin, border and padding.
          * @exception IllegalArgumentException for an invalid direction
          */
         public float getInset(int side, View v) {
@@ -2630,6 +2690,7 @@
             // implementation.
             Document doc = v.getDocument();
             SearchBuffer sb = SearchBuffer.obtainSearchBuffer();
+            @SuppressWarnings("unchecked")
             Vector<AttributeSet> muxList = sb.getVector();
             try {
                 if (doc instanceof HTMLDocument) {
@@ -2642,7 +2703,7 @@
                         muxList.addElement(htmlAttr);
                     }
                     if (elem.isLeaf()) {
-                        Enumeration keys = a.getAttributeNames();
+                        Enumeration<?> keys = a.getAttributeNames();
                         while (keys.hasMoreElements()) {
                             Object key = keys.nextElement();
                             if (key instanceof HTML.Tag) {
--- a/src/share/classes/javax/swing/text/html/parser/AttributeList.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/AttributeList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -47,11 +47,35 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public final
 class AttributeList implements DTDConstants, Serializable {
+
+    /**
+     * The attribute name
+     */
     public String name;
+
+    /**
+     * The attribute type
+     */
     public int type;
+
+    /**
+     * The possible attribute values
+     */
     public Vector<?> values;
+
+    /**
+     * The attribute modifier
+     */
     public int modifier;
+
+    /**
+     * The default attribute value
+     */
     public String value;
+
+    /**
+     * The next attribute in the list
+     */
     public AttributeList next;
 
     AttributeList() {
@@ -171,11 +195,23 @@
         attributeTypes.put("implied", Integer.valueOf(IMPLIED));
     }
 
+    /**
+     * Converts an attribute name to the type
+     *
+     * @param nm an attribute name
+     * @return the type
+     */
     public static int name2type(String nm) {
         Integer i = (Integer)attributeTypes.get(nm);
         return (i == null) ? CDATA : i.intValue();
     }
 
+    /**
+     * Converts a type to the attribute name
+     *
+     * @param tp a type
+     * @return the attribute name
+     */
     public static String type2name(int tp) {
         return (String)attributeTypes.get(Integer.valueOf(tp));
     }
--- a/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -57,6 +57,9 @@
      */
     public ContentModel next;
 
+    /**
+     * Creates {@code ContentModel}
+     */
     public ContentModel() {
     }
 
--- a/src/share/classes/javax/swing/text/html/parser/DTD.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/DTD.java	Wed Jul 09 10:42:37 2014 -0700
@@ -57,27 +57,91 @@
  */
 public
 class DTD implements DTDConstants {
+
+    /**
+     * the name of the DTD
+     */
     public String name;
+
+    /**
+     * The vector of elements
+     */
     public Vector<Element> elements = new Vector<Element>();
+
+    /**
+     * The hash table contains the name of element and
+     * the corresponding element.
+     */
     public Hashtable<String,Element> elementHash
         = new Hashtable<String,Element>();
+
+    /**
+     * The hash table contains an {@code Object} and the corresponding {@code Entity}
+     */
     public Hashtable<Object,Entity> entityHash
         = new Hashtable<Object,Entity>();
+
+    /**
+     * The element corresponding to pcdata.
+     */
     public final Element pcdata = getElement("#pcdata");
+
+    /**
+     * The element corresponding to html.
+     */
     public final Element html = getElement("html");
+
+    /**
+     * The element corresponding to meta.
+     */
     public final Element meta = getElement("meta");
+
+    /**
+     * The element corresponding to base.
+     */
     public final Element base = getElement("base");
+
+    /**
+     * The element corresponding to isindex.
+     */
     public final Element isindex = getElement("isindex");
+
+    /**
+     * The element corresponding to head.
+     */
     public final Element head = getElement("head");
+
+    /**
+     * The element corresponding to body.
+     */
     public final Element body = getElement("body");
+
+    /**
+     * The element corresponding to applet.
+     */
     public final Element applet = getElement("applet");
+
+    /**
+     * The element corresponding to param.
+     */
     public final Element param = getElement("param");
+
+    /**
+     * The element corresponding to p.
+     */
     public final Element p = getElement("p");
+
+    /**
+     * The element corresponding to title.
+     */
     public final Element title = getElement("title");
     final Element style = getElement("style");
     final Element link = getElement("link");
     final Element script = getElement("script");
 
+    /**
+     * The version of a file
+     */
     public static final int FILE_VERSION = 1;
 
     /**
@@ -344,6 +408,12 @@
      */
     private static final Object DTD_HASH_KEY = new Object();
 
+    /**
+     * Put a name and appropriate DTD to hashtable.
+     *
+     * @param name the name of the DTD
+     * @param dtd the DTD
+     */
     public static void putDTDHash(String name, DTD dtd) {
         getDtdHash().put(name, dtd);
     }
@@ -370,6 +440,7 @@
     private static Hashtable<String, DTD> getDtdHash() {
         AppContext appContext = AppContext.getAppContext();
 
+        @SuppressWarnings("unchecked")
         Hashtable<String, DTD> result = (Hashtable<String, DTD>) appContext.get(DTD_HASH_KEY);
 
         if (result == null) {
--- a/src/share/classes/javax/swing/text/html/parser/DTDConstants.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/DTDConstants.java	Wed Jul 09 10:42:37 2014 -0700
@@ -37,46 +37,186 @@
 public
 interface DTDConstants {
     // Attribute value types
+
+    /**
+     * The DTD constant corresponds to CDATA
+     */
     int CDATA           = 1;
+
+    /**
+     * The DTD constant corresponds to ENTITY
+     */
     int ENTITY          = 2;
+
+    /**
+     * The DTD constant corresponds to ENTITIES
+     */
     int ENTITIES        = 3;
+
+    /**
+     * The DTD constant corresponds to ID
+     */
     int ID              = 4;
+
+    /**
+     * The DTD constant corresponds to IDREF
+     */
     int IDREF           = 5;
+
+    /**
+     * The DTD constant corresponds to IDREFS
+     */
     int IDREFS          = 6;
+
+    /**
+     * The DTD constant corresponds to NAME
+     */
     int NAME            = 7;
+
+    /**
+     * The DTD constant corresponds to NAMES
+     */
     int NAMES           = 8;
+
+    /**
+     * The DTD constant corresponds to NMTOKEN
+     */
     int NMTOKEN         = 9;
+
+    /**
+     * The DTD constant corresponds to NMTOKENS
+     */
     int NMTOKENS        = 10;
+
+    /**
+     * The DTD constant corresponds to NOTATION
+     */
     int NOTATION        = 11;
+
+    /**
+     * The DTD constant corresponds to NUMBER
+     */
     int NUMBER          = 12;
+
+    /**
+     * The DTD constant corresponds to NUMBERS
+     */
     int NUMBERS         = 13;
+
+    /**
+     * The DTD constant corresponds to NUTOKEN
+     */
     int NUTOKEN         = 14;
+
+    /**
+     * The DTD constant corresponds to NUTOKENS
+     */
     int NUTOKENS        = 15;
 
     // Content model types
+
+    /**
+     * The DTD constant corresponds to RCDATA
+     */
     int RCDATA          = 16;
+
+    /**
+     * The DTD constant corresponds to EMPTY
+     */
     int EMPTY           = 17;
+
+    /**
+     * The DTD constant corresponds to MODEL
+     */
     int MODEL           = 18;
+
+    /**
+     * The DTD constant corresponds to ANY
+     */
     int ANY             = 19;
 
     // Attribute value modifiers
+
+    /**
+     * The DTD constant corresponds to FIXED
+     */
     int FIXED           = 1;
+
+    /**
+     * The DTD constant corresponds to REQUIRED
+     */
     int REQUIRED        = 2;
+
+    /**
+     * The DTD constant corresponds to CURRENT
+     */
     int CURRENT         = 3;
+
+    /**
+     * The DTD constant corresponds to CONREF
+     */
     int CONREF          = 4;
+
+    /**
+     * The DTD constant corresponds to IMPLIED
+     */
     int IMPLIED         = 5;
 
     // Entity types
+
+    /**
+     * The DTD constant corresponds to PUBLIC
+     */
     int PUBLIC          = 10;
+
+    /**
+     * The DTD constant corresponds to SDATA
+     */
     int SDATA           = 11;
+
+    /**
+     * The DTD constant corresponds to PI
+     */
     int PI              = 12;
+
+    /**
+     * The DTD constant corresponds to STARTTAG
+     */
     int STARTTAG        = 13;
+
+    /**
+     * The DTD constant corresponds to ENDTAG
+     */
     int ENDTAG          = 14;
+
+    /**
+     * The DTD constant corresponds to MS
+     */
     int MS              = 15;
+
+    /**
+     * The DTD constant corresponds to MD
+     */
     int MD              = 16;
+
+    /**
+     * The DTD constant corresponds to SYSTEM
+     */
     int SYSTEM          = 17;
 
+    /**
+     * The DTD constant corresponds to GENERAL
+     */
+
     int GENERAL         = 1<<16;
+
+    /**
+     * The DTD constant corresponds to DEFAULT
+     */
     int DEFAULT         = 1<<17;
+
+    /**
+     * The DTD constant corresponds to PARAMETER
+     */
     int PARAMETER       = 1<<18;
 }
--- a/src/share/classes/javax/swing/text/html/parser/DocumentParser.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/DocumentParser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -112,11 +112,24 @@
     private boolean ignoreCharSet = false;
     private static final boolean debugFlag = false;
 
+    /**
+     * Creates document parser with the specified {@code dtd}.
+     *
+     * @param dtd the dtd.
+     */
     public DocumentParser(DTD dtd) {
         super(dtd);
     }
 
-    public void parse(Reader in,  HTMLEditorKit.ParserCallback callback, boolean ignoreCharSet) throws IOException {
+    /**
+     * Parse an HTML stream, given a DTD.
+     *
+     * @param in the reader to read the source from
+     * @param callback the callback
+     * @param ignoreCharSet if {@code true} the charset is ignored
+     * @throws IOException if an I/O error occurs
+     */
+    public void parse(Reader in, HTMLEditorKit.ParserCallback callback, boolean ignoreCharSet) throws IOException {
         this.ignoreCharSet = ignoreCharSet;
         this.callback = callback;
         parse(in);
--- a/src/share/classes/javax/swing/text/html/parser/Element.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/Element.java	Wed Jul 09 10:42:37 2014 -0700
@@ -43,14 +43,50 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public final
 class Element implements DTDConstants, Serializable {
+
+    /**
+     * The element index
+     */
     public int index;
+
+    /**
+     * The name of the element
+     */
     public String name;
+
+    /**
+     * {@code true} if the start tag can be omitted
+     */
     public boolean oStart;
+
+    /**
+     * {@code true} if the end tag can be omitted
+     */
     public boolean oEnd;
+
+    /**
+     * The set of elements that can occur inside the element
+     */
     public BitSet inclusions;
+
+    /**
+     * The set of elements that must not occur inside the element
+     */
     public BitSet exclusions;
+
+    /**
+     * The element type
+     */
     public int type = ANY;
+
+    /**
+     * The content model
+     */
     public ContentModel content;
+
+    /**
+     * The attributes
+     */
     public AttributeList atts;
 
     /**
@@ -208,6 +244,14 @@
         contentTypes.put("ANY", Integer.valueOf(ANY));
     }
 
+    /**
+     * Converts {@code nm} to type. Returns appropriate DTDConstants
+     * if the {@code nm} is equal to CDATA, RCDATA, EMPTY or ANY, 0 otherwise.
+     *
+     * @param nm a name
+     * @return appropriate DTDConstants if the {@code nm} is equal to
+     * CDATA, RCDATA, EMPTY or ANY, 0 otherwise.
+     */
     public static int name2type(String nm) {
         Integer val = contentTypes.get(nm);
         return (val != null) ? val.intValue() : 0;
--- a/src/share/classes/javax/swing/text/html/parser/Entity.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/Entity.java	Wed Jul 09 10:42:37 2014 -0700
@@ -42,8 +42,19 @@
  */
 public final
 class Entity implements DTDConstants {
+    /**
+     * The name of the entity.
+     */
     public String name;
+
+    /**
+     * The type of the entity.
+     */
     public int type;
+
+    /**
+     * The char array of data.
+     */
     public char data[];
 
     /**
--- a/src/share/classes/javax/swing/text/html/parser/Parser.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/Parser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -88,6 +88,9 @@
     private char str[] = new char[128];
     private int strpos = 0;
 
+    /**
+     * The dtd.
+     */
     protected DTD dtd = null;
 
     private int ch;
@@ -198,6 +201,11 @@
         376    // &#159;
     };
 
+    /**
+     * Creates parser with the specified {@code dtd}.
+     *
+     * @param dtd the dtd.
+     */
     public Parser(DTD dtd) {
         this.dtd = dtd;
     }
@@ -421,12 +429,32 @@
         handleError(ln, err + " " + arg1 + " " + arg2 + " " + arg3);
     }
 
+    /**
+     * Invokes the error handler with the 3rd error message argument "?".
+     *
+     * @param err   the error type
+     * @param arg1  the 1st error message argument
+     * @param arg2  the 2nd error message argument
+     */
     protected void error(String err, String arg1, String arg2) {
         error(err, arg1, arg2, "?");
     }
+
+    /**
+     * Invokes the error handler with the 2nd and 3rd error message argument "?".
+     *
+     * @param err   the error type
+     * @param arg1  the 1st error message argument
+     */
     protected void error(String err, String arg1) {
         error(err, arg1, "?", "?");
     }
+
+    /**
+     * Invokes the error handler with the 1st, 2nd and 3rd error message argument "?".
+     *
+     * @param err   the error type
+     */
     protected void error(String err) {
         error(err, "?", "?", "?");
     }
@@ -2407,6 +2435,11 @@
     }
 
 
+    /**
+     * Returns the current position.
+     *
+     * @return the current position
+     */
     protected int getCurrentPos() {
         return currentPosition;
     }
--- a/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,6 +48,9 @@
 public class ParserDelegator extends HTMLEditorKit.Parser implements Serializable {
     private static final Object DTD_KEY = new Object();
 
+    /**
+     * Sets the default DTD.
+     */
     protected static void setDefaultDTD() {
         getDefaultDTD();
     }
@@ -75,6 +78,13 @@
         return dtd;
     }
 
+    /**
+     * Recreates a DTD from an archived format with the specified {@code name}.
+     *
+     * @param dtd a DTD
+     * @param name the name of the resource, relative to the  ParserDelegator class.
+     * @return the DTD with the specified {@code name}.
+     */
     protected static DTD createDTD(DTD dtd, String name) {
 
         InputStream in = null;
@@ -92,7 +102,9 @@
         return dtd;
     }
 
-
+    /**
+     * Creates {@code ParserDelegator} with default DTD.
+     */
     public ParserDelegator() {
         setDefaultDTD();
     }
@@ -109,7 +121,7 @@
      *
      * @param name the name of the resource, relative to the
      *  ParserDelegator class.
-     * @returns a stream representing the resource
+     * @return a stream representing the resource
      */
     static InputStream getResourceAsStream(final String name) {
         return AccessController.doPrivileged(
--- a/src/share/classes/javax/swing/text/html/parser/TagElement.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/TagElement.java	Wed Jul 09 10:42:37 2014 -0700
@@ -39,10 +39,21 @@
     HTML.Tag htmlTag;
     boolean insertedByErrorRecovery;
 
-    public TagElement ( Element elem ) {
+    /**
+     * Creates a generic HTML TagElement class with {@code fictional} equals to {@code false}.
+     *
+     * @param elem an element
+     */
+    public TagElement(Element elem) {
         this(elem, false);
     }
 
+    /**
+     * Creates a generic HTML TagElement class.
+     *
+     * @param elem an element
+     * @param fictional if {@code true} the tag is inserted by error recovery.
+     */
     public TagElement (Element elem, boolean fictional) {
         this.elem = elem;
         htmlTag = HTML.getTag(elem.getName());
@@ -52,22 +63,52 @@
         insertedByErrorRecovery = fictional;
     }
 
+    /**
+     * Returns {@code true} if this tag causes a
+     * line break to the flow of data, otherwise returns
+     * {@code false}.
+     *
+     * @return {@code true} if this tag causes a
+     *   line break to the flow of data, otherwise returns
+     *   {@code false}
+     */
     public boolean breaksFlow() {
         return htmlTag.breaksFlow();
     }
 
+    /**
+     * Returns {@code true} if this tag is pre-formatted.
+     *
+     * @return {@code true} if this tag is pre-formatted,
+     *   otherwise returns {@code false}
+     */
     public boolean isPreformatted() {
         return htmlTag.isPreformatted();
     }
 
+    /**
+     * Returns the element.
+     *
+     * @return the element
+     */
     public Element getElement() {
         return elem;
     }
 
+    /**
+     * Returns the tag constant corresponding to the name of the {@code element}
+     *
+     * @return the tag constant corresponding to the name of the {@code element}
+     */
     public HTML.Tag getHTMLTag() {
         return htmlTag;
     }
 
+    /**
+     * Returns {@code true} if the tag is fictional.
+     *
+     * @return {@code true} if the tag is fictional.
+     */
     public boolean fictional() {
         return insertedByErrorRecovery;
     }
--- a/src/share/classes/javax/swing/text/rtf/MockAttributeSet.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/rtf/MockAttributeSet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -74,7 +74,7 @@
 
     public void addAttributes(AttributeSet attr)
     {
-        Enumeration as = attr.getAttributeNames();
+        Enumeration<?> as = attr.getAttributeNames();
         while(as.hasMoreElements()) {
             Object el = as.nextElement();
             backing.put(el, attr.getAttribute(el));
@@ -102,7 +102,7 @@
     }
 
 
-    public Enumeration getAttributeNames()
+    public Enumeration<?> getAttributeNames()
     {
          return backing.keys();
     }
--- a/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -96,13 +96,13 @@
     static {
         MagicToken = new Object();
 
-        Dictionary textKeywordDictionary = RTFReader.textKeywords;
-        Enumeration keys = textKeywordDictionary.keys();
+        Dictionary<String, String> textKeywordDictionary = RTFReader.textKeywords;
+        Enumeration<String> keys = textKeywordDictionary.keys();
         Vector<CharacterKeywordPair> tempPairs = new Vector<CharacterKeywordPair>();
         while(keys.hasMoreElements()) {
             CharacterKeywordPair pair = new CharacterKeywordPair();
-            pair.keyword = (String)keys.nextElement();
-            pair.character = ((String)textKeywordDictionary.get(pair.keyword)).charAt(0);
+            pair.keyword = keys.nextElement();
+            pair.character = textKeywordDictionary.get(pair.keyword).charAt(0);
             tempPairs.addElement(pair);
         }
         textKeywords = new CharacterKeywordPair[tempPairs.size()];
@@ -340,7 +340,7 @@
     /* write color table */
     if (colorCount > 1) {
         Color[] sortedColorTable = new Color[colorCount];
-        Enumeration colors = colorTable.keys();
+        Enumeration<Object> colors = colorTable.keys();
         Color color;
         while(colors.hasMoreElements()) {
             color = (Color)colors.nextElement();
--- a/src/share/classes/javax/swing/text/rtf/RTFReader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/text/rtf/RTFReader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -220,6 +220,7 @@
     Object oldSaveState = parserState.get("_savedState");
     if (oldSaveState != null)
         parserState.remove("_savedState");
+    @SuppressWarnings("unchecked")
     Dictionary<String, Object> saveState = (Dictionary<String, Object>)((Hashtable)parserState).clone();
     if (oldSaveState != null)
         saveState.put("_savedState", oldSaveState);
@@ -242,13 +243,14 @@
         skippingCharacters = 0;
     }
 
+    @SuppressWarnings("unchecked")
     Dictionary<Object, Object> restoredState = (Dictionary<Object, Object>)parserState.get("_savedState");
     Destination restoredDestination = (Destination)restoredState.get("dst");
     if (restoredDestination != rtfDestination) {
         rtfDestination.close(); /* allow the destination to clean up */
         rtfDestination = restoredDestination;
     }
-    Dictionary oldParserState = parserState;
+    Dictionary<Object, Object> oldParserState = parserState;
     parserState = restoredState;
     if (rtfDestination != null)
         rtfDestination.endgroup(oldParserState);
@@ -258,7 +260,8 @@
 {
     /* Check that setting the destination won't close the
        current destination (should never happen) */
-    Dictionary previousState = (Dictionary)parserState.get("_savedState");
+    @SuppressWarnings("unchecked")
+    Dictionary<Object, Object> previousState = (Dictionary)parserState.get("_savedState");
     if (previousState != null) {
         if (rtfDestination != previousState.get("dst")) {
             warning("Warning, RTF destination overridden, invalid RTF.");
@@ -277,7 +280,7 @@
 public void close()
     throws IOException
 {
-    Enumeration docProps = documentAttributes.getAttributeNames();
+    Enumeration<?> docProps = documentAttributes.getAttributeNames();
     while(docProps.hasMoreElements()) {
         Object propName = docProps.nextElement();
         target.putProperty(propName,
@@ -628,7 +631,7 @@
     boolean handleKeyword(String keyword, int parameter);
 
     void begingroup();
-    void endgroup(Dictionary oldState);
+    void endgroup(Dictionary<Object, Object> oldState);
 
     void close();
 }
@@ -666,7 +669,7 @@
            current group level as necessary */
     }
 
-    public void endgroup(Dictionary oldState)
+    public void endgroup(Dictionary<Object, Object> oldState)
     {
         /* Ignore groups */
     }
@@ -736,7 +739,7 @@
 
     /* Groups are irrelevant. */
     public void begingroup() {}
-    public void endgroup(Dictionary oldState) {}
+    public void endgroup(Dictionary<Object, Object> oldState) {}
 
     /* currently, the only thing we do when the font table ends is
        dump its contents to the debugging log. */
@@ -806,7 +809,7 @@
 
     /* Groups are irrelevant. */
     public void begingroup() {}
-    public void endgroup(Dictionary oldState) {}
+    public void endgroup(Dictionary<Object, Object> oldState) {}
 
     /* Shouldn't see any binary blobs ... */
     public void handleBinaryBlob(byte[] data) {}
@@ -1098,7 +1101,7 @@
         parserState.put("sec", sectionAttributes);
     }
 
-    public void endgroup(Dictionary oldState)
+    public void endgroup(Dictionary<Object, Object> oldState)
     {
         characterAttributes = (MutableAttributeSet)parserState.get("chr");
         paragraphAttributes = (MutableAttributeSet)parserState.get("pgf");
@@ -1262,7 +1265,9 @@
             Dictionary<Object, Object> tabs;
             Integer stopCount;
 
-            tabs = (Dictionary<Object, Object>)parserState.get("_tabs");
+            @SuppressWarnings("unchecked")
+            Dictionary<Object, Object>tmp = (Dictionary)parserState.get("_tabs");
+            tabs = tmp;
             if (tabs == null) {
                 tabs = new Hashtable<Object, Object>();
                 parserState.put("_tabs", tabs);
@@ -1420,7 +1425,8 @@
 
         tabs = (TabStop[])parserState.get("_tabs_immutable");
         if (tabs == null) {
-            Dictionary workingTabs = (Dictionary)parserState.get("_tabs");
+            @SuppressWarnings("unchecked")
+            Dictionary<Object, Object> workingTabs = (Dictionary)parserState.get("_tabs");
             if (workingTabs != null) {
                 int count = ((Integer)workingTabs.get("stop count")).intValue();
                 tabs = new TabStop[count];
--- a/src/share/classes/javax/swing/tree/ExpandVetoException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/javax/swing/tree/ExpandVetoException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -28,7 +28,7 @@
 import javax.swing.event.TreeExpansionEvent;
 
 /**
- * Exception used to stop and expand/collapse from happening.
+ * Exception used to stop an expand/collapse from happening.
  * See <a
  href="http://docs.oracle.com/javase/tutorial/uiswing/events/treewillexpandlistener.html">How to Write a Tree-Will-Expand Listener</a>
  * in <em>The Java Tutorial</em>
--- a/src/share/classes/jdk/internal/org/objectweb/asm/tree/InsnList.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/InsnList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -550,6 +550,7 @@
     }
 
     // this class is not generified because it will create bridges
+    @SuppressWarnings("rawtypes")
     private final class InsnListIterator implements ListIterator {
 
         AbstractInsnNode next;
--- a/src/share/classes/jdk/internal/org/objectweb/asm/tree/MethodNode.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/MethodNode.java	Wed Jul 09 10:42:37 2014 -0700
@@ -399,6 +399,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public AnnotationVisitor visitParameterAnnotation(final int parameter,
             final String desc, final boolean visible) {
         AnnotationNode an = new AnnotationNode(desc);
--- a/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -131,6 +131,7 @@
      * @throws AnalyzerException
      *             if a problem occurs during the analysis.
      */
+    @SuppressWarnings("unchecked")
     public Frame<V>[] analyze(final String owner, final MethodNode m)
             throws AnalyzerException {
         if ((m.access & (ACC_ABSTRACT | ACC_NATIVE)) != 0) {
--- a/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Frame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Frame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -112,6 +112,7 @@
      * @param nStack
      *            the maximum stack size of the frame.
      */
+    @SuppressWarnings("unchecked")
     public Frame(final int nLocals, final int nStack) {
         this.values = (V[]) new Value[nLocals + nStack];
         this.locals = nLocals;
--- a/src/share/classes/jdk/internal/org/objectweb/asm/version.txt	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/version.txt	Wed Jul 09 10:42:37 2014 -0700
@@ -1,12 +1,12 @@
 Path: .
-Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/asm-svn-2014-05-27
+Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/asm-svn-2014-06-19
 URL: file:///svnroot/asm/trunk/asm
 Repository Root: file:///svnroot/asm
 Repository UUID: 271bd773-ee82-43a6-9b2b-1890ed8ce7f9
-Revision: 1748
+Revision: 1750
 Node Kind: directory
 Schedule: normal
-Last Changed Author: ebruneton
-Last Changed Rev: 1747
-Last Changed Date: 2014-05-24 10:22:13 +0200 (Sat, 24 May 2014)
+Last Changed Author: forax
+Last Changed Rev: 1750
+Last Changed Date: 2014-06-06 00:31:02 +0200 (Fri, 06 Jun 2014)
 
--- a/src/share/classes/sun/applet/AppletClassLoader.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/applet/AppletClassLoader.java	Wed Jul 09 10:42:37 2014 -0700
@@ -168,7 +168,7 @@
      */
     protected Class findClass(String name) throws ClassNotFoundException {
 
-        int index = name.indexOf(";");
+        int index = name.indexOf(';');
         String cookie = "";
         if(index != -1) {
                 cookie = name.substring(index, name.length());
@@ -608,7 +608,7 @@
 
         // deal with URL rewriting
         String cookie = null;
-        int index = name.indexOf(";");
+        int index = name.indexOf(';');
         if(index != -1) {
                 cookie = name.substring(index, name.length());
                 name = name.substring(0, index);
--- a/src/share/classes/sun/audio/AudioDevice.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/audio/AudioDevice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,10 +58,7 @@
 
     private boolean DEBUG = false  /*true*/ ;
 
-    /** Hashtable of audio clips / input streams. */
-    private Hashtable clipStreams;
-
-    private Vector infos;
+    private Vector<Info> infos;
 
     /** Are we currently playing audio? */
     private boolean playing = false;
@@ -81,9 +78,7 @@
      * Create an AudioDevice instance.
      */
     private AudioDevice() {
-
-        clipStreams = new Hashtable();
-        infos = new Vector();
+        infos = new Vector<>();
     }
 
 
@@ -161,7 +156,7 @@
 
         // is this already playing?  if so, then just return
         for(int i=0; i<infos.size(); i++) {
-            info = (AudioDevice.Info)infos.elementAt(i);
+            info = infos.elementAt(i);
             if( info.in == in ) {
 
                 return;
@@ -290,7 +285,7 @@
 
         for(int i=0; i<infos.size(); i++) {
 
-            info = (AudioDevice.Info)infos.elementAt(i);
+            info = infos.elementAt(i);
 
             if( info.in == in ) {
 
@@ -355,7 +350,7 @@
 
         for(int i=0; i<infos.size(); i++) {
 
-            info = (AudioDevice.Info)infos.elementAt(i);
+            info = infos.elementAt(i);
 
             if( info.sequencer != null ) {
 
@@ -375,8 +370,7 @@
             System.err.println("Audio Device: Streams all closed.");
         }
         // Empty the hash table.
-        clipStreams = new Hashtable();
-        infos = new Vector();
+        infos = new Vector<>();
     }
 
     /**
--- a/src/share/classes/sun/audio/AudioPlayer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/audio/AudioPlayer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -92,18 +92,16 @@
         private static AudioPlayer getAudioPlayer() {
 
             if(DEBUG) { System.out.println("> AudioPlayer.getAudioPlayer()"); }
-            AudioPlayer audioPlayer;
-            PrivilegedAction action = new PrivilegedAction() {
-                    public Object run() {
-                        Thread t = new AudioPlayer();
+            PrivilegedAction<AudioPlayer> action = new PrivilegedAction<AudioPlayer>() {
+                    public AudioPlayer run() {
+                        AudioPlayer t = new AudioPlayer();
                         t.setPriority(MAX_PRIORITY);
                         t.setDaemon(true);
                         t.start();
                         return t;
                     }
                 };
-            audioPlayer = (AudioPlayer) AccessController.doPrivileged(action);
-            return audioPlayer;
+            return  AccessController.doPrivileged(action);
         }
 
         /**
--- a/src/share/classes/sun/audio/AudioStreamSequence.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/audio/AudioStreamSequence.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,16 +44,11 @@
  * @author Arthur van Hoff
  */
 public final class AudioStreamSequence extends SequenceInputStream {
-
-        Enumeration e;
-        InputStream in;
-
         /**
          * Create an AudioStreamSequence given an
          * enumeration of streams.
          */
-        public AudioStreamSequence(Enumeration e) {
+        public AudioStreamSequence(Enumeration<? extends InputStream> e) {
             super(e);
         }
-
-    }
+}
--- a/src/share/classes/sun/awt/AWTAccessor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/AWTAccessor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -530,7 +530,12 @@
         /**
          * Sets the delegate for the EventQueue used by FX/AWT single threaded mode
          */
-        public void setFwDispatcher(EventQueue eventQueue, FwDispatcher dispatcher);
+        void setFwDispatcher(EventQueue eventQueue, FwDispatcher dispatcher);
+
+        /**
+         * Gets most recent event time in the EventQueue
+         */
+        long getMostRecentEventTime(EventQueue eventQueue);
     }
 
     /*
--- a/src/share/classes/sun/awt/EventQueueDelegate.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.awt;
-
-import java.awt.AWTEvent;
-import java.awt.EventQueue;
-
-
-public class EventQueueDelegate {
-    private static final Object EVENT_QUEUE_DELEGATE_KEY =
-        new StringBuilder("EventQueueDelegate.Delegate");
-
-    public static void setDelegate(Delegate delegate) {
-        AppContext.getAppContext().put(EVENT_QUEUE_DELEGATE_KEY, delegate);
-    }
-    public static Delegate getDelegate() {
-        return
-          (Delegate) AppContext.getAppContext().get(EVENT_QUEUE_DELEGATE_KEY);
-    }
-    public interface Delegate {
-        /**
-         * This method allows for changing {@code EventQueue} events order.
-         *
-         * @param eventQueue current {@code EventQueue}
-         * @return next {@code event} for the {@code EventDispatchThread}
-         */
-
-        public AWTEvent getNextEvent(EventQueue eventQueue) throws InterruptedException;
-
-        /**
-         * Notifies delegate before EventQueue.dispatch method.
-         *
-         * Note: this method may mutate the event
-         *
-         * @param event  to be dispatched by {@code dispatch} method
-         * @return handle to be passed to {@code afterDispatch} method
-         */
-        public Object beforeDispatch(AWTEvent event) throws InterruptedException;
-
-        /**
-         * Notifies delegate after EventQueue.dispatch method.
-         *
-         * @param event {@code event} dispatched by the {@code dispatch} method
-         * @param handle object which came from {@code beforeDispatch} method
-         */
-        public void afterDispatch(AWTEvent event, Object handle) throws InterruptedException;
-    }
-}
--- a/src/share/classes/sun/awt/FontConfiguration.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/FontConfiguration.java	Wed Jul 09 10:42:37 2014 -0700
@@ -272,9 +272,9 @@
             if (configFile != null) {
                 return configFile;
             }
-            int decimalPointIndex = osVersion.indexOf(".");
+            int decimalPointIndex = osVersion.indexOf('.');
             if (decimalPointIndex != -1) {
-                osMajorVersion = osVersion.substring(0, osVersion.indexOf("."));
+                osMajorVersion = osVersion.substring(0, osVersion.indexOf('.'));
                 configFile = findImpl(baseName + "." + osName + "." + osMajorVersion);
                 if (configFile != null) {
                     return configFile;
--- a/src/share/classes/sun/awt/LightweightFrame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/LightweightFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,7 @@
 import java.awt.Image;
 import java.awt.MenuBar;
 import java.awt.MenuComponent;
+import java.awt.Rectangle;
 import java.awt.Toolkit;
 import java.awt.peer.FramePeer;
 
@@ -124,4 +125,48 @@
      * @see SunToolkit#ungrab(java.awt.Window)
      */
     public abstract void ungrabFocus();
+
+    /**
+     * Returns the scale factor of this frame. The default value is 1.
+     *
+     * @return the scale factor
+     * @see #notifyDisplayChanged(int)
+     */
+    public abstract int getScaleFactor();
+
+    /**
+     * Called when display of the hosted frame is changed.
+     *
+     * @param scaleFactor the scale factor
+     */
+    public abstract void notifyDisplayChanged(int scaleFactor);
+
+    /**
+     * Host window absolute bounds.
+     */
+    private int hostX, hostY, hostW, hostH;
+
+    /**
+     * Returns the absolute bounds of the host (embedding) window.
+     *
+     * @return the host window bounds
+     */
+    public Rectangle getHostBounds() {
+        if (hostX == 0 && hostY == 0 && hostW == 0 && hostH == 0) {
+            // The client app is probably unaware of the setHostBounds.
+            // A safe fall-back:
+            return getBounds();
+        }
+        return new Rectangle(hostX, hostY, hostW, hostH);
+    }
+
+    /**
+     * Sets the absolute bounds of the host (embedding) window.
+     */
+    public void setHostBounds(int x, int y, int w, int h) {
+        hostX = x;
+        hostY = y;
+        hostW = w;
+        hostH = h;
+    }
 }
--- a/src/share/classes/sun/awt/SunToolkit.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/SunToolkit.java	Wed Jul 09 10:42:37 2014 -0700
@@ -850,22 +850,30 @@
 
     private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) {
         ToolkitImage rvImage = getResolutionVariant(img);
+        int rvw = getRVSize(w);
+        int rvh = getRVSize(h);
         // Ignore the resolution variant in case of error
         return (rvImage == null || rvImage.hasError()) ? 0xFFFF :
-                checkImage(rvImage, 2 * w, 2 * h, MultiResolutionToolkitImage.
+                checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage.
                                 getResolutionVariantObserver(
-                                        img, o, w, h, 2 * w, 2 * h));
+                                        img, o, w, h, rvw, rvh, true));
     }
 
     private boolean prepareResolutionVariant(Image img, int w, int h,
             ImageObserver o) {
 
         ToolkitImage rvImage = getResolutionVariant(img);
+        int rvw = getRVSize(w);
+        int rvh = getRVSize(h);
         // Ignore the resolution variant in case of error
         return rvImage == null || rvImage.hasError() || prepareImage(
-                rvImage, 2 * w, 2 * h,
+                rvImage, rvw, rvh,
                 MultiResolutionToolkitImage.getResolutionVariantObserver(
-                        img, o, w, h, 2 * w, 2 * h));
+                        img, o, w, h, rvw, rvh, true));
+    }
+
+    private static int getRVSize(int size){
+        return size == -1 ? -1 : 2 * size;
     }
 
     private static ToolkitImage getResolutionVariant(Image image) {
--- a/src/share/classes/sun/awt/datatransfer/ClipboardTransferable.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/datatransfer/ClipboardTransferable.java	Wed Jul 09 10:42:37 2014 -0700
@@ -153,7 +153,7 @@
         Object ret = flavorsToData.get(flavor);
         if (ret instanceof IOException) {
             // rethrow IOExceptions generated while fetching data
-            throw (IOException)ret;
+            throw new IOException("Exception fetching data: ", (IOException)ret);
         } else if (ret instanceof DataFactory) {
             // Now we can render the data
             DataFactory factory = (DataFactory)ret;
--- a/src/share/classes/sun/awt/image/ByteBandedRaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/ByteBandedRaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -755,10 +755,22 @@
                     + scanlineStride);
         }
 
-        for (int i = 0; i < data.length; i++) {
-            if (scanlineStride > data[i].length) {
-                throw new RasterFormatException("Incorrect scanline stride: "
-                    + scanlineStride);
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            for (int i = 0; i < data.length; i++) {
+                if (scanlineStride > data[i].length) {
+                    throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+                }
             }
         }
 
--- a/src/share/classes/sun/awt/image/ByteComponentRaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/ByteComponentRaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -885,15 +885,31 @@
             }
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
                     + scanlineStride);
         }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
--- a/src/share/classes/sun/awt/image/BytePackedRaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/BytePackedRaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1386,13 +1386,28 @@
             throw new RasterFormatException("Invalid raster dimension");
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             throw new RasterFormatException("Invalid scanline stride");
         }
 
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastbit = (dataBitOffset
                        + (height-1) * scanlineStride * 8
                        + (width-1) * pixelBitStride
--- a/src/share/classes/sun/awt/image/FileImageSource.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/FileImageSource.java	Wed Jul 09 10:42:37 2014 -0700
@@ -48,6 +48,10 @@
     }
 
     protected ImageDecoder getDecoder() {
+        if (imagefile == null) {
+            return null;
+        }
+
         InputStream is;
         try {
             is = new BufferedInputStream(new FileInputStream(imagefile));
--- a/src/share/classes/sun/awt/image/IntegerComponentRaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/IntegerComponentRaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -654,15 +654,31 @@
                                             ") must be >= 0");
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
                     + scanlineStride);
         }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
--- a/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,7 +56,7 @@
         java.security.AccessController.doPrivileged(
             new java.security.PrivilegedAction<Void>() {
                 public Void run() {
-                    System.loadLibrary("jpeg");
+                    System.loadLibrary("javajpeg");
                     return null;
                 }
             });
--- a/src/share/classes/sun/awt/image/MultiResolutionToolkitImage.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/MultiResolutionToolkitImage.java	Wed Jul 09 10:42:37 2014 -0700
@@ -66,6 +66,14 @@
             final Image image, final ImageObserver observer,
             final int imgWidth, final int imgHeight,
             final int rvWidth, final int rvHeight) {
+        return getResolutionVariantObserver(image, observer,
+                imgWidth, imgHeight, rvWidth, rvHeight, false);
+    }
+
+    public static ImageObserver getResolutionVariantObserver(
+            final Image image, final ImageObserver observer,
+            final int imgWidth, final int imgHeight,
+            final int rvWidth, final int rvHeight, boolean concatenateInfo) {
 
         if (observer == null) {
             return null;
@@ -92,6 +100,11 @@
                                 y /= 2;
                             }
 
+                            if(concatenateInfo){
+                                flags &= ((ToolkitImage) image).
+                                        getImageRep().check(null);
+                            }
+
                             return observer.imageUpdate(
                                     image, flags, x, y, width, height);
                         };
--- a/src/share/classes/sun/awt/image/ShortBandedRaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/ShortBandedRaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -754,10 +754,21 @@
                     + scanlineStride);
         }
 
-        for (int i = 0; i < data.length; i++) {
-            if (scanlineStride > data[i].length) {
-                throw new RasterFormatException("Incorrect scanline stride: "
-                    + scanlineStride);
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            for (int i = 0; i < data.length; i++) {
+                if (scanlineStride > data[i].length) {
+                    throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+                }
             }
         }
 
--- a/src/share/classes/sun/awt/image/ShortComponentRaster.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/image/ShortComponentRaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -819,15 +819,31 @@
             }
         }
 
+        if ((long)minX - sampleModelTranslateX < 0 ||
+            (long)minY - sampleModelTranslateY < 0) {
+
+            throw new RasterFormatException("Incorrect origin/translate: (" +
+                    minX + ", " + minY + ") / (" +
+                    sampleModelTranslateX + ", " + sampleModelTranslateY + ")");
+        }
+
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height) ||
-            scanlineStride > data.length)
+            scanlineStride > (Integer.MAX_VALUE / height))
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
                     + scanlineStride);
         }
+
+        if (height > 1 || minY - sampleModelTranslateY > 0) {
+            // buffer should contain at least one scanline
+            if (scanlineStride > data.length) {
+                throw new RasterFormatException("Incorrect scanline stride: "
+                        + scanlineStride);
+            }
+        }
+
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
--- a/src/share/classes/sun/awt/shell/ShellFolder.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/awt/shell/ShellFolder.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,8 +33,6 @@
 import java.util.*;
 import java.util.concurrent.Callable;
 
-import sun.reflect.misc.ReflectUtil;
-
 /**
  * @author Michael Martak
  * @since 1.4
@@ -201,16 +199,19 @@
 
     // Static
 
-    private static ShellFolderManager shellFolderManager;
+    private static final ShellFolderManager shellFolderManager;
 
-    private static Invoker invoker;
+    private static final Invoker invoker;
 
     static {
         String managerClassName = (String)Toolkit.getDefaultToolkit().
                                       getDesktopProperty("Shell.shellFolderManager");
         Class<?> managerClass = null;
         try {
-            managerClass = ReflectUtil.forName(managerClassName);
+            managerClass = Class.forName(managerClassName, false, null);
+            if (!ShellFolderManager.class.isAssignableFrom(managerClass)) {
+                managerClass = null;
+            }
         // swallow the exceptions below and use default shell folder
         } catch(ClassNotFoundException e) {
         } catch(NullPointerException e) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/font/CodePointIterator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.
+ */
+
+/*
+ * (C) Copyright IBM Corp. 2003 - All Rights Reserved
+ *
+ * The original version of this source code and documentation is
+ * copyrighted and owned by IBM. These materials are provided
+ * under terms of a License Agreement between IBM and Sun.
+ * This technology is protected by multiple US and International
+ * patents. This notice and attribution to IBM may not be removed.
+ */
+
+package sun.font;
+
+import java.text.CharacterIterator;
+
+public abstract class CodePointIterator {
+    public static final int DONE = -1;
+
+    public abstract void setToStart();
+    public abstract void setToLimit();
+
+    public abstract int next();
+    public abstract int prev();
+
+    public abstract int charIndex();
+
+    public static CodePointIterator create(char[] text) {
+        return new CharArrayCodePointIterator(text);
+    }
+
+    public static CodePointIterator create(char[] text, int start, int limit) {
+        return new CharArrayCodePointIterator(text, start, limit);
+    }
+
+    public static CodePointIterator create(CharSequence text) {
+        return new CharSequenceCodePointIterator(text);
+    }
+
+    public static CodePointIterator create(CharacterIterator iter) {
+        return new CharacterIteratorCodePointIterator(iter);
+    }
+}
+
+final class CharArrayCodePointIterator extends CodePointIterator {
+    private char[] text;
+    private int start;
+    private int limit;
+    private int index;
+
+    public CharArrayCodePointIterator(char[] text) {
+        this.text = text;
+        this.limit = text.length;
+    }
+
+    public CharArrayCodePointIterator(char[] text, int start, int limit) {
+        if (start < 0 || limit < start || limit > text.length) {
+            throw new IllegalArgumentException();
+        }
+
+        this.text = text;
+        this.start = this.index = start;
+        this.limit = limit;
+    }
+
+    public void setToStart() {
+        index = start;
+    }
+
+    public void setToLimit() {
+        index = limit;
+    }
+
+    public int next() {
+        if (index < limit) {
+            char cp1 = text[index++];
+            if (Character.isHighSurrogate(cp1) && index < limit) {
+                char cp2 = text[index];
+                if (Character.isLowSurrogate(cp2)) {
+                    ++index;
+                    return Character.toCodePoint(cp1, cp2);
+                }
+            }
+            return cp1;
+        }
+        return DONE;
+    }
+
+    public int prev() {
+        if (index > start) {
+            char cp2 = text[--index];
+            if (Character.isLowSurrogate(cp2) && index > start) {
+                char cp1 = text[index - 1];
+                if (Character.isHighSurrogate(cp1)) {
+                    --index;
+                    return Character.toCodePoint(cp1, cp2);
+                }
+            }
+            return cp2;
+        }
+        return DONE;
+    }
+
+    public int charIndex() {
+        return index;
+    }
+}
+
+final class CharSequenceCodePointIterator extends CodePointIterator {
+    private CharSequence text;
+    private int index;
+
+    public CharSequenceCodePointIterator(CharSequence text) {
+        this.text = text;
+    }
+
+    public void setToStart() {
+        index = 0;
+    }
+
+    public void setToLimit() {
+        index = text.length();
+    }
+
+    public int next() {
+        if (index < text.length()) {
+            char cp1 = text.charAt(index++);
+            if (Character.isHighSurrogate(cp1) && index < text.length()) {
+                char cp2 = text.charAt(index+1);
+                if (Character.isLowSurrogate(cp2)) {
+                    ++index;
+                    return Character.toCodePoint(cp1, cp2);
+                }
+            }
+            return cp1;
+        }
+        return DONE;
+    }
+
+    public int prev() {
+        if (index > 0) {
+            char cp2 = text.charAt(--index);
+            if (Character.isLowSurrogate(cp2) && index > 0) {
+                char cp1 = text.charAt(index - 1);
+                if (Character.isHighSurrogate(cp1)) {
+                    --index;
+                    return Character.toCodePoint(cp1, cp2);
+                }
+            }
+            return cp2;
+        }
+        return DONE;
+    }
+
+    public int charIndex() {
+        return index;
+    }
+}
+
+// note this has different iteration semantics than CharacterIterator
+final class CharacterIteratorCodePointIterator extends CodePointIterator {
+    private CharacterIterator iter;
+
+    public CharacterIteratorCodePointIterator(CharacterIterator iter) {
+        this.iter = iter;
+    }
+
+    public void setToStart() {
+        iter.setIndex(iter.getBeginIndex());
+    }
+
+    public void setToLimit() {
+        iter.setIndex(iter.getEndIndex());
+    }
+
+    public int next() {
+        char cp1 = iter.current();
+        if (cp1 != CharacterIterator.DONE) {
+            char cp2 = iter.next();
+            if (Character.isHighSurrogate(cp1) && cp2 != CharacterIterator.DONE) {
+                if (Character.isLowSurrogate(cp2)) {
+                    iter.next();
+                    return Character.toCodePoint(cp1, cp2);
+                }
+            }
+            return cp1;
+        }
+        return DONE;
+    }
+
+    public int prev() {
+        char cp2 = iter.previous();
+        if (cp2 != CharacterIterator.DONE) {
+            if (Character.isLowSurrogate(cp2)) {
+                char cp1 = iter.previous();
+                if (Character.isHighSurrogate(cp1)) {
+                    return Character.toCodePoint(cp1, cp2);
+                }
+                iter.next();
+            }
+            return cp2;
+        }
+        return DONE;
+    }
+
+    public int charIndex() {
+        return iter.getIndex();
+    }
+}
--- a/src/share/classes/sun/font/FontResolver.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/font/FontResolver.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,7 +36,6 @@
 import java.text.AttributedCharacterIterator;
 import java.util.ArrayList;
 import java.util.Map;
-import sun.text.CodePointIterator;
 
 /**
  * This class maps an individual character to a Font family which can
--- a/src/share/classes/sun/font/SunFontManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/font/SunFontManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -2872,8 +2872,7 @@
                 new java.security.PrivilegedAction<Object>() {
                         public Object run() {
                             SecurityManager sm = System.getSecurityManager();
-                            return new Boolean
-                                (sm instanceof sun.applet.AppletSecurity);
+                            return sm instanceof sun.applet.AppletSecurity;
                         }
                     });
         return appletSM.booleanValue();
--- a/src/share/classes/sun/font/TrueTypeFont.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/font/TrueTypeFont.java	Wed Jul 09 10:42:37 2014 -0700
@@ -39,10 +39,14 @@
 import java.nio.ShortBuffer;
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.FileChannel;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
 import java.util.Map;
-import java.util.Locale;
+import java.util.Map.Entry;
+
 import sun.java2d.Disposer;
 import sun.java2d.DisposerRecord;
 
@@ -1129,6 +1133,8 @@
 
             nameLocale = sun.awt.SunToolkit.getStartupLocale();
             short nameLocaleID = getLCIDFromLocale(nameLocale);
+            languageCompatibleLCIDs =
+                getLanguageCompatibleLCIDsFromLocale(nameLocale);
 
             for (int i=0; i<numRecords; i++) {
                 short platformID = sbuffer.get();
@@ -1145,18 +1151,21 @@
                 switch (nameID) {
 
                 case FAMILY_NAME_ID:
-
+                    boolean compatible = false;
                     if (familyName == null || langID == ENGLISH_LOCALE_ID ||
-                        langID == nameLocaleID)
+                        langID == nameLocaleID ||
+                        (localeFamilyName == null &&
+                         (compatible = isLanguageCompatible(langID))))
                     {
                         buffer.position(namePtr);
                         buffer.get(name, 0, nameLen);
                         tmpName = makeString(name, nameLen, encodingID);
-
                         if (familyName == null || langID == ENGLISH_LOCALE_ID){
                             familyName = tmpName;
                         }
-                        if (langID == nameLocaleID) {
+                        if (langID == nameLocaleID ||
+                            (localeFamilyName == null && compatible))
+                        {
                             localeFamilyName = tmpName;
                         }
                     }
@@ -1175,9 +1184,11 @@
                     break;
 
                 case FULL_NAME_ID:
-
+                    compatible = false;
                     if (fullName == null || langID == ENGLISH_LOCALE_ID ||
-                        langID == nameLocaleID)
+                        langID == nameLocaleID ||
+                        (localeFullName == null &&
+                         (compatible = isLanguageCompatible(langID))))
                     {
                         buffer.position(namePtr);
                         buffer.get(name, 0, nameLen);
@@ -1186,7 +1197,9 @@
                         if (fullName == null || langID == ENGLISH_LOCALE_ID) {
                             fullName = tmpName;
                         }
-                        if (langID == nameLocaleID) {
+                        if (langID == nameLocaleID ||
+                            (localeFullName == null && compatible))
+                        {
                             localeFullName = tmpName;
                         }
                     }
@@ -1697,4 +1710,156 @@
         return "** TrueType Font: Family="+familyName+ " Name="+fullName+
             " style="+style+" fileName="+getPublicFileName();
     }
+
+
+    private static Map<String, short[]> lcidLanguageCompatibilityMap;
+    private static final short[] EMPTY_COMPATIBLE_LCIDS = new short[0];
+
+    // the language compatible LCIDs for this font's nameLocale
+    private short[] languageCompatibleLCIDs;
+
+    /*
+     * Returns true if the given lcid's language is compatible
+     * to the language of the startup Locale. I.e. if
+     * startupLocale.getLanguage().equals(lcidLocale.getLanguage()) would
+     * return true.
+     */
+    private boolean isLanguageCompatible(short lcid){
+        for (short s : languageCompatibleLCIDs) {
+            if (s == lcid) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /*
+     * Returns an array of all the language compatible LCIDs for the
+     * given Locale. This array is later used to find compatible
+     * locales.
+     */
+    private static short[] getLanguageCompatibleLCIDsFromLocale(Locale locale) {
+        if (lcidLanguageCompatibilityMap == null) {
+            createLCIDMap();
+            createLCIDLanguageCompatibilityMap();
+        }
+        String language = locale.getLanguage();
+        short[] result = lcidLanguageCompatibilityMap.get(language);
+        return result == null ? EMPTY_COMPATIBLE_LCIDS : result;
+    }
+
+//     private static void prtLine(String s) {
+//        System.out.println(s);
+//     }
+
+//     /*
+//      * Initializes the map from Locale keys (e.g. "en_BZ" or "de")
+//      * to language compatible LCIDs.
+//      * This map could be statically created based on the fixed known set
+//      * added to lcidMap.
+//      */
+//     private static void createLCIDLanguageCompatibilityMap() {
+//         if (lcidLanguageCompatibilityMap != null) {
+//             return;
+//         }
+//         HashMap<String, List<Short>> result = new HashMap<>();
+//         for (Entry<String, Short> e : lcidMap.entrySet()) {
+//             String language = e.getKey();
+//             int index = language.indexOf('_');
+//             if (index != -1) {
+//                 language = language.substring(0, index);
+//             }
+//             List<Short> list = result.get(language);
+//             if (list == null) {
+//                 list = new ArrayList<>();
+//                 result.put(language, list);
+//             }
+//             if (index == -1) {
+//                 list.add(0, e.getValue());
+//             } else{
+//                 list.add(e.getValue());
+//             }
+//         }
+//         Map<String, short[]> compMap = new HashMap<>();
+//         for (Entry<String, List<Short>> e : result.entrySet()) {
+//             if (e.getValue().size() > 1) {
+//                 List<Short> list = e.getValue();
+//                 short[] shorts = new short[list.size()];
+//                 for (int i = 0; i < shorts.length; i++) {
+//                     shorts[i] = list.get(i);
+//                 }
+//                 compMap.put(e.getKey(), shorts);
+//             }
+//         }
+
+//         /* Now dump code to init the map to System.out */
+//         prtLine("    private static void createLCIDLanguageCompatibilityMap() {");
+//         prtLine("");
+
+//         prtLine("        Map<String, short[]> map = new HashMap<>();");
+//         prtLine("");
+//         prtLine("        short[] sarr;");
+//         for (Entry<String, short[]> e : compMap.entrySet()) {
+//             String lang = e.getKey();
+//             short[] ids = e.getValue();
+//             StringBuilder sb = new StringBuilder("sarr = new short[] { ");
+//             for (int i = 0; i < ids.length; i++) {
+//                 sb.append(ids[i]+", ");
+//             }
+//             sb.append("}");
+//             prtLine("        " + sb + ";");
+//             prtLine("        map.put(\"" + lang + "\", sarr);");
+//         }
+//         prtLine("");
+//         prtLine("        lcidLanguageCompatibilityMap = map;");
+//         prtLine("    }");
+//         /* done dumping map */
+
+//         lcidLanguageCompatibilityMap = compMap;
+//     }
+
+    private static void createLCIDLanguageCompatibilityMap() {
+
+        Map<String, short[]> map = new HashMap<>();
+
+        short[] sarr;
+        sarr = new short[] { 1031, 3079, 5127, 2055, 4103, };
+        map.put("de", sarr);
+        sarr = new short[] { 1044, 2068, };
+        map.put("no", sarr);
+        sarr = new short[] { 1049, 2073, };
+        map.put("ru", sarr);
+        sarr = new short[] { 1053, 2077, };
+        map.put("sv", sarr);
+        sarr = new short[] { 1046, 2070, };
+        map.put("pt", sarr);
+        sarr = new short[] { 1131, 3179, 2155, };
+        map.put("qu", sarr);
+        sarr = new short[] { 1086, 2110, };
+        map.put("ms", sarr);
+        sarr = new short[] { 11273, 3081, 12297, 8201, 10249, 4105, 13321, 6153, 7177, 5129, 2057, };
+        map.put("en", sarr);
+        sarr = new short[] { 1050, 4122, };
+        map.put("hr", sarr);
+        sarr = new short[] { 1040, 2064, };
+        map.put("it", sarr);
+        sarr = new short[] { 1036, 5132, 6156, 2060, 3084, 4108, };
+        map.put("fr", sarr);
+        sarr = new short[] { 1034, 12298, 14346, 2058, 8202, 19466, 17418, 9226, 13322, 5130, 7178, 11274, 16394, 4106, 10250, 6154, 18442, 20490, 15370, };
+        map.put("es", sarr);
+        sarr = new short[] { 1028, 3076, 5124, 4100, 2052, };
+        map.put("zh", sarr);
+        sarr = new short[] { 1025, 8193, 16385, 9217, 2049, 14337, 15361, 11265, 13313, 10241, 7169, 12289, 4097, 5121, 6145, 3073, };
+        map.put("ar", sarr);
+        sarr = new short[] { 1083, 3131, 2107, };
+        map.put("se", sarr);
+        sarr = new short[] { 1048, 2072, };
+        map.put("ro", sarr);
+        sarr = new short[] { 1043, 2067, };
+        map.put("nl", sarr);
+        sarr = new short[] { 7194, 3098, };
+        map.put("sr", sarr);
+
+        lcidLanguageCompatibilityMap = map;
+    }
 }
--- a/src/share/classes/sun/font/Type1Font.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/font/Type1Font.java	Wed Jul 09 10:42:37 2014 -0700
@@ -492,7 +492,7 @@
 
         //Conversion: Expand abbreviations in style portion (everything after '-'),
         //            replace '-' with space and insert missing spaces
-        pos = name.indexOf("-");
+        pos = name.indexOf('-');
         if (pos >= 0) {
             res =  expandName(name.substring(0, pos), false);
             res += " " + expandName(name.substring(pos+1), true);
@@ -513,8 +513,8 @@
         //Conversion: Truncate style portion (everything after '-')
         //            and insert missing spaces
 
-        if (tmp.indexOf("-") > 0) {
-            tmp = tmp.substring(0, tmp.indexOf("-"));
+        if (tmp.indexOf('-') > 0) {
+            tmp = tmp.substring(0, tmp.indexOf('-'));
         }
 
         return expandName(tmp, false);
--- a/src/share/classes/sun/java2d/SunGraphics2D.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/java2d/SunGraphics2D.java	Wed Jul 09 10:42:37 2014 -0700
@@ -2108,7 +2108,7 @@
         if (theData.copyArea(this, x, y, w, h, dx, dy)) {
             return;
         }
-        if (transformState >= TRANSFORM_TRANSLATESCALE) {
+        if (transformState > TRANSFORM_TRANSLATESCALE) {
             throw new InternalError("transformed copyArea not implemented yet");
         }
         // REMIND: This method does not deal with missing data from the
@@ -2129,8 +2129,25 @@
             lastCAcomp = comp;
         }
 
-        x += transX;
-        y += transY;
+        double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
+        transform.transform(coords, 0, coords, 0, 3);
+
+        x = (int)Math.ceil(coords[0] - 0.5);
+        y = (int)Math.ceil(coords[1] - 0.5);
+        w = ((int)Math.ceil(coords[2] - 0.5)) - x;
+        h = ((int)Math.ceil(coords[3] - 0.5)) - y;
+        dx = ((int)Math.ceil(coords[4] - 0.5)) - x;
+        dy = ((int)Math.ceil(coords[5] - 0.5)) - y;
+
+        // In case of negative scale transform, reflect the rect coords.
+        if (w < 0) {
+            w *= -1;
+            x -= w;
+        }
+        if (h < 0) {
+            h *= -1;
+            y -= h;
+        }
 
         Blit ob = lastCAblit;
         if (dy == 0 && dx > 0 && dx < w) {
--- a/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,8 @@
             // surface->sw ops
             new OGLSurfaceToSwBlit(SurfaceType.IntArgb,
                                    OGLSurfaceData.PF_INT_ARGB),
+            new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre,
+                                   OGLSurfaceData.PF_INT_ARGB_PRE),
 
             // sw->surface ops
             blitIntArgbPreToSurface,
@@ -505,23 +507,79 @@
     }
 }
 
-class OGLSurfaceToSwBlit extends Blit {
+final class OGLSurfaceToSwBlit extends Blit {
 
-    private int typeval;
+    private final int typeval;
+    private WeakReference<SurfaceData> srcTmp;
 
-    // REMIND: destination will actually be opaque/premultiplied...
-    OGLSurfaceToSwBlit(SurfaceType dstType, int typeval) {
+    // destination will actually be ArgbPre or Argb
+    OGLSurfaceToSwBlit(final SurfaceType dstType,final int typeval) {
         super(OGLSurfaceData.OpenGLSurface,
               CompositeType.SrcNoEa,
               dstType);
         this.typeval = typeval;
     }
 
+    private synchronized void complexClipBlit(SurfaceData src, SurfaceData dst,
+                                              Composite comp, Region clip,
+                                              int sx, int sy, int dx, int dy,
+                                              int w, int h) {
+        SurfaceData cachedSrc = null;
+        if (srcTmp != null) {
+            // use cached intermediate surface, if available
+            cachedSrc = srcTmp.get();
+        }
+
+        // We can convert argb_pre data from OpenGL surface in two places:
+        // - During OpenGL surface -> SW blit
+        // - During SW -> SW blit
+        // The first one is faster when we use opaque OGL surface, because in
+        // this case we simply skip conversion and use color components as is.
+        // Because of this we align intermediate buffer type with type of
+        // destination not source.
+        final int type = typeval == OGLSurfaceData.PF_INT_ARGB_PRE ?
+                         BufferedImage.TYPE_INT_ARGB_PRE :
+                         BufferedImage.TYPE_INT_ARGB;
+
+        src = convertFrom(this, src, sx, sy, w, h, cachedSrc, type);
+
+        // copy intermediate SW to destination SW using complex clip
+        final Blit performop = Blit.getFromCache(src.getSurfaceType(),
+                                                 CompositeType.SrcNoEa,
+                                                 dst.getSurfaceType());
+        performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h);
+
+        if (src != cachedSrc) {
+            // cache the intermediate surface
+            srcTmp = new WeakReference<>(src);
+        }
+    }
+
     public void Blit(SurfaceData src, SurfaceData dst,
                      Composite comp, Region clip,
                      int sx, int sy, int dx, int dy,
                      int w, int h)
     {
+        if (clip != null) {
+            clip = clip.getIntersectionXYWH(dx, dy, w, h);
+            // At the end this method will flush the RenderQueue, we should exit
+            // from it as soon as possible.
+            if (clip.isEmpty()) {
+                return;
+            }
+            sx += clip.getLoX() - dx;
+            sy += clip.getLoY() - dy;
+            dx = clip.getLoX();
+            dy = clip.getLoY();
+            w = clip.getWidth();
+            h = clip.getHeight();
+
+            if (!clip.isRectangular()) {
+                complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
+                return;
+            }
+        }
+
         OGLRenderQueue rq = OGLRenderQueue.getInstance();
         rq.lock();
         try {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/jvmstat/monitor/BufferedMonitoredVm.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.jvmstat.monitor;
+
+import sun.jvmstat.monitor.*;
+
+/**
+ * Interface to support asynchronous polling of the exported
+ * instrumentation of a target Java Virtual Machine.
+ *
+ * @author Brian Doherty
+ * @since 1.5
+ */
+public interface BufferedMonitoredVm extends MonitoredVm {
+
+    /**
+     * Interface to get the bytes associated with the instrumentation
+     * for the target Java Virtual Machine.
+     *
+     * @return byte[] - a byte array containing the current bytes
+     *                  for the instrumentation exported by the
+     *                  target Java Virtual Machine.
+     */
+    byte[] getBytes();
+
+    /**
+     * Interface to get the the size of the instrumentation buffer
+     * for the target Java Virtual Machine.
+     *
+     * @return int - the size of the instrumentation buffer for the
+     *               target Java Virtual Machine.
+     */
+    int getCapacity();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/jvmstat/monitor/META-INF/services/sun.jvmstat.monitor.MonitoredHostService	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,3 @@
+sun.jvmstat.perfdata.monitor.protocol.file.MonitoredHostFileService
+sun.jvmstat.perfdata.monitor.protocol.local.MonitoredHostLocalService
+sun.jvmstat.perfdata.monitor.protocol.rmi.MonitoredHostRmiService
--- a/src/share/classes/sun/jvmstat/monitor/MonitoredHost.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/jvmstat/monitor/MonitoredHost.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,9 +25,11 @@
 
 package sun.jvmstat.monitor;
 
-import java.util.*;
-import java.net.*;
-import java.lang.reflect.*;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
 
 import sun.jvmstat.monitor.event.HostListener;
 
@@ -52,31 +54,6 @@
                 new HashMap<HostIdentifier, MonitoredHost>();
 
     /*
-     * The monitoring implementation override mechanism. The value of
-     * this property is used as the class name for the concrete MonitoredHost
-     * subclass that implements the monitoring APIs.  Setting this property
-     * will cause the remaining override mechanisms to be ignored. When
-     * this mechanism is used, the HostIdentifier scheme name, which
-     * indicates the communications protocol, is not used to locate a
-     * the protocol specific package. However, the HostIdentifier is
-     * still passed to the corresponding single arg constructor.
-     * This property is not expected to be set in normal circumstances.
-     */
-    private static final String IMPL_OVERRIDE_PROP_NAME =
-            "sun.jvmstat.monitor.MonitoredHost";
-
-    /*
-     * The monitoring package name override mechanism. The value
-     * the this property is used as base package name for the
-     * monitoring implementation package. This property is not
-     * expected to be set under normal circumstances.
-     */
-    private static final String IMPL_PKG_PROP_NAME =
-            "sun.jvmstat.monitor.package";
-    private static final String IMPL_PACKAGE =
-            System.getProperty(IMPL_PKG_PROP_NAME, "sun.jvmstat.perfdata");
-
-    /*
      * The default optimized local protocol override mechanism. The value
      * of this property is used to construct the default package name
      * for the default optimized local protocol as follows:
@@ -100,15 +77,6 @@
     private static final String REMOTE_PROTOCOL =
             System.getProperty(REMOTE_PROTOCOL_PROP_NAME, "rmi");
 
-    /*
-     * The default class name of the MonitoredHost implementation subclass.
-     * There is no override mechanism for this variable, other than the
-     * IMPL_OVERRIDE_PROP_NAME override, which is larger in scope. A concrete
-     * instance of this class is expected to be found in:
-     *     <IMPL_PACKAGE>.monitor.protocol.<protocol>.<MONITORED_HOST_CLASS>
-     */
-    private static final String MONITORED_HOST_CLASS = "MonitoredHostProvider";
-
     /**
      * The HostIdentifier for this MonitoredHost instance.
      */
@@ -165,6 +133,13 @@
         return getMonitoredHost(hostId);
     }
 
+
+    /*
+     * Load the MonitoredHostServices
+     */
+    private static ServiceLoader<MonitoredHostService> monitoredHostServiceLoader =
+        ServiceLoader.load(MonitoredHostService.class, MonitoredHostService.class.getClassLoader());
+
     /**
      * Factory method to construct a MonitoredHost instance to manage the
      * connection to the host indicated by <tt>hostId</tt>.
@@ -177,11 +152,6 @@
      */
     public static MonitoredHost getMonitoredHost(HostIdentifier hostId)
                   throws MonitorException {
-        /*
-         * determine the class name to load. If the system property is set,
-         * use the indicated class. otherwise, use the default class.
-         */
-        String classname = System.getProperty(IMPL_OVERRIDE_PROP_NAME);
         MonitoredHost mh = null;
 
         synchronized(monitoredHosts) {
@@ -197,50 +167,21 @@
 
         hostId = resolveHostId(hostId);
 
-        if (classname == null) {
-            // construct the class name
-            classname = IMPL_PACKAGE + ".monitor.protocol."
-                        + hostId.getScheme() + "." + MONITORED_HOST_CLASS;
+        for (MonitoredHostService mhs : monitoredHostServiceLoader) {
+            if (mhs.getScheme().equals(hostId.getScheme())) {
+                mh = mhs.getMonitoredHost(hostId);
+            }
         }
 
-        try {
-            // run the constructor taking a single String parameter.
-            Class<?> c = Class.forName(classname);
-
-            Constructor cons = c.getConstructor(
-                new Class[] { hostId.getClass() }
-            );
-
-            mh = (MonitoredHost)cons.newInstance(new Object[] { hostId } );
+        if (mh == null) {
+            throw new IllegalArgumentException("Could not find MonitoredHost for scheme: " + hostId.getScheme());
+        }
 
-            synchronized(monitoredHosts) {
-                monitoredHosts.put(mh.hostId, mh);
-            }
-            return mh;
-        } catch (ClassNotFoundException e) {
-            // from Class.forName();
-            throw new IllegalArgumentException("Could not find " + classname
-                                               + ": " + e.getMessage(), e);
-        } catch (NoSuchMethodException e) {
-            // from Class.getConstructor();
-            throw new IllegalArgumentException(
-                "Expected constructor missing in " + classname + ": "
-                + e.getMessage(), e);
-        } catch (IllegalAccessException e) {
-            // from Constructor.newInstance()
-            throw new IllegalArgumentException(
-                "Unexpected constructor access in " + classname + ": "
-                + e.getMessage(), e);
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException(classname + "is abstract: "
-                                               + e.getMessage(), e);
-        } catch (InvocationTargetException e) {
-            Throwable cause = e.getCause();
-            if (cause instanceof MonitorException) {
-                throw (MonitorException)cause;
-            }
-            throw new RuntimeException("Unexpected exception", e);
+        synchronized(monitoredHosts) {
+            monitoredHosts.put(mh.hostId, mh);
         }
+
+        return mh;
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/jvmstat/monitor/MonitoredHostService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.jvmstat.monitor;
+
+public interface MonitoredHostService {
+
+    /**
+     * Construct a MonitoredHost instance to manage the
+     * connection to the host indicated by <tt>hostId</tt>.
+     *
+     * @param hostId the identifier for the target host.
+     * @return MonitoredHost - The MonitoredHost object needed to attach to
+     *                         the target host.
+     *
+     * @throws MonitorException Thrown if monitoring errors occur.
+     */
+    public MonitoredHost getMonitoredHost(HostIdentifier hostId) throws MonitorException;
+
+    /**
+     * Get the scheme that this service supports.
+     *
+     * @return scheme name
+     */
+    public String getScheme();
+}
--- a/src/share/classes/sun/jvmstat/monitor/remote/BufferedMonitoredVm.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.jvmstat.monitor.remote;
-
-import sun.jvmstat.monitor.*;
-
-/**
- * Interface to support asynchronous polling of the exported
- * instrumentation of a target Java Virtual Machine.
- *
- * @author Brian Doherty
- * @since 1.5
- */
-public interface BufferedMonitoredVm extends MonitoredVm {
-
-    /**
-     * Interface to get the bytes associated with the instrumentation
-     * for the target Java Virtual Machine.
-     *
-     * @return byte[] - a byte array containing the current bytes
-     *                  for the instrumentation exported by the
-     *                  target Java Virtual Machine.
-     */
-    byte[] getBytes();
-
-    /**
-     * Interface to get the the size of the instrumentation buffer
-     * for the target Java Virtual Machine.
-     *
-     * @return int - the size of the instrumentation buffer for the
-     *               target Java Virtual Machine.
-     */
-    int getCapacity();
-}
--- a/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -66,7 +66,7 @@
      *                  return type is guaranteed to be of type Long.
      */
     public Object getValue() {
-        return new Long(lb.get(0));
+        return Long.valueOf(lb.get(0));
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/MonitoredHostFileService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.jvmstat.perfdata.monitor.protocol.file;
+
+import sun.jvmstat.monitor.HostIdentifier;
+import sun.jvmstat.monitor.MonitorException;
+import sun.jvmstat.monitor.MonitoredHost;
+import sun.jvmstat.monitor.MonitoredHostService;
+
+public final class MonitoredHostFileService implements MonitoredHostService {
+
+    @Override
+    public MonitoredHost getMonitoredHost(HostIdentifier hostId)
+            throws MonitorException {
+        return new MonitoredHostProvider(hostId);
+    }
+
+    @Override
+    public String getScheme() {
+        return "file";
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostLocalService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.jvmstat.perfdata.monitor.protocol.local;
+
+import sun.jvmstat.monitor.HostIdentifier;
+import sun.jvmstat.monitor.MonitorException;
+import sun.jvmstat.monitor.MonitoredHost;
+import sun.jvmstat.monitor.MonitoredHostService;
+
+public final class MonitoredHostLocalService implements MonitoredHostService {
+
+    @Override
+    public MonitoredHost getMonitoredHost(HostIdentifier hostId)
+            throws MonitorException {
+        return new MonitoredHostProvider(hostId);
+    }
+
+    @Override
+    public String getScheme() {
+        return "local";
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/rmi/MonitoredHostRmiService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.jvmstat.perfdata.monitor.protocol.rmi;
+
+import sun.jvmstat.monitor.HostIdentifier;
+import sun.jvmstat.monitor.MonitorException;
+import sun.jvmstat.monitor.MonitoredHost;
+import sun.jvmstat.monitor.MonitoredHostService;
+
+public final class MonitoredHostRmiService implements MonitoredHostService {
+
+    @Override
+    public MonitoredHost getMonitoredHost(HostIdentifier hostId) throws MonitorException {
+        return new MonitoredHostProvider(hostId);
+    }
+
+    @Override
+    public String getScheme() {
+        return "rmi";
+    }
+
+}
--- a/src/share/classes/sun/management/GcInfoCompositeData.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/GcInfoCompositeData.java	Wed Jul 09 10:42:37 2014 -0700
@@ -105,10 +105,10 @@
 
         try {
             baseGcInfoItemValues = new Object[] {
-                new Long(info.getId()),
-                new Long(info.getStartTime()),
-                new Long(info.getEndTime()),
-                new Long(info.getDuration()),
+                info.getId(),
+                info.getStartTime(),
+                info.getEndTime(),
+                info.getDuration(),
                 memoryUsageMapType.toOpenTypeData(info.getMemoryUsageBeforeGc()),
                 memoryUsageMapType.toOpenTypeData(info.getMemoryUsageAfterGc()),
             };
--- a/src/share/classes/sun/management/HotspotThread.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/HotspotThread.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,7 +60,7 @@
         int numThreads = getInternalThreadTimes0(names, times);
         Map<String, Long> result = new HashMap<>(numThreads);
         for (int i = 0; i < numThreads; i++) {
-            result.put(names[i], new Long(times[i]));
+            result.put(names[i], times[i]);
         }
         return result;
     }
--- a/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java	Wed Jul 09 10:42:37 2014 -0700
@@ -60,7 +60,7 @@
         final Object[] memoryNotifInfoItemValues = {
             memoryNotifInfo.getPoolName(),
             MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()),
-            new Long(memoryNotifInfo.getCount()),
+            memoryNotifInfo.getCount(),
         };
 
         try {
--- a/src/share/classes/sun/management/MemoryUsageCompositeData.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/MemoryUsageCompositeData.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,10 +56,10 @@
         // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
         // memoryUsageItemNames!
         final Object[] memoryUsageItemValues = {
-            new Long(usage.getInit()),
-            new Long(usage.getUsed()),
-            new Long(usage.getCommitted()),
-            new Long(usage.getMax()),
+            usage.getInit(),
+            usage.getUsed(),
+            usage.getCommitted(),
+            usage.getMax(),
         };
 
         try {
--- a/src/share/classes/sun/management/ThreadInfoCompositeData.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/ThreadInfoCompositeData.java	Wed Jul 09 10:42:37 2014 -0700
@@ -108,16 +108,16 @@
         // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
         // threadInfoItemNames!
         final Object[] threadInfoItemValues = {
-            new Long(threadInfo.getThreadId()),
+            threadInfo.getThreadId(),
             threadInfo.getThreadName(),
             threadInfo.getThreadState().name(),
-            new Long(threadInfo.getBlockedTime()),
-            new Long(threadInfo.getBlockedCount()),
-            new Long(threadInfo.getWaitedTime()),
-            new Long(threadInfo.getWaitedCount()),
+            threadInfo.getBlockedTime(),
+            threadInfo.getBlockedCount(),
+            threadInfo.getWaitedTime(),
+            threadInfo.getWaitedCount(),
             lockInfoData,
             threadInfo.getLockName(),
-            new Long(threadInfo.getLockOwnerId()),
+            threadInfo.getLockOwnerId(),
             threadInfo.getLockOwnerName(),
             stackTraceData,
                 threadInfo.isSuspended(),
--- a/src/share/classes/sun/management/counter/perf/LongCounterSnapshot.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/counter/perf/LongCounterSnapshot.java	Wed Jul 09 10:42:37 2014 -0700
@@ -43,7 +43,7 @@
     }
 
     public Object getValue() {
-        return new Long(value);
+        return Long.valueOf(value);
     }
 
     /**
--- a/src/share/classes/sun/management/counter/perf/PerfLongCounter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/counter/perf/PerfLongCounter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -42,7 +42,7 @@
     }
 
     public Object getValue() {
-        return new Long(lb.get(0));
+        return Long.valueOf(lb.get(0));
     }
 
     /**
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -129,21 +129,21 @@
      * Getter for the "JvmClassesUnloadedCount" variable.
      */
     public Long getJvmClassesUnloadedCount() throws SnmpStatusException {
-        return new Long(getClassLoadingMXBean().getUnloadedClassCount());
+        return getClassLoadingMXBean().getUnloadedClassCount();
     }
 
     /**
      * Getter for the "JvmClassesTotalLoadedCount" variable.
      */
     public Long getJvmClassesTotalLoadedCount() throws SnmpStatusException {
-        return new Long(getClassLoadingMXBean().getTotalLoadedClassCount());
+        return getClassLoadingMXBean().getTotalLoadedClassCount();
     }
 
     /**
      * Getter for the "JvmClassesLoadedCount" variable.
      */
     public Long getJvmClassesLoadedCount() throws SnmpStatusException {
-        return new Long(getClassLoadingMXBean().getLoadedClassCount());
+        return (long)getClassLoadingMXBean().getLoadedClassCount();
     }
 
 }
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -115,7 +115,7 @@
             t = getCompilationMXBean().getTotalCompilationTime();
         else
             t = 0;
-        return new Long(t);
+        return t;
     }
 
     /**
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -70,7 +70,7 @@
      */
     // Don't bother to uses the request contextual cache for this.
     public Long getJvmMemGCTimeMs() throws SnmpStatusException {
-        return new Long(gcm.getCollectionTime());
+        return gcm.getCollectionTime();
     }
 
     /**
@@ -78,7 +78,7 @@
      */
     // Don't bother to uses the request contextual cache for this.
     public Long getJvmMemGCCount() throws SnmpStatusException {
-        return new Long(gcm.getCollectionCount());
+        return gcm.getCollectionCount();
     }
 
     /**
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -191,7 +191,7 @@
      */
     public Long getJvmMemPoolMaxSize() throws SnmpStatusException {
         final long val = getMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -200,7 +200,7 @@
      */
     public Long getJvmMemPoolUsed() throws SnmpStatusException {
         final long val = getMemoryUsage().getUsed();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -209,7 +209,7 @@
      */
     public Long getJvmMemPoolInitSize() throws SnmpStatusException {
         final long val = getMemoryUsage().getInit();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -218,7 +218,7 @@
      */
     public Long getJvmMemPoolCommitted() throws SnmpStatusException {
         final long val = getMemoryUsage().getCommitted();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -227,7 +227,7 @@
      */
     public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException {
         final long val = getPeakMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -236,7 +236,7 @@
      */
     public Long getJvmMemPoolPeakUsed() throws SnmpStatusException {
         final long val = getPeakMemoryUsage().getUsed();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -245,7 +245,7 @@
      */
     public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException {
         final long val = getPeakMemoryUsage().getCommitted();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -254,7 +254,7 @@
      */
     public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException {
         final long val = getCollectMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -263,7 +263,7 @@
      */
     public Long getJvmMemPoolCollectUsed() throws SnmpStatusException {
         final long val = getCollectMemoryUsage().getUsed();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -272,7 +272,7 @@
      */
     public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException {
         final long val = getCollectMemoryUsage().getCommitted();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -283,7 +283,7 @@
         if (!pool.isUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getUsageThreshold();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -334,7 +334,7 @@
         if (!pool.isUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getUsageThresholdCount();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -345,7 +345,7 @@
         if (!pool.isCollectionUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getCollectionUsageThreshold();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -399,7 +399,7 @@
         if (!pool.isCollectionUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getCollectionUsageThresholdCount();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -450,7 +450,7 @@
      */
     public synchronized Long getJvmMemPoolPeakReset()
         throws SnmpStatusException {
-        return new Long(jvmMemPoolPeakReset);
+        return jvmMemPoolPeakReset;
     }
 
     /**
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -222,7 +222,7 @@
         }
     }
 
-    static final Long Long0 = new Long(0);
+    static final Long Long0 = 0L;
 
     /**
      * Getter for the "JvmMemoryNonHeapMaxSize" variable.
@@ -230,7 +230,7 @@
     public Long getJvmMemoryNonHeapMaxSize()
         throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return Long0;
     }
 
@@ -239,7 +239,7 @@
      */
     public Long getJvmMemoryNonHeapCommitted() throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getCommitted();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -248,7 +248,7 @@
      */
     public Long getJvmMemoryNonHeapUsed() throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getUsed();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -257,7 +257,7 @@
      */
     public Long getJvmMemoryNonHeapInitSize() throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getInit();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -266,7 +266,7 @@
      */
     public Long getJvmMemoryHeapMaxSize() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getMax();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -320,7 +320,7 @@
      */
     public Long getJvmMemoryHeapCommitted() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getCommitted();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -359,7 +359,7 @@
      */
     public Long getJvmMemoryHeapUsed() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getUsed();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -368,7 +368,7 @@
      */
     public Long getJvmMemoryHeapInitSize() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getInit();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -380,11 +380,11 @@
         final long val = ManagementFactory.getMemoryMXBean().
             getObjectPendingFinalizationCount();
 
-        if (val > -1) return new Long((int)val);
+        if (val > -1) return Long.valueOf((int) val);
 
         // Should never happen... but stay safe all the same.
         //
-        else return new Long(0);
+        else return 0L;
     }
 
     static final MibLogger log = new MibLogger(JvmMemoryImpl.class);
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -259,14 +259,14 @@
      * Getter for the "JvmRTUptimeMs" variable.
      */
     public Long getJvmRTUptimeMs() throws SnmpStatusException {
-        return new Long(getRuntimeMXBean().getUptime());
+        return getRuntimeMXBean().getUptime();
     }
 
     /**
      * Getter for the "JvmRTStartTimeMs" variable.
      */
     public Long getJvmRTStartTimeMs() throws SnmpStatusException {
-        return new Long(getRuntimeMXBean().getStartTime());
+        return getRuntimeMXBean().getStartTime();
     }
 
     /**
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -139,7 +139,7 @@
                           "Unexpected exception: " + r);
                 log.debug("getJvmThreadInstState",r);
             }
-            Byte[] result = { new Byte(bitmap[0]), new Byte(bitmap[1]) };
+            Byte[] result = {bitmap[0], bitmap[1]};
             return result;
         }
     }
@@ -231,7 +231,7 @@
             log.debug("getJvmThreadInstCpuTimeNs",
                       "Operation not supported: " + e);
         }
-        return new Long(l);
+        return l;
     }
 
     /**
@@ -248,14 +248,14 @@
             //Monitoring is disabled
             if(l == -1) l = 0;
         }
-        return new Long(l);
+        return l;
     }
 
     /**
      * Getter for the "JvmThreadInstBlockCount" variable.
      */
     public Long getJvmThreadInstBlockCount() throws SnmpStatusException {
-        return new Long(info.getBlockedCount());
+        return info.getBlockedCount();
     }
 
     /**
@@ -272,14 +272,14 @@
             //Monitoring is disabled
             if(l == -1) l = 0;
         }
-        return new Long(l);
+        return l;
     }
 
     /**
      * Getter for the "JvmThreadInstWaitCount" variable.
      */
     public Long getJvmThreadInstWaitCount() throws SnmpStatusException {
-        return new Long(info.getWaitedCount());
+        return info.getWaitedCount();
     }
 
     /**
@@ -294,7 +294,7 @@
      * Getter for the "JvmThreadInstId" variable.
      */
     public Long getJvmThreadInstId() throws SnmpStatusException {
-        return new Long(info.getThreadId());
+        return info.getThreadId();
     }
 
     /**
--- a/src/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -303,28 +303,28 @@
      * Getter for the "JvmThreadTotalStartedCount" variable.
      */
     public Long getJvmThreadTotalStartedCount() throws SnmpStatusException {
-        return new Long(getThreadMXBean().getTotalStartedThreadCount());
+        return getThreadMXBean().getTotalStartedThreadCount();
     }
 
     /**
      * Getter for the "JvmThreadPeakCount" variable.
      */
     public Long getJvmThreadPeakCount() throws SnmpStatusException {
-        return  new Long(getThreadMXBean().getPeakThreadCount());
+        return (long)getThreadMXBean().getPeakThreadCount();
     }
 
     /**
      * Getter for the "JvmThreadDaemonCount" variable.
      */
     public Long getJvmThreadDaemonCount() throws SnmpStatusException {
-        return new Long(getThreadMXBean().getDaemonThreadCount());
+        return (long)getThreadMXBean().getDaemonThreadCount();
     }
 
     /**
      * Getter for the "JvmThreadCount" variable.
      */
     public Long getJvmThreadCount() throws SnmpStatusException {
-        return new Long(getThreadMXBean().getThreadCount());
+        return (long)getThreadMXBean().getThreadCount();
     }
 
    /**
@@ -332,7 +332,7 @@
      */
     public synchronized Long getJvmThreadPeakCountReset()
         throws SnmpStatusException {
-        return new Long(jvmThreadPeakCountReset);
+        return jvmThreadPeakCountReset;
     }
 
     /**
--- a/src/share/classes/sun/misc/Launcher.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/misc/Launcher.java	Wed Jul 09 10:42:37 2014 -0700
@@ -207,7 +207,7 @@
          * look in the extension directory itself.
          */
         public String findLibrary(String name) {
-            name = System.mapLibraryName(name);
+            final String libname = System.mapLibraryName(name);
             URL[] urls = super.getURLs();
             File prevDir = null;
             for (int i = 0; i < urls.length; i++) {
@@ -216,17 +216,26 @@
                 if (dir != null && !dir.equals(prevDir)) {
                     // Look in architecture-specific subdirectory first
                     // Read from the saved system properties to avoid deadlock
-                    String arch = VM.getSavedProperty("os.arch");
-                    if (arch != null) {
-                        File file = new File(new File(dir, arch), name);
-                        if (file.exists()) {
-                            return file.getAbsolutePath();
-                        }
-                    }
-                    // Then check the extension directory
-                    File file = new File(dir, name);
-                    if (file.exists()) {
-                        return file.getAbsolutePath();
+                    final String arch = VM.getSavedProperty("os.arch");
+                    String pathname = AccessController.doPrivileged(
+                        new PrivilegedAction<String>() {
+                            public String run() {
+                                if (arch != null) {
+                                    File file = new File(new File(dir, arch), libname);
+                                    if (file.exists()) {
+                                        return file.getAbsolutePath();
+                                    }
+                                }
+                                // Then check the extension directory
+                                File file = new File(dir, libname);
+                                if (file.exists()) {
+                                    return file.getAbsolutePath();
+                                }
+                                return null;
+                            }
+                        });
+                    if (pathname != null) {
+                        return pathname;
                     }
                 }
                 prevDir = dir;
--- a/src/share/classes/sun/misc/ProxyGenerator.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/misc/ProxyGenerator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1885,7 +1885,7 @@
                         "late constant pool addition: " + key);
                 }
                 short i = addEntry(new ValueEntry(key));
-                map.put(key, new Short(i));
+                map.put(key, i);
                 return i;
             }
         }
@@ -1903,7 +1903,7 @@
                     throw new InternalError("late constant pool addition");
                 }
                 short i = addEntry(e);
-                map.put(e, new Short(i));
+                map.put(e, i);
                 return i;
             }
         }
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -195,15 +195,8 @@
         synchronized (stateLock) {
             ensureOpen();
 
-            if (name == StandardSocketOptions.IP_TOS) {
-                // IPv4 only; no-op for IPv6
-                if (family == StandardProtocolFamily.INET) {
-                    Net.setSocketOption(fd, family, name, value);
-                }
-                return this;
-            }
-
-            if (name == StandardSocketOptions.IP_MULTICAST_TTL ||
+            if (name == StandardSocketOptions.IP_TOS ||
+                name == StandardSocketOptions.IP_MULTICAST_TTL ||
                 name == StandardSocketOptions.IP_MULTICAST_LOOP)
             {
                 // options are protocol dependent
@@ -256,16 +249,8 @@
         synchronized (stateLock) {
             ensureOpen();
 
-            if (name == StandardSocketOptions.IP_TOS) {
-                // IPv4 only; always return 0 on IPv6
-                if (family == StandardProtocolFamily.INET) {
-                    return (T) Net.getSocketOption(fd, family, name);
-                } else {
-                    return (T) Integer.valueOf(0);
-                }
-            }
-
-            if (name == StandardSocketOptions.IP_MULTICAST_TTL ||
+            if (name == StandardSocketOptions.IP_TOS ||
+                name == StandardSocketOptions.IP_MULTICAST_TTL ||
                 name == StandardSocketOptions.IP_MULTICAST_LOOP)
             {
                 return (T) Net.getSocketOption(fd, family, name);
--- a/src/share/classes/sun/nio/ch/Net.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/nio/ch/Net.java	Wed Jul 09 10:42:37 2014 -0700
@@ -352,7 +352,8 @@
         }
 
         boolean mayNeedConversion = (family == UNSPEC);
-        setIntOption0(fd, mayNeedConversion, key.level(), key.name(), arg);
+        boolean isIPv6 = (family == StandardProtocolFamily.INET6);
+        setIntOption0(fd, mayNeedConversion, key.level(), key.name(), arg, isIPv6);
     }
 
     static Object getSocketOption(FileDescriptor fd, ProtocolFamily family,
@@ -499,7 +500,7 @@
         throws IOException;
 
     private static native void setIntOption0(FileDescriptor fd, boolean mayNeedConversion,
-                                             int level, int opt, int arg)
+                                             int level, int opt, int arg, boolean isIPv6)
         throws IOException;
 
     static native int poll(FileDescriptor fd, int events, long timeout)
--- a/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -133,6 +133,14 @@
         synchronized (stateLock) {
             if (!isOpen())
                 throw new ClosedChannelException();
+
+            if (name == StandardSocketOptions.IP_TOS) {
+                ProtocolFamily family = Net.isIPv6Available() ?
+                    StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
+                Net.setSocketOption(fd, family, name, value);
+                return this;
+            }
+
             if (name == StandardSocketOptions.SO_REUSEADDR &&
                     Net.useExclusiveBind())
             {
@@ -177,6 +185,7 @@
             HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(2);
             set.add(StandardSocketOptions.SO_RCVBUF);
             set.add(StandardSocketOptions.SO_REUSEADDR);
+            set.add(StandardSocketOptions.IP_TOS);
             return Collections.unmodifiableSet(set);
         }
     }
--- a/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Wed Jul 09 10:42:37 2014 -0700
@@ -173,14 +173,14 @@
             if (!isOpen())
                 throw new ClosedChannelException();
 
-            // special handling for IP_TOS: no-op when IPv6
             if (name == StandardSocketOptions.IP_TOS) {
-                if (!Net.isIPv6Available())
-                    Net.setSocketOption(fd, StandardProtocolFamily.INET, name, value);
+                ProtocolFamily family = Net.isIPv6Available() ?
+                    StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
+                Net.setSocketOption(fd, family, name, value);
                 return this;
-            } else if (name == StandardSocketOptions.SO_REUSEADDR &&
-                           Net.useExclusiveBind())
-            {
+            }
+
+            if (name == StandardSocketOptions.SO_REUSEADDR && Net.useExclusiveBind()) {
                 // SO_REUSEADDR emulated when using exclusive bind
                 isReuseAddress = (Boolean)value;
                 return this;
@@ -215,8 +215,9 @@
 
             // special handling for IP_TOS: always return 0 when IPv6
             if (name == StandardSocketOptions.IP_TOS) {
-                return (Net.isIPv6Available()) ? (T) Integer.valueOf(0) :
-                    (T) Net.getSocketOption(fd, StandardProtocolFamily.INET, name);
+                ProtocolFamily family = Net.isIPv6Available() ?
+                    StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
+                return (T) Net.getSocketOption(fd, family, name);
             }
 
             // no options that require special handling
--- a/src/share/classes/sun/nio/ch/Util.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/nio/ch/Util.java	Wed Jul 09 10:42:37 2014 -0700
@@ -329,7 +329,7 @@
         try {
             dbb = (MappedByteBuffer)directByteBufferConstructor.newInstance(
               new Object[] { new Integer(size),
-                             new Long(addr),
+                             addr,
                              fd,
                              unmapper });
         } catch (InstantiationException |
@@ -374,7 +374,7 @@
         try {
             dbb = (MappedByteBuffer)directByteBufferRConstructor.newInstance(
               new Object[] { new Integer(size),
-                             new Long(addr),
+                             addr,
                              fd,
                              unmapper });
         } catch (InstantiationException |
--- a/src/share/classes/sun/print/CustomMediaSizeName.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/CustomMediaSizeName.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,8 +33,8 @@
 import java.util.ArrayList;
 
 class CustomMediaSizeName extends MediaSizeName {
-    private static ArrayList customStringTable = new ArrayList();
-    private static ArrayList customEnumTable = new ArrayList();
+    private static ArrayList<String> customStringTable = new ArrayList<>();
+    private static ArrayList<MediaSizeName> customEnumTable = new ArrayList<>();
     private String choiceName;
     private MediaSizeName mediaName;
 
@@ -162,7 +162,7 @@
      */
     protected String[] getStringTable() {
       String[] nameTable = new String[customStringTable.size()];
-      return (String[])customStringTable.toArray(nameTable);
+      return customStringTable.toArray(nameTable);
     }
 
     /**
@@ -170,7 +170,7 @@
      */
     protected EnumSyntax[] getEnumValueTable() {
       MediaSizeName[] enumTable = new MediaSizeName[customEnumTable.size()];
-      return (MediaSizeName[])customEnumTable.toArray(enumTable);
+      return customEnumTable.toArray(enumTable);
     }
 
 }
--- a/src/share/classes/sun/print/CustomMediaTray.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/CustomMediaTray.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
 import java.util.ArrayList;
 
 class CustomMediaTray extends MediaTray {
-    private static ArrayList customStringTable = new ArrayList();
-    private static ArrayList customEnumTable = new ArrayList();
+    private static ArrayList<String> customStringTable = new ArrayList<>();
+    private static ArrayList<MediaTray> customEnumTable = new ArrayList<>();
     private String choiceName;
 
     private CustomMediaTray(int x) {
@@ -79,7 +79,7 @@
      */
     protected String[] getStringTable() {
       String[] nameTable = new String[customStringTable.size()];
-      return (String[])customStringTable.toArray(nameTable);
+      return customStringTable.toArray(nameTable);
     }
 
     /**
@@ -87,7 +87,7 @@
      */
     protected EnumSyntax[] getEnumValueTable() {
       MediaTray[] enumTable = new MediaTray[customEnumTable.size()];
-      return (MediaTray[])customEnumTable.toArray(enumTable);
+      return customEnumTable.toArray(enumTable);
     }
 
 }
--- a/src/share/classes/sun/print/DialogOwner.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/DialogOwner.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,6 +25,7 @@
 
 package sun.print;
 
+import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintRequestAttribute;
 import java.awt.Frame;
 
@@ -72,7 +73,7 @@
      * @return  Printing attribute class (category), an instance of class
      *          {@link java.lang.Class java.lang.Class}.
      */
-    public final Class getCategory() {
+    public final Class<? extends Attribute> getCategory() {
         return DialogOwner.class;
     }
 
--- a/src/share/classes/sun/print/PSPrinterJob.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/PSPrinterJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -310,7 +310,7 @@
    /**
     * A stack that represents the PostScript gstate stack.
     */
-   ArrayList mGStateStack = new ArrayList();
+   ArrayList<GState> mGStateStack = new ArrayList<>();
 
    /**
     * The x coordinate of the current pen position.
@@ -346,7 +346,7 @@
        //enable priviledges so initProps can access system properties,
         // open the property file, etc.
         java.security.AccessController.doPrivileged(
-                            new java.security.PrivilegedAction() {
+                            new java.security.PrivilegedAction<Object>() {
             public Object run() {
                 mFontProps = initProps();
                 String osName = System.getProperty("os.name");
@@ -622,11 +622,11 @@
                                            paperWidth + " "+ paperHeight+"]");
 
             final PrintService pservice = getPrintService();
-            Boolean isPS = (Boolean)java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
-                    public Object run() {
+            Boolean isPS = java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Boolean>() {
+                    public Boolean run() {
                        try {
-                           Class psClass = Class.forName("sun.print.IPPPrintService");
+                           Class<?> psClass = Class.forName("sun.print.IPPPrintService");
                            if (psClass.isInstance(pservice)) {
                                Method isPSMethod = psClass.getMethod("isPostscript",
                                                                      (Class[])null);
@@ -660,11 +660,11 @@
 
     // Inner class to run "privileged" to open the printer output stream.
 
-    private class PrinterOpener implements java.security.PrivilegedAction {
+    private class PrinterOpener implements java.security.PrivilegedAction<OutputStream> {
         PrinterException pex;
         OutputStream result;
 
-        public Object run() {
+        public OutputStream run() {
             try {
 
                     /* Write to a temporary file which will be spooled to
@@ -687,7 +687,7 @@
 
     // Inner class to run "privileged" to invoke the system print command
 
-    private class PrinterSpooler implements java.security.PrivilegedAction {
+    private class PrinterSpooler implements java.security.PrivilegedAction<Object> {
         PrinterException pex;
 
         private void handleProcessFailure(final Process failedProcess,
@@ -708,8 +708,8 @@
                     }
                 } finally {
                     pw.flush();
-                    throw new IOException(sw.toString());
                 }
+                throw new IOException(sw.toString());
             }
         }
 
@@ -753,7 +753,7 @@
             mPSStream.close();
         }
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
 
             public Object run() {
                if (spoolFile != null && spoolFile.exists()) {
@@ -812,7 +812,7 @@
          * It will have the default PostScript gstate
          * attributes.
          */
-        mGStateStack = new ArrayList();
+        mGStateStack = new ArrayList<>();
         mGStateStack.add(new GState());
 
         mPSStream.println(PAGE_COMMENT + pageNumber + " " + pageNumber);
@@ -825,13 +825,11 @@
                             paperWidth + " " + paperHeight + "]");
 
             final PrintService pservice = getPrintService();
-            Boolean isPS =
-                (Boolean)java.security.AccessController.doPrivileged(
-
-                new java.security.PrivilegedAction() {
-                    public Object run() {
+            Boolean isPS = java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Boolean>() {
+                    public Boolean run() {
                         try {
-                            Class psClass =
+                            Class<?> psClass =
                                 Class.forName("sun.print.IPPPrintService");
                             if (psClass.isInstance(pservice)) {
                                 Method isPSMethod =
@@ -1720,7 +1718,7 @@
      */
     private GState getGState() {
         int count = mGStateStack.size();
-        return (GState) mGStateStack.get(count - 1);
+        return mGStateStack.get(count - 1);
     }
 
     /**
--- a/src/share/classes/sun/print/PSStreamPrintJob.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/PSStreamPrintJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -66,9 +66,9 @@
 
 public class PSStreamPrintJob implements CancelablePrintJob {
 
-    transient private Vector jobListeners;
-    transient private Vector attrListeners;
-    transient private Vector listenedAttributeSets;
+    transient private Vector<PrintJobListener> jobListeners;
+    transient private Vector<PrintJobAttributeListener> attrListeners;
+    transient private Vector<PrintJobAttributeSet> listenedAttributeSets;
 
     private PSStreamPrintService service;
     private boolean fidelity;
@@ -117,7 +117,7 @@
                 return;
             }
             if (jobListeners == null) {
-                jobListeners = new Vector();
+                jobListeners = new Vector<>();
             }
             jobListeners.add(listener);
         }
@@ -191,7 +191,7 @@
                 PrintJobListener listener;
                 PrintJobEvent event = new PrintJobEvent(this, reason);
                 for (int i = 0; i < jobListeners.size(); i++) {
-                    listener = (PrintJobListener)(jobListeners.elementAt(i));
+                    listener = jobListeners.elementAt(i);
                     switch (reason) {
 
                         case PrintJobEvent.JOB_CANCELED :
@@ -230,8 +230,8 @@
                 return;
             }
             if (attrListeners == null) {
-                attrListeners = new Vector();
-                listenedAttributeSets = new Vector();
+                attrListeners = new Vector<>();
+                listenedAttributeSets = new Vector<>();
             }
             attrListeners.add(listener);
             if (attributes == null) {
@@ -494,7 +494,7 @@
     private void getAttributeValues(DocFlavor flavor) throws PrintException {
 
         Attribute attr;
-        Class category;
+        Class<? extends Attribute> category;
 
         if (reqAttrSet.get(Fidelity.class) == Fidelity.FIDELITY_TRUE) {
             fidelity = true;
--- a/src/share/classes/sun/print/PSStreamPrintService.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/PSStreamPrintService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -62,7 +62,7 @@
 public class PSStreamPrintService extends StreamPrintService
     implements SunPrinterJobService {
 
-    private static final Class[] suppAttrCats = {
+    private static final Class<?>[] suppAttrCats = {
         Chromaticity.class,
         Copies.class,
         Fidelity.class,
@@ -108,7 +108,7 @@
         return new PSStreamPrintJob(this);
     }
 
-    public boolean usesClass(Class c) {
+    public boolean usesClass(Class<?> c) {
         return (c == sun.print.PSPrinterJob.class);
     }
 
@@ -137,7 +137,9 @@
             throw new IllegalArgumentException("Not a PrintServiceAttribute");
         }
         if (category == ColorSupported.class) {
-            return (T)ColorSupported.SUPPORTED;
+            @SuppressWarnings("unchecked")
+            T tmp = (T)ColorSupported.SUPPORTED;
+            return tmp;
         } else {
             return null;
         }
@@ -161,7 +163,7 @@
 
 
     public Class<?>[] getSupportedAttributeCategories() {
-        Class []cats = new Class[suppAttrCats.length];
+        Class<?>[] cats = new Class<?>[suppAttrCats.length];
         System.arraycopy(suppAttrCats, 0, cats, 0, cats.length);
         return cats;
     }
@@ -401,7 +403,7 @@
             throw new IllegalArgumentException(flavor +
                                                " is an unsupported flavor");
         }
-        Class category = attr.getCategory();
+        Class<? extends Attribute> category = attr.getCategory();
         if (!isAttributeCategorySupported(category)) {
             return false;
         }
--- a/src/share/classes/sun/print/PrintJob2D.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/PrintJob2D.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1011,7 +1011,7 @@
 
         private String qid="noname";
 
-        private ArrayList queue = new ArrayList();
+        private ArrayList<Graphics2D> queue = new ArrayList<>();
 
         MessageQ(String id) {
           qid = id;
@@ -1055,7 +1055,7 @@
             while (g == null && queue != null) {
 
                 if (queue.size() > 0) {
-                    g = (Graphics2D) queue.remove(0);
+                    g = queue.remove(0);
                     notify();
 
                 } else {
--- a/src/share/classes/sun/print/PrintJobAttributeException.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/PrintJobAttributeException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -34,19 +34,19 @@
     implements AttributeException {
 
     private Attribute attr;
-    private Class category;
+    private Class<?> category;
 
-    PrintJobAttributeException(String s, Class cat, Attribute attrval) {
+    PrintJobAttributeException(String s, Class<?> cat, Attribute attrval) {
         super(s);
         attr = attrval;
         category = cat;
     }
 
-    public Class[] getUnsupportedAttributes() {
+    public Class<?>[] getUnsupportedAttributes() {
         if (category == null) {
             return null;
         } else {
-            Class [] cats = { category};
+            Class<?>[] cats = { category};
             return cats;
         }
     }
--- a/src/share/classes/sun/print/PrinterJobWrapper.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/PrinterJobWrapper.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,6 +26,7 @@
 package sun.print;
 
 import java.awt.print.PrinterJob;
+import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintRequestAttribute;
 
 public class PrinterJobWrapper implements PrintRequestAttribute {
@@ -42,7 +43,7 @@
         return job;
     }
 
-    public final Class getCategory() {
+    public final Class<? extends Attribute> getCategory() {
         return PrinterJobWrapper.class;
     }
 
--- a/src/share/classes/sun/print/RasterPrinterJob.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/RasterPrinterJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -273,7 +273,7 @@
     /**
      * List of areas & the graphics state for redrawing
      */
-    private ArrayList redrawList = new ArrayList();
+    private ArrayList<GraphicsState> redrawList = new ArrayList<>();
 
 
     /* variables representing values extracted from an attribute set.
@@ -712,10 +712,9 @@
           GraphicsEnvironment.getLocalGraphicsEnvironment().
           getDefaultScreenDevice().getDefaultConfiguration();
 
-        PrintService service =
-            (PrintService)java.security.AccessController.doPrivileged(
-                                        new java.security.PrivilegedAction() {
-                public Object run() {
+        PrintService service = java.security.AccessController.doPrivileged(
+                               new java.security.PrivilegedAction<PrintService>() {
+                public PrintService run() {
                     PrintService service = getPrintService();
                     if (service == null) {
                         ServiceDialog.showNoPrintService(gc);
@@ -768,10 +767,9 @@
         int x = bounds.x+bounds.width/3;
         int y = bounds.y+bounds.height/3;
 
-        PrintService service =
-            (PrintService)java.security.AccessController.doPrivileged(
-                                        new java.security.PrivilegedAction() {
-                public Object run() {
+        PrintService service = java.security.AccessController.doPrivileged(
+                               new java.security.PrivilegedAction<PrintService>() {
+                public PrintService run() {
                     PrintService service = getPrintService();
                     if (service == null) {
                         ServiceDialog.showNoPrintService(gc);
@@ -793,7 +791,7 @@
         if (pageDialog.getStatus() == ServiceDialog.APPROVE) {
             PrintRequestAttributeSet newas =
                 pageDialog.getAttributes();
-            Class amCategory = SunAlternateMedia.class;
+            Class<?> amCategory = SunAlternateMedia.class;
 
             if (attributes.containsKey(amCategory) &&
                 !newas.containsKey(amCategory)) {
@@ -868,10 +866,9 @@
             GraphicsEnvironment.getLocalGraphicsEnvironment().
             getDefaultScreenDevice().getDefaultConfiguration();
 
-        PrintService service =
-            (PrintService)java.security.AccessController.doPrivileged(
-                       new java.security.PrivilegedAction() {
-                public Object run() {
+        PrintService service = java.security.AccessController.doPrivileged(
+                               new java.security.PrivilegedAction<PrintService>() {
+                public PrintService run() {
                     PrintService service = getPrintService();
                     if (service == null) {
                         ServiceDialog.showNoPrintService(gc);
@@ -894,10 +891,9 @@
                 services[i] = spsFactories[i].getPrintService(null);
             }
         } else {
-            services =
-            (PrintService[])java.security.AccessController.doPrivileged(
-                       new java.security.PrivilegedAction() {
-                public Object run() {
+            services = java.security.AccessController.doPrivileged(
+                       new java.security.PrivilegedAction<PrintService[]>() {
+                public PrintService[] run() {
                     PrintService[] services = PrinterJob.lookupPrintServices();
                     return services;
                 }
@@ -2131,7 +2127,7 @@
                 painter.print(pathGraphics, origPage, pageIndex);
 
                 for (int i=0;i<redrawList.size();i++) {
-                   GraphicsState gstate = (GraphicsState)redrawList.get(i);
+                   GraphicsState gstate = redrawList.get(i);
                    pathGraphics.setTransform(initialTx);
                    ((PathGraphics)pathGraphics).redrawRegion(
                                                          gstate.region,
--- a/src/share/classes/sun/print/ServiceDialog.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/ServiceDialog.java	Wed Jul 09 10:42:37 2014 -0700
@@ -395,7 +395,7 @@
      * for "Print To File"
      */
     private boolean showFileChooser() {
-        Class dstCategory = Destination.class;
+        Class<Destination> dstCategory = Destination.class;
 
         Destination dst = (Destination)asCurrent.get(dstCategory);
         if (dst == null) {
@@ -463,7 +463,7 @@
      */
     public static void initResource() {
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
                 public Object run() {
                     try {
                         messageRB = ResourceBundle.getBundle(strBundle);
@@ -529,7 +529,7 @@
     /**
      * Returns the mnemonic as a KeyEvent.VK constant from the resource.
      */
-    static Class _keyEventClazz = null;
+    static Class<?> _keyEventClazz = null;
     private static int getVKMnemonic(String key) {
         String s = String.valueOf(getMnemonic(key));
         if ( s == null || s.length() != 1) {
@@ -554,9 +554,9 @@
      * Returns URL for image resource
      */
     private static URL getImageResource(final String key) {
-        URL url = (URL)java.security.AccessController.doPrivileged(
-                       new java.security.PrivilegedAction() {
-                public Object run() {
+        URL url = java.security.AccessController.doPrivileged(
+                       new java.security.PrivilegedAction<URL>() {
+                public URL run() {
                     URL url = ServiceDialog.class.getResource(
                                                   "resources/" + key);
                     return url;
@@ -710,7 +710,7 @@
         private FilePermission printToFilePermission;
         private JButton btnProperties;
         private JCheckBox cbPrintToFile;
-        private JComboBox cbName;
+        private JComboBox<String> cbName;
         private JLabel lblType, lblStatus, lblInfo;
         private ServiceUIFactory uiFactory;
         private boolean changedService = false;
@@ -731,7 +731,7 @@
             for (int i = 0; i < psnames.length; i++) {
                 psnames[i] = services[i].getName();
             }
-            cbName = new JComboBox(psnames);
+            cbName = new JComboBox<>(psnames);
             cbName.setSelectedIndex(defaultServiceIndex);
             cbName.addItemListener(this);
             cbName.addPopupMenuListener(this);
@@ -924,7 +924,7 @@
         }
 
         public void updateInfo() {
-            Class dstCategory = Destination.class;
+            Class<Destination> dstCategory = Destination.class;
             boolean dstSupported = false;
             boolean dstSelected = false;
             boolean dstAllowed = filePermission ?
@@ -1123,7 +1123,7 @@
         }
 
         public void updateInfo() {
-            Class prCategory = PageRanges.class;
+            Class<PageRanges> prCategory = PageRanges.class;
             prSupported = false;
 
             if (psCurrent.isAttributeCategorySupported(prCategory) ||
@@ -1240,9 +1240,8 @@
         }
 
         public void updateInfo() {
-            Class cpCategory = Copies.class;
-            Class csCategory = CopiesSupported.class;
-            Class scCategory = SheetCollate.class;
+            Class<Copies> cpCategory = Copies.class;
+            Class<SheetCollate> scCategory = SheetCollate.class;
             boolean cpSupported = false;
             scSupported = false;
 
@@ -1525,7 +1524,7 @@
             float bm = bmTmpObj.floatValue();
 
             /* adjust for orientation */
-            Class orCategory = OrientationRequested.class;
+            Class<OrientationRequested> orCategory = OrientationRequested.class;
             OrientationRequested or =
                 (OrientationRequested)asCurrent.get(orCategory);
 
@@ -1589,7 +1588,7 @@
         private MediaPrintableArea validateMargins(float lm, float rm,
                                                    float tm, float bm) {
 
-            Class mpaCategory = MediaPrintableArea.class;
+            Class<MediaPrintableArea> mpaCategory = MediaPrintableArea.class;
             MediaPrintableArea mpa;
             MediaPrintableArea mpaMax = null;
             MediaSize mediaSize = null;
@@ -1671,7 +1670,7 @@
                 return;
             }
 
-            Class mpaCategory = MediaPrintableArea.class;
+            Class<MediaPrintableArea> mpaCategory = MediaPrintableArea.class;
             MediaPrintableArea mpa =
                  (MediaPrintableArea)asCurrent.get(mpaCategory);
             MediaPrintableArea mpaMax = null;
@@ -1845,7 +1844,7 @@
              * to the fields appropriate for the orientation.
              * Note: if orientation changes this method must be called.
              */
-            Class orCategory = OrientationRequested.class;
+            Class<OrientationRequested> orCategory = OrientationRequested.class;
             OrientationRequested or =
                 (OrientationRequested)asCurrent.get(orCategory);
 
@@ -1885,9 +1884,9 @@
 
         private final String strTitle = getMsg("border.media");
         private JLabel lblSize, lblSource;
-        private JComboBox cbSize, cbSource;
-        private Vector sizes = new Vector();
-        private Vector sources = new Vector();
+        private JComboBox<Object> cbSize, cbSource;
+        private Vector<MediaSizeName> sizes = new Vector<>();
+        private Vector<MediaTray> sources = new Vector<>();
         private MarginsPanel pnlMargins = null;
 
         public MediaPanel() {
@@ -1899,8 +1898,8 @@
             setLayout(gridbag);
             setBorder(BorderFactory.createTitledBorder(strTitle));
 
-            cbSize = new JComboBox();
-            cbSource = new JComboBox();
+            cbSize = new JComboBox<>();
+            cbSource = new JComboBox<>();
 
             c.fill = GridBagConstraints.BOTH;
             c.insets = compInsets;
@@ -1950,17 +1949,17 @@
                             (cbSource.getSelectedIndex() >= 1))
                         {
                             int src = cbSource.getSelectedIndex() - 1;
-                            MediaTray mt = (MediaTray)sources.get(src);
+                            MediaTray mt = sources.get(src);
                             asCurrent.add(new SunAlternateMedia(mt));
                         }
-                        asCurrent.add((MediaSizeName)sizes.get(index));
+                        asCurrent.add(sizes.get(index));
                     }
                 } else if (source == cbSource) {
                     int index = cbSource.getSelectedIndex();
 
                     if ((index >= 1) && (index < (sources.size() + 1))) {
                        asCurrent.remove(SunAlternateMedia.class);
-                       MediaTray newTray = (MediaTray)sources.get(index - 1);
+                       MediaTray newTray = sources.get(index - 1);
                        Media m = (Media)asCurrent.get(Media.class);
                        if (m == null || m instanceof MediaTray) {
                            asCurrent.add(newTray);
@@ -1980,7 +1979,7 @@
                         asCurrent.remove(SunAlternateMedia.class);
                         if (cbSize.getItemCount() > 0) {
                             int size = cbSize.getSelectedIndex();
-                            asCurrent.add((MediaSizeName)sizes.get(size));
+                            asCurrent.add(sizes.get(size));
                         }
                     }
                 }
@@ -1997,8 +1996,8 @@
             pnlMargins = pnl;
         }
         public void updateInfo() {
-            Class mdCategory = Media.class;
-            Class amCategory = SunAlternateMedia.class;
+            Class<Media> mdCategory = Media.class;
+            Class<SunAlternateMedia> amCategory = SunAlternateMedia.class;
             boolean mediaSupported = false;
 
             cbSize.removeItemListener(this);
@@ -2025,10 +2024,10 @@
                         Media medium = media[i];
 
                         if (medium instanceof MediaSizeName) {
-                            sizes.add(medium);
+                            sizes.add((MediaSizeName)medium);
                             cbSize.addItem(getMediaName(medium.toString()));
                         } else if (medium instanceof MediaTray) {
-                            sources.add(medium);
+                            sources.add((MediaTray)medium);
                             cbSource.addItem(getMediaName(medium.toString()));
                         }
                     }
@@ -2095,12 +2094,12 @@
 
                 int selIndex = cbSize.getSelectedIndex();
                 if ((selIndex >= 0) && (selIndex < sizes.size())) {
-                  asCurrent.add((MediaSizeName)sizes.get(selIndex));
+                  asCurrent.add(sizes.get(selIndex));
                 }
 
                 selIndex = cbSource.getSelectedIndex();
                 if ((selIndex >= 1) && (selIndex < (sources.size()+1))) {
-                    MediaTray mt = (MediaTray)sources.get(selIndex-1);
+                    MediaTray mt = sources.get(selIndex-1);
                     if (medium instanceof MediaTray) {
                         asCurrent.add(mt);
                     } else {
@@ -2185,7 +2184,7 @@
         }
 
         public void updateInfo() {
-            Class orCategory = OrientationRequested.class;
+            Class<OrientationRequested> orCategory = OrientationRequested.class;
             boolean pSupported = false;
             boolean lSupported = false;
             boolean rpSupported = false;
@@ -2363,7 +2362,7 @@
         }
 
         public void updateInfo() {
-            Class chCategory = Chromaticity.class;
+            Class<Chromaticity> chCategory = Chromaticity.class;
             boolean monoSupported = false;
             boolean colorSupported = false;
 
@@ -2458,7 +2457,7 @@
         }
 
         public void updateInfo() {
-            Class pqCategory = PrintQuality.class;
+            Class<PrintQuality> pqCategory = PrintQuality.class;
             boolean draftSupported = false;
             boolean normalSupported = false;
             boolean highSupported = false;
@@ -2568,7 +2567,7 @@
         }
 
         public void updateInfo() {
-            Class sdCategory = Sides.class;
+            Class<Sides> sdCategory = Sides.class;
             boolean osSupported = false;
             boolean tSupported = false;
             boolean dSupported = false;
@@ -2725,10 +2724,10 @@
         public void focusGained(FocusEvent e) {}
 
         public void updateInfo() {
-            Class jsCategory = JobSheets.class;
-            Class jpCategory = JobPriority.class;
-            Class jnCategory = JobName.class;
-            Class unCategory = RequestingUserName.class;
+            Class<JobSheets>          jsCategory = JobSheets.class;
+            Class<JobPriority>        jpCategory = JobPriority.class;
+            Class<JobName>            jnCategory = JobName.class;
+            Class<RequestingUserName> unCategory = RequestingUserName.class;
             boolean jsSupported = false;
             boolean jpSupported = false;
             boolean jnSupported = false;
@@ -2817,9 +2816,9 @@
         {
             super(new FlowLayout(FlowLayout.LEADING));
             final URL imgURL = getImageResource(img);
-            Icon icon = (Icon)java.security.AccessController.doPrivileged(
-                                 new java.security.PrivilegedAction() {
-                public Object run() {
+            Icon icon = java.security.AccessController.doPrivileged(
+                                 new java.security.PrivilegedAction<Icon>() {
+                public Icon run() {
                     Icon icon = new ImageIcon(imgURL);
                     return icon;
                 }
--- a/src/share/classes/sun/print/ServiceNotifier.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/ServiceNotifier.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,14 +43,14 @@
 class ServiceNotifier extends Thread {
 
     private PrintService service;
-    private Vector listeners;
+    private Vector<PrintServiceAttributeListener> listeners;
     private boolean stop = false;
     private PrintServiceAttributeSet lastSet;
 
     ServiceNotifier(PrintService service) {
         super(service.getName() + " notifier");
         this.service = service;
-        listeners = new Vector();
+        listeners = new Vector<>();
         try {
               setPriority(Thread.NORM_PRIORITY-1);
               setDaemon(true);
@@ -128,8 +128,7 @@
                     }
                     if (psa != null && !psa.isEmpty()) {
                         for (int i = 0; i < listeners.size() ; i++) {
-                            listener = (PrintServiceAttributeListener)
-                                listeners.elementAt(i);
+                            listener = listeners.elementAt(i);
                             attrs =
                                 new HashPrintServiceAttributeSet(psa);
                             attrEvent =
--- a/src/share/classes/sun/print/SunAlternateMedia.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/SunAlternateMedia.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,6 +25,7 @@
 
 package sun.print;
 
+import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintRequestAttribute;
 import javax.print.attribute.standard.Media;
 
@@ -47,7 +48,7 @@
         return media;
     }
 
-    public final Class getCategory() {
+    public final Class<? extends Attribute> getCategory() {
         return SunAlternateMedia.class;
     }
 
--- a/src/share/classes/sun/print/SunMinMaxPage.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/SunMinMaxPage.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,6 +26,7 @@
 package sun.print;
 
 import javax.print.attribute.PrintRequestAttribute;
+import javax.print.attribute.PrintRequestAttribute;
 
 /*
  * A class used to determine minimum and maximum pages.
@@ -40,7 +41,7 @@
     }
 
 
-    public final Class getCategory() {
+    public final Class<? extends PrintRequestAttribute> getCategory() {
         return SunMinMaxPage.class;
     }
 
--- a/src/share/classes/sun/print/SunPageSelection.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/SunPageSelection.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,6 +25,7 @@
 
 package sun.print;
 
+import javax.print.attribute.Attribute;
 import javax.print.attribute.PrintRequestAttribute;
 
 /*
@@ -43,7 +44,7 @@
         pages = value;
     }
 
-    public final Class getCategory() {
+    public final Class<? extends Attribute> getCategory() {
         return SunPageSelection.class;
     }
 
--- a/src/share/classes/sun/print/SunPrinterJobService.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/print/SunPrinterJobService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -37,6 +37,6 @@
      * platform's built-in subclass of PrinterJob.
      * ie the same class as the caller.
      */
-    public boolean usesClass(Class c);
+    public boolean usesClass(Class<?> c);
 
 }
--- a/src/share/classes/sun/security/action/GetLongAction.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/action/GetLongAction.java	Wed Jul 09 10:42:37 2014 -0700
@@ -106,7 +106,7 @@
     public Long run() {
         Long value = Long.getLong(theProp);
         if ((value == null) && defaultSet)
-            return new Long(defaultVal);
+            return defaultVal;
         return value;
     }
 }
--- a/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Wed Jul 09 10:42:37 2014 -0700
@@ -203,7 +203,7 @@
     }
 
     public int hashCode() {
-        return new Long(pName).hashCode();
+        return Long.hashCode(pName);
     }
 
     public byte[] export() throws GSSException {
--- a/src/share/classes/sun/security/krb5/Config.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/krb5/Config.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,10 +31,13 @@
 package sun.security.krb5;
 
 import java.io.File;
-import java.io.FileInputStream;
+import java.io.FilePermission;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.Path;
+import java.security.PrivilegedAction;
 import java.util.*;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -196,8 +199,11 @@
                 }
             }
         } catch (IOException ioe) {
-            // I/O error, mostly like krb5.conf missing.
-            // No problem. We'll use DNS or system property etc.
+            if (DEBUG) {
+                System.out.println("Exception thrown in loading config:");
+                ioe.printStackTrace(System.out);
+            }
+            throw new KrbException("krb5.conf loading failed");
         }
     }
 
@@ -206,7 +212,7 @@
      * @param keys the keys, as an array from section name, sub-section names
      * (if any), to value name.
      * @return the value. When there are multiple values for the same key,
-     * returns the last one. {@code null} is returned if not all the keys are
+     * returns the first one. {@code null} is returned if not all the keys are
      * defined. For example, {@code get("libdefaults", "forwardable")} will
      * return null if "forwardable" is not defined in [libdefaults], and
      * {@code get("realms", "R", "kdc")} will return null if "R" is not
@@ -223,7 +229,7 @@
     public String get(String... keys) {
         Vector<String> v = getString0(keys);
         if (v == null) return null;
-        return v.lastElement();
+        return v.firstElement();
     }
 
     /**
@@ -273,7 +279,7 @@
     }
 
     /**
-     * Returns true if keys exists, can be either final string(s) or sub-stanza
+     * Returns true if keys exists, can be final string(s) or a sub-section
      * @throws IllegalArgumentException if any of the keys is illegal
      *         (See {@link #get})
      */
@@ -291,9 +297,9 @@
         }
     }
 
-    // Internal method. Returns the value for keys, which can be a sub-stanza
-    // or final string value(s).
-    // The only method (except for toString) that reads stanzaTable directly.
+    // Internal method. Returns the value for keys, which can be a sub-section
+    // (as a Hashtable) or final string value(s) (as a Vector). This is the
+    // only method (except for toString) that reads stanzaTable directly.
     @SuppressWarnings("unchecked")
     private Object get0(String... keys) {
         Object current = stanzaTable;
@@ -453,142 +459,207 @@
     }
 
     /**
-     * Reads lines to the memory from the configuration file.
+     * Reads the lines of the configuration file. All include and includedir
+     * directives are resolved by calling this method recursively.
      *
-     * Configuration file contains information about the default realm,
-     * ticket parameters, location of the KDC and the admin server for
-     * known realms, etc. The file is divided into sections. Each section
-     * contains one or more name/value pairs with one pair per line. A
-     * typical file would be:
-     * <pre>
-     * [libdefaults]
-     *          default_realm = EXAMPLE.COM
-     *          default_tgs_enctypes = des-cbc-md5
-     *          default_tkt_enctypes = des-cbc-md5
-     * [realms]
-     *          EXAMPLE.COM = {
-     *                  kdc = kerberos.example.com
-     *                  kdc = kerberos-1.example.com
-     *                  admin_server = kerberos.example.com
-     *                  }
-     *          SAMPLE_COM = {
-     *                  kdc = orange.sample.com
-     *                  admin_server = orange.sample.com
-     *                  }
-     * [domain_realm]
-     *          blue.sample.com = TEST.SAMPLE.COM
-     *          .backup.com     = EXAMPLE.COM
-     * </pre>
-     * @return an ordered list of strings representing the config file after
-     * some initial processing, including:<ol>
-     * <li> Comment lines and empty lines are removed
-     * <li> "{" not at the end of a line is appended to the previous line
-     * <li> The content of a section is also placed between "{" and "}".
-     * <li> Lines are trimmed</ol>
+     * @param file the krb5.conf file, must be absolute
+     * @param content the lines. Comment and empty lines are removed,
+     *                all lines trimmed, include and includedir
+     *                directives resolved, unknown directives ignored
+     * @param dups a set of Paths to check for possible infinite loop
      * @throws IOException if there is an I/O error
-     * @throws KrbException if there is a file format error
+     */
+    private static Void readConfigFileLines(
+            Path file, List<String> content, Set<Path> dups)
+            throws IOException {
+
+        if (DEBUG) {
+            System.out.println("Loading krb5 profile at " + file);
+        }
+        if (!file.isAbsolute()) {
+            throw new IOException("Profile path not absolute");
+        }
+
+        if (!dups.add(file)) {
+            throw new IOException("Profile path included more than once");
+        }
+
+        List<String> lines = Files.readAllLines(file);
+
+        boolean inDirectives = true;
+        for (String line: lines) {
+            line = line.trim();
+            if (line.isEmpty() || line.startsWith("#")) {
+                continue;
+            }
+            if (inDirectives) {
+                if (line.charAt(0) == '[') {
+                    inDirectives = false;
+                    content.add(line);
+                } else if (line.startsWith("includedir ")) {
+                    Path dir = Paths.get(
+                            line.substring("includedir ".length()).trim());
+                    try (DirectoryStream<Path> files =
+                                 Files.newDirectoryStream(dir)) {
+                        for (Path p: files) {
+                            if (Files.isDirectory(p)) continue;
+                            String name = p.getFileName().toString();
+                            if (name.matches("[a-zA-Z0-9_-]+")) {
+                                // if dir is absolute, so is p
+                                readConfigFileLines(p, content, dups);
+                            }
+                        }
+                    }
+                } else if (line.startsWith("include ")) {
+                    readConfigFileLines(
+                            Paths.get(line.substring("include ".length()).trim()),
+                            content, dups);
+                } else {
+                    // Unsupported directives
+                    if (DEBUG) {
+                        System.out.println("Unknown directive: " + line);
+                    }
+                }
+            } else {
+                content.add(line);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Reads the configuration file and return normalized lines.
+     * If the original file is:
+     *
+     *     [realms]
+     *     EXAMPLE.COM =
+     *     {
+     *         kdc = kerberos.example.com
+     *         ...
+     *     }
+     *     ...
+     *
+     * The result will be (no indentations):
+     *
+     *     {
+     *         realms = {
+     *             EXAMPLE.COM = {
+     *                 kdc = kerberos.example.com
+     *                 ...
+     *             }
+     *         }
+     *         ...
+     *     }
+     *
+     * @param fileName the configuration file
+     * @return normalized lines
      */
     private List<String> loadConfigFile(final String fileName)
             throws IOException, KrbException {
+
+        List<String> result = new ArrayList<>();
+        List<String> raw = new ArrayList<>();
+        Set<Path> dupsCheck = new HashSet<>();
+
         try {
-            List<String> v = new ArrayList<>();
-            try (BufferedReader br = new BufferedReader(new InputStreamReader(
-                AccessController.doPrivileged(
-                    new PrivilegedExceptionAction<FileInputStream> () {
-                        public FileInputStream run() throws IOException {
-                            return new FileInputStream(fileName);
+            Path fullp = AccessController.doPrivileged((PrivilegedAction<Path>)
+                        () -> Paths.get(fileName).toAbsolutePath(),
+                    null,
+                    new PropertyPermission("user.dir", "read"));
+            AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Void>() {
+                        @Override
+                        public Void run() throws IOException {
+                            Path path = Paths.get(fileName);
+                            if (!Files.exists(path)) {
+                                // This is OK. There are other ways to get
+                                // Kerberos 5 settings
+                                return null;
+                            } else {
+                                return readConfigFileLines(
+                                        fullp, raw, dupsCheck);
+                            }
                         }
-                    })))) {
-                String line;
-                String previous = null;
-                while ((line = br.readLine()) != null) {
-                    line = line.trim();
-                    if (line.startsWith("#") || line.isEmpty()) {
-                        // ignore comments and blank line
-                        // Comments start with #.
-                        continue;
-                    }
-                    // In practice, a subsection might look like:
-                    //      [realms]
-                    //      EXAMPLE.COM =
-                    //      {
-                    //          kdc = kerberos.example.com
-                    //          ...
-                    //      }
-                    // Before parsed into stanza table, it needs to be
-                    // converted into a canonicalized style (no indent):
-                    //      realms = {
-                    //          EXAMPLE.COM = {
-                    //              kdc = kerberos.example.com
-                    //              ...
-                    //          }
-                    //      }
-                    //
-                    if (line.startsWith("[")) {
-                        if (!line.endsWith("]")) {
-                            throw new KrbException("Illegal config content:"
-                                    + line);
-                        }
-                        if (previous != null) {
-                            v.add(previous);
-                            v.add("}");
-                        }
-                        String title = line.substring(
-                                1, line.length()-1).trim();
-                        if (title.isEmpty()) {
-                            throw new KrbException("Illegal config content:"
-                                    + line);
-                        }
-                        previous = title + " = {";
-                    } else if (line.startsWith("{")) {
-                        if (previous == null) {
-                            throw new KrbException(
-                                "Config file should not start with \"{\"");
-                        }
-                        previous += " {";
-                        if (line.length() > 1) {
-                            // { and content on the same line
-                            v.add(previous);
-                            previous = line.substring(1).trim();
-                        }
-                    } else {
-                        // Lines before the first section are ignored
-                        if (previous != null) {
-                            v.add(previous);
-                            previous = line;
-                        }
-                    }
-                }
-                if (previous != null) {
-                    v.add(previous);
-                    v.add("}");
-                }
-            }
-            return v;
+                    },
+                    null,
+                    // include/includedir can go anywhere
+                    new FilePermission("<<ALL FILES>>", "read"));
         } catch (java.security.PrivilegedActionException pe) {
             throw (IOException)pe.getException();
         }
+        String previous = null;
+        for (String line: raw) {
+            if (line.startsWith("[")) {
+                if (!line.endsWith("]")) {
+                    throw new KrbException("Illegal config content:"
+                            + line);
+                }
+                if (previous != null) {
+                    result.add(previous);
+                    result.add("}");
+                }
+                String title = line.substring(
+                        1, line.length()-1).trim();
+                if (title.isEmpty()) {
+                    throw new KrbException("Illegal config content:"
+                            + line);
+                }
+                previous = title + " = {";
+            } else if (line.startsWith("{")) {
+                if (previous == null) {
+                    throw new KrbException(
+                        "Config file should not start with \"{\"");
+                }
+                previous += " {";
+                if (line.length() > 1) {
+                    // { and content on the same line
+                    result.add(previous);
+                    previous = line.substring(1).trim();
+                }
+            } else {
+                if (previous == null) {
+                    // This won't happen, because before a section
+                    // all directives have been resolved
+                    throw new KrbException(
+                        "Config file must starts with a section");
+                }
+                result.add(previous);
+                previous = line;
+            }
+        }
+        if (previous != null) {
+            result.add(previous);
+            result.add("}");
+        }
+        return result;
     }
 
     /**
-     * Parses stanza names and values from configuration file to
-     * stanzaTable (Hashtable). Hashtable key would be stanza names,
-     * (libdefaults, realms, domain_realms, etc), and the hashtable value
-     * would be another hashtable which contains the key-value pairs under
-     * a stanza name. The value of this sub-hashtable can be another hashtable
-     * containing another sub-sub-section or a vector of strings for
-     * final values (even if there is only one value defined).
+     * Parses the input lines to a hashtable. The key would be section names
+     * (libdefaults, realms, domain_realms, etc), and the value would be
+     * another hashtable which contains the key-value pairs inside the section.
+     * The value of this sub-hashtable can be another hashtable containing
+     * another sub-sub-section or a non-empty vector of strings for final values
+     * (even if there is only one value defined).
+     * <p>
+     * For top-level sections with duplicates names, their contents are merged.
+     * For sub-sections the former overwrites the latter. For final values,
+     * they are stored in a vector in their appearing order. Please note these
+     * values must appear in the same sub-section. Otherwise, the sub-section
+     * appears first should have already overridden the others.
      * <p>
-     * For duplicates section names, the latter overwrites the former. For
-     * duplicate value names, the values are in a vector in its appearing order.
-     * </ol>
-     * Please note that this behavior is Java traditional. and it is
-     * not the same as the MIT krb5 behavior, where:<ol>
-     * <li>Duplicated root sections will be merged
-     * <li>For duplicated sub-sections, the former overwrites the latter
-     * <li>Duplicate keys for values are always saved in a vector
-     * </ol>
-     * @param v the strings in the file, never null, might be empty
+     * As a corner case, if the same name is used as both a section name and a
+     * value name, the first appearance decides the type. That is to say, if the
+     * first one is for a section, all latter appearances are ignored. If it's
+     * a value, latter appearances as sections are ignored, but those as values
+     * are added to the vector.
+     * <p>
+     * The behavior described above is compatible to other krb5 implementations
+     * but it's not decumented publicly anywhere. the best practice is not to
+     * assume any kind of override functionality and only specify values for
+     * a particular key in one place.
+     *
+     * @param v the normalized input as return by loadConfigFile
      * @throws KrbException if there is a file format error
      */
     @SuppressWarnings("unchecked")
@@ -596,7 +667,7 @@
             throws KrbException {
         Hashtable<String,Object> current = stanzaTable;
         for (String line: v) {
-            // There are 3 kinds of lines
+            // There are only 3 kinds of lines
             // 1. a = b
             // 2. a = {
             // 3. }
@@ -612,14 +683,25 @@
                     throw new KrbException("Illegal config content:" + line);
                 }
                 String key = line.substring(0, pos).trim();
-                String value = trimmed(line.substring(pos+1));
+                String value = unquote(line.substring(pos + 1));
                 if (value.equals("{")) {
                     Hashtable<String,Object> subTable;
                     if (current == stanzaTable) {
                         key = key.toLowerCase(Locale.US);
                     }
-                    subTable = new Hashtable<>();
-                    current.put(key, subTable);
+                    // When there are dup names for sections
+                    if (current.containsKey(key)) {
+                        if (current == stanzaTable) {   // top-level, merge
+                            // The value at top-level must be another Hashtable
+                            subTable = (Hashtable<String,Object>)current.get(key);
+                        } else {                        // otherwise, ignored
+                            // read and ignore it (do not put into current)
+                            subTable = new Hashtable<>();
+                        }
+                    } else {
+                        subTable = new Hashtable<>();
+                        current.put(key, subTable);
+                    }
                     // A special entry for its parent. Put whitespaces around,
                     // so will never be confused with a normal key
                     subTable.put(" PARENT ", current);
@@ -628,20 +710,19 @@
                     Vector<String> values;
                     if (current.containsKey(key)) {
                         Object obj = current.get(key);
-                        // If a key first shows as a section and then a value,
-                        // this is illegal. However, we haven't really forbid
-                        // first value then section, which the final result
-                        // is a section.
-                        if (!(obj instanceof Vector)) {
-                            throw new KrbException("Key " + key
-                                    + "used for both value and section");
+                        if (obj instanceof Vector) {
+                            // String values are merged
+                            values = (Vector<String>)obj;
+                            values.add(value);
+                        } else {
+                            // If a key shows as section first and then a value,
+                            // ignore the value.
                         }
-                        values = (Vector<String>)current.get(key);
                     } else {
                         values = new Vector<String>();
+                        values.add(value);
                         current.put(key, values);
                     }
-                    values.add(value);
                 }
             }
         }
@@ -764,7 +845,7 @@
         return "/etc/krb5.conf";
     }
 
-    private static String trimmed(String s) {
+    private static String unquote(String s) {
         s = s.trim();
         if (s.isEmpty()) return s;
         if (s.charAt(0) == '"' && s.charAt(s.length()-1) == '"' ||
--- a/src/share/classes/sun/security/krb5/internal/KerberosTime.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/krb5/internal/KerberosTime.java	Wed Jul 09 10:42:37 2014 -0700
@@ -188,8 +188,8 @@
     }
 
     public int getMicroSeconds() {
-        Long temp_long = new Long((kerberosTime % 1000L) * 1000L);
-        return temp_long.intValue() + microSeconds;
+        int temp_int = (int) ((kerberosTime % 1000L) * 1000L);
+        return temp_int + microSeconds;
     }
 
     /**
@@ -250,8 +250,7 @@
     }
 
     public int getSeconds() {
-        Long temp_long = new Long(kerberosTime / 1000L);
-        return temp_long.intValue();
+        return (int) (kerberosTime / 1000L);
     }
 
     /**
--- a/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java	Wed Jul 09 10:42:37 2014 -0700
@@ -334,15 +334,29 @@
      * returns null.
      */
     Credentials readCred(int version) throws IOException,RealmException, KrbApErrException, Asn1Exception {
-        PrincipalName cpname = readPrincipal(version);
-        if (DEBUG)
+        PrincipalName cpname = null;
+        try {
+            cpname = readPrincipal(version);
+        } catch (Exception e) {
+            // Do not return here. All data for this cred should be fully
+            // consumed so that we can read the next one.
+        }
+        if (DEBUG) {
             System.out.println(">>>DEBUG <CCacheInputStream>  client principal is " + cpname);
-        PrincipalName spname = readPrincipal(version);
-        if (DEBUG)
+        }
+        PrincipalName spname = null;
+        try {
+            spname = readPrincipal(version);
+        } catch (Exception e) {
+            // same as above
+        }
+        if (DEBUG) {
             System.out.println(">>>DEBUG <CCacheInputStream> server principal is " + spname);
+        }
         EncryptionKey key = readKey(version);
-        if (DEBUG)
+        if (DEBUG) {
             System.out.println(">>>DEBUG <CCacheInputStream> key type: " + key.getEType());
+        }
         long times[] = readTimes();
         KerberosTime authtime = new KerberosTime(times[0]);
         KerberosTime starttime =
@@ -375,6 +389,11 @@
         byte[] ticketData = readData();
         byte[] ticketData2 = readData();
 
+        // Skip this cred if either cpname or spname isn't created.
+        if (cpname == null || spname == null) {
+            return null;
+        }
+
         try {
             return new Credentials(cpname, spname, key, authtime, starttime,
                 endtime, renewTill, skey, tFlags,
--- a/src/share/classes/sun/security/pkcs/PKCS9Attribute.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/pkcs/PKCS9Attribute.java	Wed Jul 09 10:42:37 2014 -0700
@@ -309,26 +309,26 @@
      */
     private static final Byte[][] PKCS9_VALUE_TAGS = {
         null,
-        {new Byte(DerValue.tag_IA5String)},   // EMailAddress
-        {new Byte(DerValue.tag_IA5String),   // UnstructuredName
-         new Byte(DerValue.tag_PrintableString)},
-        {new Byte(DerValue.tag_ObjectId)},    // ContentType
-        {new Byte(DerValue.tag_OctetString)}, // MessageDigest
-        {new Byte(DerValue.tag_UtcTime)},     // SigningTime
-        {new Byte(DerValue.tag_Sequence)},    // Countersignature
-        {new Byte(DerValue.tag_PrintableString),
-         new Byte(DerValue.tag_T61String)},   // ChallengePassword
-        {new Byte(DerValue.tag_PrintableString),
-         new Byte(DerValue.tag_T61String)},   // UnstructuredAddress
-        {new Byte(DerValue.tag_SetOf)},       // ExtendedCertificateAttributes
-        {new Byte(DerValue.tag_Sequence)},    // issuerAndSerialNumber
+        {DerValue.tag_IA5String},   // EMailAddress
+        {DerValue.tag_IA5String,   // UnstructuredName
+         DerValue.tag_PrintableString},
+        {DerValue.tag_ObjectId},    // ContentType
+        {DerValue.tag_OctetString}, // MessageDigest
+        {DerValue.tag_UtcTime},     // SigningTime
+        {DerValue.tag_Sequence},    // Countersignature
+        {DerValue.tag_PrintableString,
+         DerValue.tag_T61String},   // ChallengePassword
+        {DerValue.tag_PrintableString,
+         DerValue.tag_T61String},   // UnstructuredAddress
+        {DerValue.tag_SetOf},       // ExtendedCertificateAttributes
+        {DerValue.tag_Sequence},    // issuerAndSerialNumber
         null,
         null,
         null,
-        {new Byte(DerValue.tag_Sequence)},    // extensionRequest
-        {new Byte(DerValue.tag_Sequence)},    // SMIMECapability
-        {new Byte(DerValue.tag_Sequence)},    // SigningCertificate
-        {new Byte(DerValue.tag_Sequence)}     // SignatureTimestampToken
+        {DerValue.tag_Sequence},    // extensionRequest
+        {DerValue.tag_Sequence},    // SMIMECapability
+        {DerValue.tag_Sequence},    // SigningCertificate
+        {DerValue.tag_Sequence}     // SignatureTimestampToken
     };
 
     private static final Class<?>[] VALUE_CLASSES = new Class<?>[18];
@@ -511,7 +511,7 @@
         // check for illegal element tags
         Byte tag;
         for (int i=0; i < elems.length; i++) {
-            tag = new Byte(elems[i].tag);
+            tag = elems[i].tag;
 
             if (indexOf(tag, PKCS9_VALUE_TAGS[index], 0) == -1)
                 throwTagException(tag);
--- a/src/share/classes/sun/security/pkcs11/P11Signature.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/pkcs11/P11Signature.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -340,7 +340,10 @@
         }
         int minKeySize = (int) mechInfo.ulMinKeySize;
         int maxKeySize = (int) mechInfo.ulMaxKeySize;
-
+        // need to override the MAX keysize for SHA1withDSA
+        if (md != null && mechanism == CKM_DSA && maxKeySize > 1024) {
+               maxKeySize = 1024;
+        }
         int keySize = 0;
         if (key instanceof P11Key) {
             keySize = ((P11Key) key).length();
--- a/src/share/classes/sun/security/tools/keytool/Main.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/tools/keytool/Main.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1675,7 +1675,7 @@
             Object[] source = {new Integer(keysize),
                                 privKey.getAlgorithm(),
                                 chain[0].getSigAlgName(),
-                                new Long(validity),
+                                validity,
                                 x500Name};
             System.err.println(form.format(source));
         }
--- a/src/share/classes/sun/security/x509/AVA.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/security/x509/AVA.java	Wed Jul 09 10:42:37 2014 -0700
@@ -517,7 +517,7 @@
             if (hexDigits.indexOf(Character.toUpperCase((char)c2)) >= 0) {
                 int hi = Character.digit((char)c1, 16);
                 int lo = Character.digit((char)c2, 16);
-                return new Byte((byte)((hi<<4) + lo));
+                return (byte)((hi<<4) + lo);
             } else {
                 throw new IOException
                         ("escaped hex value must include two valid digits");
--- a/src/share/classes/sun/swing/JLightweightFrame.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/swing/JLightweightFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -54,6 +54,7 @@
 import javax.swing.RootPaneContainer;
 import javax.swing.SwingUtilities;
 
+import sun.awt.DisplayChangedListener;
 import sun.awt.LightweightFrame;
 import sun.security.action.GetPropertyAction;
 import sun.swing.SwingUtilities2.RepaintListener;
@@ -80,6 +81,8 @@
 
     private BufferedImage bbImage;
 
+    private volatile int scaleFactor = 1;
+
     /**
      * {@code copyBufferEnabled}, true by default, defines the following strategy.
      * A duplicating (copy) buffer is created for the original pixel buffer.
@@ -90,7 +93,7 @@
      * by the lock (managed with the {@link LightweightContent#paintLock()},
      * {@link LightweightContent#paintUnlock()} methods).
      */
-    private boolean copyBufferEnabled;
+    private static boolean copyBufferEnabled;
     private int[] copyBuffer;
 
     private PropertyChangeListener layoutSizeListener;
@@ -103,6 +106,8 @@
                 frame.updateClientCursor();
             }
         });
+        copyBufferEnabled = "true".equals(AccessController.
+            doPrivileged(new GetPropertyAction("swing.jlf.copyBufferEnabled", "true")));
     }
 
     /**
@@ -144,7 +149,8 @@
             }
             Point p = SwingUtilities.convertPoint(c, x, y, jlf);
             Rectangle r = new Rectangle(p.x, p.y, w, h).intersection(
-                    new Rectangle(0, 0, bbImage.getWidth(), bbImage.getHeight()));
+                    new Rectangle(0, 0, bbImage.getWidth() / scaleFactor,
+                                  bbImage.getHeight() / scaleFactor));
 
             if (!r.isEmpty()) {
                 notifyImageUpdated(r.x, r.y, r.width, r.height);
@@ -198,6 +204,7 @@
         g.setBackground(getBackground());
         g.setColor(getForeground());
         g.setFont(getFont());
+        g.scale(scaleFactor, scaleFactor);
         return g;
     }
 
@@ -221,7 +228,39 @@
         if (content != null) content.focusUngrabbed();
     }
 
-    private void syncCopyBuffer(boolean reset, int x, int y, int w, int h) {
+    @Override
+    public int getScaleFactor() {
+        return scaleFactor;
+    }
+
+    @Override
+    public void notifyDisplayChanged(final int scaleFactor) {
+        if (scaleFactor != this.scaleFactor) {
+            if (!copyBufferEnabled) content.paintLock();
+            try {
+                if (bbImage != null) {
+                    resizeBuffer(getWidth(), getHeight(), scaleFactor);
+                }
+            } finally {
+                if (!copyBufferEnabled) content.paintUnlock();
+            }
+            this.scaleFactor = scaleFactor;
+        }
+        if (getPeer() instanceof DisplayChangedListener) {
+            ((DisplayChangedListener)getPeer()).displayChanged();
+        }
+        repaint();
+    }
+
+    @Override
+    public void addNotify() {
+        super.addNotify();
+        if (getPeer() instanceof DisplayChangedListener) {
+            ((DisplayChangedListener)getPeer()).displayChanged();
+        }
+    }
+
+    private void syncCopyBuffer(boolean reset, int x, int y, int w, int h, int scale) {
         content.paintLock();
         try {
             int[] srcBuffer = ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
@@ -230,6 +269,11 @@
             }
             int linestride = bbImage.getWidth();
 
+            x *= scale;
+            y *= scale;
+            w *= scale;
+            h *= scale;
+
             for (int i=0; i<h; i++) {
                 int from = (y + i) * linestride + x;
                 System.arraycopy(srcBuffer, from, copyBuffer, from, w);
@@ -241,7 +285,7 @@
 
     private void notifyImageUpdated(int x, int y, int width, int height) {
         if (copyBufferEnabled) {
-            syncCopyBuffer(false, x, y, width, height);
+            syncCopyBuffer(false, x, y, width, height, scaleFactor);
         }
         content.imageUpdated(x, y, width, height);
     }
@@ -269,7 +313,8 @@
                     EventQueue.invokeLater(new Runnable() {
                         @Override
                         public void run() {
-                            notifyImageUpdated(clip.x, clip.y, clip.width, clip.height);
+                            Rectangle c = contentPane.getBounds().intersection(clip);
+                            notifyImageUpdated(c.x, c.y, c.width, c.height);
                         }
                     });
                 } finally {
@@ -323,48 +368,37 @@
             content.paintLock();
         }
         try {
-            if ((bbImage == null) || (width != bbImage.getWidth()) || (height != bbImage.getHeight())) {
-                boolean createBB = true;
-                int newW = width;
-                int newH = height;
-                if (bbImage != null) {
-                    int oldW = bbImage.getWidth();
-                    int oldH = bbImage.getHeight();
-                    if ((oldW >= newW) && (oldH >= newH)) {
-                        createBB = false;
-                    } else {
-                        if (oldW >= newW) {
-                            newW = oldW;
+            boolean createBB = (bbImage == null);
+            int newW = width;
+            int newH = height;
+            if (bbImage != null) {
+                int imgWidth = bbImage.getWidth() / scaleFactor;
+                int imgHeight = bbImage.getHeight() / scaleFactor;
+                if (width != imgWidth || height != imgHeight) {
+                    createBB = true;
+                    if (bbImage != null) {
+                        int oldW = imgWidth;
+                        int oldH = imgHeight;
+                        if ((oldW >= newW) && (oldH >= newH)) {
+                            createBB = false;
                         } else {
-                            newW = Math.max((int)(oldW * 1.2), width);
-                        }
-                        if (oldH >= newH) {
-                            newH = oldH;
-                        } else {
-                            newH = Math.max((int)(oldH * 1.2), height);
+                            if (oldW >= newW) {
+                                newW = oldW;
+                            } else {
+                                newW = Math.max((int)(oldW * 1.2), width);
+                            }
+                            if (oldH >= newH) {
+                                newH = oldH;
+                            } else {
+                                newH = Math.max((int)(oldH * 1.2), height);
+                            }
                         }
                     }
                 }
-                if (createBB) {
-                    BufferedImage oldBB = bbImage;
-                    bbImage = new BufferedImage(newW, newH, BufferedImage.TYPE_INT_ARGB_PRE);
-                    if (oldBB != null) {
-                        Graphics g = bbImage.getGraphics();
-                        try {
-                            g.drawImage(oldBB, 0, 0, newW, newH, null);
-                        } finally {
-                            g.dispose();
-                            oldBB.flush();
-                        }
-                    }
-                    int[] pixels = ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
-                    if (copyBufferEnabled) {
-                        syncCopyBuffer(true, 0, 0, width, height);
-                        pixels = copyBuffer;
-                    }
-                    content.imageBufferReset(pixels, 0, 0, width, height, bbImage.getWidth());
-                    return;
-                }
+            }
+            if (createBB) {
+                resizeBuffer(newW, newH, scaleFactor);
+                return;
             }
             content.imageReshaped(0, 0, width, height);
 
@@ -375,6 +409,18 @@
         }
     }
 
+    private void resizeBuffer(int width, int height, int newScaleFactor) {
+            bbImage = new BufferedImage(width*newScaleFactor,height*newScaleFactor,
+                                        BufferedImage.TYPE_INT_ARGB_PRE);
+        int[] pixels= ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
+        if (copyBufferEnabled) {
+            syncCopyBuffer(true, 0, 0, width, height, newScaleFactor);
+            pixels = copyBuffer;
+        }
+        content.imageBufferReset(pixels, 0, 0, width, height,
+                                 width * newScaleFactor, newScaleFactor);
+    }
+
     @Override
     public JRootPane getRootPane() {
         return rootPane;
--- a/src/share/classes/sun/swing/LightweightContent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/swing/LightweightContent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -85,31 +85,53 @@
      * {@code JLightweightFrame} calls this method to notify the client
      * application that a new data buffer has been set as a content pixel
      * buffer. Typically this occurs when a buffer of a larger size is
-     * created in response to a content resize event. The method reports
-     * a reference to the pixel data buffer, the content image bounds
-     * within the buffer and the line stride of the buffer. These values
-     * have the following correlation.
+     * created in response to a content resize event.
      * <p>
-     * The {@code width} and {@code height} matches the size of the content
+     * The method reports a reference to the pixel data buffer, the content
+     * image bounds within the buffer and the line stride of the buffer.
+     * These values have the following correlation.
+     * The {@code width} and {@code height} matches the layout size of the content
      * (the component returned from the {@link #getComponent} method). The
      * {@code x} and {@code y} is the origin of the content, {@code (0, 0)}
-     * in the coordinate space of the content, appearing at
-     * {@code data[y * linestride + x]} in the buffer. All indices
-     * {@code data[(y + j) * linestride + (x + i)]} where
-     * {@code (0 <= i < width)} and {@code (0 <= j < height)} will represent
-     * valid pixel data, {@code (i, j)} in the coordinate space of the content.
+     * in the layout coordinate space of the content, appearing at
+     * {@code data[y * scale * linestride + x * scale]} in the buffer.
+     * A pixel with indices {@code (i, j)}, where {@code (0 <= i < width)} and
+     * {@code (0 <= j < height)}, in the layout coordinate space of the content
+     * is represented by a {@code scale^2} square of pixels in the physical
+     * coordinate space of the buffer. The top-left corner of the square has the
+     * following physical coordinate in the buffer:
+     * {@code data[(y + j) * scale * linestride + (x + i) * scale]}.
      *
      * @param data the content pixel data buffer of INT_ARGB_PRE type
-     * @param x the x coordinate of the image
-     * @param y the y coordinate of the image
-     * @param width the width of the image
-     * @param height the height of the image
+     * @param x the logical x coordinate of the image
+     * @param y the logical y coordinate of the image
+     * @param width the logical width of the image
+     * @param height the logical height of the image
      * @param linestride the line stride of the pixel buffer
+     * @param scale the scale factor of the pixel buffer
      */
-    public void imageBufferReset(int[] data,
+    default public void imageBufferReset(int[] data,
                                  int x, int y,
                                  int width, int height,
-                                 int linestride);
+                                 int linestride,
+                                 int scale)
+    {
+        imageBufferReset(data, x, y, width, height, linestride);
+    }
+
+    /**
+     * The default implementation for #imageBufferReset uses a hard-coded value
+     * of 1 for the scale factor. Both the old and the new methods provide
+     * default implementations in order to allow a client application to run
+     * with any JDK version without breaking backward compatibility.
+     */
+    default public void imageBufferReset(int[] data,
+                                 int x, int y,
+                                 int width, int height,
+                                 int linestride)
+    {
+        imageBufferReset(data, x, y, width, height, linestride, 1);
+    }
 
     /**
      * {@code JLightweightFrame} calls this method to notify the client
--- a/src/share/classes/sun/swing/SwingAccessor.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/swing/SwingAccessor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -27,11 +27,10 @@
 
 import sun.misc.Unsafe;
 
-import java.awt.Point;
-import javax.swing.RepaintManager;
+import java.awt.*;
+import javax.swing.*;
 
 import javax.swing.text.JTextComponent;
-import javax.swing.TransferHandler;
 
 /**
  * The SwingAccessor utility class.
@@ -91,6 +90,14 @@
     }
 
     /**
+     * An accessor for PopupFactory class.
+     */
+    public interface PopupFactoryAccessor {
+        Popup getHeavyWeightPopup(PopupFactory factory, Component owner, Component contents,
+                                  int ownerX, int ownerY);
+    }
+
+    /**
      * The javax.swing.text.JTextComponent class accessor object.
      */
     private static JTextComponentAccessor jtextComponentAccessor;
@@ -156,4 +163,26 @@
         }
         return repaintManagerAccessor;
     }
+
+    /**
+     * The PopupFactory class accessor object.
+     */
+    private static PopupFactoryAccessor popupFactoryAccessor;
+
+    /**
+     * Retrieve the accessor object for the PopupFactory class.
+     */
+    public static PopupFactoryAccessor getPopupFactoryAccessor() {
+        if (popupFactoryAccessor == null) {
+            unsafe.ensureClassInitialized(PopupFactory.class);
+        }
+        return popupFactoryAccessor;
+    }
+
+    /**
+     * Set an Accessor object for the PopupFactory class.
+     */
+    public static void setPopupFactoryAccessor(PopupFactoryAccessor popupFactoryAccessor) {
+        SwingAccessor.popupFactoryAccessor = popupFactoryAccessor;
+    }
 }
--- a/src/share/classes/sun/text/CodePointIterator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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.
- */
-
-/*
- * (C) Copyright IBM Corp. 2003 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- */
-
-package sun.text;
-
-import java.text.CharacterIterator;
-
-public abstract class CodePointIterator {
-    public static final int DONE = -1;
-
-    public abstract void setToStart();
-    public abstract void setToLimit();
-
-    public abstract int next();
-    public abstract int prev();
-
-    public abstract int charIndex();
-
-    public static CodePointIterator create(char[] text) {
-        return new CharArrayCodePointIterator(text);
-    }
-
-    public static CodePointIterator create(char[] text, int start, int limit) {
-        return new CharArrayCodePointIterator(text, start, limit);
-    }
-
-    public static CodePointIterator create(CharSequence text) {
-        return new CharSequenceCodePointIterator(text);
-    }
-
-    public static CodePointIterator create(CharacterIterator iter) {
-        return new CharacterIteratorCodePointIterator(iter);
-    }
-}
-
-final class CharArrayCodePointIterator extends CodePointIterator {
-    private char[] text;
-    private int start;
-    private int limit;
-    private int index;
-
-    public CharArrayCodePointIterator(char[] text) {
-        this.text = text;
-        this.limit = text.length;
-    }
-
-    public CharArrayCodePointIterator(char[] text, int start, int limit) {
-        if (start < 0 || limit < start || limit > text.length) {
-            throw new IllegalArgumentException();
-        }
-
-        this.text = text;
-        this.start = this.index = start;
-        this.limit = limit;
-    }
-
-    public void setToStart() {
-        index = start;
-    }
-
-    public void setToLimit() {
-        index = limit;
-    }
-
-    public int next() {
-        if (index < limit) {
-            char cp1 = text[index++];
-            if (Character.isHighSurrogate(cp1) && index < limit) {
-                char cp2 = text[index];
-                if (Character.isLowSurrogate(cp2)) {
-                    ++index;
-                    return Character.toCodePoint(cp1, cp2);
-                }
-            }
-            return cp1;
-        }
-        return DONE;
-    }
-
-    public int prev() {
-        if (index > start) {
-            char cp2 = text[--index];
-            if (Character.isLowSurrogate(cp2) && index > start) {
-                char cp1 = text[index - 1];
-                if (Character.isHighSurrogate(cp1)) {
-                    --index;
-                    return Character.toCodePoint(cp1, cp2);
-                }
-            }
-            return cp2;
-        }
-        return DONE;
-    }
-
-    public int charIndex() {
-        return index;
-    }
-}
-
-final class CharSequenceCodePointIterator extends CodePointIterator {
-    private CharSequence text;
-    private int index;
-
-    public CharSequenceCodePointIterator(CharSequence text) {
-        this.text = text;
-    }
-
-    public void setToStart() {
-        index = 0;
-    }
-
-    public void setToLimit() {
-        index = text.length();
-    }
-
-    public int next() {
-        if (index < text.length()) {
-            char cp1 = text.charAt(index++);
-            if (Character.isHighSurrogate(cp1) && index < text.length()) {
-                char cp2 = text.charAt(index+1);
-                if (Character.isLowSurrogate(cp2)) {
-                    ++index;
-                    return Character.toCodePoint(cp1, cp2);
-                }
-            }
-            return cp1;
-        }
-        return DONE;
-    }
-
-    public int prev() {
-        if (index > 0) {
-            char cp2 = text.charAt(--index);
-            if (Character.isLowSurrogate(cp2) && index > 0) {
-                char cp1 = text.charAt(index - 1);
-                if (Character.isHighSurrogate(cp1)) {
-                    --index;
-                    return Character.toCodePoint(cp1, cp2);
-                }
-            }
-            return cp2;
-        }
-        return DONE;
-    }
-
-    public int charIndex() {
-        return index;
-    }
-}
-
-// note this has different iteration semantics than CharacterIterator
-final class CharacterIteratorCodePointIterator extends CodePointIterator {
-    private CharacterIterator iter;
-
-    public CharacterIteratorCodePointIterator(CharacterIterator iter) {
-        this.iter = iter;
-    }
-
-    public void setToStart() {
-        iter.setIndex(iter.getBeginIndex());
-    }
-
-    public void setToLimit() {
-        iter.setIndex(iter.getEndIndex());
-    }
-
-    public int next() {
-        char cp1 = iter.current();
-        if (cp1 != CharacterIterator.DONE) {
-            char cp2 = iter.next();
-            if (Character.isHighSurrogate(cp1) && cp2 != CharacterIterator.DONE) {
-                if (Character.isLowSurrogate(cp2)) {
-                    iter.next();
-                    return Character.toCodePoint(cp1, cp2);
-                }
-            }
-            return cp1;
-        }
-        return DONE;
-    }
-
-    public int prev() {
-        char cp2 = iter.previous();
-        if (cp2 != CharacterIterator.DONE) {
-            if (Character.isLowSurrogate(cp2)) {
-                char cp1 = iter.previous();
-                if (Character.isHighSurrogate(cp1)) {
-                    return Character.toCodePoint(cp1, cp2);
-                }
-                iter.next();
-            }
-            return cp2;
-        }
-        return DONE;
-    }
-
-    public int charIndex() {
-        return iter.getIndex();
-    }
-}
--- a/src/share/classes/sun/tools/java/BinaryConstantPool.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/tools/java/BinaryConstantPool.java	Wed Jul 09 10:42:37 2014 -0700
@@ -66,7 +66,7 @@
                 cpool[i] = new Float(in.readFloat());
                 break;
               case CONSTANT_LONG:
-                cpool[i++] = new Long(in.readLong());
+                cpool[i++] = in.readLong();
                 break;
               case CONSTANT_DOUBLE:
                 cpool[i++] = new Double(in.readDouble());
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Wed Jul 09 10:42:37 2014 -0700
@@ -56,7 +56,7 @@
                 ObjectName mbeanName = new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
                                                       ",name=" + name);
                 if (client.isRegistered(mbeanName)) {
-                    gcMBeans.put(mbeanName, new Long(0));
+                    gcMBeans.put(mbeanName, 0L);
                 }
             } catch (Exception e) {
                 assert false;
@@ -97,7 +97,7 @@
             Long gcCount = e.getValue();
             Long newCount = gc.getCollectionCount();
             if (newCount > gcCount) {
-                gcMBeans.put(e.getKey(), new Long(newCount));
+                gcMBeans.put(e.getKey(), newCount);
                 lastGcInfo = gc.getLastGcInfo();
                 if (lastGcInfo.getEndTime() > lastGcEndTime) {
                     gcId = lastGcInfo.getId();
--- a/src/share/classes/sun/tools/jconsole/inspector/Utils.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/Utils.java	Wed Jul 09 10:42:37 2014 -0700
@@ -342,14 +342,14 @@
         Object result;
         if (primitiveToWrapper.containsKey(type)) {
             if (type.equals(Character.TYPE.getName())) {
-                result = new Character(value.charAt(0));
+                result = value.charAt(0);
             } else {
                 result = newStringConstructor(
                         ((Class<?>) primitiveToWrapper.get(type)).getName(),
                         value);
             }
         } else if (type.equals(Character.class.getName())) {
-            result = new Character(value.charAt(0));
+            result = value.charAt(0);
         } else if (Number.class.isAssignableFrom(Utils.getClass(type))) {
             result = createNumberFromStringValue(value);
         } else if (value == null || value.equals("null")) {
--- a/src/share/classes/sun/tools/tree/BitNotExpression.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/tools/tree/BitNotExpression.java	Wed Jul 09 10:42:37 2014 -0700
@@ -83,7 +83,7 @@
             asm.add(where, opc_ldc, new Integer(-1));
             asm.add(where, opc_ixor);
         } else {
-            asm.add(where, opc_ldc2_w, new Long(-1));
+            asm.add(where, opc_ldc2_w, -1L);
             asm.add(where, opc_lxor);
         }
     }
--- a/src/share/classes/sun/tools/tree/IncDecExpression.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/tools/tree/IncDecExpression.java	Wed Jul 09 10:42:37 2014 -0700
@@ -131,7 +131,7 @@
             asm.add(where, inc ? opc_iadd : opc_isub);
             break;
           case TC_LONG:
-            asm.add(where, opc_ldc2_w, new Long(1));
+            asm.add(where, opc_ldc2_w, 1L);
             asm.add(where, inc ? opc_ladd : opc_lsub);
             break;
           case TC_FLOAT:
--- a/src/share/classes/sun/tools/tree/LongExpression.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/classes/sun/tools/tree/LongExpression.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,7 +50,7 @@
      * Get the value
      */
     public Object getValue() {
-        return new Long(value);
+        return value;
     }
 
     /**
@@ -71,7 +71,7 @@
      * Code
      */
     public void codeValue(Environment env, Context ctx, Assembler asm) {
-        asm.add(where, opc_ldc2_w, new Long(value));
+        asm.add(where, opc_ldc2_w, value);
     }
 
     /**
--- a/src/share/native/com/sun/java/util/jar/pack/main.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/com/sun/java/util/jar/pack/main.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -62,6 +62,13 @@
     return unpacker::run(argc, argv);
 }
 
+// Dealing with big-endian arch
+#ifdef _BIG_ENDIAN
+#define SWAP_INT(a) (((a>>24)&0xff) | ((a<<8)&0xff0000) | ((a>>8)&0xff00) | ((a<<24)&0xff000000))
+#else
+#define SWAP_INT(a) (a)
+#endif
+
 // Single-threaded, implementation, not reentrant.
 // Includes a weak error check against MT access.
 #ifndef THREAD_SELF
@@ -385,6 +392,7 @@
       u.start();
     }
   } else {
+    u.gzcrc = 0;
     u.start(peek, sizeof(peek));
   }
 
@@ -425,7 +433,23 @@
     status = 1;
   }
 
-  if (u.infileptr != null) {
+  if (!u.aborting() && u.infileptr != null) {
+    if (u.gzcrc != 0) {
+      // Read the CRC information from the gzip container
+      fseek(u.infileptr, -8, SEEK_END);
+      uint filecrc;
+      fread(&filecrc, sizeof(filecrc), 1, u.infileptr);
+      if (u.gzcrc != SWAP_INT(filecrc)) { // CRC error
+        if (strcmp(destination_file, "-") != 0) {
+          // Output is not stdout, remove it, it's broken
+          if (u.jarout != null)
+            u.jarout->closeJarFile(false);
+          remove(destination_file);
+        }
+        // Print out the error and exit with return code != 0
+        u.abort("CRC error, invalid compressed data.");
+      }
+    }
     fclose(u.infileptr);
     u.infileptr = null;
   }
--- a/src/share/native/com/sun/java/util/jar/pack/unpack.h	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/com/sun/java/util/jar/pack/unpack.h	Wed Jul 09 10:42:37 2014 -0700
@@ -171,6 +171,7 @@
   bytes inbytes;    // direct
   gunzip* gzin;     // gunzip filter, if any
   jar*  jarout;     // output JAR file
+  uint  gzcrc;      // CRC gathered from gzip content
 
 #ifndef PRODUCT
   int   nowrite;
--- a/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -435,7 +435,7 @@
   struct tm* s = gmtime_r(&t, &sbuf);
   if (s == NULL) {
     fprintf(u->errstrm, "Error: gmtime failure, invalid input archive\n");
-    exit(2);
+    exit(-1);
   }
   modtime_cache = modtime;
   dostime_cache = dostime(s->tm_year + 1900, s->tm_mon + 1, s->tm_mday,
@@ -551,6 +551,7 @@
       break;
     }
     int nr = readlen - zs.avail_out;
+    u->gzcrc = crc32(u->gzcrc, (const unsigned char *)bufptr, nr);
     numread += nr;
     bufptr += nr;
     assert(numread <= maxlen);
@@ -589,6 +590,7 @@
   zstream = NEW(z_stream, 1);
   u->gzin = this;
   u->read_input_fn = read_input_via_gzip;
+  u->gzcrc = crc32(0L, Z_NULL, 0);
 }
 
 void gunzip::start(int magic) {
--- a/src/share/native/java/util/zip/ZipFile.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/java/util/zip/ZipFile.c	Wed Jul 09 10:42:37 2014 -0700
@@ -272,7 +272,9 @@
     case java_util_zip_ZipFile_JZENTRY_NAME:
         if (ze->name != 0) {
             len = (int)strlen(ze->name);
-            if (len == 0 || (jba = (*env)->NewByteArray(env, len)) == NULL)
+            // Unlike for extra and comment, we never return null for
+            // an (extremely rarely seen) empty name
+            if ((jba = (*env)->NewByteArray(env, len)) == NULL)
                 break;
             (*env)->SetByteArrayRegion(env, jba, 0, len, (jbyte *)ze->name);
         }
--- a/src/share/native/sun/awt/giflib/dgif_lib.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/awt/giflib/dgif_lib.c	Wed Jul 09 10:42:37 2014 -0700
@@ -195,6 +195,11 @@
     GifFileType *GifFile;
     GifFilePrivateType *Private;
 
+    if (!readFunc) {
+        _GifError = D_GIF_ERR_READ_FAILED;
+        return NULL;
+    }
+
     GifFile = (GifFileType *)malloc(sizeof(GifFileType));
     if (GifFile == NULL) {
         _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Wed Jul 09 10:42:37 2014 -0700
@@ -51,11 +51,17 @@
 
 /* headers from the JPEG library */
 #include <jpeglib.h>
-#include "jerror.h"
+#include <jerror.h>
 
 #undef MAX
 #define MAX(a,b)        ((a) > (b) ? (a) : (b))
 
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
 /* Cached Java method ids */
 static jmethodID JPEGImageReader_readInputDataID;
 static jmethodID JPEGImageReader_skipInputBytesID;
--- a/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	Wed Jul 09 10:42:37 2014 -0700
@@ -47,6 +47,12 @@
 #include <jpeglib.h>
 #include "jerror.h"
 
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
 /* The method IDs we cache. Note that the last two belongs to the
  * java.io.InputStream class.
  */
--- a/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,12 @@
 
 #include <setjmp.h>
 
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
 /* stream input handling */
 
 typedef struct
--- a/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Wed Jul 09 10:42:37 2014 -0700
@@ -71,7 +71,12 @@
         goto done;
     }
 
+#ifdef __APPLE__
+    /* use setjmp/longjmp versions that do not save/restore the signal mask */
+    if (_setjmp(png_set_longjmp_fn(png_ptr, _longjmp, sizeof(jmp_buf)))) {
+#else
     if (setjmp(png_jmpbuf(png_ptr))) {
+#endif
         goto done;
     }
 
--- a/src/share/native/sun/font/layout/IndicLayoutEngine.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/font/layout/IndicLayoutEngine.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -151,7 +151,7 @@
     le_int32 outCharCount;
     if (fVersion2) {
         _LETRACE("v2process");
-        outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage);
+        outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage, success);
     } else {
         _LETRACE("reorder");
         outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups, success);
--- a/src/share/native/sun/font/layout/IndicReordering.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/font/layout/IndicReordering.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -1096,9 +1096,13 @@
 
 
 le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode,
-                                  LEUnicode *outChars, LEGlyphStorage &glyphStorage)
+                                  LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success)
 {
     const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode);
+    if (classTable == NULL) {
+        success = LE_MEMORY_ALLOCATION_ERROR;
+        return 0;
+    }
 
     DynamicProperties dynProps[INDIC_BLOCK_SIZE];
     IndicReordering::getDynamicProperties(dynProps,classTable);
--- a/src/share/native/sun/font/layout/IndicReordering.h	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/font/layout/IndicReordering.h	Wed Jul 09 10:42:37 2014 -0700
@@ -181,7 +181,7 @@
     static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success);
 
     static le_int32 v2process(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode,
-        LEUnicode *outChars, LEGlyphStorage &glyphStorage);
+        LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success);
 
     static const FeatureMap *getFeatureMap(le_int32 &count);
 
--- a/src/share/native/sun/font/layout/LEScripts.h	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/font/layout/LEScripts.h	Wed Jul 09 10:42:37 2014 -0700
@@ -263,12 +263,6 @@
     tirhScriptCode = 158,
 
 /**
- * @stable ICU 52
- */
-    aghbScriptCode = 159,
-    mahjScriptCode = 160,
-
-/**
  * @stable ICU 2.2
  */
     scriptCodeCount
--- a/src/share/native/sun/java2d/opengl/OGLBlitLoops.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/java2d/opengl/OGLBlitLoops.c	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,10 @@
 #include "OGLSurfaceData.h"
 #include "GraphicsPrimitiveMgr.h"
 
+#include <stdlib.h> // malloc
+#include <string.h> // memcpy
+#include "IntArgbPre.h"
+
 extern OGLPixelFormat PixelFormats[];
 
 /**
@@ -335,6 +339,9 @@
                                         0, 0, sw, sh,
                                         pf->format, pf->type,
                                         srcInfo->rasBase);
+
+                    j2d_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+                    j2d_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
                 }
 
                 // the texture image is "right side up", so we align the
@@ -697,6 +704,50 @@
 }
 
 /**
+ * This method makes vertical flip of the provided area of Surface and convert
+ * pixel's data from argbPre to argb format if requested.
+ */
+void flip(void *pDst, juint w, juint h, jint scanStride, jboolean convert) {
+    const size_t clippedStride = 4 * w;
+    void *tempRow = (h > 1 && !convert) ? malloc(clippedStride) : NULL;
+    juint i = 0;
+    juint step = 0;
+    // vertical flip and convert argbpre to argb if necessary
+    for (; i < h / 2; ++i) {
+        juint *r1 = PtrAddBytes(pDst, (i * scanStride));
+        juint *r2 = PtrAddBytes(pDst, (h - i - 1) * scanStride);
+        if (tempRow) {
+            // fast path
+            memcpy(tempRow, r1, clippedStride);
+            memcpy(r1, r2, clippedStride);
+            memcpy(r2, tempRow, clippedStride);
+        } else {
+            // slow path
+            for (step = 0; step < w; ++step) {
+                juint tmp = r1[step];
+                if (convert) {
+                    LoadIntArgbPreTo1IntArgb(r2, 0, step, r1[step]);
+                    LoadIntArgbPreTo1IntArgb(&tmp, 0, 0, r2[step]);
+                } else {
+                    r1[step] = r2[step];
+                    r2[step] = tmp;
+                }
+            }
+        }
+    }
+    // convert the middle line if necessary
+    if (convert && h % 2) {
+        juint *r1 = PtrAddBytes(pDst, (i * scanStride));
+        for (step = 0; step < w; ++step) {
+            LoadIntArgbPreTo1IntArgb(r1, 0, step, r1[step]);
+        }
+    }
+    if (tempRow) {
+        free(tempRow);
+    }
+}
+
+/**
  * Specialized blit method for copying a native OpenGL "Surface" (pbuffer,
  * window, etc.) to a system memory ("Sw") surface.
  */
@@ -758,7 +809,9 @@
             width = srcInfo.bounds.x2 - srcInfo.bounds.x1;
             height = srcInfo.bounds.y2 - srcInfo.bounds.y1;
 
-            j2d_glPixelStorei(GL_PACK_SKIP_PIXELS, dstx);
+            pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride);
+            pDst = PtrAddBytes(pDst, dsty * dstInfo.scanStride);
+
             j2d_glPixelStorei(GL_PACK_ROW_LENGTH,
                               dstInfo.scanStride / dstInfo.pixelStride);
             j2d_glPixelStorei(GL_PACK_ALIGNMENT, pf.alignment);
@@ -779,27 +832,20 @@
 
             // this accounts for lower-left origin of the source region
             srcx = srcOps->xOffset + srcx;
-            srcy = srcOps->yOffset + srcOps->height - (srcy + 1);
+            srcy = srcOps->yOffset + srcOps->height - srcy - height;
 
-            // we must read one scanline at a time because there is no way
-            // to read starting at the top-left corner of the source region
-            while (height > 0) {
-                j2d_glPixelStorei(GL_PACK_SKIP_ROWS, dsty);
-                j2d_glReadPixels(srcx, srcy, width, 1,
-                                 pf.format, pf.type, pDst);
-                srcy--;
-                dsty++;
-                height--;
-            }
-
+            // Note that glReadPixels() is extremely slow!
+            // So we call it only once and flip the image using memcpy.
+            j2d_glReadPixels(srcx, srcy, width, height,
+                             pf.format, pf.type, pDst);
+            // It was checked above that width and height are positive.
+            flip(pDst, (juint) width, (juint) height, dstInfo.scanStride,
+                 !pf.isPremult && !srcOps->isOpaque);
 #ifdef MACOSX
             if (srcOps->isOpaque) {
                 j2d_glPixelTransferf(GL_ALPHA_BIAS, 0.0);
             }
 #endif
-
-            j2d_glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
-            j2d_glPixelStorei(GL_PACK_SKIP_ROWS, 0);
             j2d_glPixelStorei(GL_PACK_ROW_LENGTH, 0);
             j2d_glPixelStorei(GL_PACK_ALIGNMENT, 4);
         }
--- a/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c	Wed Jul 09 10:42:37 2014 -0700
@@ -639,7 +639,7 @@
  */
 void inquireCred(JNIEnv *env, jobject jobj, gss_cred_id_t pCred,
                  jint type, void *result) {
-  OM_uint32 minor, major=0;
+  OM_uint32 minor=0, major=0;
   OM_uint32 routineErr;
   gss_cred_id_t credHdl;
 
--- a/src/solaris/classes/java/util/prefs/FileSystemPreferences.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/java/util/prefs/FileSystemPreferences.java	Wed Jul 09 10:42:37 2014 -0700
@@ -747,7 +747,7 @@
                        nmt = systemRootModFile.lastModified();
                        isSystemRootModified = systemRootModTime == nmt;
                    }
-                   return new Long(nmt);
+                   return nmt;
                }
            });
            try {
--- a/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,6 +97,7 @@
      * @param handler the synthetic error handler to set
      */
     public static void WITH_XERROR_HANDLER(XErrorHandler handler) {
+        XSync();
         saved_error = null;
         current_error_handler = handler;
     }
@@ -105,15 +106,9 @@
      * Unsets a current synthetic error handler. Must be called with the acquired AWT lock.
      */
     public static void RESTORE_XERROR_HANDLER() {
-        RESTORE_XERROR_HANDLER(true);
-    }
-
-    private static void RESTORE_XERROR_HANDLER(boolean doXSync) {
-        if (doXSync) {
-            // Wait until all requests are processed by the X server
-            // and only then uninstall the error handler.
-            XSync();
-        }
+        // Wait until all requests are processed by the X server
+        // and only then uninstall the error handler.
+        XSync();
         current_error_handler = null;
     }
 
--- a/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,8 +38,9 @@
     public XFocusProxyWindow(XWindowPeer owner) {
         super(new XCreateWindowParams(new Object[] {
             BOUNDS, new Rectangle(-1, -1, 1, 1),
-            PARENT_WINDOW, new Long(owner.getWindow()),
-            EVENT_MASK, new Long(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)
+            PARENT_WINDOW, Long.valueOf(owner.getWindow()),
+            EVENT_MASK, Long.valueOf(XConstants.FocusChangeMask | XConstants
+                .KeyPressMask | XConstants.KeyReleaseMask)
         }));
         this.owner = owner;
     }
--- a/src/solaris/classes/sun/print/CUPSPrinter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/print/CUPSPrinter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -246,9 +246,9 @@
                 IPPPrintService.getIPPConnection(url);
 
             if (urlConnection != null) {
-                OutputStream os = (OutputStream)java.security.AccessController.
-                    doPrivileged(new java.security.PrivilegedAction() {
-                        public Object run() {
+                OutputStream os = java.security.AccessController.
+                    doPrivileged(new java.security.PrivilegedAction<OutputStream>() {
+                        public OutputStream run() {
                             try {
                                 return urlConnection.getOutputStream();
                             } catch (Exception e) {
@@ -274,10 +274,10 @@
                                         IPPPrintService.OP_CUPS_GET_DEFAULT,
                                         attCl)) {
 
-                    HashMap defaultMap = null;
+                    HashMap<String, AttributeClass> defaultMap = null;
                     String[] printerInfo = new String[2];
                     InputStream is = urlConnection.getInputStream();
-                    HashMap[] responseMap = IPPPrintService.readIPPResponse(
+                    HashMap<String, AttributeClass>[] responseMap = IPPPrintService.readIPPResponse(
                                          is);
                     is.close();
 
@@ -309,13 +309,11 @@
                     }
 
 
-                    AttributeClass attribClass = (AttributeClass)
-                        defaultMap.get("printer-name");
+                    AttributeClass attribClass = defaultMap.get("printer-name");
 
                     if (attribClass != null) {
                         printerInfo[0] = attribClass.getStringValue();
-                        attribClass = (AttributeClass)
-                            defaultMap.get("printer-uri-supported");
+                        attribClass = defaultMap.get("printer-uri-supported");
                         IPPPrintService.debug_println(debugPrefix+
                           "printer-uri-supported="+attribClass);
                         if (attribClass != null) {
@@ -348,9 +346,9 @@
                 IPPPrintService.getIPPConnection(url);
 
             if (urlConnection != null) {
-                OutputStream os = (OutputStream)java.security.AccessController.
-                    doPrivileged(new java.security.PrivilegedAction() {
-                        public Object run() {
+                OutputStream os = java.security.AccessController.
+                    doPrivileged(new java.security.PrivilegedAction<OutputStream>() {
+                        public OutputStream run() {
                             try {
                                 return urlConnection.getOutputStream();
                             } catch (Exception e) {
@@ -375,7 +373,7 @@
                                 IPPPrintService.OP_CUPS_GET_PRINTERS, attCl)) {
 
                     InputStream is = urlConnection.getInputStream();
-                    HashMap[] responseMap =
+                    HashMap<String, AttributeClass>[] responseMap =
                         IPPPrintService.readIPPResponse(is);
 
                     is.close();
@@ -386,9 +384,9 @@
                         return null;
                     }
 
-                    ArrayList printerNames = new ArrayList();
+                    ArrayList<String> printerNames = new ArrayList<>();
                     for (int i=0; i< responseMap.length; i++) {
-                        AttributeClass attribClass = (AttributeClass)
+                        AttributeClass attribClass =
                             responseMap[i].get("printer-uri-supported");
 
                         if (attribClass != null) {
@@ -396,7 +394,7 @@
                             printerNames.add(nameStr);
                         }
                     }
-                    return (String[])printerNames.toArray(new String[] {});
+                    return printerNames.toArray(new String[] {});
                 } else {
                     os.close();
                     urlConnection.disconnect();
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -91,7 +91,7 @@
     private CUPSPrinter cps;
     private HttpURLConnection urlConnection = null;
     private DocFlavor[] supportedDocFlavors;
-    private Class[] supportedCats;
+    private Class<?>[] supportedCats;
     private MediaTray[] mediaTrays;
     private MediaSizeName[] mediaSizeNames;
     private CustomMediaSizeName[] customMediaSizeNames;
@@ -99,7 +99,7 @@
     private boolean isCupsPrinter;
     private boolean init;
     private Boolean isPS;
-    private HashMap getAttMap;
+    private HashMap<String, AttributeClass> getAttMap;
     private boolean pngImagesAdded = false;
     private boolean gifImagesAdded = false;
     private boolean jpgImagesAdded = false;
@@ -424,8 +424,8 @@
 
             // use IPP to get all media,
             Media[] allMedia = getSupportedMedia();
-            ArrayList sizeList = new ArrayList();
-            ArrayList trayList = new ArrayList();
+            ArrayList<Media> sizeList = new ArrayList<>();
+            ArrayList<Media> trayList = new ArrayList<>();
             for (int i=0; i<allMedia.length; i++) {
                 if (allMedia[i] instanceof MediaSizeName) {
                     sizeList.add(allMedia[i]);
@@ -436,13 +436,11 @@
 
             if (sizeList != null) {
                 mediaSizeNames = new MediaSizeName[sizeList.size()];
-                mediaSizeNames = (MediaSizeName[])sizeList.toArray(
-                                                       mediaSizeNames);
+                mediaSizeNames = sizeList.toArray(mediaSizeNames);
             }
             if (trayList != null) {
                 mediaTrays = new MediaTray[trayList.size()];
-                mediaTrays = (MediaTray[])trayList.toArray(
-                                                           mediaTrays);
+                mediaTrays = trayList.toArray(mediaTrays);
             }
             urlConnection.disconnect();
 
@@ -503,7 +501,7 @@
                   flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT))) {
                 CopiesSupported cs = new CopiesSupported(1, MAXCOPIES);
                 AttributeClass attribClass = (getAttMap != null) ?
-                    (AttributeClass)getAttMap.get(cs.getName()) : null;
+                    getAttMap.get(cs.getName()) : null;
                 if (attribClass != null) {
                     int[] range = attribClass.getIntRangeValue();
                     cs = new CopiesSupported(range[0], range[1]);
@@ -545,7 +543,7 @@
             return arr;
         } else if (category == Finishings.class) {
             AttributeClass attribClass = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get("finishings-supported")
+                getAttMap.get("finishings-supported")
                 : null;
             if (attribClass != null) {
                 int[] finArray = attribClass.getArrayOfIntValues();
@@ -648,7 +646,7 @@
             }
         } else if (category == NumberUp.class) {
             AttributeClass attribClass = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get("number-up-supported") : null;
+                getAttMap.get("number-up-supported") : null;
             if (attribClass != null) {
                 int[] values = attribClass.getArrayOfIntValues();
                 if (values != null) {
@@ -673,7 +671,7 @@
             OrientationRequested[] orientSup = null;
 
             AttributeClass attribClass = (getAttMap != null) ?
-              (AttributeClass)getAttMap.get("orientation-requested-supported")
+              getAttMap.get("orientation-requested-supported")
                 : null;
             if (attribClass != null) {
                 int[] orientArray = attribClass.getArrayOfIntValues();
@@ -748,7 +746,7 @@
             // or printable so if the document is in Landscape, this may
             // result in double rotation.
             AttributeClass attribClass = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get("sides-supported")
+                getAttMap.get("sides-supported")
                 : null;
             if (attribClass != null) {
                 String[] sidesArray = attribClass.getArrayOfStringValues();
@@ -833,13 +831,13 @@
             getAttMap.containsKey("document-format-supported")) {
 
             AttributeClass attribClass =
-                (AttributeClass)getAttMap.get("document-format-supported");
+                getAttMap.get("document-format-supported");
             if (attribClass != null) {
                 String mimeType;
                 boolean psSupported = false;
                 String[] docFlavors = attribClass.getArrayOfStringValues();
                 DocFlavor[] flavors;
-                HashSet docList = new HashSet();
+                HashSet<Object> docList = new HashSet<>();
                 int j;
                 String hostEnc = DocFlavor.hostEncoding.
                     toLowerCase(Locale.ENGLISH);
@@ -970,8 +968,7 @@
         if ((getAttMap != null) &&
             getAttMap.containsKey("media-supported")) {
 
-            AttributeClass attribClass =
-                (AttributeClass)getAttMap.get("media-supported");
+            AttributeClass attribClass = getAttMap.get("media-supported");
 
             if (attribClass != null) {
                 String[] mediaVals = attribClass.getArrayOfStringValues();
@@ -990,23 +987,21 @@
     }
 
 
-    public synchronized Class[] getSupportedAttributeCategories() {
+    public synchronized Class<?>[] getSupportedAttributeCategories() {
         if (supportedCats != null) {
             return supportedCats;
         }
 
         initAttributes();
 
-        ArrayList catList = new ArrayList();
-        Class cl;
+        ArrayList<Class<?>> catList = new ArrayList<>();
 
         for (int i=0; i < printReqAttribDefault.length; i++) {
             PrintRequestAttribute pra =
                 (PrintRequestAttribute)printReqAttribDefault[i];
             if (getAttMap != null &&
                 getAttMap.containsKey(pra.getName()+"-supported")) {
-                cl = pra.getCategory();
-                catList.add(cl);
+                catList.add(pra.getCategory());
             }
         }
 
@@ -1047,7 +1042,7 @@
         if (getAttMap != null && getAttMap.containsKey("color-supported")) {
             catList.add(Chromaticity.class);
         }
-        supportedCats = new Class[catList.size()];
+        supportedCats = new Class<?>[catList.size()];
         catList.toArray(supportedCats);
         return supportedCats;
     }
@@ -1085,7 +1080,7 @@
         return false;
     }
 
-
+    @SuppressWarnings("unchecked")
     public synchronized <T extends PrintServiceAttribute>
         T getAttribute(Class<T> category)
     {
@@ -1103,7 +1098,7 @@
         } else if (category == PrinterInfo.class) {
             PrinterInfo pInfo = new PrinterInfo(printer, null);
             AttributeClass ac = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get(pInfo.getName())
+                getAttMap.get(pInfo.getName())
                 : null;
             if (ac != null) {
                 return (T)(new PrinterInfo(ac.getStringValue(), null));
@@ -1112,7 +1107,7 @@
         } else if (category == QueuedJobCount.class) {
             QueuedJobCount qjc = new QueuedJobCount(0);
             AttributeClass ac = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get(qjc.getName())
+                getAttMap.get(qjc.getName())
                 : null;
             if (ac != null) {
                 qjc = new QueuedJobCount(ac.getIntValue());
@@ -1122,7 +1117,7 @@
             PrinterIsAcceptingJobs accJob =
                 PrinterIsAcceptingJobs.ACCEPTING_JOBS;
             AttributeClass ac = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get(accJob.getName())
+                getAttMap.get(accJob.getName())
                 : null;
             if ((ac != null) && (ac.getByteValue() == 0)) {
                 accJob = PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;
@@ -1131,7 +1126,7 @@
         } else if (category == ColorSupported.class) {
             ColorSupported cs = ColorSupported.SUPPORTED;
             AttributeClass ac = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get(cs.getName())
+                getAttMap.get(cs.getName())
                 : null;
             if ((ac != null) && (ac.getByteValue() == 0)) {
                 cs = ColorSupported.NOT_SUPPORTED;
@@ -1165,7 +1160,8 @@
         for (int i=0; i < serviceAttributes.length; i++) {
             String name = (String)serviceAttributes[i][1];
             if (getAttMap != null && getAttMap.containsKey(name)) {
-                Class c = (Class)serviceAttributes[i][0];
+                @SuppressWarnings("unchecked")
+                Class<PrintServiceAttribute> c = (Class<PrintServiceAttribute>)serviceAttributes[i][0];
                 PrintServiceAttribute psa = getAttribute(c);
                 if (psa != null) {
                     attrs.add(psa);
@@ -1279,7 +1275,7 @@
                 return false;
             }
         }
-        Class category = attr.getCategory();
+        Class<? extends Attribute> category = attr.getCategory();
         if (!isAttributeCategorySupported(category)) {
             return false;
         }
@@ -1397,7 +1393,7 @@
         }
         String attribName = catName+"-default";
         AttributeClass attribClass = (getAttMap != null) ?
-                (AttributeClass)getAttMap.get(attribName) : null;
+                getAttMap.get(attribName) : null;
 
         if (category == Copies.class) {
             if (attribClass != null) {
@@ -1600,7 +1596,7 @@
     }
 
 
-    public boolean usesClass(Class c) {
+    public boolean usesClass(Class<?> c) {
         return (c == sun.print.PSPrinterJob.class);
     }
 
@@ -1675,9 +1671,9 @@
                                    AttributeClass.TAG_URI,
                                    ""+myURI)};
 
-            OutputStream os = (OutputStream)java.security.AccessController.
-                doPrivileged(new java.security.PrivilegedAction() {
-                    public Object run() {
+            OutputStream os = java.security.AccessController.
+                doPrivileged(new java.security.PrivilegedAction<OutputStream>() {
+                    public OutputStream run() {
                         try {
                             return urlConnection.getOutputStream();
                         } catch (Exception e) {
@@ -1696,7 +1692,7 @@
             if (success) {
                 InputStream is = null;
                 if ((is = urlConnection.getInputStream())!=null) {
-                    HashMap[] responseMap = readIPPResponse(is);
+                    HashMap<String, AttributeClass>[] responseMap = readIPPResponse(is);
 
                     if (responseMap != null && responseMap.length > 0) {
                         getAttMap = responseMap[0];
@@ -1771,7 +1767,7 @@
     }
 
 
-    public static HashMap[] readIPPResponse(InputStream inputStream) {
+    public static HashMap<String, AttributeClass>[] readIPPResponse(InputStream inputStream) {
 
         if (inputStream == null) {
             return null;
@@ -1792,8 +1788,8 @@
                 String attribStr = null;
                 // assign default value
                 byte valTagByte = AttributeClass.TAG_KEYWORD;
-                ArrayList respList = new ArrayList();
-                HashMap responseMap = new HashMap();
+                ArrayList<HashMap<String, AttributeClass>> respList = new ArrayList<>();
+                HashMap<String, AttributeClass> responseMap = new HashMap<>();
 
                 response[0] = ois.readByte();
 
@@ -1829,7 +1825,7 @@
                             // if key exists, new HashMap
                             if (responseMap.containsKey(attribStr)) {
                                 respList.add(responseMap);
-                                responseMap = new HashMap();
+                                responseMap = new HashMap<>();
                             }
 
                             // exclude those that are unknown
@@ -1885,7 +1881,7 @@
                         if ((counter != 0) &&
                             responseMap.containsKey(attribStr)) {
                             respList.add(responseMap);
-                            responseMap = new HashMap();
+                            responseMap = new HashMap<>();
                         }
 
                         byte outArray[] = outObj.toByteArray();
@@ -1901,8 +1897,10 @@
                 if ((responseMap != null) && (responseMap.size() > 0)) {
                     respList.add(responseMap);
                 }
-                return (HashMap[])respList.toArray(
-                                  new HashMap[respList.size()]);
+                @SuppressWarnings({"unchecked", "rawtypes"})
+                HashMap<String, AttributeClass>[] tmp  =
+                    respList.toArray((HashMap<String, AttributeClass>[])new HashMap[respList.size()]);
+                return tmp;
             } else {
                 debug_println(debugPrefix+
                           "readIPPResponse client error, IPP status code: 0x"+
--- a/src/solaris/classes/sun/print/UnixPrintJob.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/print/UnixPrintJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -90,9 +90,9 @@
 public class UnixPrintJob implements CancelablePrintJob {
     private static String debugPrefix = "UnixPrintJob>> ";
 
-    transient private Vector jobListeners;
-    transient private Vector attrListeners;
-    transient private Vector listenedAttributeSets;
+    transient private Vector<PrintJobListener> jobListeners;
+    transient private Vector<PrintJobAttributeListener> attrListeners;
+    transient private Vector<PrintJobAttributeSet> listenedAttributeSets;
 
     private PrintService service;
     private boolean fidelity;
@@ -150,7 +150,7 @@
                 return;
             }
             if (jobListeners == null) {
-                jobListeners = new Vector();
+                jobListeners = new Vector<>();
             }
             jobListeners.add(listener);
         }
@@ -238,7 +238,7 @@
                 PrintJobListener listener;
                 PrintJobEvent event = new PrintJobEvent(this, reason);
                 for (int i = 0; i < jobListeners.size(); i++) {
-                    listener = (PrintJobListener)(jobListeners.elementAt(i));
+                    listener = jobListeners.elementAt(i);
                     switch (reason) {
 
                         case PrintJobEvent.JOB_CANCELED :
@@ -273,8 +273,8 @@
                 return;
             }
             if (attrListeners == null) {
-                attrListeners = new Vector();
-                listenedAttributeSets = new Vector();
+                attrListeners = new Vector<>();
+                listenedAttributeSets = new Vector<>();
             }
             attrListeners.add(listener);
             if (attributes == null) {
@@ -770,7 +770,7 @@
 
     private void getAttributeValues(DocFlavor flavor) throws PrintException {
         Attribute attr;
-        Class category;
+        Class<? extends Attribute> category;
 
         if (reqAttrSet.get(Fidelity.class) == Fidelity.FIDELITY_TRUE) {
             fidelity = true;
@@ -941,11 +941,11 @@
 
     // Inner class to run "privileged" to open the printer output stream.
 
-    private class PrinterOpener implements java.security.PrivilegedAction {
+    private class PrinterOpener implements java.security.PrivilegedAction<OutputStream> {
         PrintException pex;
         OutputStream result;
 
-        public Object run() {
+        public OutputStream run() {
             try {
                 if (mDestType == UnixPrintJob.DESTFILE) {
                     spoolFile = new File(mDestination);
@@ -971,7 +971,7 @@
 
     // Inner class to run "privileged" to invoke the system print command
 
-    private class PrinterSpooler implements java.security.PrivilegedAction {
+    private class PrinterSpooler implements java.security.PrivilegedAction<Object> {
         PrintException pex;
 
         private void handleProcessFailure(final Process failedProcess,
@@ -992,8 +992,8 @@
                     }
                 } finally {
                     pw.flush();
-                    throw new IOException(sw.toString());
                 }
+                throw new IOException(sw.toString());
             }
         }
 
--- a/src/solaris/classes/sun/print/UnixPrintService.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/print/UnixPrintService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -148,7 +148,7 @@
     }
 
     /* let's try to support a few of these */
-    private static final Class[] serviceAttrCats = {
+    private static final Class<?>[] serviceAttrCats = {
         PrinterName.class,
         PrinterIsAcceptingJobs.class,
         QueuedJobCount.class,
@@ -157,7 +157,7 @@
     /*  it turns out to be inconvenient to store the other categories
      *  separately because many attributes are in multiple categories.
      */
-    private static final Class[] otherAttrCats = {
+    private static final Class<?>[] otherAttrCats = {
         Chromaticity.class,
         Copies.class,
         Destination.class,
@@ -278,7 +278,7 @@
     // and extra lines which have been added for remote printers.
     // 'protected' because this method is also used from UnixPrintServiceLookup.
     protected static String[] filterPrinterNamesAIX(String[] posPrinters) {
-        ArrayList printers = new ArrayList();
+        ArrayList<String> printers = new ArrayList<>();
         String [] splitPart;
 
         for(int i = 0; i < posPrinters.length; i++) {
@@ -295,7 +295,7 @@
             }
         }
 
-        return (String[])printers.toArray(new String[printers.size()]);
+        return printers.toArray(new String[printers.size()]);
     }
 
     private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
@@ -533,6 +533,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     public <T extends PrintServiceAttribute>
         T getAttribute(Class<T> category)
     {
@@ -617,9 +618,9 @@
         return false;
     }
 
-    public Class[] getSupportedAttributeCategories() {
+    public Class<?>[] getSupportedAttributeCategories() {
         int totalCats = otherAttrCats.length;
-        Class [] cats = new Class[totalCats];
+        Class<?>[] cats = new Class<?>[totalCats];
         System.arraycopy(otherAttrCats, 0, cats, 0, otherAttrCats.length);
         return cats;
     }
@@ -967,7 +968,7 @@
                 return false;
             }
         }
-        Class category = attr.getCategory();
+        Class<? extends Attribute> category = attr.getCategory();
         if (!isAttributeCategorySupported(category)) {
             return false;
         }
@@ -1078,7 +1079,7 @@
         return this.getClass().hashCode()+getName().hashCode();
     }
 
-    public boolean usesClass(Class c) {
+    public boolean usesClass(Class<?> c) {
         return (c == sun.print.PSPrinterJob.class);
     }
 
--- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -69,7 +69,7 @@
     private String defaultPrinter;
     private PrintService defaultPrintService;
     private PrintService[] printServices; /* includes the default printer */
-    private Vector lookupListeners = null;
+    private Vector<BackgroundLookupListener> lookupListeners = null;
     private static String debugPrefix = "UnixPrintServiceLookup>> ";
     private static boolean pollServices = true;
     private static final int DEFAULT_MINREFRESH = 120;  // 2 minutes
@@ -239,7 +239,7 @@
         }
     }
 
-    private int addPrintServiceToList(ArrayList printerList, PrintService ps) {
+    private int addPrintServiceToList(ArrayList<PrintService> printerList, PrintService ps) {
         int index = printerList.indexOf(ps);
         // Check if PrintService with same name is already in the list.
         if (CUPSPrinter.isCupsRunning() && index != -1) {
@@ -253,7 +253,7 @@
                 IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, ignoring the new local printer: "+ps);
                 return index;  // Do not add this.
             }
-            PrintService oldPS = (PrintService)(printerList.get(index));
+            PrintService oldPS = printerList.get(index);
             uri = oldPS.getAttribute(PrinterURI.class);
             if (uri.getURI().getHost().equals("localhost")) {
                 IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, removing existing local printer: "+oldPS);
@@ -319,7 +319,7 @@
             return;
         }
 
-        ArrayList printerList = new ArrayList();
+        ArrayList<PrintService> printerList = new ArrayList<>();
         int defaultIndex = -1;
         for (int p=0; p<printers.length; p++) {
             if (printers[p] == null) {
@@ -396,8 +396,7 @@
             defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
         }
 
-        printServices = (PrintService[])printerList.toArray(
-                                      new PrintService[] {});
+        printServices = printerList.toArray(new PrintService[] {});
 
         // swap default with the first in the list
         if (defaultIndex > 0) {
@@ -411,9 +410,9 @@
                                       PrintServiceAttributeSet attributes) {
 
         Attribute [] attrs =  attributes.toArray();
-        Attribute serviceAttr;
         for (int i=0; i<attrs.length; i++) {
-            serviceAttr
+            @SuppressWarnings("unchecked")
+            Attribute serviceAttr
                 = service.getAttribute((Class<PrintServiceAttribute>)attrs[i].getCategory());
             if (serviceAttr == null || !serviceAttr.equals(attrs[i])) {
                 return false;
@@ -542,7 +541,7 @@
             }
         } else {
             /* specified service attributes don't include a name.*/
-            Vector matchedServices = new Vector();
+            Vector<PrintService> matchedServices = new Vector<>();
             services = getPrintServices();
             for (int i = 0; i< services.length; i++) {
                 if (matchesAttributes(services[i], serviceSet)) {
@@ -551,7 +550,7 @@
             }
             services = new PrintService[matchedServices.size()];
             for (int i = 0; i< services.length; i++) {
-                services[i] = (PrintService)matchedServices.elementAt(i);
+                services[i] = matchedServices.elementAt(i);
             }
             return services;
         }
@@ -591,7 +590,7 @@
         }
 
         if (CUPSPrinter.isCupsRunning()) {
-            ArrayList matchingServices = new ArrayList();
+            ArrayList<PrintService> matchingServices = new ArrayList<>();
             for (int i=0; i<services.length; i++) {
                 try {
                     if (services[i].
@@ -602,7 +601,7 @@
                 }
             }
             services = new PrintService[matchingServices.size()];
-            return (PrintService[])matchingServices.toArray(services);
+            return matchingServices.toArray(services);
 
         } else {
             // We only need to compare 1 PrintService because all
@@ -704,7 +703,7 @@
             listener.notifyServices(printServices);
         } else {
             if (lookupListeners == null) {
-                lookupListeners = new Vector();
+                lookupListeners = new Vector<>();
                 lookupListeners.add(listener);
                 Thread lookupThread = new Thread(this);
                 lookupThread.start();
@@ -733,8 +732,7 @@
         synchronized (this) {
             BackgroundLookupListener listener;
             for (int i=0; i<lookupListeners.size(); i++) {
-                listener =
-                    (BackgroundLookupListener)lookupListeners.elementAt(i);
+                listener = lookupListeners.elementAt(i);
                 listener.notifyServices(copyOf(services));
             }
             lookupListeners = null;
@@ -820,7 +818,7 @@
         String command = "/usr/bin/lpstat -v|/usr/bin/expand|/usr/bin/cut -f3 -d' ' |/usr/bin/cut -f1 -d':' | /usr/bin/sort";
 
         String [] names = execCmd(command);
-        ArrayList printerNames = new ArrayList();
+        ArrayList<String> printerNames = new ArrayList<>();
         for (int i=0; i < names.length; i++) {
             if (!names[i].equals("_default") &&
                 !names[i].equals(defaultPrinter) &&
@@ -828,7 +826,7 @@
                 printerNames.add(names[i]);
             }
         }
-        return (String[])printerNames.toArray(new String[printerNames.size()]);
+        return printerNames.toArray(new String[printerNames.size()]);
     }
 
     private String getDefaultPrinterNameAIX() {
@@ -870,7 +868,7 @@
     }
 
     static String[] execCmd(final String command) {
-        ArrayList results = null;
+        ArrayList<String> results = null;
         try {
             final String[] cmd = new String[3];
             if (isSysV() || isAIX()) {
@@ -883,9 +881,9 @@
                 cmd[2] = "LC_ALL=C " + command;
             }
 
-            results = (ArrayList)AccessController.doPrivileged(
-                new PrivilegedExceptionAction() {
-                    public Object run() throws IOException {
+            results = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<ArrayList<String>>() {
+                    public ArrayList<String> run() throws IOException {
 
                         Process proc;
                         BufferedReader bufferedReader = null;
@@ -907,7 +905,7 @@
                                 FileReader reader = new FileReader(f);
                                 bufferedReader = new BufferedReader(reader);
                                 String line;
-                                ArrayList results = new ArrayList();
+                                ArrayList<String> results = new ArrayList<>();
                                 while ((line = bufferedReader.readLine())
                                        != null) {
                                     results.add(line);
@@ -932,7 +930,7 @@
         if (results == null) {
             return new String[0];
         } else {
-            return (String[])results.toArray(new String[results.size()]);
+            return results.toArray(new String[results.size()]);
         }
     }
 
--- a/src/solaris/native/java/net/net_util_md.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/native/java/net/net_util_md.c	Wed Jul 09 10:42:37 2014 -0700
@@ -1317,7 +1317,7 @@
      *    or sending UDP packet.
      * 2. IPv6 on Linux: By default Linux ignores flowinfo
      *    field so enable IPV6_FLOWINFO_SEND so that flowinfo
-     *    will be examined.
+     *    will be examined. We also set the IPv4 TOS option in this case.
      * 3. IPv4: set socket option based on ToS and Precedence
      *    fields (otherwise get invalid argument)
      */
@@ -1333,8 +1333,10 @@
 #if defined(AF_INET6) && defined(__linux__)
         if (ipv6_available()) {
             int optval = 1;
-            return setsockopt(fd, IPPROTO_IPV6, IPV6_FLOWINFO_SEND,
-                              (void *)&optval, sizeof(optval));
+            if (setsockopt(fd, IPPROTO_IPV6, IPV6_FLOWINFO_SEND,
+                           (void *)&optval, sizeof(optval)) < 0) {
+                return -1;
+            }
         }
 #endif
 
--- a/src/solaris/native/sun/awt/gtk2_interface.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/native/sun/awt/gtk2_interface.c	Wed Jul 09 10:42:37 2014 -0700
@@ -783,6 +783,8 @@
         fp_gtk_widget_show = dl_symbol("gtk_widget_show");
         fp_gtk_main = dl_symbol("gtk_main");
 
+        fp_g_path_get_dirname = dl_symbol("g_path_get_dirname");
+
         /**
          * GLib thread system
          */
--- a/src/solaris/native/sun/awt/gtk2_interface.h	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/native/sun/awt/gtk2_interface.h	Wed Jul 09 10:42:37 2014 -0700
@@ -817,7 +817,7 @@
 void (*fp_gtk_widget_show)(GtkWidget *widget);
 void (*fp_gtk_main)(void);
 guint (*fp_gtk_main_level)(void);
-
+gchar* (*fp_g_path_get_dirname) (const gchar *file_name);
 
 /**
  * This function is available for GLIB > 2.20, so it MUST be
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Jul 09 10:42:37 2014 -0700
@@ -59,7 +59,6 @@
 static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gpointer obj)
 {
     JNIEnv *env;
-    jclass cx;
     jstring filename;
 
     env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
@@ -158,62 +157,55 @@
     fp_gdk_threads_leave();
 }
 
+/*
+ * baseDir should be freed by user.
+ */
+static gboolean isFromSameDirectory(GSList* list, gchar** baseDir) {
+
+    GSList *it = list;
+    gchar* prevDir = NULL;
+    gboolean isAllDirsSame = TRUE;
+
+    while (it) {
+        gchar* dir = fp_g_path_get_dirname((gchar*) it->data);
+
+        if (prevDir && strcmp(prevDir, dir) != 0) {
+            isAllDirsSame = FALSE;
+            fp_g_free(dir);
+            break;
+        }
+
+        if (!prevDir) {
+            prevDir = strdup(dir);
+        }
+        fp_g_free(dir);
+
+        it = it->next;
+    }
+
+    if (isAllDirsSame) {
+        *baseDir = prevDir;
+    } else {
+        free(prevDir);
+        *baseDir = strdup("/");
+    }
+
+    return isAllDirsSame;
+}
+
 /**
- * Convert a GSList to an array of filenames (without the parent folder)
+ * Convert a GSList to an array of filenames
  */
-static jobjectArray toFilenamesArray(JNIEnv *env, GSList* list)
+static jobjectArray toFilenamesArray(JNIEnv *env, GSList* list, jstring* jcurrent_folder)
 {
     jstring str;
     jclass stringCls;
     GSList *iterator;
     jobjectArray array;
     int i;
-    char* entry;
-
-    if (NULL == list) {
-        return NULL;
-    }
-
-    stringCls = (*env)->FindClass(env, "java/lang/String");
-    if (stringCls == NULL) {
-        (*env)->ExceptionClear(env);
-        JNU_ThrowInternalError(env, "Could not get java.lang.String class");
-        return NULL;
-    }
-
-    array = (*env)->NewObjectArray(env, fp_gtk_g_slist_length(list), stringCls, NULL);
-    if (array == NULL) {
-        (*env)->ExceptionClear(env);
-        JNU_ThrowInternalError(env, "Could not instantiate array files array");
-        return NULL;
-    }
-
-    i = 0;
-    for (iterator = list; iterator; iterator = iterator->next) {
-        entry = (char*) iterator->data;
-        entry = strrchr(entry, '/') + 1;
-        str = (*env)->NewStringUTF(env, entry);
-        if (str && !(*env)->ExceptionCheck(env)) {
-            (*env)->SetObjectArrayElement(env, array, i, str);
-        }
-        i++;
-    }
-
-    return array;
-}
-
-/**
- * Convert a GSList to an array of filenames (with the parent folder)
- */
-static jobjectArray toPathAndFilenamesArray(JNIEnv *env, GSList* list)
-{
-    jstring str;
-    jclass stringCls;
-    GSList *iterator;
-    jobjectArray array;
-    int i;
-    char* entry;
-
+    gchar* entry;
+    gchar * baseDir;
+    gboolean isFromSameDir;
 
     if (list == NULL) {
         return NULL;
@@ -233,12 +225,23 @@
         return NULL;
     }
 
-    i = 0;
-    for (iterator = list; iterator; iterator = iterator->next) {
-        entry = (char*) iterator->data;
+    isFromSameDir = isFromSameDirectory(list, &baseDir);
+
+    *jcurrent_folder = (*env)->NewStringUTF(env, baseDir);
+    if (*jcurrent_folder == NULL) {
+        free(baseDir);
+        return NULL;
+    }
 
-        //check for leading slash.
-        if (entry[0] == '/') {
+    for (iterator = list, i=0;
+            iterator;
+            iterator = iterator->next, i++) {
+
+        entry = (gchar*) iterator->data;
+
+        if (isFromSameDir) {
+            entry = strrchr(entry, '/') + 1;
+        } else if (entry[0] == '/') {
             entry++;
         }
 
@@ -246,48 +249,33 @@
         if (str && !(*env)->ExceptionCheck(env)) {
             (*env)->SetObjectArrayElement(env, array, i, str);
         }
-        i++;
     }
 
+    free(baseDir);
     return array;
 }
 
 static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj)
 {
     JNIEnv *env;
-    char *current_folder;
     GSList *filenames;
-    jclass cx;
-    jstring jcurrent_folder;
+    jstring jcurrent_folder = NULL;
     jobjectArray jfilenames;
 
     env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
-    current_folder = NULL;
     filenames = NULL;
-    gboolean full_path_names = FALSE;
 
     if (responseId == GTK_RESPONSE_ACCEPT) {
-        current_folder = fp_gtk_file_chooser_get_current_folder(
-                GTK_FILE_CHOOSER(aDialog));
-        if (current_folder == NULL) {
-            full_path_names = TRUE;
-        }
         filenames = fp_gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(aDialog));
     }
-    if (full_path_names) {
-        //This is a hack for use with "Recent Folders" in gtk where each
-        //file could have its own directory.
-        jfilenames = toPathAndFilenamesArray(env, filenames);
-        jcurrent_folder = (*env)->NewStringUTF(env, "/");
-    } else {
-        jfilenames = toFilenamesArray(env, filenames);
-        jcurrent_folder = (*env)->NewStringUTF(env, current_folder);
-    }
+
+    jfilenames = toFilenamesArray(env, filenames, &jcurrent_folder);
+
     if (!(*env)->ExceptionCheck(env)) {
         (*env)->CallVoidMethod(env, obj, setFileInternalMethodID,
                                jcurrent_folder, jfilenames);
     }
-    fp_g_free(current_folder);
+
     quit(env, (jobject)obj, TRUE);
 }
 
--- a/src/solaris/native/sun/nio/ch/Net.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/native/sun/nio/ch/Net.c	Wed Jul 09 10:42:37 2014 -0700
@@ -435,7 +435,8 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_Net_setIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
-                                  jboolean mayNeedConversion, jint level, jint opt, jint arg)
+                                  jboolean mayNeedConversion, jint level,
+                                  jint opt, jint arg, jboolean isIPv6)
 {
     int result;
     struct linger linger;
@@ -478,6 +479,12 @@
                                      JNU_JAVANETPKG "SocketException",
                                      "sun.nio.ch.Net.setIntOption");
     }
+#ifdef __linux__
+    if (level == IPPROTO_IPV6 && opt == IPV6_TCLASS && isIPv6) {
+        // set the V4 option also
+        setsockopt(fdval(env, fdo), IPPROTO_IP, IP_TOS, parg, arglen);
+    }
+#endif
 }
 
 JNIEXPORT jint JNICALL
--- a/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h	Wed Jul 09 10:42:37 2014 -0700
@@ -75,6 +75,13 @@
 }
 SCARD_READERSTATE_A;
 
+typedef struct _SCARD_IO_REQUEST
+{
+        unsigned long dwProtocol;       /* Protocol identifier */
+        unsigned long cbPciLength;      /* Protocol Control Inf Length */
+}
+SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
+
 #else // __APPLE__
 
 #pragma pack(1)
@@ -88,6 +95,13 @@
         unsigned char rgbAtr[MAX_ATR_SIZE];
 }
 SCARD_READERSTATE_A;
+
+typedef struct _SCARD_IO_REQUEST
+{
+        uint32_t dwProtocol;            /* Protocol identifier */
+        uint32_t cbPciLength;           /* Protocol Control Inf Length */
+}
+SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
 #pragma pack()
 
 #endif // __APPLE__
@@ -95,13 +109,6 @@
 typedef SCARD_READERSTATE_A SCARD_READERSTATE, *PSCARD_READERSTATE_A,
         *LPSCARD_READERSTATE_A;
 
-typedef struct _SCARD_IO_REQUEST
-{
-        unsigned long dwProtocol;       /* Protocol identifier */
-        unsigned long cbPciLength;      /* Protocol Control Inf Length */
-}
-SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
-
 typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST;
 
 extern SCARD_IO_REQUEST g_rgSCardT0Pci, g_rgSCardT1Pci,
--- a/src/windows/classes/sun/awt/Win32FontManager.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/Win32FontManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -42,8 +42,6 @@
 import sun.font.FontManager;
 import sun.font.SunFontManager;
 import sun.font.TrueTypeFont;
-import sun.java2d.HeadlessGraphicsEnvironment;
-import sun.java2d.SunGraphicsEnvironment;
 
 /**
  * The X11 implementation of {@link FontManager}.
@@ -56,7 +54,7 @@
 
     static {
 
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
 
                 public Object run() {
                     String eudcFile = getEUDCFontFile();
@@ -90,7 +88,7 @@
 
     public Win32FontManager() {
         super();
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
                 public Object run() {
 
                     /* Register the JRE fonts so that the native platform can
@@ -227,7 +225,7 @@
         final String[] dirs = getPlatformFontDirs(true);
         if (dirs.length > 1) {
             String dir = (String)
-                AccessController.doPrivileged(new PrivilegedAction() {
+                AccessController.doPrivileged(new PrivilegedAction<Object>() {
                         public Object run() {
                             for (int i=0; i<dirs.length; i++) {
                                 String path =
@@ -272,7 +270,7 @@
             fontsForPrinting = null;
         }
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
+            new java.security.PrivilegedAction<Object>() {
                 public Object run() {
                     File f1 = new File(pathName);
                     String[] ls = f1.list(SunFontManager.getInstance().
--- a/src/windows/classes/sun/awt/Win32GraphicsDevice.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/Win32GraphicsDevice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -172,7 +172,7 @@
 
             int max = getMaxConfigs(screen);
             int defaultPixID = getDefaultPixID(screen);
-            Vector v = new Vector( max );
+            Vector<GraphicsConfiguration> v = new Vector<>( max );
             if (defaultPixID == 0) {
                 // Workaround for failing GDI calls
                 defaultConfig = Win32GraphicsConfig.getConfig(this,
@@ -437,7 +437,7 @@
     protected native void configDisplayMode(int screen, WindowPeer w, int width,
                                           int height, int bitDepth,
                                           int refreshRate);
-    protected native void enumDisplayModes(int screen, ArrayList modes);
+    protected native void enumDisplayModes(int screen, ArrayList<DisplayMode> modes);
 
     @Override
     public synchronized DisplayMode getDisplayMode() {
@@ -447,12 +447,12 @@
 
     @Override
     public synchronized DisplayMode[] getDisplayModes() {
-        ArrayList modes = new ArrayList();
+        ArrayList<DisplayMode> modes = new ArrayList<>();
         enumDisplayModes(screen, modes);
         int listSize = modes.size();
         DisplayMode[] retArray = new DisplayMode[listSize];
         for (int i = 0; i < listSize; i++) {
-            retArray[i] = (DisplayMode)modes.get(i);
+            retArray[i] = modes.get(i);
         }
         return retArray;
     }
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Wed Jul 09 10:42:37 2014 -0700
@@ -894,10 +894,10 @@
 
     // Icons
 
-    private static Map smallSystemImages = new HashMap();
-    private static Map largeSystemImages = new HashMap();
-    private static Map smallLinkedSystemImages = new HashMap();
-    private static Map largeLinkedSystemImages = new HashMap();
+    private static Map<Integer, Image> smallSystemImages = new HashMap<>();
+    private static Map<Integer, Image> largeSystemImages = new HashMap<>();
+    private static Map<Integer, Image> smallLinkedSystemImages = new HashMap<>();
+    private static Map<Integer, Image> largeLinkedSystemImages = new HashMap<>();
 
     // NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details
     private static native long getIShellIcon(long pIShellFolder);
@@ -970,13 +970,13 @@
                             // These are cached per type (using the index in the system image list)
                             int index = getIconIndex(parentIShellIcon, relativePIDL);
                             if (index > 0) {
-                                Map imageCache;
+                                Map<Integer, Image> imageCache;
                                 if (isLink()) {
                                     imageCache = getLargeIcon ? largeLinkedSystemImages : smallLinkedSystemImages;
                                 } else {
                                     imageCache = getLargeIcon ? largeSystemImages : smallSystemImages;
                                 }
-                                newIcon = (Image) imageCache.get(Integer.valueOf(index));
+                                newIcon = imageCache.get(Integer.valueOf(index));
                                 if (newIcon == null) {
                                     long hIcon = getIcon(getAbsolutePath(), getLargeIcon);
                                     newIcon = makeIcon(hIcon, getLargeIcon);
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Wed Jul 09 10:42:37 2014 -0700
@@ -51,7 +51,7 @@
  * @since 1.4
  */
 
-public class Win32ShellFolderManager2 extends ShellFolderManager {
+final class Win32ShellFolderManager2 extends ShellFolderManager {
 
     static {
         // Load library here
@@ -414,14 +414,14 @@
         return false;
     }
 
-    private static List topFolderList = null;
+    private static List<Win32ShellFolder2> topFolderList = null;
     static int compareShellFolders(Win32ShellFolder2 sf1, Win32ShellFolder2 sf2) {
         boolean special1 = sf1.isSpecial();
         boolean special2 = sf2.isSpecial();
 
         if (special1 || special2) {
             if (topFolderList == null) {
-                ArrayList tmpTopFolderList = new ArrayList();
+                ArrayList<Win32ShellFolder2> tmpTopFolderList = new ArrayList<>();
                 tmpTopFolderList.add(Win32ShellFolderManager2.getPersonal());
                 tmpTopFolderList.add(Win32ShellFolderManager2.getDesktop());
                 tmpTopFolderList.add(Win32ShellFolderManager2.getDrives());
--- a/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,6 +29,7 @@
 import java.awt.Cursor;
 import java.awt.Image;
 import java.awt.Point;
+import java.awt.datatransfer.DataFlavor;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 
@@ -76,8 +77,9 @@
         return theInstance;
     }
 
+    @Override
     protected void startDrag(Transferable trans,
-                             long[] formats, Map formatMap) {
+                             long[] formats, Map<Long, DataFlavor> formatMap) {
 
         long nativeCtxtLocal = 0;
 
@@ -153,7 +155,7 @@
                                  InputEvent nativeTrigger,
                                  int actions,
                                  long[] formats,
-                                 Map formatMap);
+                                 Map<Long, DataFlavor> formatMap);
 
     /**
      * downcall into native code
--- a/src/windows/classes/sun/awt/windows/WFontConfiguration.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WFontConfiguration.java	Wed Jul 09 10:42:37 2014 -0700
@@ -53,7 +53,7 @@
     @Override
     protected void initReorderMap() {
         if (encoding.equalsIgnoreCase("windows-31j")) {
-            localeMap = new Hashtable();
+            localeMap = new Hashtable<>();
             /* Substitute Mincho for Gothic in this one case.
              * Note the windows fontconfig files already contain the mapping:
              * filename.MS_Mincho=MSMINCHO.TTC
@@ -67,7 +67,7 @@
             localeMap.put("dialoginput.italic.japanese", "MS Mincho");
             localeMap.put("dialoginput.bolditalic.japanese", "MS Mincho");
         }
-        reorderMap = new HashMap();
+        reorderMap = new HashMap<>();
         reorderMap.put("UTF-8.hi", "devanagari");
         reorderMap.put("windows-1255", "hebrew");
         reorderMap.put("x-windows-874", "thai");
@@ -118,7 +118,7 @@
 
     @Override
     protected String makeAWTFontName(String platformFontName, String characterSubsetName) {
-        String windowsCharset = (String) subsetCharsetMap.get(characterSubsetName);
+        String windowsCharset = subsetCharsetMap.get(characterSubsetName);
         if (windowsCharset == null) {
             windowsCharset = "DEFAULT_CHARSET";
         }
@@ -127,7 +127,7 @@
 
     @Override
     protected String getEncoding(String awtFontName, String characterSubsetName) {
-        String encoding = (String) subsetEncodingMap.get(characterSubsetName);
+        String encoding = subsetEncodingMap.get(characterSubsetName);
         if (encoding == null) {
             encoding = "default";
         }
@@ -174,8 +174,8 @@
         return fontName;
     }
 
-    private static HashMap subsetCharsetMap = new HashMap();
-    private static HashMap subsetEncodingMap = new HashMap();
+    private static HashMap<String, String> subsetCharsetMap = new HashMap<>();
+    private static HashMap<String, String> subsetEncodingMap = new HashMap<>();
     private static String textInputCharset;
 
     private void initTables(String defaultEncoding) {
--- a/src/windows/classes/sun/awt/windows/WFontMetrics.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WFontMetrics.java	Wed Jul 09 10:42:37 2014 -0700
@@ -199,10 +199,10 @@
 
     native void init();
 
-    static Hashtable table = new Hashtable();
+    static Hashtable<Font, FontMetrics> table = new Hashtable<>();
 
     static FontMetrics getFontMetrics(Font font) {
-        FontMetrics fm = (FontMetrics)table.get(font);
+        FontMetrics fm = table.get(font);
         if (fm == null) {
             table.put(font, fm = new WFontMetrics(font));
         }
--- a/src/windows/classes/sun/awt/windows/WInputMethod.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WInputMethod.java	Wed Jul 09 10:42:37 2014 -0700
@@ -86,26 +86,27 @@
 
     // Initialize highlight mapping table
     static {
+        @SuppressWarnings({"rawtypes", "unchecked"})
         Map<TextAttribute,Object> styles[] = new Map[4];
         HashMap<TextAttribute,Object> map;
 
         // UNSELECTED_RAW_TEXT_HIGHLIGHT
-        map = new HashMap(1);
+        map = new HashMap<>(1);
         map.put(TextAttribute.INPUT_METHOD_UNDERLINE, TextAttribute.UNDERLINE_LOW_DOTTED);
         styles[0] = Collections.unmodifiableMap(map);
 
         // SELECTED_RAW_TEXT_HIGHLIGHT
-        map = new HashMap(1);
+        map = new HashMap<>(1);
         map.put(TextAttribute.INPUT_METHOD_UNDERLINE, TextAttribute.UNDERLINE_LOW_GRAY);
         styles[1] = Collections.unmodifiableMap(map);
 
         // UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
-        map = new HashMap(1);
+        map = new HashMap<>(1);
         map.put(TextAttribute.INPUT_METHOD_UNDERLINE, TextAttribute.UNDERLINE_LOW_DOTTED);
         styles[2] = Collections.unmodifiableMap(map);
 
         // SELECTED_CONVERTED_TEXT_HIGHLIGHT
-        map = new HashMap(4);
+        map = new HashMap<>(4);
         Color navyBlue = new Color(0, 0, 128);
         map.put(TextAttribute.FOREGROUND, navyBlue);
         map.put(TextAttribute.BACKGROUND, Color.white);
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Jul 09 10:42:37 2014 -0700
@@ -843,6 +843,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T extends DragGestureRecognizer> T
         createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                     DragSource ds, Component c, int srcActions,
--- a/src/windows/classes/sun/awt/windows/WWindowPeer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -450,8 +450,9 @@
      * active window is always at the end.
      */
     @SuppressWarnings("unchecked")
-    public static long[] getActiveWindowHandles() {
-        AppContext appContext = AppContext.getAppContext();
+    public static long[] getActiveWindowHandles(Component target) {
+        AppContext appContext = SunToolkit.targetToAppContext(target);
+        if (appContext == null) return null;
         synchronized (appContext) {
             List<WWindowPeer> l = (List<WWindowPeer>)appContext.get(ACTIVE_WINDOWS_KEY);
             if (l == null) {
--- a/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java	Wed Jul 09 10:42:37 2014 -0700
@@ -717,7 +717,7 @@
 class D3DGeneralBlit extends Blit {
 
     private Blit performop;
-    private WeakReference srcTmp;
+    private WeakReference<SurfaceData> srcTmp;
 
     D3DGeneralBlit(SurfaceType dstType,
                    CompositeType compType,
@@ -739,7 +739,7 @@
         SurfaceData cachedSrc = null;
         if (srcTmp != null) {
             // use cached intermediate surface, if available
-            cachedSrc = (SurfaceData)srcTmp.get();
+            cachedSrc = srcTmp.get();
         }
 
         // convert source to IntArgbPre
@@ -752,7 +752,7 @@
 
         if (src != cachedSrc) {
             // cache the intermediate surface
-            srcTmp = new WeakReference(src);
+            srcTmp = new WeakReference<>(src);
         }
     }
 }
--- a/src/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -41,7 +41,6 @@
 import sun.awt.windows.WWindowPeer;
 import sun.java2d.pipe.hw.ContextCapabilities;
 import sun.java2d.windows.WindowsFlags;
-import static sun.java2d.pipe.BufferedOpCodes.*;
 import static sun.java2d.d3d.D3DContext.D3DContextCaps.*;
 import sun.java2d.d3d.D3DContext.D3DContextCaps;
 
@@ -383,9 +382,9 @@
     }
 
     private static native void enumDisplayModesNative(int screen,
-                                                      ArrayList modes);
+                                                      ArrayList<DisplayMode> modes);
     @Override
-    protected void enumDisplayModes(final int screen, final ArrayList modes) {
+    protected void enumDisplayModes(final int screen, final ArrayList<DisplayMode> modes) {
         D3DRenderQueue rq = D3DRenderQueue.getInstance();
         rq.lock();
         try {
--- a/src/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java	Wed Jul 09 10:42:37 2014 -0700
@@ -75,7 +75,7 @@
     public static final SurfaceType ThreeByteBgrGdi =
         SurfaceType.ThreeByteBgr.deriveSubType(DESC_GDI);
 
-    private static native void initIDs(Class xorComp);
+    private static native void initIDs(Class<?> xorComp);
 
     static {
         initIDs(XORComposite.class);
--- a/src/windows/classes/sun/java2d/windows/WindowsFlags.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/java2d/windows/WindowsFlags.java	Wed Jul 09 10:42:37 2014 -0700
@@ -201,7 +201,7 @@
 
     private static void initJavaFlags() {
         java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction()
+            new java.security.PrivilegedAction<Object>()
         {
             public Object run() {
                 magPresent = getBooleanProp(
--- a/src/windows/classes/sun/print/Win32MediaTray.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/print/Win32MediaTray.java	Wed Jul 09 10:42:37 2014 -0700
@@ -50,8 +50,8 @@
     static final Win32MediaTray FORMSOURCE = new Win32MediaTray(5,
                                                       15); //DMBIN_FORMSOURCE
 
-    private static ArrayList winStringTable = new ArrayList();
-    private static ArrayList winEnumTable = new ArrayList();
+    private static ArrayList<String> winStringTable = new ArrayList<>();
+    private static ArrayList<Win32MediaTray> winEnumTable = new ArrayList<>();
     public int winID;
 
     private Win32MediaTray(int value, int id) {
@@ -97,22 +97,22 @@
     }
 
     protected String[] getStringTable() {
-      ArrayList completeList = new ArrayList();
+      ArrayList<String> completeList = new ArrayList<>();
       for (int i=0; i < myStringTable.length; i++) {
         completeList.add(myStringTable[i]);
       }
       completeList.addAll(winStringTable);
       String[] nameTable = new String[completeList.size()];
-      return (String[])completeList.toArray(nameTable);
+      return completeList.toArray(nameTable);
     }
 
     protected EnumSyntax[] getEnumValueTable() {
-      ArrayList completeList = new ArrayList();
+      ArrayList<MediaTray> completeList = new ArrayList<>();
       for (int i=0; i < myEnumValueTable.length; i++) {
         completeList.add(myEnumValueTable[i]);
       }
       completeList.addAll(winEnumTable);
       MediaTray[] enumTable = new MediaTray[completeList.size()];
-      return (MediaTray[])completeList.toArray(enumTable);
+      return completeList.toArray(enumTable);
     }
 }
--- a/src/windows/classes/sun/print/Win32PrintJob.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/print/Win32PrintJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -79,9 +79,9 @@
 
 public class Win32PrintJob implements CancelablePrintJob {
 
-    transient private Vector jobListeners;
-    transient private Vector attrListeners;
-    transient private Vector listenedAttributeSets;
+    transient private Vector<PrintJobListener> jobListeners;
+    transient private Vector<PrintJobAttributeListener> attrListeners;
+    transient private Vector<PrintJobAttributeSet> listenedAttributeSets;
 
     private Win32PrintService service;
     private boolean fidelity;
@@ -139,7 +139,7 @@
                 return;
             }
             if (jobListeners == null) {
-                jobListeners = new Vector();
+                jobListeners = new Vector<>();
             }
             jobListeners.add(listener);
         }
@@ -227,7 +227,7 @@
                 PrintJobListener listener;
                 PrintJobEvent event = new PrintJobEvent(this, reason);
                 for (int i = 0; i < jobListeners.size(); i++) {
-                    listener = (PrintJobListener)(jobListeners.elementAt(i));
+                    listener = jobListeners.elementAt(i);
                     switch (reason) {
 
                         case PrintJobEvent.JOB_COMPLETE :
@@ -266,8 +266,8 @@
                 return;
             }
             if (attrListeners == null) {
-                attrListeners = new Vector();
-                listenedAttributeSets = new Vector();
+                attrListeners = new Vector<>();
+                listenedAttributeSets = new Vector<>();
             }
             attrListeners.add(listener);
             if (attributes == null) {
@@ -670,7 +670,7 @@
             fidelity = false;
         }
 
-        Class category;
+        Class<? extends Attribute> category;
         Attribute [] attrs = reqAttrSet.toArray();
         for (int i=0; i<attrs.length; i++) {
             Attribute attr = attrs[i];
--- a/src/windows/classes/sun/print/Win32PrintService.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/print/Win32PrintService.java	Wed Jul 09 10:42:37 2014 -0700
@@ -97,7 +97,7 @@
     };
 
     /* let's try to support a few of these */
-    private static final Class[] serviceAttrCats = {
+    private static final Class<?>[] serviceAttrCats = {
         PrinterName.class,
         PrinterIsAcceptingJobs.class,
         QueuedJobCount.class,
@@ -107,7 +107,7 @@
     /*  it turns out to be inconvenient to store the other categories
      *  separately because many attributes are in multiple categories.
      */
-    private static Class[] otherAttrCats = {
+    private static Class<?>[] otherAttrCats = {
         JobName.class,
         RequestingUserName.class,
         Copies.class,
@@ -202,7 +202,7 @@
     private MediaPrintableArea[] mediaPrintables;
     private MediaTray[] mediaTrays;
     private PrinterResolution[] printRes;
-    private HashMap mpaMap;
+    private HashMap<MediaSizeName, MediaPrintableArea> mpaMap;
     private int nCopies;
     private int prnCaps;
     private int[] defaultSettings;
@@ -212,7 +212,7 @@
     private boolean mediaInitialized;
     private boolean mpaListInitialized;
 
-    private ArrayList idList;
+    private ArrayList<Integer> idList;
     private MediaSize[] mediaSizes;
 
     private boolean isInvalid;
@@ -279,7 +279,7 @@
             (idList.size() == mediaSizes.length)) {
             for (int i=0; i< idList.size(); i++) {
                 if (mediaSizes[i].getMediaSizeName() == msn) {
-                    return ((Integer)idList.get(i)).intValue();
+                    return idList.get(i).intValue();
                 }
             }
         }
@@ -338,10 +338,11 @@
         }
     }
 
-    private boolean addToUniqueList(ArrayList msnList, MediaSizeName mediaName) {
+    private boolean addToUniqueList(ArrayList<MediaSizeName> msnList,
+                                    MediaSizeName mediaName) {
         MediaSizeName msn;
         for (int i=0; i< msnList.size(); i++) {
-            msn = (MediaSizeName)msnList.get(i);
+            msn = msnList.get(i);
             if (msn == mediaName) {
                 return false;
             }
@@ -360,9 +361,8 @@
             return;
         }
 
-        ArrayList msnList = new ArrayList();
+        ArrayList<MediaSizeName> msnList = new ArrayList<>();
         ArrayList<Win32MediaSize> trailingWmsList = new ArrayList<Win32MediaSize>();
-        ArrayList printableList = new ArrayList();
         MediaSizeName mediaName;
         boolean added;
         boolean queryFailure = false;
@@ -375,7 +375,7 @@
         // We remove from ID list any invalid mediaSize.  Though this is rare,
         // it happens in HP 4050 German driver.
 
-        idList = new ArrayList();
+        idList = new ArrayList<>();
         for (int i=0; i < media.length; i++) {
             idList.add(Integer.valueOf(media[i]));
         }
@@ -385,7 +385,7 @@
         for (int i = 0; i < idList.size(); i++) {
 
             // match Win ID with our predefined ID using table
-            mediaName = findWin32Media(((Integer)idList.get(i)).intValue());
+            mediaName = findWin32Media(idList.get(i).intValue());
             // Verify that this standard size is the same size as that
             // reported by the driver. This should be the case except when
             // the driver is mis-using a standard windows paper ID.
@@ -420,7 +420,7 @@
                  */
                 Win32MediaSize wms = Win32MediaSize.findMediaName(dmPaperNameList.get(i));
                 if ((wms == null) && (idList.size() == mediaSizes.length)) {
-                    wms = new Win32MediaSize(dmPaperNameList.get(i), (Integer)idList.get(i));
+                    wms = new Win32MediaSize(dmPaperNameList.get(i), idList.get(i));
                     mediaSizes[i] = new MediaSize(mediaSizes[i].getX(MediaSize.MM),
                         mediaSizes[i].getY(MediaSize.MM), MediaSize.MM, wms);
                 }
@@ -458,7 +458,7 @@
             // get from cached mapping of MPAs
             if (mpaMap != null && (mpaMap.get(msn) != null)) {
                 MediaPrintableArea[] mpaArr = new MediaPrintableArea[1];
-                mpaArr[0] = (MediaPrintableArea)mpaMap.get(msn);
+                mpaArr[0] = mpaMap.get(msn);
                 return mpaArr;
             }
         }
@@ -478,7 +478,7 @@
         }
 
         if (mpaMap == null) {
-            mpaMap = new HashMap();
+            mpaMap = new HashMap<>();
         }
 
         for (int i=0; i < loopNames.length; i++) {
@@ -532,10 +532,10 @@
            }
            MediaPrintableArea[] mpaArr = new MediaPrintableArea[1];
            // by this time, we've already gotten the desired MPA
-           mpaArr[0] = (MediaPrintableArea)mpaMap.get(msn);
+           mpaArr[0] = mpaMap.get(msn);
            return mpaArr;
        } else {
-           mediaPrintables = (MediaPrintableArea[])mpaMap.values().toArray(new MediaPrintableArea[0]);
+           mediaPrintables = mpaMap.values().toArray(new MediaPrintableArea[0]);
            mpaListInitialized = true;
            return mediaPrintables;
        }
@@ -624,7 +624,8 @@
     }
 
 
-    private MediaSize[] getMediaSizes(ArrayList idList, int[] media, ArrayList<String> dmPaperNameList) {
+    private MediaSize[] getMediaSizes(ArrayList<Integer> idList, int[] media,
+                                      ArrayList<String> dmPaperNameList) {
         if (dmPaperNameList == null) {
             dmPaperNameList = new ArrayList<String>();
         }
@@ -641,7 +642,7 @@
         }
 
         int nMedia = mediaSz.length/2;
-        ArrayList msList = new ArrayList();
+        ArrayList<MediaSize> msList = new ArrayList<>();
 
         for (int i = 0; i < nMedia; i++, ms=null) {
             wid = mediaSz[i*2]/10f;
@@ -814,7 +815,7 @@
             } else {
                 int nRes = prnRes.length/2;
 
-                ArrayList arrList = new ArrayList();
+                ArrayList<PrinterResolution> arrList = new ArrayList<>();
                 PrinterResolution pr;
 
                 for (int i=0; i<nRes; i++) {
@@ -826,8 +827,7 @@
                     }
                 }
 
-                printRes = (PrinterResolution[])arrList.toArray(
-                                        new PrinterResolution[arrList.size()]);
+                printRes = arrList.toArray(new PrinterResolution[arrList.size()]);
             }
         }
         return printRes;
@@ -915,6 +915,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     public <T extends PrintServiceAttribute> T
         getAttribute(Class<T> category)
     {
@@ -1009,7 +1010,7 @@
     }
 
     public Class<?>[] getSupportedAttributeCategories() {
-        ArrayList categList = new ArrayList(otherAttrCats.length+3);
+        ArrayList<Class<?>> categList = new ArrayList<>(otherAttrCats.length+3);
         for (int i=0; i < otherAttrCats.length; i++) {
             categList.add(otherAttrCats[i]);
         }
@@ -1033,7 +1034,7 @@
             categList.add(PrinterResolution.class);
         }
 
-        return (Class[])categList.toArray(new Class[categList.size()]);
+        return categList.toArray(new Class<?>[categList.size()]);
     }
 
     public boolean
@@ -1049,7 +1050,7 @@
                                                " is not an Attribute");
         }
 
-        Class[] classList = getSupportedAttributeCategories();
+        Class<?>[] classList = getSupportedAttributeCategories();
         for (int i = 0; i < classList.length; i++) {
             if (category.equals(classList[i])) {
                 return true;
@@ -1234,7 +1235,7 @@
         }
     }
 
-    private boolean isPSDocAttr(Class category) {
+    private boolean isPSDocAttr(Class<?> category) {
         if (category == OrientationRequested.class || category == Copies.class) {
                 return true;
         }
@@ -1475,7 +1476,7 @@
         if (attr == null) {
             throw new NullPointerException("null attribute");
         }
-        Class category = attr.getCategory();
+        Class<? extends Attribute> category = attr.getCategory();
         if (flavor != null) {
             if (!isDocFlavorSupported(flavor)) {
                 throw new IllegalArgumentException(flavor +
@@ -1700,7 +1701,7 @@
         return this.getClass().hashCode()+getName().hashCode();
     }
 
-    public boolean usesClass(Class c) {
+    public boolean usesClass(Class<?> c) {
         return (c == sun.awt.windows.WPrinterJob.class);
     }
 
@@ -1722,8 +1723,8 @@
 
 @SuppressWarnings("serial") // JDK implementation class
 class Win32MediaSize extends MediaSizeName {
-    private static ArrayList winStringTable = new ArrayList();
-    private static ArrayList winEnumTable = new ArrayList();
+    private static ArrayList<String> winStringTable = new ArrayList<>();
+    private static ArrayList<Win32MediaSize> winEnumTable = new ArrayList<>();
     private static MediaSize[] predefMedia;
 
     private int dmPaperID; // driver ID for this paper.
@@ -1741,7 +1742,7 @@
     public static synchronized Win32MediaSize findMediaName(String name) {
         int nameIndex = winStringTable.indexOf(name);
         if (nameIndex != -1) {
-            return (Win32MediaSize)winEnumTable.get(nameIndex);
+            return winEnumTable.get(nameIndex);
         }
         return null;
     }
@@ -1783,12 +1784,12 @@
 
     protected String[] getStringTable() {
       String[] nameTable = new String[winStringTable.size()];
-      return (String[])winStringTable.toArray(nameTable);
+      return winStringTable.toArray(nameTable);
     }
 
     protected EnumSyntax[] getEnumValueTable() {
       MediaSizeName[] enumTable = new MediaSizeName[winEnumTable.size()];
-      return (MediaSizeName[])winEnumTable.toArray(enumTable);
+      return winEnumTable.toArray(enumTable);
     }
 
 }
--- a/src/windows/classes/sun/print/Win32PrintServiceLookup.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/classes/sun/print/Win32PrintServiceLookup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -183,6 +183,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked") // Cast to Class<PrintServiceAttribute>
     boolean matchingService(PrintService service,
                             PrintServiceAttributeSet serviceSet) {
         if (serviceSet != null) {
@@ -246,7 +247,7 @@
         if (services.length == 0) {
             return services;
         } else {
-            ArrayList matchingServices = new ArrayList();
+            ArrayList<PrintService> matchingServices = new ArrayList<>();
             for (int i=0; i<services.length; i++) {
                 try {
                     if (services[i].
@@ -257,7 +258,7 @@
                 }
             }
             services = new PrintService[matchingServices.size()];
-            return (PrintService[])matchingServices.toArray(services);
+            return matchingServices.toArray(services);
         }
     }
 
--- a/src/windows/native/sun/nio/ch/Net.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/native/sun/nio/ch/Net.c	Wed Jul 09 10:42:37 2014 -0700
@@ -319,7 +319,7 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_Net_setIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
-                                  jboolean mayNeedConversion, jint level, jint opt, jint arg)
+                                  jboolean mayNeedConversion, jint level, jint opt, jint arg, jboolean ipv6)
 {
     struct linger linger;
     char *parg;
--- a/src/windows/native/sun/windows/awt_Dialog.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/native/sun/windows/awt_Dialog.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -464,7 +464,8 @@
                                              &exc,
                                              "sun/awt/windows/WWindowPeer",
                                              "getActiveWindowHandles",
-                                             "()[J").l;
+                                             "(Ljava/awt/Component;)[J",
+                                             dialogTarget).l;
     if (exc == JNI_TRUE) {
         throw std::bad_alloc();
     }
--- a/src/windows/native/sun/windows/awt_InputMethod.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/native/sun/windows/awt_InputMethod.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -454,7 +454,7 @@
     TRY;
 
     // get list of available HKLs
-    int layoutCount = ::GetKeyboardLayoutList(0, NULL);
+    const int layoutCount = ::GetKeyboardLayoutList(0, NULL);
     HKL FAR * hKLList = (HKL FAR *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(HKL), layoutCount);
     CHECK_NULL_RETURN(hKLList, NULL);
     ::GetKeyboardLayoutList(layoutCount, hKLList);
--- a/src/windows/native/sun/windows/awt_List.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/native/sun/windows/awt_List.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -219,7 +219,7 @@
     JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
 
     /* Copy current box's contents to string array */
-    int nCount = GetCount();
+    const int nCount = GetCount();
     LPTSTR * strings = new LPTSTR[nCount];
     int i;
 
--- a/src/windows/native/sun/windows/awt_PrintJob.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/native/sun/windows/awt_PrintJob.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -2541,8 +2541,21 @@
      * rounded advances will drift away from the true advance.
      */
     if (glyphPos != NULL && strLen > 0) {
-         xadvances = (int*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, strLen, sizeof(int));
-         xyadvances = (int*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, strLen, sizeof(int) * 2);
+        try {
+            xadvances = (int*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc,
+                    strLen, sizeof(int));
+            xyadvances = (int*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, strLen,
+                    sizeof(int) * 2);
+        } catch (std::bad_alloc&) {
+            if (xadvances != NULL) {
+                free(xadvances);
+                xadvances = NULL;
+            }
+            if (xyadvances != NULL) {
+                free(xyadvances);
+                xyadvances = NULL;
+            }
+        }
     }
     if (xadvances != NULL && xyadvances != NULL) {
         int *inxAdvances = xadvances;
@@ -2752,8 +2765,12 @@
     if ((imgWidthByteSz % sizeof(DWORD)) != 0)
         padBytes = sizeof(DWORD) - (imgWidthByteSz % sizeof(DWORD));
 
-    jbyte* alignedImage = (jbyte*) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc,
+    jbyte* alignedImage = NULL;
+    try {
+        alignedImage = (jbyte*) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc,
             imgWidthByteSz+padBytes, ROUND_TO_LONG(srcHeight));
+    } catch (std::bad_alloc&) {
+    }
     long newImgSize = (imgWidthByteSz+padBytes) * ROUND_TO_LONG(srcHeight);
 
     if (alignedImage != NULL) {
@@ -3355,36 +3372,6 @@
     // Set page size here.
 }
 
-
-/**
- * Return an array of POINTS describing the paper sizes supported
- * by the driver identified by 'deviceName' and 'portName'.
- * If there is an error, then NULL is returned.
- */
-static POINT *getPaperSizeList(LPCTSTR deviceName, LPCTSTR portName) {
-    DWORD numPaperSizes;
-    POINT *paperSizes = NULL;
-
-    SAVE_CONTROLWORD
-    numPaperSizes = DeviceCapabilities(deviceName, portName,
-                                       DC_PAPERSIZE, NULL, NULL);
-
-    if (numPaperSizes > 0) {
-        paperSizes = (POINT *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(*paperSizes), numPaperSizes);
-
-        DWORD result = DeviceCapabilities(deviceName, portName,
-                                          DC_PAPERSIZE, (LPTSTR) paperSizes,
-                                          NULL);
-        if (result == -1) {
-            free((char *) paperSizes);
-            paperSizes = NULL;
-        }
-    }
-    RESTORE_CONTROLWORD
-
-    return paperSizes;
-}
-
 static WORD getOrientationFromDevMode2(HGLOBAL hDevMode) {
 
     WORD orient = DMORIENT_PORTRAIT;
@@ -3989,20 +3976,33 @@
     numPaperSizes = (int)DeviceCapabilities(printer, port, DC_PAPERSIZE,
                                             NULL, NULL);
     if (numPaperSizes > 0) {
-        papers = (WORD*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(WORD), numPaperSizes);
-        paperSizes = (POINT *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(*paperSizes), numPaperSizes);
-
-        DWORD result1 = DeviceCapabilities(printer, port,
-                                           DC_PAPERS, (LPTSTR) papers, NULL);
-        DWORD result2 = DeviceCapabilities(printer, port,
-                                           DC_PAPERSIZE, (LPTSTR) paperSizes,
-                                           NULL);
-
-        if (result1 == -1 || result2 == -1 ) {
-            free((char *) papers);
-            papers = NULL;
-            free((char *) paperSizes);
-            paperSizes = NULL;
+        try {
+            papers = (WORD*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(WORD), numPaperSizes);
+            paperSizes = (POINT *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(*paperSizes), numPaperSizes);
+        } catch (std::bad_alloc&) {
+            if (papers != NULL) {
+                free((char*)papers);
+                papers = NULL;
+            }
+            if (paperSizes != NULL) {
+               free((char *)paperSizes);
+               paperSizes = NULL;
+            }
+        }
+
+        if (papers != NULL && paperSizes != NULL) {
+             DWORD result1 = DeviceCapabilities(printer, port,
+                                                DC_PAPERS, (LPTSTR) papers, NULL);
+            DWORD result2 = DeviceCapabilities(printer, port,
+                                               DC_PAPERSIZE, (LPTSTR) paperSizes,
+                                               NULL);
+
+            if (result1 == -1 || result2 == -1 ) {
+                free((char *) papers);
+                papers = NULL;
+                free((char *) paperSizes);
+                paperSizes = NULL;
+            }
         }
     }
 
--- a/src/windows/native/sun/windows/awt_TextField.cpp	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/native/sun/windows/awt_TextField.cpp	Wed Jul 09 10:42:37 2014 -0700
@@ -200,7 +200,10 @@
             si.cbSize = sizeof(si);
             si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
 
+            SendMessage(EM_SHOWSCROLLBAR, SB_HORZ, TRUE);
             VERIFY(::GetScrollInfo(GetHWnd(), SB_HORZ, &si));
+            SendMessage(EM_SHOWSCROLLBAR, SB_HORZ, FALSE);
+
             if (bScrollLeft == TRUE) {
                 si.nPos = si.nPos - si.nPage / 2;
                 si.nPos = max(si.nMin, si.nPos);
--- a/src/windows/transport/shmem/shmem_md.c	Thu Jul 03 11:37:18 2014 -0700
+++ b/src/windows/transport/shmem/shmem_md.c	Wed Jul 09 10:42:37 2014 -0700
@@ -200,17 +200,6 @@
     rc = WaitForMultipleObjects(count, handles,
                                 FALSE,              /* wait for either, not both */
                                 INFINITE);          /* infinite timeout */
-
-    /* If the mutex is abandoned we will consider this a fatal error
-     * and abort with appropriate message.
-     *
-     * Note that only mutexes can be abandoned and that our mutex is
-     * always at position 0 in the handles array. Thus we only need
-     * to check WAIT_ABANDONED_0 (not WAIT_ABANDONED_0 + x).
-     */
-    if (rc == WAIT_ABANDONED_0) {
-        exitTransportWithError("Observed abandoned IP mutex. Aborting.",THIS_FILE, __DATE__, __LINE__);
-    }
     return (rc == WAIT_OBJECT_0) ? SYS_OK : SYS_ERR;
 }
 
--- a/test/ProblemList.txt	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/ProblemList.txt	Wed Jul 09 10:42:37 2014 -0700
@@ -239,9 +239,6 @@
 
 # jdk_tools
 
-# 8028474
-sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh      generic-all
-
 # Tests take too long, on sparcs see 7143279
 tools/pack200/CommandLineTests.java                             solaris-all, macosx-all
 tools/pack200/Pack200Test.java                                  solaris-all, macosx-all
@@ -298,7 +295,4 @@
 # 8046355
 sun/tools/jstatd/TestJstatdExternalRegistry.java                generic-all
 
-# 8046352
-com/sun/tools/attach/TempDirTest.java                           generic-all
-
 ############################################################################
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/se/impl/io/CustomOutputStream.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.Serializable;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.Principal;
+import org.omg.CORBA_2_3.portable.OutputStream;
+import org.omg.CORBA_2_3.portable.InputStream;
+
+public class CustomOutputStream extends OutputStream {
+
+    @Override
+    public void write_value(Serializable value, Class clz) {
+    }
+
+    @Override
+    public InputStream create_input_stream() {
+        return null;
+    }
+
+    @Override
+    public void write_boolean(boolean value) {
+    }
+
+    @Override
+    public void write_char(char value) {
+    }
+
+    @Override
+    public void write_wchar(char value) {
+    }
+
+    @Override
+    public void write_octet(byte value) {
+    }
+
+    @Override
+    public void write_short(short value) {
+    }
+
+    @Override
+    public void write_ushort(short value) {
+    }
+
+    @Override
+    public void write_long(int value) {
+    }
+
+    @Override
+    public void write_ulong(int value) {
+    }
+
+    @Override
+    public void write_longlong(long value) {
+    }
+
+    @Override
+    public void write_ulonglong(long value) {
+    }
+
+    @Override
+    public void write_float(float value) {
+    }
+
+    @Override
+    public void write_double(double value) {
+    }
+
+    @Override
+    public void write_string(String value) {
+    }
+
+    @Override
+    public void write_wstring(String value) {
+    }
+
+    @Override
+    public void write_boolean_array(boolean[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_char_array(char[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_wchar_array(char[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_octet_array(byte[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_short_array(short[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_ushort_array(short[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_long_array(int[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_ulong_array(int[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_longlong_array(long[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_ulonglong_array(long[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_float_array(float[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_double_array(double[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_Object(org.omg.CORBA.Object value) {
+    }
+
+    @Override
+    public void write_TypeCode(TypeCode value) {
+    }
+
+    @Override
+    public void write_any(Any value) {
+    }
+
+    @Override
+    public void write_Principal(Principal value) {
+    }
+
+    @Override
+    public void write(int b) throws java.io.IOException {
+    }
+
+    @Override
+    public void write_fixed(java.math.BigDecimal value) {
+    }
+
+    @Override
+    public void write_Context(org.omg.CORBA.Context ctx,
+            org.omg.CORBA.ContextList contexts) {
+    }
+
+    @Override
+    public org.omg.CORBA.ORB orb() {
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7095856
+ * @summary OutputStreamHook doesn't handle null values
+ */
+
+import java.net.InetAddress;
+import javax.rmi.CORBA.Util;
+import javax.rmi.CORBA.ValueHandler;
+
+public class HookPutFieldsTest  {
+
+    public static void main(String[] args ) throws Exception {
+        CustomOutputStream os = new CustomOutputStream();
+        InetAddress a = InetAddress.getByAddress(null, new byte[] {1,2,3,4});
+        ValueHandler vh = Util.createValueHandler();
+        vh.writeValue(os, a);
+    }
+}
--- a/test/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8026943
+ * @bug 8026943 8027575
  * @summary Verify that same buffer can be used as input and output when
  * using Cipher objects.
  * @author Valerie Peng
@@ -44,7 +44,7 @@
     private static SecretKey KEY = new SecretKeySpec(new byte[16], "AES");
     private static byte[] IV = new byte[16];
 
-    private static int[] OFFSETS = { 1, 8, 17 };
+    private static int[] OFFSETS = { 1, 8, 9, 16, 17, 32, 33 };
 
     private static final String[] MODES = {
         "ECB", "CBC", "PCBC", "CTR", "CTS",
--- a/test/com/sun/jdi/ExclusiveBind.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/jdi/ExclusiveBind.java	Wed Jul 09 10:42:37 2014 -0700
@@ -68,7 +68,9 @@
     private static ProcessBuilder prepareLauncher(String address, boolean suspend, String class_name) throws Exception {
         List<String> args = new ArrayList<>();
         for(String dbgOption : VMConnection.getDebuggeeVMOptions().split(" ")) {
-            args.add(dbgOption);
+            if (!dbgOption.trim().isEmpty()) {
+                args.add(dbgOption);
+            }
         }
         String lib = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=";
         if (suspend) {
--- a/test/com/sun/jdi/PrivateTransportTest.sh	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/jdi/PrivateTransportTest.sh	Wed Jul 09 10:42:37 2014 -0700
@@ -82,12 +82,7 @@
 echo "JDK under test is: $TESTJAVA"
 
 # Get flags being sent to debuggee
-DEBUGGEEFLAGS=
-if [ -r $TESTCLASSES/@debuggeeVMOptions ] ; then
-   DEBUGGEEFLAGS=`cat $TESTCLASSES/@debuggeeVMOptions`
-elif [ -r $TESTCLASSES/../@debuggeeVMOptions ] ; then
-   DEBUGGEEFLAGS=`cat $TESTCLASSES/../@debuggeeVMOptions`
-fi
+DEBUGGEEFLAGS=$TESTVMOPTS $TESTJAVAOPTS
 
 # Figure out what the libarch path is
 os=`uname -s`
--- a/test/com/sun/jdi/ProcessAttachDebuggee.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.
- */
-
-/*
- *
- *
- * The "debuggee" used by the unit tests for the ProcessAttachingConnector.
- * This debuggee binds to a random TCP port and waits for a client to connect.
- */
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.nio.file.CopyOption;
-import java.nio.file.Files;
-import java.nio.file.StandardCopyOption;
-import java.io.File;
-import java.io.FileOutputStream;
-
-public class ProcessAttachDebuggee {
-    public static void main(String args[]) throws Exception {
-        // bind to a random port
-        ServerSocket ss = new ServerSocket(0);
-        int port = ss.getLocalPort();
-
-        // Write the port number to the given file
-        File partial = new File(args[0] + ".partial");
-        File portFile = new File(args[0]);
-        try (FileOutputStream fos = new FileOutputStream(partial)) {
-            fos.write( Integer.toString(port).getBytes("UTF-8") );
-        }
-        Files.move(partial.toPath(), portFile.toPath(), StandardCopyOption.ATOMIC_MOVE);
-
-        System.out.println("Debuggee bound to port: " + port);
-        System.out.flush();
-
-        // wait for test harness to connect
-        Socket s = ss.accept();
-        s.close();
-        ss.close();
-
-        System.out.println("Debuggee shutdown.");
-    }
-}
--- a/test/com/sun/jdi/ProcessAttachDebugger.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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.
- */
-
-/*
- *
- *
- * Unit test for ProcessAttachingConnector - this "debugger" attaches to a debuggee
- * given it's pid. Usage:
- *
- *      java ProcessAttachDebugger <pid>
- */
-
-import com.sun.jdi.Bootstrap;
-import com.sun.jdi.VirtualMachine;
-import com.sun.jdi.ThreadReference;
-import com.sun.jdi.connect.Connector;
-import com.sun.jdi.connect.AttachingConnector;
-
-import java.util.List;
-import java.util.Map;
-
-public class ProcessAttachDebugger {
-
-    public static void main(String main_args[]) throws Exception {
-        String pid = main_args[0];
-
-        // find ProcessAttachingConnector
-
-        List<AttachingConnector> l =
-            Bootstrap.virtualMachineManager().attachingConnectors();
-        AttachingConnector ac = null;
-        for (AttachingConnector c: l) {
-            if (c.name().equals("com.sun.jdi.ProcessAttach")) {
-                ac = c;
-                break;
-            }
-        }
-        if (ac == null) {
-            throw new RuntimeException("Unable to locate ProcessAttachingConnector");
-        }
-
-        Map<String,Connector.Argument> args = ac.defaultArguments();
-        Connector.StringArgument arg = (Connector.StringArgument)args.get("pid");
-        arg.setValue(pid);
-
-        System.out.println("Debugger is attaching to: " + pid + " ...");
-
-        VirtualMachine vm = ac.attach(args);
-
-        System.out.println("Attached! Now listing threads ...");
-
-        // list all threads
-
-        for (ThreadReference thr: vm.allThreads()) {
-            System.out.println(thr);
-        }
-
-        System.out.println("Debugger done.");
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jdi/ProcessAttachTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import jdk.testlibrary.ProcessTools;
+
+import com.sun.jdi.Bootstrap;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.VirtualMachine;
+import com.sun.jdi.connect.AttachingConnector;
+import com.sun.jdi.connect.Connector;
+import com.sun.jdi.connect.IllegalConnectorArgumentsException;
+
+/**
+ * @test
+ * @bug 4527279
+ * @summary Unit test for ProcessAttachingConnector
+ *
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.* ProcessAttachTest
+ * @run driver ProcessAttachTest
+ */
+
+class ProcessAttachTestTarg {
+    public static void main(String args[]) throws Exception {
+        // Write something that can be read by the driver
+        System.out.println("Debuggee started");
+        System.out.flush();
+        for (;;) {
+            Thread.sleep(100);
+        }
+    }
+}
+
+public class ProcessAttachTest {
+
+    public static final String TESTCLASSES = System.getProperty("test.classes");
+
+    public static void main(String[] args) throws Exception {
+
+        System.out.println("Test 1: Debuggee start with suspend=n");
+        runTest("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n");
+
+        System.out.println("Test 2: Debuggee start with suspend=y");
+        runTest("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y");
+
+    }
+
+    private static void runTest(String jdwpArg) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+                jdwpArg,
+                "-classpath", TESTCLASSES,
+                "ProcessAttachTestTarg");
+        Process p = null;
+        try {
+            p = pb.start();
+
+            // Wait for the process to start
+            InputStream is = p.getInputStream();
+            is.read();
+
+            // Attach a debugger
+            tryDebug(p.getPid());
+        } finally {
+            p.destroyForcibly();
+        }
+    }
+
+    private static void tryDebug(long pid) throws IOException,
+            IllegalConnectorArgumentsException {
+        AttachingConnector ac = Bootstrap.virtualMachineManager().attachingConnectors()
+                .stream()
+                .filter(c -> c.name().equals("com.sun.jdi.ProcessAttach"))
+                .findFirst()
+                .orElseThrow(() -> new RuntimeException("Unable to locate ProcessAttachingConnector"));
+
+        Map<String, Connector.Argument> args = ac.defaultArguments();
+        Connector.StringArgument arg = (Connector.StringArgument) args
+                .get("pid");
+        arg.setValue("" + pid);
+
+        System.out.println("Debugger is attaching to: " + pid + " ...");
+        VirtualMachine vm = ac.attach(args);
+
+        // list all threads
+        System.out.println("Attached! Now listing threads ...");
+        vm.allThreads().stream().forEach(System.out::println);
+
+        System.out.println("Debugger done.");
+        vm.dispose();
+    }
+}
--- a/test/com/sun/jdi/ProcessAttachTest.sh	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-# @test
-# @bug 4527279
-# @summary Unit test for ProcessAttachingConnector
-#
-# @build ProcessAttachDebugger ProcessAttachDebuggee ShutdownDebuggee
-# @run shell/timeout=120 ProcessAttachTest.sh
-
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-                                                                                                     
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-                                                                                                     
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-                                                                                                     
-JAVA="${TESTJAVA}/bin/java"
-
-OS=`uname -s`
-
-case "$OS" in
-  Windows*)
-    PS=";"
-    OS="Windows"
-    ;;
-  CYGWIN*)
-    PS=";"
-    OS="CYGWIN"
-    ;;
-  * )
-    PS=":"
-    ;;
-esac
-
-startDebuggee()
-{
-  rm -f ${OUTPUTFILE}
-  ${JAVA} "$@" > ${OUTPUTFILE} 2>&1 &
-  startpid="$!"
-  pid="${startpid}"
-                                                                                                     
-  # CYGWIN startpid is not the native windows PID we want, get the WINPID
-  if [ "${OS}" = "CYGWIN" ]; then
-    sleep 2
-    ps -l -p ${startpid}
-    pid=`ps -l -p ${startpid} | tail -1 | awk '{print $4;}'`
-  fi
-  
-  # MKS creates an intermediate shell to launch ${JAVA} so
-  # ${startpid} is not the actual pid. We have put in a small sleep
-  # to give the intermediate shell process time to launch the
-  # "java" process.
-  if [ "$OS" = "Windows" ]; then
-    sleep 2
-    pid=`ps -o pid,ppid,comm | awk '/${startpid}.+java/{ print $1 }'`
-  fi
-                                                                                                     
-  echo "Waiting for Debuggee to initialize..."
-  attempts=0
-  while true; do
-    out=`tail -1 ${OUTPUTFILE}`
-    if [ ! -z "$out" ]; then
-      break
-    fi
-    sleep 1
-    attempts=`expr $attempts + 1`
-    echo "Waiting $attempts second(s) ..."
-  done
-
-  echo "Debuggee is process $pid (startpid=${startpid})"
-}
-
-stopDebuggee()
-{
-  # We have to make sure the debuggee has written the portfile before
-  # trying to read it.
-
-  echo "Waiting for port file to be written..."
-  attempts=0
-  while true; do
-    attempts=`expr $attempts + 1`
-    if [ -f  ${PORTFILE} ]; then
-      break
-    fi
-    sleep 1
-    echo "Waiting $attempts second(s) ..."
-  done
-
-  $JAVA -classpath "${TESTCLASSES}" ShutdownDebuggee $1 2>&1
-  if [ $? != 0 ] ; then
-    echo "Error: ShutdownDebuggee failed: $?"
-    failures=`expr $failures + 1`
-    kill -9 ${startpid}
-  fi
-}
-
-failures=0
-
-#########################################################
-echo "Test 1: Debuggee start with suspend=n"
-
-PORTFILE=shutdown1.port
-OUTPUTFILE=Debuggee1.out
-
-DEBUGGEEFLAGS=
-if [ -r $TESTCLASSES/@debuggeeVMOptions ] ; then
-   DEBUGGEEFLAGS=`cat $TESTCLASSES/@debuggeeVMOptions`
-elif [ -r $TESTCLASSES/../@debuggeeVMOptions ] ; then
-   DEBUGGEEFLAGS=`cat $TESTCLASSES/../@debuggeeVMOptions`
-fi
-
-startDebuggee \
-  $DEBUGGEEFLAGS \
-  -agentlib:jdwp=transport=dt_socket,server=y,suspend=n \
-  -classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
-
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-  ProcessAttachDebugger $pid 2>&1
-  
-if [ $? != 0 ]; then 
-  echo "Error: ProcessAttachDebugger failed: $?"
-  failures=`expr $failures + 1`
-fi
-
-# Note that when the debugger disconnects, the debuggee picks another
-# port and outputs another 'Listening for transport ... ' msg.
-
-stopDebuggee "${PORTFILE}"
-
-echo "${OUTPUTFILE}:"
-cat $OUTPUTFILE
-echo "-----"
-
-#########################################################
-echo "\nTest 2: Debuggee start with suspend=y"
-
-PORTFILE=shutdown2.port
-OUTPUTFILE=Debuggee2.out
-
-startDebuggee \
-  $DEBUGGEEFLAGS \
-  -agentlib:jdwp=transport=dt_socket,server=y,suspend=y \
-  -classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
-
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-  ProcessAttachDebugger $pid 2>&1
-
-if [ $? != 0 ]; then 
-  echo "Error: ProcessAttachDebugger failed: $?"
-  failures=`expr $failures + 1`
-fi
-
-stopDebuggee "${PORTFILE}"
-
-echo $OUTPUTFILE :
-cat $OUTPUTFILE
-echo -----
-
-### 
-if [ $failures = 0 ];
-  then echo "All tests passed.";
-  else echo "$failures test(s) failed."
-fi
-exit $failures
--- a/test/com/sun/jdi/ShellScaffold.sh	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/jdi/ShellScaffold.sh	Wed Jul 09 10:42:37 2014 -0700
@@ -882,15 +882,10 @@
 
 startDebuggee()
 {
-    args=
-    # Note that @debuggeeVMOptions is unique to a test run instead of
-    # a test in a run.  It is not modified during a test run.
-    if [ -r $TESTCLASSES/../@debuggeeVMOptions ] ; then
-       args=`cat $TESTCLASSES/../@debuggeeVMOptions`
-    fi
+    args=$TESTVMOPTS $TESTJAVAOPTS
 
     if [ ! -z "$args" ] ; then
-       echo "--Starting debuggee with args from @debuggeeVMOptions: $args"
+       echo "--Starting debuggee with args from TESTVMOPTS and/or TESTJAVAOPTS: $args"
     else
        echo "--Starting debuggee"
     fi
--- a/test/com/sun/jdi/ShutdownDebuggee.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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.
- */
-
-/*
- *
- *
- * Used by the unit tests for the ProcessAttachingConnector. This class is
- * used to shutdown the debuggee by connecting to its shutdown port.
- */
-import java.net.Socket;
-import java.net.InetSocketAddress;
-import java.io.File;
-import java.io.FileInputStream;
-
-public class ShutdownDebuggee {
-    public static void main(String args[]) throws Exception {
-
-        // read the (TCP) port number from the given file
-
-        File f = new File(args[0]);
-        FileInputStream fis = new FileInputStream(f);
-        byte b[] = new byte[8];
-        int n = fis.read(b);
-        if (n < 1) {
-            throw new RuntimeException("Empty file");
-        }
-        fis.close();
-
-        String str = new String(b, 0, n, "UTF-8");
-        System.out.println("Port number of debuggee is: " + str);
-        int port = Integer.parseInt(str);
-
-        // Now connect to the port (which will shutdown debuggee)
-
-        System.out.println("Connecting to port " + port +
-            " to shutdown Debuggee ...");
-
-        Socket s = new Socket();
-        s.connect( new InetSocketAddress(port) );
-        s.close();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jdi/SuspendNoFlagTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
+
+/* @test
+ * @bug 4914611
+ * @summary Test for JDWP: -agentlib:jdwp=suspend=n hanging
+ * @library /lib/testlibrary
+ * @build jdk.testlibarary.*
+ * @compile -g HelloWorld.java
+ * @run driver SuspendNoFlagTest
+ */
+public class SuspendNoFlagTest {
+
+    private static final String TEST_CLASSES = System.getProperty(
+            "test.classes", ".");
+
+    public static void main(String[] args) throws Throwable {
+        OutputAnalyzer output = ProcessTools.executeTestJvm("-classpath",
+                TEST_CLASSES,
+                "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n",
+                "HelloWorld");
+        output.shouldHaveExitValue(0);
+    }
+
+}
--- a/test/com/sun/jdi/SuspendNoFlagTest.sh	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-#!/bin/ksh -p
-
-#
-# Copyright (c) 2003, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-#   @test       SuspendNoFlagTest.sh
-#   @bug        4914611
-#   @summary    Test for JDWP: -agentlib:jdwp=suspend=n hanging
-#   @author     Kelly O'Hair
-#   Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
-#
-#   @run compile -g HelloWorld.java
-#   @run shell/timeout=60 SuspendNoFlagTest.sh
-#
-
-# Beginning of subroutines:
-status=1
-
-#Call this from anywhere to fail the test with an error message
-# usage: fail "reason why the test failed"
-fail() 
- { echo "The test failed :-("
-   echo "$*" 1>&2
-   echo "exit status was $status"
-   exit $status
- } #end of fail()
-
-#Call this from anywhere to pass the test with a message
-# usage: pass "reason why the test passed if applicable"
-pass() 
- { echo "The test passed!!!"
-   echo "$*" 1>&2
-   exit 0
- } #end of pass()
-
-# end of subroutines
-
-# The beginning of the script proper
-
-TARGETCLASS="HelloWorld"
-if [ -z "${TESTJAVA}" ] ; then
-   # TESTJAVA is not set, so the test is running stand-alone.
-   # TESTJAVA holds the path to the root directory of the build of the JDK
-   # to be tested.  That is, any java files run explicitly in this shell
-   # should use TESTJAVA in the path to the java interpreter.
-   # So, we'll set this to the JDK spec'd on the command line.  If none
-   # is given on the command line, tell the user that and use a default.
-   # THIS IS THE JDK BEING TESTED.
-   if [ -n "$1" ] ; then
-         TESTJAVA=$1
-      else
-         TESTJAVA=$JAVA_HOME
-   fi
-   TESTSRC=.
-   TESTCLASSES=.
-   #Deal with .class files:
-   ${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-            -classpath "${TESTCLASSES}" -g \
-            ${TARGETCLASS}.java
-fi
-#
-echo "JDK under test is: $TESTJAVA"
-#
-CP="-classpath \"${TESTCLASSES}\""
-#
-DEBUGEEFLAGS=
-if [ -r $TESTCLASSES/@debuggeeVMOptions ] ; then
-   DEBUGEEFLAGS=`cat $TESTCLASSES/@debuggeeVMOptions`
-elif [ -r $TESTCLASSES/../@debuggeeVMOptions ] ; then
-   DEBUGEEFLAGS=`cat $TESTCLASSES/../@debuggeeVMOptions`
-fi
-DEBUGEEFLAGS="$DEBUGEEFLAGS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n"
-
-java=java
-echo ${TESTJAVA}/bin/$java ${DEBUGEEFLAGS} ${CP} ${TARGETCLASS}
-eval ${TESTJAVA}/bin/$java ${DEBUGEEFLAGS} ${CP} ${TARGETCLASS}
-status=$?
-echo "test status was: $status"
-if [ $status -eq "0" ] ;
-   then pass "status = 0 and no timeout occured"
-
-   else fail "unspecified test failure (timed out or hung)"
-fi
--- a/test/com/sun/jdi/VMConnection.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/jdi/VMConnection.java	Wed Jul 09 10:42:37 2014 -0700
@@ -44,8 +44,7 @@
     /**
      * Return a String containing VM Options to pass to the debugee
      * or an empty string if there are none.
-     * These are read from the first non-comment line
-     * in file @debuggeeVMOptions in the test.classes dir
+     * These are read from TESTVMOPTS and/or TESTJAVAOPTS.
      */
     static public String getDebuggeeVMOptions() {
         String retVal = "";
@@ -59,13 +58,13 @@
         retVal += "-classpath " + testClasses;
 
         String vmOpts = System.getProperty("test.vm.opts");
-        System.out.println("vmOpts: "+vmOpts);
-        if (vmOpts != null) {
+        System.out.println("vmOpts: '" + vmOpts + "'");
+        if (vmOpts != null && !vmOpts.trim().isEmpty()) {
             retVal += " " + vmOpts;
         }
         String javaOpts = System.getProperty("test.java.opts");
-        System.out.println("javaOpts: "+javaOpts);
-        if (javaOpts != null) {
+        System.out.println("javaOpts: '" + javaOpts + "'");
+        if (javaOpts != null && !javaOpts.trim().isEmpty()) {
             retVal += " " + javaOpts;
         }
 
--- a/test/com/sun/tools/attach/Application.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/tools/attach/Application.java	Wed Jul 09 10:42:37 2014 -0700
@@ -23,41 +23,21 @@
 
 /*
  * A simple "Application" used by the Attach API unit tests. This application is
- * launched by the test. It binds to a random port and shuts down when somebody
- * connects to that port.
- * Used port and pid are written both to stdout and to a specified file.
+ * launched by the test.
  */
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.PrintWriter;
-import jdk.testlibrary.ProcessTools;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
 
 public class Application {
-    public static void main(String args[]) throws Exception {
-        // bind to a random port
-        if (args.length < 1) {
-            System.err.println("First argument should be path to output file.");
-        }
-        String outFileName = args[0];
+    public static final String READY_MSG="ready";
+    public static final String SHUTDOWN_MSG="shutdown";
 
-        ServerSocket ss = new ServerSocket(0);
-        int port = ss.getLocalPort();
-        int pid = ProcessTools.getProcessId();
-
-        System.out.println("shutdownPort=" + port);
-        System.out.println("pid=" + pid);
+    public static void main(String args[]) throws Exception {
+        System.out.println(READY_MSG);
         System.out.flush();
 
-        try (PrintWriter writer = new PrintWriter(outFileName)) {
-            writer.println("shutdownPort=" + port);
-            writer.println("pid=" + pid);
-            writer.println("done");
-            writer.flush();
+        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
+            while (!br.readLine().equals(SHUTDOWN_MSG));
         }
-
-        // wait for test harness to connect
-        Socket s = ss.accept();
-        s.close();
-        ss.close();
     }
 }
--- a/test/com/sun/tools/attach/BasicTests.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/tools/attach/BasicTests.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,7 +38,7 @@
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  * @summary Basic unit tests for the VM attach mechanism.
  * @library /lib/testlibrary
- * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application Shutdown RedefineDummy RunnerUtil
+ * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
  * @run main BasicTests
  *
  * This test will perform a number of basic attach tests.
@@ -55,21 +55,18 @@
      * 5. Shut down the Application.
      */
     public static void main(String args[]) throws Throwable {
-        final String pidFile = "TestsBasic.Application.pid";
         ProcessThread processThread = null;
-        RunnerUtil.ProcessInfo info = null;
         try {
             buildJars();
-            processThread = RunnerUtil.startApplication(pidFile);
-            info = RunnerUtil.readProcessInfo(pidFile);
-            runTests(info.pid);
+            processThread = RunnerUtil.startApplication();
+            runTests(processThread.getPid());
         } catch (Throwable t) {
             System.out.println("TestBasic got unexpected exception: " + t);
             t.printStackTrace();
             throw t;
         } finally {
             // Make sure the Application process is stopped.
-            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+            RunnerUtil.stopApplication(processThread);
         }
     }
 
@@ -78,7 +75,7 @@
      * The reason for running the tests in a separate process
      * is that we need to modify the class path.
      */
-    private static void runTests(int pid) throws Throwable {
+    private static void runTests(long pid) throws Throwable {
         final String sep = File.separator;
 
         // Need to add jdk/lib/tools.jar to classpath.
@@ -92,7 +89,7 @@
             "-classpath",
             classpath,
             "BasicTests$TestMain",
-            Integer.toString(pid),
+            Long.toString(pid),
             testClassDir + "Agent.jar",
             testClassDir + "BadAgent.jar",
             testClassDir + "RedefineAgent.jar" };
--- a/test/com/sun/tools/attach/PermissionTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/tools/attach/PermissionTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -23,7 +23,6 @@
 
 import com.sun.tools.attach.VirtualMachine;
 import com.sun.tools.attach.AttachNotSupportedException;
-import java.util.Properties;
 import java.io.File;
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
@@ -34,7 +33,7 @@
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  * @summary Basic unit tests for the VM attach mechanism.
  * @library /lib/testlibrary
- * @run build jdk.testlibrary.* Application Shutdown
+ * @run build jdk.testlibrary.* Application
  * @run main PermissionTest
  *
  * Unit test for Attach API -
@@ -51,20 +50,17 @@
      * 4. Shut down the Application.
      */
     public static void main(String args[]) throws Throwable {
-        final String pidFile ="TestPermission.Application.pid";
         ProcessThread processThread = null;
-        RunnerUtil.ProcessInfo info = null;
         try {
-            processThread = RunnerUtil.startApplication(pidFile);
-            info = RunnerUtil.readProcessInfo(pidFile);
-            runTests(info.pid);
+            processThread = RunnerUtil.startApplication();
+            runTests(processThread.getPid());
         } catch (Throwable t) {
             System.out.println("TestPermission got unexpected exception: " + t);
             t.printStackTrace();
             throw t;
         } finally {
             // Make sure the Application process is stopped.
-            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+            RunnerUtil.stopApplication(processThread);
         }
     }
 
@@ -72,7 +68,7 @@
      * Runs the actual test the nested class TestMain.
      * The test is run in a separate process because we need to add to the classpath.
      */
-    private static void runTests(int pid) throws Throwable {
+    private static void runTests(long pid) throws Throwable {
         final String sep = File.separator;
 
         // Need to add jdk/lib/tools.jar to classpath.
@@ -88,7 +84,7 @@
             "-Djava.security.manager",
             String.format("-Djava.security.policy=%sjava.policy.deny", testSrc),
             "PermissionTest$TestMain",
-            Integer.toString(pid),
+            Long.toString(pid),
             "true" };
         OutputAnalyzer output = ProcessTools.executeTestJvm(args);
         output.shouldHaveExitValue(0);
@@ -100,7 +96,7 @@
             "-Djava.security.manager",
             String.format("-Djava.security.policy=%sjava.policy.allow", testSrc),
             "PermissionTest$TestMain",
-            Integer.toString(pid),
+            Long.toString(pid),
             "false" };
         output = ProcessTools.executeTestJvm(args);
         output.shouldHaveExitValue(0);
--- a/test/com/sun/tools/attach/RunnerUtil.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/tools/attach/RunnerUtil.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,10 +25,7 @@
 import java.io.File;
 import java.nio.file.Files;
 import java.util.Arrays;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
 
-import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.Utils;
 import jdk.testlibrary.ProcessThread;
@@ -49,12 +46,12 @@
      *
      * The Application will write its pid and shutdownPort in the given outFile.
      */
-    public static ProcessThread startApplication(String outFile, String... additionalOpts) throws Throwable {
+    public static ProcessThread startApplication(String... additionalOpts) throws Throwable {
         String classpath = System.getProperty("test.class.path", ".");
-        String[] myArgs = concat(additionalOpts, new String [] { "-Dattach.test=true", "-classpath", classpath, "Application", outFile });
+        String[] myArgs = concat(additionalOpts, new String [] { "-Dattach.test=true", "-classpath", classpath, "Application" });
         String[] args = Utils.addTestJavaOpts(myArgs);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
-        ProcessThread pt = new ProcessThread("runApplication", pb);
+        ProcessThread pt = new ProcessThread("runApplication", (line) -> line.equals(Application.READY_MSG), pb);
         pt.start();
         return pt;
     }
@@ -81,23 +78,16 @@
      *
      * If the nice shutdown fails, then an Exception is thrown and the test should fail.
      *
-     * @param port The shut down port.
      * @param processThread The process to stop.
      */
-    public static void stopApplication(int port, ProcessThread processThread) throws Throwable {
+    public static void stopApplication(ProcessThread processThread) throws Throwable {
         if (processThread == null) {
             System.out.println("RunnerUtil.stopApplication ignored since proc is null");
             return;
         }
         try {
-            System.out.println("RunnerUtil.stopApplication waiting to for shutdown");
-            OutputAnalyzer output = ProcessTools.executeTestJvm(
-                    "-classpath",
-                    System.getProperty("test.class.path", "."),
-                    "Shutdown",
-                    Integer.toString(port));
-            // Verify that both the Shutdown command and the Application finished ok.
-            output.shouldHaveExitValue(0);
+            System.out.println("RunnerUtil.stopApplication waiting for shutdown");
+            processThread.sendMessage(Application.SHUTDOWN_MSG);
             processThread.joinAndThrow();
             processThread.getOutput().shouldHaveExitValue(0);
         } catch (Throwable t) {
@@ -120,52 +110,6 @@
     }
 
     /**
-     * Read process info for the running Application.
-     * The Application writes its info to a file with this format:
-     * shutdownPort=42994
-     * pid=19597
-     * done
-     *
-     * The final "done" is used to make sure the complete file has been written
-     * before we try to read it.
-     * This function will wait until the file is available.
-     *
-     * @param filename Path to file to read.
-     * @return The ProcessInfo containing pid and shutdownPort.
-     */
-    public static ProcessInfo readProcessInfo(String filename) throws Throwable {
-        System.out.println("Reading port and pid from file: " + filename);
-        File file = new File(filename);
-        String content = null;
-
-        // Read file or wait for it to be created.
-        while (true) {
-            content = readFile(file);
-            if (content != null && content.indexOf("done") >= 0) {
-                break;
-            }
-            Thread.sleep(100);
-        }
-
-        ProcessInfo info = new ProcessInfo();
-        // search for a line with format: key=nnn
-        Pattern pattern = Pattern.compile("(\\w*)=([0-9]+)\\r?\\n");
-        Matcher matcher = pattern.matcher(content);
-        while (matcher.find()) {
-            String key = matcher.group(1);
-            int value  = Integer.parseInt(matcher.group(2));
-            if ("pid".equals(key)) {
-                info.pid = value;
-            } else if ("shutdownPort".equals(key)) {
-                info.shutdownPort = value;
-            }
-        }
-        System.out.println("processInfo.pid:" + info.pid);
-        System.out.println("processInfo.shutdownPort:" + info.shutdownPort);
-        return info;
-    }
-
-    /**
      * Read the content of a file.
      * @param file The file to read.
      * @return The file content or null if file does not exists.
@@ -183,13 +127,4 @@
             throw e;
         }
     }
-
-    /**
-     * Helper class with info of the running Application.
-     */
-    public static class ProcessInfo {
-        public int pid = -1;
-        public int shutdownPort = -1;
-    }
-
 }
--- a/test/com/sun/tools/attach/Shutdown.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- *
- * Utility used by the unit tests for the attach mechanism. Connects to a
- * given port which triggers the listener to shutdown.
- */
-import java.net.Socket;
-import java.net.InetSocketAddress;
-import java.io.IOException;
-
-public class Shutdown {
-    public static void main(String args[]) throws IOException {
-        int port = Integer.parseInt(args[0]);
-
-        System.out.println("Connecting to port " + port +
-            " to shutdown Application ...");
-
-        Socket s = new Socket();
-        s.connect( new InetSocketAddress(port) );
-        s.close();
-    }
-}
--- a/test/com/sun/tools/attach/StartManagementAgent.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/tools/attach/StartManagementAgent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -40,7 +40,7 @@
  * @test
  * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
  * @library /lib/testlibrary
- * @run build Application Shutdown
+ * @run build Application jdk.testlibrary.*
  * @run main StartManagementAgent
  */
 
@@ -51,20 +51,17 @@
  */
 public class StartManagementAgent {
     public static void main(String[] args) throws Throwable {
-        final String pidFile = "StartManagementAgent.Application.pid";
         ProcessThread processThread = null;
-        RunnerUtil.ProcessInfo info = null;
         try {
-            processThread = RunnerUtil.startApplication(pidFile);
-            info = RunnerUtil.readProcessInfo(pidFile);
-            runTests(info.pid);
+            processThread = RunnerUtil.startApplication();
+            runTests(processThread.getPid());
         } catch (Throwable t) {
             System.out.println("StartManagementAgent got unexpected exception: " + t);
             t.printStackTrace();
             throw t;
         } finally {
             // Make sure the Application process is stopped.
-            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+            RunnerUtil.stopApplication(processThread);
         }
     }
 
@@ -104,7 +101,7 @@
 
     private static final int MAX_RETRIES = 10;
 
-    public static void runTests(int pid) throws Exception {
+    public static void runTests(long pid) throws Exception {
         VirtualMachine vm = VirtualMachine.attach(""+pid);
         try {
 
--- a/test/com/sun/tools/attach/TempDirTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/com/sun/tools/attach/TempDirTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,14 +38,23 @@
  * @bug 8033104
  * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
  * @library /lib/testlibrary
- * @run build jdk.testlibrary.* Application Shutdown RunnerUtil
- * @run main TempDirTest
+ * @run build jdk.testlibrary.* Application RunnerUtil
+ * @run main/timeout=200 TempDirTest
+ */
+
+/*
+ * This test runs with an extra long timeout since it takes a really long time with -Xcomp
+ * when starting many processes.
  */
 
 public class TempDirTest {
 
+    private static long startTime;
+
     public static void main(String args[]) throws Throwable {
 
+        startTime = System.currentTimeMillis();
+
         Path clientTmpDir = Files.createTempDirectory("TempDirTest-client");
         clientTmpDir.toFile().deleteOnExit();
         Path targetTmpDir = Files.createTempDirectory("TempDirTest-target");
@@ -76,25 +85,30 @@
         System.out.print(" target: " + (targetTmpDir == null ? "no" : "yes"));
         System.out.println(" ###");
 
+        long elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
+        System.out.println("Started after " + elapsedTime + "s");
+
         final String pidFile = "TempDirTest.Application.pid-" + counter++;
         ProcessThread processThread = null;
-        RunnerUtil.ProcessInfo info = null;
         try {
             String[] tmpDirArg = null;
             if (targetTmpDir != null) {
                 tmpDirArg = new String[] {"-Djava.io.tmpdir=" + targetTmpDir};
             }
-            processThread = RunnerUtil.startApplication(pidFile, tmpDirArg);
-            info = RunnerUtil.readProcessInfo(pidFile);
-            launchTests(info.pid, clientTmpDir);
+            processThread = RunnerUtil.startApplication(tmpDirArg);
+            launchTests(processThread.getPid(), clientTmpDir);
         } catch (Throwable t) {
             System.out.println("TempDirTest got unexpected exception: " + t);
             t.printStackTrace();
             throw t;
         } finally {
             // Make sure the Application process is stopped.
-            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+            RunnerUtil.stopApplication(processThread);
         }
+
+        elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
+        System.out.println("Completed after " + elapsedTime + "s");
+
     }
 
     /**
@@ -103,7 +117,7 @@
      * is that we need to modify the class path and
      * the -Djava.io.tmpdir property.
      */
-    private static void launchTests(int pid, Path clientTmpDir) throws Throwable {
+    private static void launchTests(long pid, Path clientTmpDir) throws Throwable {
         final String sep = File.separator;
 
         // Need to add jdk/lib/tools.jar to classpath.
@@ -123,7 +137,7 @@
                     "-classpath",
                     classpath,
                     "TempDirTest$TestMain",
-                    Integer.toString(pid) });
+                    Long.toString(pid) });
         OutputAnalyzer output = ProcessTools.executeTestJvm(args);
         output.shouldHaveExitValue(0);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/AlphaComposite/HeadlessAlphaComposite.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.ColorModel;
+
+/*
+ * @test
+ * @summary Check no exception occurrence when running AlphaComposite getInstance(),
+ *          createContext(), getAlpha(), getRule(), hashCode() methods in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessAlphaComposite
+ */
+
+public class HeadlessAlphaComposite {
+
+    public static void main(String args[]) {
+        AlphaComposite ac;
+        ac = AlphaComposite.getInstance(AlphaComposite.CLEAR);
+        ac = AlphaComposite.getInstance(AlphaComposite.DST_IN);
+        ac = AlphaComposite.getInstance(AlphaComposite.DST_OUT);
+        ac = AlphaComposite.getInstance(AlphaComposite.DST_OVER);
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC);
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC_IN);
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC_OUT);
+        ac = AlphaComposite.getInstance(AlphaComposite.DST_IN);
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC, (float) 0.5);
+
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC, (float) 0.5);
+        CompositeContext cc = ac.createContext(ColorModel.getRGBdefault(),
+                ColorModel.getRGBdefault(),
+                new RenderingHints(RenderingHints.KEY_ANTIALIASING,
+                        RenderingHints.VALUE_ANTIALIAS_ON));
+
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC, (float) 0.5);
+        float alpha = ac.getAlpha();
+
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC, (float) 0.5);
+        int rule = ac.getRule();
+
+        ac = AlphaComposite.getInstance(AlphaComposite.SRC, (float) 0.5);
+        int hc = ac.hashCode();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.html	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,45 @@
+<!--
+ Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+<html>
+<!--
+  @test
+  @bug 6200670
+  @summary MouseMoved events are triggered by Choice when mouse is moved outside the component, XToolkit
+  @library ../../regtesthelpers/
+  @author andrei.dmitriev area=choice
+  @build Util
+  @run applet PopdownGeneratesMouseEvents.html
+  -->
+<head>
+<title>  </title>
+</head>
+<body>
+
+<h1>PopdownGeneratesMouseEvents<br>Bug ID: 6200670 </h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="PopdownGeneratesMouseEvents.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug 6200670
+  @summary MouseMoved events are triggered by Choice when mouse is moved outside the component, XToolkit
+  @library ../../regtesthelpers/
+  @author andrei.dmitriev area=choice
+  @build Util
+  @run applet PopdownGeneratesMouseEvents.html
+*/
+
+import test.java.awt.regtesthelpers.Util;
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+
+public class PopdownGeneratesMouseEvents extends Applet {
+    private volatile Robot robot;
+    private final Choice choice1 = new Choice();
+
+    private volatile MouseMotionHandler mmh;
+
+    public void init() {
+        for (int i = 1; i < 10; i++) {
+            choice1.add("item-0" + i);
+        }
+        choice1.setForeground(Color.RED);
+        choice1.setBackground(Color.RED);
+        mmh = new MouseMotionHandler();
+        choice1.addMouseMotionListener(mmh);
+        Button b1 = new Button("FirstButton");
+        Button b2 = new Button("SecondButton");
+        add(b1);
+        add(choice1);
+        add(b2);
+        setLayout (new FlowLayout());
+    }
+
+    public void start() {
+        setSize(300, 200);
+        setVisible(true);
+        validate();
+        String toolkit = Toolkit.getDefaultToolkit().getClass().getName();
+
+        /*
+         * Choice should not generate MouseEvents outside of Choice
+         * Test for XAWT only.
+         */
+        try{
+            robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+            robot.setAutoDelay(50);
+
+            if (toolkit.equals("sun.awt.X11.XToolkit")) {
+                testMouseMoveOutside();
+            } else {
+                System.out.println("This test is for XToolkit only. Now using "
+                                        + toolkit + ". Automatically passed.");
+                return;
+            }
+        } catch (Throwable e) {
+            throw new RuntimeException("Test failed. Exception thrown: " + e);
+        }
+        System.out.println("Passed : Choice should not generate MouseEvents outside of Choice.");
+    }
+
+    private void testMouseMoveOutside() {
+        waitForIdle();
+        Point pt = choice1.getLocationOnScreen();
+        robot.mouseMove(pt.x + choice1.getWidth() / 2, pt.y + choice1.getHeight() / 2);
+        waitForIdle();
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        waitForIdle();
+
+        Color color = robot.getPixelColor(pt.x + choice1.getWidth() / 2,
+                                          pt.y + 3 * choice1.getHeight());
+        if (!color.equals(Color.RED)) {
+            throw new RuntimeException("Choice wasn't opened with LEFTMOUSE button");
+        }
+
+        pt = getLocationOnScreen();
+        robot.mouseMove(pt.x + getWidth() * 2, pt.y + getHeight() * 2);
+        mmh.testStarted = true;
+
+        int x0 = pt.x + getWidth() * 3 / 2;
+        int y0 = pt.y + getHeight() * 3 / 2;
+        int x1 = pt.x + getWidth() * 2;
+        int y1 = pt.y + getHeight() * 2;
+
+        Util.mouseMove(robot, new Point(x0, y0), new Point(x1, y0));
+        Util.mouseMove(robot, new Point(x1, y0), new Point(x1, y1));
+
+        waitForIdle();
+        //close opened choice
+        robot.keyPress(KeyEvent.VK_ESCAPE);
+        robot.keyRelease(KeyEvent.VK_ESCAPE);
+    }
+
+    private void waitForIdle() {
+        Util.waitForIdle(robot);
+        robot.delay(500);
+    }
+}
+
+class MouseMotionHandler extends MouseMotionAdapter {
+    public volatile boolean testStarted;
+    public void mouseMoved(MouseEvent ke) {
+        if (testStarted) {
+            throw new RuntimeException("Test failed: Choice generated MouseMove events while moving mouse outside of Choice");
+        }
+    }
+    public void mouseDragged(MouseEvent ke) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Color/HeadlessColor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.color.ColorSpace;
+
+/*
+ * @test
+ * @summary Check Color constructors and methods works correctly in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessColor
+ */
+
+public class HeadlessColor {
+    public static void main(String args[]) {
+        Color c;
+
+        // Constructors without exceptions
+        c = new Color(1, 2, 3);
+        c = new Color(1, 2, 3, 4);
+        c = new Color((1 << 16) | (2 << 8) | (3));
+        c = new Color((1 << 24) | (1 << 16) | (2 << 8) | (3));
+        c = new Color((1 << 24) | (2 << 16) | (3 << 8) | (4), true);
+        c = new Color((2 << 16) | (3 << 8) | (4), false);
+        c = new Color(0.8f, 0.8f, 0.3f);
+        c = new Color(0.999f, 0.8f, 0.8f, 0.3f);
+        c = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                new float[]{0.8f, 0.8f, 0.3f}, 1f);
+
+        // Constructors with exceptions
+        boolean exceptions = false;
+        try {
+            c = new Color(409, 400, 400);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(400, 3003, 400, 400);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(8f, 8f, 3f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(-8f, -8f, -3f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(0.999f, 8f, 8f, 3f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(20f, 8f, 8f, 3f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(-20f, -8f, -8f, -3f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                    new float[]{-8f, -8f, -3f}, 1f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+        exceptions = false;
+        try {
+            c = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                    new float[]{-8f, -8f, -3f}, -1f);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException " +
+                    "when expected in headless mode");
+
+
+        c = new Color(1, 2, 3);
+        c.hashCode();
+        c.toString();
+        if (c.getRed() != 1)
+            throw new RuntimeException("Incorrect red value");
+        if (c.getGreen() != 2)
+            throw new RuntimeException("Incorrect green value");
+        if (c.getBlue() != 3)
+            throw new RuntimeException("Incorrect bluevalue");
+        if (c.getAlpha() != 255)
+            throw new RuntimeException("Incorrect alpha value");
+        if (c.getRGB() != ((255 << 24) | (1 << 16) | (2 << 8) | (3)))
+            throw new RuntimeException("Incorrect rgb value");
+
+        int rgb = c.getRGB();
+        c.brighter();
+        if (rgb != c.getRGB())
+            throw new RuntimeException("Color object changed RGB value after brighter() called");
+
+        rgb = c.getRGB();
+        c.darker();
+        if (rgb != c.getRGB())
+            throw new RuntimeException("Color object changed RGB value after brighter() called");
+
+        c = new Color(1, 2, 3, 4);
+        c.hashCode();
+        c.toString();
+        if (c.getRed() != 1)
+            throw new RuntimeException("Incorrect red value");
+        if (c.getGreen() != 2)
+            throw new RuntimeException("Incorrect green value");
+        if (c.getBlue() != 3)
+            throw new RuntimeException("Incorrect bluevalue");
+        if (c.getAlpha() != 4)
+            throw new RuntimeException("Incorrect alpha value");
+        if (c.getRGB() != ((4 << 24) | (1 << 16) | (2 << 8) | (3)))
+            throw new RuntimeException("Incorrect rgb value");
+
+        rgb = c.getRGB();
+        c.brighter();
+        if (rgb != c.getRGB())
+            throw new RuntimeException("Color object changed RGB value after brighter() called");
+
+        rgb = c.getRGB();
+        c.darker();
+        if (rgb != c.getRGB())
+            throw new RuntimeException("Color object changed RGB value after brighter() called");
+
+
+        if (!(new Color(1, 2, 3).equals(new Color(1, 2, 3))))
+            throw new RuntimeException("Inequality in colors when equality expected");
+        if (new Color(1, 2, 3).equals(new Color(3, 2, 1)))
+            throw new RuntimeException("Equality in colors when NO equality expected");
+
+        if (!(new Color(1, 2, 3, 4).equals(new Color(1, 2, 3, 4))))
+            throw new RuntimeException("Inequality in colors when equality expected");
+        if (new Color(1, 2, 3, 4).equals(new Color(4, 3, 2, 1)))
+            throw new RuntimeException("Equality in colors when NO equality expected");
+
+        c = Color.decode("0xffffff");
+        c = Color.getColor("65535");
+        c = Color.getColor("65535", Color.black);
+        c = Color.getColor("65535", 0xffffff);
+
+        int hsb_value = Color.HSBtoRGB(0.1f, 0.2f, 0.3f);
+        float[] rgb_value = Color.RGBtoHSB(1, 2, 3, null);
+
+        c = Color.getHSBColor(0.3f, 0.4f, 0.6f);
+        c = Color.getHSBColor(-0.3f, -0.4f, -0.6f);
+        c = Color.getHSBColor(30, 40, 60);
+
+        float[] comps;
+        comps = Color.black.getRGBComponents(null);
+        comps = Color.black.getRGBColorComponents(null);
+        comps = Color.black.getComponents(null);
+        comps = Color.black.getColorComponents(null);
+        comps = Color.black.getComponents(ColorSpace.getInstance(ColorSpace.CS_sRGB), null);
+        comps = Color.black.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_sRGB), null);
+
+        Color.black.getColorSpace();
+        Color.black.getTransparency();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check whether Button constructors throw HeadlessException in
+ *          headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessButton
+ */
+
+public class HeadlessButton {
+
+    public static void main(String args[]) {
+        Button b;
+
+        boolean exceptions = false;
+        try {
+            b = new Button();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+
+        exceptions = false;
+        try {
+            b = new Button("Press me");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessCanvas.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check whether Canvas constructor does not throw exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCanvas
+ */
+
+public class HeadlessCanvas {
+    public static void main(String args[]) {
+        Canvas c = new Canvas();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessCheckbox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Checkbox constructors trow HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCheckbox
+ */
+
+public class HeadlessCheckbox {
+    public static void main(String args[]) {
+        Checkbox b;
+
+        boolean exceptions = false;
+        try {
+            b = new Checkbox();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!", true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!", false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        CheckboxGroup cbg = new CheckboxGroup();
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!", true, cbg);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!", false, cbg);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!", cbg, true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            b = new Checkbox("Hey, check it out!", cbg, false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessChoice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Choice constructor throws HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessChoice
+ */
+
+public class HeadlessChoice {
+
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        try {
+            Choice c = new Choice();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessComponent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that Component methods do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessComponent
+ */
+
+public class HeadlessComponent {
+    public static void main(String args[]) {
+        Component comp = new Component(){};
+        comp.addComponentListener(new ComponentAdapter() {});
+        comp.addFocusListener(new FocusAdapter(){});
+        comp.addHierarchyBoundsListener(new HierarchyBoundsAdapter(){});
+        comp.addHierarchyListener(e -> {});
+        comp.addInputMethodListener(new InputMethodListener() {
+            public void inputMethodTextChanged(InputMethodEvent event) {}
+            public void caretPositionChanged(InputMethodEvent event) {}
+        });
+        comp.addKeyListener(new KeyAdapter() {});
+        comp.addMouseListener(new MouseAdapter() {});
+        comp.addMouseMotionListener(new MouseMotionAdapter() {});
+        comp.addMouseWheelListener(e -> {});
+        comp.addPropertyChangeListener(e -> {});
+        comp.addNotify();
+        comp.getName();
+        comp.setName("goober");
+        comp.getParent();
+        comp.getPeer();
+        comp.getGraphicsConfiguration();
+        comp.getTreeLock();
+        comp.getToolkit();
+        comp.isValid();
+        comp.isDisplayable();
+        comp.isVisible();
+        comp.isShowing();
+        comp.isEnabled();
+        comp.setEnabled(false);
+        comp.setEnabled(true);
+        comp.enable();
+        comp.enable(false);
+        comp.enable(true);
+        comp.disable();
+        comp.isDoubleBuffered();
+        comp.enableInputMethods(false);
+        comp.enableInputMethods(true);
+        comp.setVisible(false);
+        comp.setVisible(true);
+        comp.show();
+        comp.show(false);
+        comp.show(true);
+        comp.hide();
+        comp.getForeground();
+        comp.setForeground(Color.red);
+        comp.isForegroundSet();
+        comp.getBackground();
+        comp.setBackground(Color.red);
+        comp.isBackgroundSet();
+        comp.getFont();
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int i = 8; i < 17; i++) {
+                Font f1 = new Font(font, Font.PLAIN, i);
+                Font f2 = new Font(font, Font.BOLD, i);
+                Font f3 = new Font(font, Font.ITALIC, i);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, i);
+
+                comp.setFont(f1);
+                comp.getFontMetrics(f1);
+                comp.setFont(f2);
+                comp.getFontMetrics(f2);
+                comp.setFont(f3);
+                comp.getFontMetrics(f3);
+                comp.setFont(f4);
+                comp.getFontMetrics(f4);
+            }
+        }
+        comp.isFontSet();
+
+        boolean exceptions = false;
+        try {
+            Container c = new Container();
+            c.add(comp);
+            comp.getLocale();
+        } catch (IllegalComponentStateException ex) {
+           exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        for (Locale locale : Locale.getAvailableLocales())
+            comp.setLocale(locale);
+
+        comp.getColorModel();
+        comp.getLocation();
+
+        exceptions = false;
+        try {
+            comp = new Component(){};
+            comp.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        comp.location();
+        comp.setLocation(1, 2);
+        comp.move(1, 2);
+        comp.setLocation(new Point(1, 2));
+        comp.getSize();
+        comp.size();
+        comp.setSize(1, 32);
+        comp.resize(1, 32);
+        comp.setSize(new Dimension(1, 32));
+        comp.resize(new Dimension(1, 32));
+        comp.getBounds();
+        comp.bounds();
+        comp.setBounds(10, 10, 10, 10);
+        comp.reshape(10, 10, 10, 10);
+        comp.setBounds(new Rectangle(10, 10, 10, 10));
+        comp.getX();
+        comp.getY();
+        comp.getWidth();
+        comp.getHeight();
+        comp.getBounds(new Rectangle(1, 1, 1, 1));
+        comp.getSize(new Dimension(1, 2));
+        comp.getLocation(new Point(1, 2));
+        comp.isOpaque();
+        comp.isLightweight();
+        comp.getPreferredSize();
+        comp.preferredSize();
+        comp.getMinimumSize();
+        comp.minimumSize();
+        comp.getMaximumSize();
+        comp.getAlignmentX();
+        comp.getAlignmentY();
+        comp.doLayout();
+        comp.layout();
+        comp.validate();
+        comp.invalidate();
+        comp.getGraphics();
+        Cursor c = new Cursor(Cursor.CROSSHAIR_CURSOR);
+        comp.setCursor(c);
+        comp.getCursor();
+        comp.isCursorSet();
+        comp.contains(1, 2);
+        comp.inside(1, 2);
+        comp.contains(new Point(1, 2));
+        comp.getComponentAt(1, 2);
+        comp.locate(1, 2);
+        comp.getComponentAt(new Point(1, 2));
+        comp.isFocusTraversable();
+        comp.isFocusable();
+        comp.setFocusable(true);
+        comp.setFocusable(false);
+        comp.requestFocus();
+        comp.requestFocusInWindow();
+        comp.transferFocus();
+        comp.getFocusCycleRootAncestor();
+        comp.isFocusCycleRoot(new Container());
+        comp.nextFocus();
+        comp.transferFocusBackward();
+        comp.transferFocusUpCycle();
+        comp.hasFocus();
+        comp.isFocusOwner();
+        comp.toString();
+        comp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        comp.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        comp.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        comp.getComponentOrientation();
+        comp.getAccessibleContext();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessContainer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.util.*;
+
+/*
+ * @test
+ * @summary Check that Container methods do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessContainer
+ */
+
+public class HeadlessContainer {
+    public static void main(String args[]) {
+        Container lw = new java.awt.Container();
+        Component c1 = lw.add(new Component(){});
+        Component c2 = lw.add(new Component(){});
+        Component c3 = lw.add(new Component(){});
+
+        lw.getComponentCount();
+        lw.countComponents();
+        lw.getComponent(1);
+        lw.getComponent(2);
+        Component[] cs = lw.getComponents();
+        Insets ins = lw.getInsets();
+        ins = lw.insets();
+        lw.remove(1);
+        lw.remove((java.awt.Component) c2);
+        lw.removeAll();
+
+        lw.add(c1);
+        lw.add(c2);
+        lw.add(c3);
+        lw.getLayout();
+        lw.setLayout(new FlowLayout());
+        lw.doLayout();
+        lw.layout();
+        lw.invalidate();
+        lw.validate();
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int i = 8; i < 17; i++) {
+                Font f1 = new Font(font, Font.PLAIN, i);
+                Font f2 = new Font(font, Font.BOLD, i);
+                Font f3 = new Font(font, Font.ITALIC, i);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, i);
+
+                lw.setFont(f1);
+                lw.setFont(f2);
+                lw.setFont(f3);
+                lw.setFont(f4);
+            }
+        }
+        lw.getPreferredSize();
+        lw.preferredSize();
+        lw.getMinimumSize();
+        lw.minimumSize();
+        lw.getMaximumSize();
+        lw.getAlignmentX();
+        lw.getAlignmentY();
+        lw.getComponentAt(1, 2);
+        lw.locate(1, 2);
+        lw.getComponentAt(new Point(1, 2));
+        lw.isFocusCycleRoot(new Container());
+        lw.transferFocusBackward();
+        lw.getName();
+        lw.setName("goober");
+        lw.getName();
+        lw.getParent();
+        lw.getPeer();
+        lw.getGraphicsConfiguration();
+        lw.getTreeLock();
+        lw.getToolkit();
+        lw.isValid();
+        lw.isDisplayable();
+        lw.isVisible();
+        lw.isShowing();
+        lw.isEnabled();
+        lw.setEnabled(false);
+        lw.setEnabled(true);
+        lw.enable();
+        lw.enable(false);
+        lw.enable(true);
+        lw.disable();
+        lw.isDoubleBuffered();
+        lw.enableInputMethods(false);
+        lw.enableInputMethods(true);
+        lw.setVisible(false);
+        lw.setVisible(true);
+        lw.show();
+        lw.show(false);
+        lw.show(true);
+        lw.hide();
+        lw.getForeground();
+        lw.setForeground(Color.red);
+        lw.isForegroundSet();
+        lw.getBackground();
+        lw.setBackground(Color.red);
+        lw.isBackgroundSet();
+        lw.getFont();
+        lw.isFontSet();
+
+        boolean exceptions = false;
+        try {
+            Container c = new Container();
+            lw = new java.awt.Container();
+            c.add(lw);
+            lw.getLocale();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        for (Locale locale : Locale.getAvailableLocales())
+            lw.setLocale(locale);
+
+        lw.getColorModel();
+        lw.getLocation();
+
+        exceptions = false;
+        try {
+            lw.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        lw.location();
+        lw.setLocation(1, 2);
+        lw.move(1, 2);
+        lw.setLocation(new Point(1, 2));
+        lw.getSize();
+        lw.size();
+        lw.setSize(1, 32);
+        lw.resize(1, 32);
+        lw.setSize(new Dimension(1, 32));
+        lw.resize(new Dimension(1, 32));
+        lw.getBounds();
+        lw.bounds();
+        lw.setBounds(10, 10, 10, 10);
+        lw.reshape(10, 10, 10, 10);
+        lw.setBounds(new Rectangle(10, 10, 10, 10));
+        lw.getX();
+        lw.getY();
+        lw.getWidth();
+        lw.getHeight();
+        lw.getBounds(new Rectangle(1, 1, 1, 1));
+        lw.getSize(new Dimension(1, 2));
+        lw.getLocation(new Point(1, 2));
+        lw.isOpaque();
+        lw.isLightweight();
+        lw.getGraphics();
+
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                lw.getFontMetrics(f1);
+                lw.getFontMetrics(f2);
+                lw.getFontMetrics(f3);
+                lw.getFontMetrics(f4);
+            }
+        }
+
+        Cursor c = new Cursor(Cursor.CROSSHAIR_CURSOR);
+        lw.setCursor(c);
+        lw.getCursor();
+        lw.isCursorSet();
+        lw.contains(1, 2);
+        lw.inside(1, 2);
+        lw.contains(new Point(1, 2));
+        lw.isFocusTraversable();
+        lw.isFocusable();
+        lw.setFocusable(true);
+        lw.setFocusable(false);
+        lw.requestFocus();
+        lw.requestFocusInWindow();
+        lw.transferFocus();
+        lw.getFocusCycleRootAncestor();
+        lw.nextFocus();
+        lw.transferFocusUpCycle();
+        lw.hasFocus();
+        lw.isFocusOwner();
+        lw.toString();
+        lw.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        lw.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        lw.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        lw.getComponentOrientation();
+        lw.getAccessibleContext();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessDialog.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Dialog constructors throw expected HeadlessException
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDialog
+ */
+
+public class HeadlessDialog  {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        Dialog d;
+
+        try {
+            d = new Dialog(new Frame("Hi there"));
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new Dialog(new Frame("Hi there"), true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new Dialog(new Frame("Hi there"), false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new Dialog(new Frame("Hi there"), "Dialog title");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new Dialog(new Frame("Hi there"), "Dialog title", true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new Dialog(new Frame("Hi there"), "Dialog title", false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessFileDialog.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that FileDialog constructors throw HeadlessException
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessFileDialog
+ */
+
+public class HeadlessFileDialog {
+    public static void main(String args[]) {
+        FileDialog d;
+        boolean exceptions = false;
+        try {
+            d = new FileDialog(new Frame("Hi there"));
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new FileDialog(new Frame("Hi there"), "Dialog title");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new FileDialog(new Frame("Hi there"), "Dialog title", FileDialog.LOAD);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            d = new FileDialog(new Frame("Hi there"), "Dialog title", FileDialog.SAVE);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Font constructors and throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessFrame
+ */
+
+public class HeadlessFrame {
+    public static void main(String args[]) {
+        Frame f;
+        boolean exceptions = false;
+
+        try {
+            f = new Frame();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            f = new Frame("Frame me peculiar");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessLabel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Label constructors do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessLabel
+ */
+
+public class HeadlessLabel {
+    public static void main(String args[]) {
+        Label l;
+
+        boolean exceptions = false;
+        try {
+            l = new Label();
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new Label("Label me blue");
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new Label("Label me blue", 200);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that List constructors do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessList
+ */
+
+public class HeadlessList {
+    public static void main(String args[]) {
+        List l;
+
+        boolean exceptions = false;
+        try {
+            l = new List();
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new List(10);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new List(1000);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new List(10, true);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new List(10, false);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new List(1000, true);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            l = new List(1000, false);
+        } catch (java.awt.HeadlessException java_awt_HeadlessException) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessPanel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that Panel constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPanel
+ */
+
+public class HeadlessPanel {
+    public static void main(String args[]) {
+        Panel p;
+        p = new Panel();
+        p = new Panel(new FlowLayout());
+        p.getAccessibleContext();
+        Component c1 = p.add(new Component(){});
+        Component c2 = p.add(new Component(){});
+        Component c3 = p.add(new Component(){});
+        p.getComponentCount();
+        p.countComponents();
+        p.getComponent(1);
+        p.getComponent(2);
+        Component[] cs = p.getComponents();
+        Insets ins = p.getInsets();
+        ins = p.insets();
+        p.remove(0);
+        p.remove((Component) c2);
+        p.removeAll();
+
+        p.add(c1);
+        p.add(c2);
+        p.add(c3);
+        p.getLayout();
+        p.setLayout(new FlowLayout());
+        p.doLayout();
+        p.layout();
+        p.invalidate();
+        p.validate();
+
+        p.getPreferredSize();
+        p.preferredSize();
+        p.getMinimumSize();
+        p.minimumSize();
+        p.getMaximumSize();
+        p.getAlignmentX();
+        p.getAlignmentY();
+        p.getComponentAt(1, 2);
+        p.locate(1, 2);
+        p.getComponentAt(new Point(1, 2));
+        p.isFocusCycleRoot(new Container());
+        p.transferFocusBackward();
+        p.setName("goober");
+        p.getName();
+        p.getParent();
+        p.getPeer();
+        p.getGraphicsConfiguration();
+        p.getTreeLock();
+        p.getToolkit();
+        p.isValid();
+        p.isDisplayable();
+        p.isVisible();
+        p.isShowing();
+        p.isEnabled();
+        p.setEnabled(false);
+        p.setEnabled(true);
+        p.enable();
+        p.enable(false);
+        p.enable(true);
+        p.disable();
+        p.isDoubleBuffered();
+        p.enableInputMethods(false);
+        p.enableInputMethods(true);
+        p.setVisible(false);
+        p.setVisible(true);
+        p.show();
+        p.show(false);
+        p.show(true);
+        p.hide();
+        p.getForeground();
+        p.setForeground(Color.red);
+        p.isForegroundSet();
+        p.getBackground();
+        p.setBackground(Color.red);
+        p.isBackgroundSet();
+        p.getFont();
+        p.isFontSet();
+        p.getColorModel();
+        p.getLocation();
+        p.location();
+        p.setLocation(1, 2);
+        p.move(1, 2);
+        p.setLocation(new Point(1, 2));
+        p.getSize();
+        p.size();
+        p.setSize(1, 32);
+        p.resize(1, 32);
+        p.setSize(new Dimension(1, 32));
+        p.resize(new Dimension(1, 32));
+        p.getBounds();
+        p.bounds();
+        p.setBounds(10, 10, 10, 10);
+        p.reshape(10, 10, 10, 10);
+        p.setBounds(new Rectangle(10, 10, 10, 10));
+        p.getX();
+        p.getY();
+        p.getWidth();
+        p.getHeight();
+        p.getBounds(new Rectangle(1, 1, 1, 1));
+        p.getSize(new Dimension(1, 2));
+        p.getLocation(new Point(1, 2));
+        p.isOpaque();
+        p.isLightweight();
+        p.getGraphics();
+
+
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                p.setFont(f1);
+                p.setFont(f2);
+                p.setFont(f3);
+                p.setFont(f4);
+            }
+        }
+
+        boolean exceptions = false;
+        try {
+            Container c = new Container();
+            p = new Panel();
+            c.add(p);
+            p.getLocale();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        for (Locale locale : Locale.getAvailableLocales())
+            p.setLocale(locale);
+
+        exceptions = false;
+        try {
+            p.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j
+                    < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                p.getFontMetrics(f1);
+                p.getFontMetrics(f2);
+                p.getFontMetrics(f3);
+                p.getFontMetrics(f4);
+            }
+        }
+
+        Cursor c = new Cursor(Cursor.CROSSHAIR_CURSOR);
+        p.setCursor(c);
+        p.getCursor();
+        p.isCursorSet();
+        p.contains(1, 2);
+        p.inside(1, 2);
+        p.contains(new Point(1, 2));
+        p.isFocusTraversable();
+        p.isFocusable();
+        p.setFocusable(true);
+        p.setFocusable(false);
+        p.requestFocus();
+        p.requestFocusInWindow();
+        p.transferFocus();
+        p.getFocusCycleRootAncestor();
+        p.nextFocus();
+        p.transferFocusUpCycle();
+        p.hasFocus();
+        p.isFocusOwner();
+        p.toString();
+        p.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        p.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        p.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        p.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessScrollPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that ScrollPane constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessScrollPane
+ */
+
+public class HeadlessScrollPane {
+    public static void main(String args[]) {
+        ScrollPane s;
+        boolean exceptions = false;
+
+        try {
+            s = new ScrollPane();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new ScrollPane(ScrollPane.SCROLLBARS_NEVER);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessScrollbar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Scrollbar constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessScrollbar
+ */
+
+public class HeadlessScrollbar {
+
+    public static void main(String args[]) {
+        Scrollbar s;
+        boolean exceptions = false;
+
+        try {
+            s = new Scrollbar();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new Scrollbar(Scrollbar.HORIZONTAL);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new Scrollbar(Scrollbar.VERTICAL);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new Scrollbar(Scrollbar.HORIZONTAL, 1, 10, 0, 100);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            s = new Scrollbar(Scrollbar.VERTICAL, 1, 10, 0, 100);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessTextArea.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that TextArea constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessTextArea
+ */
+
+public class HeadlessTextArea {
+    public static void main(String args[]) {
+        TextArea t;
+        boolean exceptions = false;
+
+        try {
+            t = new TextArea();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea("Hi there");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea(10, 100);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea("Hi there", 10, 100);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea("Hi there", 10, 100, TextArea.SCROLLBARS_BOTH);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea("Hi there", 10, 100, TextArea.SCROLLBARS_HORIZONTAL_ONLY);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea("Hi there", 10, 100, TextArea.SCROLLBARS_VERTICAL_ONLY);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextArea("Hi there", 10, 100, TextArea.SCROLLBARS_NONE);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessTextField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that TextField constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessTextField
+ */
+
+public class HeadlessTextField {
+    public static void main(String args[]) {
+        TextField t;
+        boolean exceptions = false;
+
+        try {
+            t = new TextField();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextField("Hi there");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        try {
+            t = new TextField(20);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextField(200);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        try {
+            t = new TextField("Hi there", 20);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            t = new TextField("Hi there", 200);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/Headless/HeadlessWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Window constructor throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessWindow
+ */
+
+public class HeadlessWindow {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        try {
+            Window b = new Window(new Frame("Hi there"));
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Cursor/HeadlessCursor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Cursor constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCursor
+ */
+
+public class HeadlessCursor {
+    public static void main(String args[]) {
+        Cursor c;
+        c = new Cursor(Cursor.CROSSHAIR_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.DEFAULT_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.E_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.HAND_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.N_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.NE_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.NW_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.S_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.SE_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.SW_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.TEXT_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.W_RESIZE_CURSOR);
+        c.getType();
+        c.getName();
+        c = new Cursor(Cursor.WAIT_CURSOR);
+        c.getType();
+        c.getName();
+
+        c = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR);
+        c = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
+        c = Cursor.getDefaultCursor();
+        c.getType();
+        c.getName();
+    }
+}
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/AbsoluteComponentCenterCalculator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.*;
-
-class AbsoluteComponentCenterCalculator {
-    private AbsoluteComponentCenterCalculator() {
-    }
-
-    public static int calculateXCenterCoordinate(Component component) {
-        return (int) component.getLocationOnScreen().getX() + (component.getWidth() / 2);
-    }
-
-    public static int calculateYCenterCoordinate(Component component) {
-        return (int) component.getLocationOnScreen().getY() + (component.getHeight() / 2);
-    }
-}
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/DataFlavorSearcher.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.FlavorTable;
-import java.awt.datatransfer.SystemFlavorMap;
-import java.util.Arrays;
-
-public class DataFlavorSearcher {
-    static public String[] HTML_NAMES = new String[]{"HTML", "HTML Format"};
-    static public String[] RICH_TEXT_NAMES = new String[]{"RICH_TEXT", "Rich Text Format"};
-
-    static public DataFlavor getByteDataFlavorForNative(String[] nats) {
-        FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();
-
-        for (String nat : nats) {
-            java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
-            for (DataFlavor flavor : flavors) {
-                if (flavor != null
-                        && flavor.getRepresentationClass().equals(byte[].class)) {
-                    return flavor;
-                }
-            }
-        }
-        throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
-    }
-}
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/InterprocessMessages.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.
- */
-
-interface InterprocessMessages {
-    final static int EXECUTION_IS_SUCCESSFULL = 0;
-    final static int DATA_IS_CORRUPTED = 212;
-    final static int NO_DROP_HAPPENED = 112;
-}
-
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-<!--
- Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-<!--  
-  @test
-  @bug 8005932 8017456
-  @summary Java 7 on mac os x only provides text clipboard formats
-  @author mikhail.cherkasov@oracle.com
-  @library ../../regtesthelpers
-  @library ../../regtesthelpers/process
-  @build Util
-  @build ProcessResults ProcessCommunicator
-  @run applet/othervm MissedHtmlAndRtfBug.html
--->
-
-<head>
-    <title>Java 7 on mac os x only provides text clipboard formats</title>
-</head>
-<body>
-
-<h1> MissedHtmlAndRtfBug <br>Bug ID: 8005932 </h1>
-
-<p> This is an AUTOMATIC test, simply wait for completion </p>
-
-<APPLET CODE="MissedHtmlAndRtfBug.class" WIDTH=200 HEIGHT=200></APPLET>
-</body>
-</html>
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.*;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.event.*;
-import java.applet.Applet;
-import java.io.File;
-import java.util.ArrayList;
-
-import test.java.awt.regtesthelpers.process.ProcessCommunicator;
-import test.java.awt.regtesthelpers.process.ProcessResults;
-import test.java.awt.regtesthelpers.Util;
-import sun.awt.OSInfo;
-
-import static java.lang.Thread.sleep;
-
-public class MissedHtmlAndRtfBug extends Applet {
-
-    public void init() {
-        setLayout(new BorderLayout());
-    }//End  init()
-
-    public void start() {
-        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX
-                && OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
-            System.out.println("This test is for Windows and Mac only. Passed.");
-            return;
-        }
-
-        final Frame sourceFrame = new Frame("Source frame");
-        final SourcePanel sourcePanel = new SourcePanel();
-        sourceFrame.add(sourcePanel);
-        sourceFrame.pack();
-        sourceFrame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent e) {
-                sourceFrame.dispose();
-            }
-        });
-        sourceFrame.setVisible(true);
-
-        Util.waitForIdle(null);
-
-        NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame);
-
-        ArrayList<String> args = new ArrayList<String>(5);
-        args.add(String.valueOf(positionCalculator.getNextLocationX()));
-        args.add(String.valueOf(positionCalculator.getNextLocationY()));
-        args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)));
-        args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)));
-        args.add(concatStrings(DataFlavorSearcher.RICH_TEXT_NAMES));
-
-        ProcessResults processResults =
-                ProcessCommunicator.executeChildProcess(this.getClass(),
-                        "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
-
-        verifyTestResults(processResults);
-
-        args.set(args.size() - 1, concatStrings(DataFlavorSearcher.HTML_NAMES));
-
-        ProcessCommunicator.executeChildProcess(this.getClass(),
-                "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
-        verifyTestResults(processResults);
-
-
-    }// start()
-
-    private String concatStrings(String[] strings) {
-        StringBuffer result = new StringBuffer("\"");
-        for (int i = 0; i < strings.length; i++) {
-            result.append(strings[i]);
-            result.append(",");
-        }
-        result.append("\"");
-        return result.toString();
-    }
-
-
-    private static void verifyTestResults(ProcessResults processResults) {
-        if (InterprocessMessages.DATA_IS_CORRUPTED ==
-                processResults.getExitValue()) {
-            processResults.printProcessErrorOutput(System.err);
-            throw new RuntimeException("TEST IS FAILED: Target has received" +
-                    " corrupted data.");
-        }
-        if (InterprocessMessages.NO_DROP_HAPPENED ==
-                processResults.getExitValue()) {
-            processResults.printProcessErrorOutput(System.err);
-            throw new RuntimeException("Error. Drop did not happen." +
-                " Target frame is possibly covered by a window of other application." +
-                " Please, rerun the test with all windows minimized.");
-        }
-        processResults.verifyStdErr(System.err);
-        processResults.verifyProcessExitValue(System.err);
-        processResults.printProcessStandartOutput(System.out);
-    }
-
-    //We cannot make an instance of the applet without the default constructor
-    public MissedHtmlAndRtfBug() {
-        super();
-    }
-
-    //We need in this constructor to pass frame position between JVMs
-    public MissedHtmlAndRtfBug(Point targetFrameLocation, Point dragSourcePoint, DataFlavor df)
-            throws InterruptedException {
-        final Frame targetFrame = new Frame("Target frame");
-        final TargetPanel targetPanel = new TargetPanel(targetFrame, df);
-        targetFrame.add(targetPanel);
-        targetFrame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent e) {
-                targetFrame.dispose();
-            }
-        });
-        targetFrame.setLocation(targetFrameLocation);
-        targetFrame.pack();
-        targetFrame.setVisible(true);
-
-        doTest(dragSourcePoint, targetPanel);
-    }
-
-    private void doTest(Point dragSourcePoint, TargetPanel targetPanel) {
-        Util.waitForIdle(null);
-
-        final Robot robot = Util.createRobot();
-
-        robot.mouseMove((int) dragSourcePoint.getX(), (int) dragSourcePoint.getY());
-        try {
-            sleep(100);
-            robot.mousePress(InputEvent.BUTTON1_MASK);
-            sleep(100);
-            robot.mouseRelease(InputEvent.BUTTON1_MASK);
-            sleep(100);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        Util.drag(robot, dragSourcePoint, new Point(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(targetPanel),
-                AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(targetPanel)),
-                InputEvent.BUTTON1_MASK);
-    }
-
-
-    enum InterprocessArguments {
-        TARGET_FRAME_X_POSITION_ARGUMENT,
-        TARGET_FRAME_Y_POSITION_ARGUMENT,
-        DRAG_SOURCE_POINT_X_ARGUMENT,
-        DRAG_SOURCE_POINT_Y_ARGUMENT,
-        DATA_FLAVOR_NAMES;
-
-        int extractInt(String[] args) {
-            return Integer.parseInt(args[this.ordinal()]);
-        }
-
-        String[] extractStringArray(String[] args) {
-            return args[this.ordinal()].replaceAll("\"", "").split(",");
-        }
-    }
-
-    public static void main(String[] args) throws InterruptedException {
-        Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extractInt(args),
-                InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extractInt(args));
-        Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extractInt(args),
-                InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extractInt(args));
-        String[] names = InterprocessArguments.DATA_FLAVOR_NAMES.extractStringArray(args);
-
-        DataFlavor df = DataFlavorSearcher.getByteDataFlavorForNative(names);
-        try {
-            new MissedHtmlAndRtfBug(targetFrameLocation, dragSourcePoint, df);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        sleep(5000);
-        System.exit(InterprocessMessages.NO_DROP_HAPPENED);
-    }
-
-
-}
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MyTransferable.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.datatransfer.*;
-import java.io.IOException;
-
-class MyTransferable implements Transferable {
-
-    public static final String TEST_DATA = "<b>Test</b>";
-    private DataFlavor[] dataFlavors;
-
-    public MyTransferable() {
-        dataFlavors = new DataFlavor[]{DataFlavorSearcher.getByteDataFlavorForNative(DataFlavorSearcher.HTML_NAMES),
-                DataFlavorSearcher.getByteDataFlavorForNative(DataFlavorSearcher.RICH_TEXT_NAMES)};
-    }
-
-
-    @Override
-    public DataFlavor[] getTransferDataFlavors() {
-        return dataFlavors;
-    }
-
-    @Override
-    public boolean isDataFlavorSupported(DataFlavor flavor) {
-        for (DataFlavor f : dataFlavors) {
-            if (f.equals(flavor)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public Object getTransferData(DataFlavor flavor)
-            throws UnsupportedFlavorException, IOException {
-        if (isDataFlavorSupported(flavor)) {
-            return TEST_DATA.getBytes("UTF-16");
-        } else {
-            throw new UnsupportedFlavorException(flavor);
-        }
-    }
-}
\ No newline at end of file
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/NextFramePositionCalculator.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.*;
-
-
-class NextFramePositionCalculator {
-
-    private final Frame currentFrame;
-
-    public NextFramePositionCalculator(Frame currentFrame) {
-        this.currentFrame = currentFrame;
-    }
-
-    public int getNextLocationX() {
-        return currentFrame.getX() + currentFrame.getWidth();
-    }
-
-    public int getNextLocationY() {
-        return currentFrame.getY();
-    }
-
-}
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/SourcePanel.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.dnd.DragSource;
-import java.awt.dnd.DnDConstants;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureListener;
-import java.awt.*;
-
-public class SourcePanel extends Panel {
-
-    private final MyDragGestureListener dragGestureListener =
-            new MyDragGestureListener();
-
-    public SourcePanel() {
-        setPreferredSize(new Dimension(200, 200));
-        DragSource defaultDragSource =
-                DragSource.getDefaultDragSource();
-        defaultDragSource.createDefaultDragGestureRecognizer(this,
-                DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);
-        setBackground(Color.RED);
-    }
-
-    private class MyDragGestureListener implements DragGestureListener {
-        public void dragGestureRecognized(DragGestureEvent dge) {
-            dge.startDrag(null, new MyTransferable());
-        }
-    }
-}
--- a/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/TargetPanel.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.datatransfer.Transferable;
-import java.awt.dnd.*;
-import java.awt.*;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-import java.util.Timer;
-import java.util.TimerTask;
-
-public class TargetPanel extends Panel implements DropTargetListener {
-
-
-    //private final CustomDropTargetListener dropTargetListener = new CustomDropTargetListener();
-
-    private Frame frame;
-    DataFlavor dataFlavor;
-
-    public TargetPanel(Frame frame, DataFlavor dataFlavor) {
-        this.dataFlavor = dataFlavor;
-        this.frame = frame;
-        setBackground(Color.DARK_GRAY);
-        setPreferredSize(new Dimension(200, 200));
-        setDropTarget(new DropTarget(this, this));
-    }
-
-    public void dragEnter(DropTargetDragEvent dtde) {
-        if (dtde.isDataFlavorSupported(dataFlavor)) {
-            dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
-        }
-    }
-
-    public void dragOver(DropTargetDragEvent dtde) {
-        if (dtde.isDataFlavorSupported(dataFlavor)) {
-            dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
-        }
-    }
-
-    public void dropActionChanged(DropTargetDragEvent dtde) {
-        if (dtde.isDataFlavorSupported(dataFlavor)) {
-            dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
-        }
-    }
-
-    public void dragExit(DropTargetEvent dte) {
-
-    }
-
-    public void drop(DropTargetDropEvent dtde) {
-        dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
-        if (dtde.isDataFlavorSupported(dataFlavor)) {
-            String result = null;
-            try {
-                Transferable t = dtde.getTransferable();
-                byte[] data = (byte[]) dtde.getTransferable().getTransferData(dataFlavor);
-                result = new String(data, "UTF-16");
-                repaint();
-            } catch (UnsupportedFlavorException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            dtde.dropComplete(true);
-
-
-            if (result != null && result.contains(MyTransferable.TEST_DATA)) {
-                System.err.println(InterprocessMessages.EXECUTION_IS_SUCCESSFULL);
-                Timer t = new Timer();
-                t.schedule(new TimerTask() {
-                    @Override
-                    public void run() {
-                        System.exit(0);
-                    }
-                }, 2000);
-                return;
-
-            }
-        }
-        dtde.rejectDrop();
-        System.err.println(InterprocessMessages.DATA_IS_CORRUPTED);
-        System.exit(InterprocessMessages.DATA_IS_CORRUPTED);
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.io.*;
+import javax.swing.*;
+import sun.awt.SunToolkit;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @test
+ * @bug 8043705
+ * @summary Can't exit color chooser dialog when running as an applet
+ * @run main CloseDialogTest
+ */
+public class CloseDialogTest {
+
+    private static volatile Frame frame;
+    private static volatile Dialog dialog;
+    private static volatile InputStream testErrorStream;
+    private static final PrintStream systemErrStream = System.err;
+    private static final AtomicReference<Exception> caughtException
+            = new AtomicReference<>();
+
+    public static void main(String[] args) throws Exception {
+
+        // redirect System err
+        PipedOutputStream errorOutputStream = new PipedOutputStream();
+        testErrorStream = new PipedInputStream(errorOutputStream);
+        System.setErr(new PrintStream(errorOutputStream));
+
+        ThreadGroup swingTG = new ThreadGroup(getRootThreadGroup(), "SwingTG");
+        try {
+            new Thread(swingTG, () -> {
+                SunToolkit.createNewAppContext();
+                SwingUtilities.invokeLater(() -> {
+                    frame = new Frame();
+                    frame.setSize(300, 300);
+                    frame.setVisible(true);
+
+                    dialog = new Dialog(frame);
+                    dialog.setSize(200, 200);
+                    dialog.setModal(true);
+                    dialog.setVisible(true);
+                });
+            }).start();
+
+            Thread.sleep(400);
+
+            Thread disposeThread = new Thread(swingTG, () ->
+                    SwingUtilities.invokeLater(() -> {
+                try {
+                    while (dialog == null || !dialog.isVisible()) {
+                        Thread.sleep(100);
+                    }
+                    dialog.setVisible(false);
+                    dialog.dispose();
+                    frame.dispose();
+                } catch (Exception e) {
+                    caughtException.set(e);
+                }
+            }));
+            disposeThread.start();
+            disposeThread.join();
+            Thread.sleep(500);
+
+            // read System err
+            final char[] buffer = new char[2048];
+            System.err.print("END");
+            System.setErr(systemErrStream);
+            try (Reader in = new InputStreamReader(testErrorStream, "UTF-8")) {
+                int size = in.read(buffer, 0, buffer.length);
+                String errorString = new String(buffer, 0, size);
+                if (!errorString.startsWith("END")) {
+                    System.err.println(errorString.
+                            substring(0, errorString.length() - 4));
+                    throw new RuntimeException("Error output is not empty!");
+                }
+            }
+        } finally {
+            if (caughtException.get() != null) {
+                throw new RuntimeException("Failed. Caught exception!",
+                        caughtException.get());
+            }
+        }
+    }
+
+    private static ThreadGroup getRootThreadGroup() {
+        ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
+        while (threadGroup.getParent() != null) {
+            threadGroup = threadGroup.getParent();
+        }
+        return threadGroup;
+    }
+}
--- a/test/java/awt/EventQueue/6638195/bug6638195.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* @test
- *
- * @bug 6638195 6844297
- * @author Igor Kushnirskiy
- * @summary tests if EventQueueDelegate.Delegate is invoked.
- */
-
-import sun.awt.EventQueueDelegate;
-import com.sun.java.swing.SwingUtilities3;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.awt.*;
-
-public class bug6638195 {
-    public static void main(String[] args) throws Exception {
-        MyEventQueueDelegate delegate = new MyEventQueueDelegate();
-        EventQueueDelegate.setDelegate(delegate);
-        runTest(delegate);
-
-        delegate = new MyEventQueueDelegate();
-        SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
-        runTest(delegate);
-    }
-
-    private static void runTest(MyEventQueueDelegate delegate) throws Exception {
-        // We need an empty runnable here, so the next event is
-        // processed with a new EventQueueDelegate. See 6844297
-        // for details
-        EventQueue.invokeLater(
-            new Runnable() {
-                public void run() {
-                }
-            });
-        // The following event is expected to be processed by
-        // the EventQueueDelegate instance
-        EventQueue.invokeLater(
-            new Runnable() {
-                public void run() {
-                }
-            });
-        // Finally, proceed on the main thread
-        final CountDownLatch latch = new CountDownLatch(1);
-        EventQueue.invokeLater(
-            new Runnable() {
-                public void run() {
-                    latch.countDown();
-                }
-            });
-        latch.await();
-        if (!delegate.allInvoked()) {
-            throw new RuntimeException("failed");
-        }
-    }
-
-    static Map<String, Map<String, Object>> getObjectMap(
-          final EventQueueDelegate.Delegate delegate) {
-        Map<String, Map<String, Object>> objectMap =
-            new HashMap<String, Map<String, Object>>();
-        Map<String, Object> methodMap;
-
-        final AWTEvent[] afterDispatchEventArgument = new AWTEvent[1];
-        final Object[] afterDispatchHandleArgument = new Object[1];
-        Callable<Void> afterDispatchCallable =
-            new Callable<Void>() {
-                public Void call() {
-                    try {
-                        delegate.afterDispatch(afterDispatchEventArgument[0],
-                                afterDispatchHandleArgument[0]);
-                    }
-                    catch (InterruptedException e) {
-                        throw new RuntimeException("afterDispatch interrupted", e);
-                    }
-                    return null;
-                }
-            };
-        methodMap = new HashMap<String, Object>();
-        methodMap.put("event", afterDispatchEventArgument);
-        methodMap.put("handle", afterDispatchHandleArgument);
-        methodMap.put("method", afterDispatchCallable);
-        objectMap.put("afterDispatch", methodMap);
-
-        final AWTEvent[] beforeDispatchEventArgument = new AWTEvent[1];
-        Callable<Object> beforeDispatchCallable =
-            new Callable<Object>() {
-                public Object call() {
-                    try {
-                        return delegate.beforeDispatch(
-                                beforeDispatchEventArgument[0]);
-                    }
-                    catch (InterruptedException e) {
-                        throw new RuntimeException("beforeDispatch interrupted", e);
-                    }
-                }
-            };
-        methodMap = new HashMap<String, Object>();
-        methodMap.put("event", beforeDispatchEventArgument);
-        methodMap.put("method", beforeDispatchCallable);
-        objectMap.put("beforeDispatch", methodMap);
-
-        final EventQueue[] getNextEventEventQueueArgument = new EventQueue[1];
-        Callable<AWTEvent> getNextEventCallable =
-            new Callable<AWTEvent>() {
-                public AWTEvent call() throws Exception {
-                    return delegate.getNextEvent(
-                        getNextEventEventQueueArgument[0]);
-                }
-            };
-        methodMap = new HashMap<String, Object>();
-        methodMap.put("eventQueue", getNextEventEventQueueArgument);
-        methodMap.put("method", getNextEventCallable);
-        objectMap.put("getNextEvent", methodMap);
-
-        return objectMap;
-    }
-
-    static class MyEventQueueDelegate implements EventQueueDelegate.Delegate {
-        private volatile boolean getNextEventInvoked = false;
-        private volatile boolean beforeDispatchInvoked = false;
-        private volatile boolean afterDispatchInvoked = false;
-        public AWTEvent getNextEvent(EventQueue eventQueue)
-              throws InterruptedException {
-            getNextEventInvoked = true;
-            return eventQueue.getNextEvent();
-        }
-        public Object beforeDispatch(AWTEvent event) {
-            beforeDispatchInvoked = true;
-            return null;
-        }
-        public void afterDispatch(AWTEvent event, Object handle) {
-            afterDispatchInvoked = true;
-        }
-        private boolean allInvoked() {
-            return getNextEventInvoked && beforeDispatchInvoked && afterDispatchInvoked;
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/EventQueue/HeadlessEventQueue.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that EventQueue constructor does not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessEventQueue
+ */
+
+public class HeadlessEventQueue {
+    public static void main(String args[]) {
+        EventQueue eq = new EventQueue();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/EventQueue/InvocationEventTest/InvocationEventTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.awt.event.*;
+
+/*
+ * @test
+ * @summary  To Test the following assertions in InvovationEvent.
+ * 1.InvocationEvent when dispatched, should invoke the
+ *   run() method of the Runnable Interface.
+ * 2.If catchExceptions is false, Exception should be
+ *   propagated up to the EventDispatchThread's dispatch loop.
+ * 3.If catchExceptions is true, InvocationEvent.getExceptions()
+ *   should return the exception thrown inside thr run() method.
+ * 4.When InvocationEvent object is posted on to the EventQueue,
+ *   InvocationEvent.dispatch() method should be invoked by the
+ *   EventQueue.
+ * 5.If the notifier object is not null, notifyAll() of the
+ *   notifier object should be invoked when the run() method returns.
+ * 6.To test whether the threads are invoked in the right order
+ *   When InvocationEvents are nested.
+ * 7.The getWhen method should return timestamp which is less than
+ *   current System time and greater than the time before it has
+ *   actually happened
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main InvocationEventTest
+ */
+
+public class InvocationEventTest {
+    EventQueue eventQ1 = new EventQueue();
+
+    Object lock = new Object();
+
+    static final int delay = 5000;
+
+    public volatile boolean notifierStatus = false;
+    public Object notifierLock = new Object();
+
+    public volatile boolean threadStatus = false;
+    public volatile boolean childInvoked = false;
+
+    public synchronized void doTest() throws Exception {
+        // Testing assertions 1, 2 and 7:
+        // 1.InvocationEvent when dispatched, should invoke the
+        //   run() method of the Runnable Interface.
+        // 2.If catchExceptions is false, Exception should be
+        //   propagated up to the EventDispatchThread's dispatch loop.
+        // 7.The getWhen method should return timestamp which is less than
+        //   current System time and greater than the time before it has
+        //   actually happened
+
+        long timeBeforeInvoking = System.currentTimeMillis();
+
+        Thread.sleep(10);
+
+        InvocationEvent invoc = new InvocationEvent(this, () -> { threadStatus = true; }, lock, false);
+        invoc.dispatch();
+
+        Thread.sleep(10);
+
+        if (!threadStatus) {
+            synchronized (lock) {
+                lock.wait(delay);
+            }
+        }
+
+        // testing getException() when no exception is thrown
+        if (invoc.getWhen() <= timeBeforeInvoking ||
+                invoc.getWhen() >= System.currentTimeMillis()) {
+            throw new RuntimeException("getWhen method is not getting the time at which event occured");
+        }
+
+        if (invoc.getException() != null) {
+            throw new RuntimeException("InvocationEvent.getException() does not return null " +
+                    "when catchException is false");
+        }
+
+        // testing the normal behaviour of InvocationEvent
+        if (!threadStatus) {
+            throw new RuntimeException("InvocationEvent when dispatched, did not" +
+                    " invoke the run() of the Runnable interface  ");
+        }
+        threadStatus = false;
+
+        // Testing assertion 3:
+        // 3.If catchExceptions is true, InvocationEvent.getExceptions()
+        //   should return the exception thrown inside the run() method.
+        RuntimeException sampleExn = new RuntimeException(" test exception");
+
+        invoc = new InvocationEvent(this, () -> { threadStatus = true; throw sampleExn; }, lock, true);
+        invoc.dispatch();
+        if (!threadStatus) {
+            synchronized (lock) {
+                lock.wait(delay);
+            }
+        }
+        // testing getException() when exception is thrown
+        // Should return the same exception thrown inside the run() method
+        if (!invoc.getException().equals(sampleExn)) {
+            throw new RuntimeException("getException() does not return " +
+                    "the same Exception thrown inside the run() method ");
+        }
+        threadStatus = false;
+
+        // Testing assertions 4 and 5:
+        // 4.When InvocationEvent object is posted on to the EventQueue,
+        //   InvocationEvent.dispatch() method should be invoked by the
+        //   EventQueue.
+        // 5.If the notifier object is not null, notifyAll() of the
+        //   notifier object should be invoked when the run() method returns.
+
+        Thread notify = new Thread(){
+            public void run() {
+                synchronized (this) {
+                    try { wait(); } catch (InterruptedException e) { throw new RuntimeException(e); }
+                }
+                notifierStatus = true;
+                synchronized (notifierLock) {
+                    notifierLock.notifyAll();
+                }
+            }
+        };
+        notify.start();
+
+        while (notify.getState() != Thread.State.WAITING)
+            Thread.sleep(delay/5);
+
+        InvocationEvent invocation = new InvocationEvent(this, () -> { }, (Object) notify, false);
+        eventQ1.postEvent(invocation);
+
+        while(!invocation.isDispatched())
+            synchronized (notifierLock) {
+                notifierLock.wait(delay);
+            }
+
+        while (notify.getState() != Thread.State.TERMINATED)
+            Thread.sleep(delay/5);
+
+        if (!notifierStatus) {
+            throw new RuntimeException("Notifier object did not get notified" +
+                    " When the run method of the Runnable returns ");
+        }
+
+        // Testing assertion 6:
+        // 6.To test whether the threads are invoked in the right order
+        //   When InvocationEvents are nested.
+        Thread thread = new Thread(){
+            public void run() {
+                InvocationEvent evt = new InvocationEvent(this, () -> { childInvoked = true; }, (Object) this, false);
+                new EventQueue().postEvent(evt);
+                synchronized (this) {
+                    try {
+                        wait(delay);
+                    } catch (InterruptedException e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+                threadStatus = true;
+            }
+        };
+
+        invocation = new InvocationEvent(this, thread, lock, false);
+
+        eventQ1.postEvent(invocation);
+
+        while (!invocation.isDispatched())
+            synchronized (lock) {
+                lock.wait(delay);
+            }
+
+        if (!threadStatus || !childInvoked) {
+            throw new RuntimeException("Nesting of InvocationEvents when dispatched," +
+                    " did not invoke the run() of the Runnables properly ");
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        new InvocationEventTest().doTest();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/Headless/HeadlessContainerOrderFocusTraversalPolicy.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that ContainerOrderFocusTraversalPolicy constructor and
+ *          methods do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessContainerOrderFocusTraversalPolicy
+ */
+
+public class HeadlessContainerOrderFocusTraversalPolicy {
+
+    public static void main(String args[]) {
+        ContainerOrderFocusTraversalPolicy cot = new ContainerOrderFocusTraversalPolicy();
+
+        Container c = new Container();
+        Component cb1;
+        Component cb2;
+        Component cb3;
+
+        c.setFocusCycleRoot(true);
+        c.setFocusTraversalPolicy(cot);
+        c.add(cb1 = new Component(){});
+        c.add(cb2 = new Component(){});
+        c.add(cb3 = new Component(){});
+
+        cot.getComponentAfter(c, cb1);
+        cot.getComponentAfter(c, cb2);
+        cot.getComponentAfter(c, cb3);
+
+        cot.getComponentBefore(c, cb1);
+        cot.getComponentBefore(c, cb2);
+        cot.getComponentBefore(c, cb3);
+
+        cot.getFirstComponent(c);
+
+        cot.getLastComponent(c);
+
+        cot.getDefaultComponent(c);
+        cot.setImplicitDownCycleTraversal(true);
+        cot.setImplicitDownCycleTraversal(false);
+        cot.getImplicitDownCycleTraversal();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/Headless/HeadlessDefaultFocusTraversalPolicy.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that DefaultFocusTraversalPolicy constructor and
+ *          methods do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDefaultFocusTraversalPolicy
+ */
+
+public class HeadlessDefaultFocusTraversalPolicy  {
+    public static void main(String args[]) {
+        Container c = new Container();
+        Component cb1;
+        Component cb2;
+        Component cb3;
+
+        DefaultFocusTraversalPolicy cot = new DefaultFocusTraversalPolicy();
+        c.setFocusCycleRoot(true);
+        c.setFocusTraversalPolicy(cot);
+        c.add(cb1 = new Component(){});
+        c.add(cb2 = new Component(){});
+        c.add(cb3 = new Component(){});
+
+        cot.getComponentAfter(c, cb1);
+        cot.getComponentAfter(c, cb2);
+        cot.getComponentAfter(c, cb3);
+
+        cot.getComponentBefore(c, cb1);
+        cot.getComponentBefore(c, cb2);
+        cot.getComponentBefore(c, cb3);
+
+        cot.getFirstComponent(c);
+
+        cot.getLastComponent(c);
+
+        cot.getDefaultComponent(c);
+
+        cot.setImplicitDownCycleTraversal(true);
+
+        cot.setImplicitDownCycleTraversal(false);
+
+        cot.getImplicitDownCycleTraversal();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/Headless/HeadlessDefaultKeyboardFocusManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that DefaultKeyboardFocusManager constructor does not
+ *          throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDefaultKeyboardFocusManager
+ */
+
+public class HeadlessDefaultKeyboardFocusManager {
+    public static void main(String args[]) {
+        DefaultKeyboardFocusManager dfk = new DefaultKeyboardFocusManager();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FontClass/HeadlessFont.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.font.TextAttribute;
+import java.awt.geom.AffineTransform;
+import java.text.AttributedCharacterIterator;
+import java.text.StringCharacterIterator;
+import java.util.HashMap;
+import java.util.Map;
+
+/*
+ * @test
+ * @summary Check that Font constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessFont
+ */
+
+public class HeadlessFont {
+
+    public static void main(String args[]) {
+        HashMap attMap = new HashMap();
+        attMap.put(TextAttribute.FAMILY, "Helvetica Bold");
+        attMap.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_LIGHT);
+        attMap.put(TextAttribute.WIDTH, TextAttribute.WIDTH_REGULAR);
+        attMap.put(TextAttribute.SIZE, new Float(20));
+        attMap.put(TextAttribute.FOREGROUND, Color.white);
+        attMap.put(TextAttribute.BACKGROUND, Color.black);
+
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int i = 8; i < 17; i++) {
+                Font f1 = new Font(font, Font.PLAIN, i);
+                Font f2 = new Font(font, Font.BOLD, i);
+                Font f3 = new Font(font, Font.ITALIC, i);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, i);
+
+                FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(f1);
+                metrics = Toolkit.getDefaultToolkit().getFontMetrics(f2);
+                metrics = Toolkit.getDefaultToolkit().getFontMetrics(f3);
+                metrics = Toolkit.getDefaultToolkit().getFontMetrics(f4);
+
+                AffineTransform trans = f1.getTransform();
+                trans = f2.getTransform();
+                trans = f3.getTransform();
+                trans = f4.getTransform();
+
+                String str;
+                str = f1.getFamily();
+                str = f2.getFamily();
+                str = f3.getFamily();
+                str = f4.getFamily();
+
+                str = f1.getPSName();
+                str = f2.getPSName();
+                str = f3.getPSName();
+                str = f4.getPSName();
+
+                str = f1.getName();
+                str = f2.getName();
+                str = f3.getName();
+                str = f4.getName();
+
+                str = f1.getFontName();
+                str = f2.getFontName();
+                str = f3.getFontName();
+                str = f4.getFontName();
+
+                str = f1.toString();
+                str = f2.toString();
+                str = f3.toString();
+                str = f4.toString();
+
+                int s;
+                s = f1.getStyle();
+                s = f2.getStyle();
+                s = f3.getStyle();
+                s = f4.getStyle();
+
+                s = f1.getSize();
+                s = f2.getSize();
+                s = f3.getSize();
+                s = f4.getSize();
+
+                s = f1.hashCode();
+                s = f2.hashCode();
+                s = f3.hashCode();
+                s = f4.hashCode();
+
+                s = f1.getNumGlyphs();
+                s = f2.getNumGlyphs();
+                s = f3.getNumGlyphs();
+                s = f4.getNumGlyphs();
+
+                s = f1.getMissingGlyphCode();
+                s = f2.getMissingGlyphCode();
+                s = f3.getMissingGlyphCode();
+                s = f4.getMissingGlyphCode();
+
+                float f;
+                f = f1.getSize2D();
+                f = f2.getSize2D();
+                f = f3.getSize2D();
+                f = f4.getSize2D();
+
+
+                byte b;
+                b = f1.getBaselineFor('c');
+                b = f2.getBaselineFor('c');
+                b = f3.getBaselineFor('c');
+                b = f4.getBaselineFor('c');
+
+                Map m = f1.getAttributes();
+                m = f2.getAttributes();
+                m = f3.getAttributes();
+                m = f4.getAttributes();
+
+                AttributedCharacterIterator.Attribute[] a;
+                a = f1.getAvailableAttributes();
+                a = f2.getAvailableAttributes();
+                a = f3.getAvailableAttributes();
+                a = f4.getAvailableAttributes();
+
+
+                Font fnt;
+                fnt = f1.deriveFont(Font.BOLD | Font.ITALIC, (float) 80);
+                fnt = f2.deriveFont(Font.BOLD | Font.ITALIC, (float) 80);
+                fnt = f3.deriveFont(Font.BOLD | Font.ITALIC, (float) 80);
+                fnt = f4.deriveFont(Font.BOLD | Font.ITALIC, (float) 80);
+
+                fnt = f1.deriveFont(80f);
+                fnt = f2.deriveFont(80f);
+                fnt = f3.deriveFont(80f);
+                fnt = f4.deriveFont(80f);
+
+                fnt = f1.deriveFont(Font.BOLD | Font.ITALIC);
+                fnt = f2.deriveFont(Font.BOLD | Font.ITALIC);
+                fnt = f3.deriveFont(Font.BOLD | Font.ITALIC);
+                fnt = f4.deriveFont(Font.BOLD | Font.ITALIC);
+
+                fnt = f1.deriveFont(attMap);
+                fnt = f2.deriveFont(attMap);
+                fnt = f3.deriveFont(attMap);
+                fnt = f4.deriveFont(attMap);
+
+
+                if (!f1.isPlain())
+                    throw new RuntimeException("Plain font " + f1.getName() + " says it's not plain");
+                if (f2.isPlain())
+                    throw new RuntimeException("Bold font " + f1.getName() + " says it is plain");
+                if (f3.isPlain())
+                    throw new RuntimeException("Italic font " + f1.getName() + " says it is plain");
+                if (f4.isPlain())
+                    throw new RuntimeException("Bold|Italic font " + f1.getName() + " says it is plain");
+
+                if (f1.isBold())
+                    throw new RuntimeException("Plain font " + f1.getName() + " says it is bold");
+                if (!f2.isBold())
+                    throw new RuntimeException("Bold font " + f1.getName() + " says it's not bold");
+                if (f3.isBold())
+                    throw new RuntimeException("Italic font " + f1.getName() + " says it is bold");
+                if (!f4.isBold())
+                    throw new RuntimeException("Bold|Italic font " + f1.getName() + " says it's not bold");
+
+                if (f1.isItalic())
+                    throw new RuntimeException("Plain font " + f1.getName() + " says it is italic");
+                if (f2.isItalic())
+                    throw new RuntimeException("Bold font " + f1.getName() + " says it is italic");
+                if (!f3.isItalic())
+                    throw new RuntimeException("Italic font " + f1.getName() + " says it's not italic");
+                if (!f4.isItalic())
+                    throw new RuntimeException("Bold|Italic font " + f1.getName() + " says it's not italic");
+
+                f1.canDisplay('~');
+                f2.canDisplay('~');
+                f3.canDisplay('~');
+                f4.canDisplay('~');
+                f1.canDisplay('c');
+                f2.canDisplay('c');
+                f3.canDisplay('c');
+                f4.canDisplay('c');
+
+                f1.canDisplayUpTo("canDisplayUpTo");
+                f2.canDisplayUpTo("canDisplayUpTo");
+                f3.canDisplayUpTo("canDisplayUpTo");
+                f4.canDisplayUpTo("canDisplayUpTo");
+
+                str = "canDisplayUpTo";
+                f1.canDisplayUpTo(str.toCharArray(), 0, str.length());
+                f2.canDisplayUpTo(str.toCharArray(), 0, str.length());
+                f3.canDisplayUpTo(str.toCharArray(), 0, str.length());
+                f4.canDisplayUpTo(str.toCharArray(), 0, str.length());
+
+                f1.canDisplayUpTo(new StringCharacterIterator(str), 0, str.length());
+                f2.canDisplayUpTo(new StringCharacterIterator(str), 0, str.length());
+                f3.canDisplayUpTo(new StringCharacterIterator(str), 0, str.length());
+                f4.canDisplayUpTo(new StringCharacterIterator(str), 0, str.length());
+
+                f1.getItalicAngle();
+                f2.getItalicAngle();
+                f3.getItalicAngle();
+                f4.getItalicAngle();
+
+                f1.hasUniformLineMetrics();
+                f2.hasUniformLineMetrics();
+                f3.hasUniformLineMetrics();
+                f4.hasUniformLineMetrics();
+
+                f1.getPeer();
+                f2.getPeer();
+                f3.getPeer();
+                f4.getPeer();
+            }
+        }
+
+        Font f = new Font(attMap);
+        f = Font.getFont(attMap);
+        f = Font.decode(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Frame/DecoratedExceptions/DecoratedExceptions.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary An attempt to set non-trivial background, shape, or translucency
+ *          to a decorated toplevel should end with an exception.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main DecoratedExceptions
+ */
+public class DecoratedExceptions {
+    public static void main(String args[]) throws Exception{
+        ExtendedRobot robot = new ExtendedRobot();
+        Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(() -> {
+            Frame frame = new Frame("Frame");
+            frame.setBounds(50,50,400,200);
+            try {
+                frame.setOpacity(0.5f);
+                throw new RuntimeException("No exception when Opacity set to a decorated Frame");
+            }catch(IllegalComponentStateException e) {
+            }
+            try {
+                frame.setShape(new Rectangle(50,50,400,200));
+                throw new RuntimeException("No exception when Shape set to a decorated Frame");
+            }catch(IllegalComponentStateException e) {
+            }
+            try {
+                frame.setBackground(new Color(50, 50, 50, 100));
+                throw new RuntimeException("No exception when Alpha background set to a decorated Frame");
+            }catch(IllegalComponentStateException e) {
+            }
+            frame.setVisible(true);
+            Dialog dialog = new Dialog( frame );
+            try {
+                dialog.setOpacity(0.5f);
+                throw new RuntimeException("No exception when Opacity set to a decorated Dialog");
+            }catch(IllegalComponentStateException e) {
+            }
+            try {
+                dialog.setShape(new Rectangle(50,50,400,200));
+                throw new RuntimeException("No exception when Shape set to a decorated Dialog");
+            }catch(IllegalComponentStateException e) {
+            }
+            try {
+                dialog.setBackground(new Color(50, 50, 50, 100));
+                throw new RuntimeException("No exception when Alpha background set to a decorated Dialog");
+            }catch(IllegalComponentStateException e) {
+            }
+            dialog.setVisible(true);
+        });
+        robot.waitForIdle(1000);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c) 2005, 2014 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ @test
+ @bug 6275887 6429971 6459792
+ @summary Test that we don't crash when alt+tabbing in and out of
+         fullscreen app
+ @author Dmitri.Trembovetski@sun.com: area=FullScreen
+ @run main/othervm/timeout=100  AltTabCrashTest -auto -changedm
+ @run main/othervm/timeout=100 -Dsun.java2d.d3d=True AltTabCrashTest -auto -changedm
+ @run main/othervm/timeout=100 -Dsun.java2d.d3d=True AltTabCrashTest -auto -usebs -changedm
+ @run main/othervm/timeout=100 -Dsun.java2d.opengl=True AltTabCrashTest -auto
+*/
+
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.DisplayMode;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.RenderingHints;
+import java.awt.Robot;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.image.BufferStrategy;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.util.Random;
+import java.util.Vector;
+
+/**
+ * Note that the alt+tabbing in and out part will most likely only work
+ * on Windows, and only if there are no interventions.
+ */
+
+public class AltTabCrashTest extends Frame {
+    public static int width;
+    public static int height;
+    public static volatile boolean autoMode;
+    public static boolean useBS;
+    public static final int NUM_OF_BALLS = 70;
+    // number of times to alt+tab in and out of the app
+    public static int altTabs = 5;
+    private final Vector<Ball> balls = new Vector<>();
+    GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment()
+        .getDefaultScreenDevice();
+    VolatileImage vimg = null;
+    BufferStrategy bufferStrategy = null;
+    volatile boolean timeToQuit = false;
+    static final Object lock = new Object();
+
+    enum SpriteType {
+        OVALS, VIMAGES, BIMAGES, AAOVALS, TEXT
+    }
+
+    private static boolean changeDM = false;
+    private static SpriteType spriteType;
+    static Random rnd = new Random();
+
+    public AltTabCrashTest( ) {
+        addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
+                    timeToQuit = true;
+                }
+            }
+        });
+        setIgnoreRepaint(true);
+        addMouseListener(new MouseHandler());
+        for (int i = 0; i < NUM_OF_BALLS; i++) {
+            int x = 50 + rnd.nextInt(550), y = 50 + rnd.nextInt(400);
+
+            balls.addElement(createRandomBall(y, x));
+        }
+        setUndecorated(true);
+        gd.setFullScreenWindow(this);
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        if (gd.isDisplayChangeSupported() && changeDM) {
+            DisplayMode dm = findDisplayMode();
+            if (dm != null) {
+                try {
+                    gd.setDisplayMode(dm);
+                } catch (IllegalArgumentException iae) {
+                    System.err.println("Error setting display mode");
+                }
+            }
+        }
+        if (useBS) {
+            createBufferStrategy(2);
+            bufferStrategy = getBufferStrategy();
+        } else {
+            Graphics2D g = (Graphics2D) getGraphics();
+            render(g);
+            g.dispose();
+        }
+        Thread t = new BallThread();
+        t.start();
+        if (autoMode) {
+            Thread tt = new AltTabberThread();
+            tt.start();
+            synchronized (lock) {
+                while (!timeToQuit) {
+                    try {
+                        lock.wait(200);
+                    } catch (InterruptedException ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+            t = null;
+            dispose();
+        }
+    }
+
+    private Ball createRandomBall(final int y, final int x) {
+        Ball b;
+        SpriteType type;
+
+        if (spriteType == null) {
+            int index = rnd.nextInt(SpriteType.values().length);
+            type = SpriteType.values()[index];
+        } else {
+            type = spriteType;
+        }
+        switch (type) {
+            case VIMAGES: b = new VISpriteBall(x, y); break;
+            case AAOVALS: b = new AAOvalBall(x, y); break;
+            case BIMAGES: b = new BISpriteBall(x, y); break;
+            case TEXT: b = new TextBall(x,y, "Text Sprite!"); break;
+            default: b = new Ball(x, y); break;
+        }
+        return b;
+    }
+
+    private class MouseHandler extends MouseAdapter  {
+        public void mousePressed(MouseEvent e) {
+            synchronized (balls) {
+                balls.addElement(createRandomBall(e.getX(), e.getY()));
+            }
+        }
+    }
+
+    private class AltTabberThread extends Thread {
+        Robot robot;
+
+        void pressAltTab() {
+            robot.keyPress(KeyEvent.VK_ALT);
+            robot.keyPress(KeyEvent.VK_TAB);
+            robot.keyRelease(KeyEvent.VK_TAB);
+            robot.keyRelease(KeyEvent.VK_ALT);
+        }
+        void pressShiftAltTab() {
+            robot.keyPress(KeyEvent.VK_SHIFT);
+            pressAltTab();
+            robot.keyRelease(KeyEvent.VK_SHIFT);
+        }
+        public void run() {
+            try {
+                robot = new Robot();
+                robot.setAutoDelay(200);
+            } catch (AWTException e) {
+                throw new RuntimeException("Can't create robot");
+            }
+            boolean out = true;
+            while (altTabs-- > 0 && !timeToQuit) {
+                System.err.println("Alt+tabber Iteration: "+altTabs);
+                try { Thread.sleep(2500); } catch (InterruptedException ex) {}
+
+                if (out) {
+                    System.err.println("Issuing alt+tab");
+                    pressAltTab();
+                } else {
+                    System.err.println("Issuing shift ");
+                    pressShiftAltTab();
+                }
+                out = !out;
+            }
+            System.err.println("Alt+tabber finished.");
+            synchronized (lock) {
+                timeToQuit = true;
+                lock.notify();
+            }
+        }
+    }
+
+    private class BallThread extends Thread {
+        public void run() {
+            while (!timeToQuit) {
+                if (useBS) {
+                    renderToBS();
+                    bufferStrategy.show();
+                } else {
+                    Graphics g = AltTabCrashTest.this.getGraphics();
+                    render(g);
+                    g.dispose();
+                }
+            }
+            gd.setFullScreenWindow(null);
+            AltTabCrashTest.this.dispose();
+        }
+    }
+
+    static class Ball {
+
+        int x, y;     // current location
+        int dx, dy;   // motion delta
+        int diameter = 40;
+        Color color = Color.red;
+
+        public Ball() {
+        }
+
+        public Ball(int x, int y) {
+            this.x = x;
+            this.y = y;
+            dx = x % 20 + 1;
+            dy = y % 20 + 1;
+            color = new Color(rnd.nextInt(0x00ffffff));
+        }
+
+        public void move() {
+            if (x < 10 || x >= AltTabCrashTest.width - 20)
+                dx = -dx;
+            if (y < 10 || y > AltTabCrashTest.height - 20)
+                dy = -dy;
+            x += dx;
+            y += dy;
+        }
+
+        public void paint(Graphics g, Color c) {
+            if (c == null) {
+                g.setColor(color);
+            } else {
+                g.setColor(c);
+            }
+            g.fillOval(x, y, diameter, diameter);
+        }
+
+    }
+
+    static class TextBall extends Ball {
+        String text;
+        public TextBall(int x, int y, String text) {
+            super(x, y);
+            this.text = text;
+        }
+
+        public void paint(Graphics g, Color c) {
+            if (c == null) {
+                g.setColor(color);
+            } else {
+                g.setColor(c);
+            }
+            g.drawString(text, x, y);
+        }
+    }
+
+    static class AAOvalBall extends Ball {
+        public AAOvalBall(int x, int y) {
+            super(x, y);
+        }
+        public void paint(Graphics g, Color c) {
+            if (c == null) {
+                Graphics2D g2d = (Graphics2D)g.create();
+                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                                     RenderingHints.VALUE_ANTIALIAS_ON);
+                g2d.setColor(color);
+                g2d.fillOval(x, y, diameter, diameter);
+            } else {
+                g.setColor(c);
+                g.fillOval(x-2, y-2, diameter+4, diameter+4);
+            }
+        }
+    }
+
+    static abstract class SpriteBall extends Ball {
+        Image image;
+        public SpriteBall(int x, int y) {
+            super(x, y);
+            image = createSprite();
+            Graphics g = image.getGraphics();
+            g.setColor(color);
+            g.fillRect(0, 0, image.getWidth(null), image.getHeight(null));
+        }
+        public void paint(Graphics g, Color c) {
+            if (c != null) {
+                g.setColor(c);
+                g.fillRect(x, y, image.getWidth(null), image.getHeight(null));
+            } else do {
+                validateSprite();
+                g.drawImage(image, x, y, null);
+            } while (renderingIncomplete());
+        }
+        public abstract Image createSprite();
+        public void validateSprite() {}
+        public boolean renderingIncomplete() { return false; }
+    }
+    class VISpriteBall extends SpriteBall {
+
+        public VISpriteBall(int x, int y) {
+            super(x, y);
+        }
+        public boolean renderingIncomplete() {
+            return ((VolatileImage)image).contentsLost();
+        }
+
+        public Image createSprite() {
+            return gd.getDefaultConfiguration().
+                createCompatibleVolatileImage(20, 20);
+        }
+        public void validateSprite() {
+            int result =
+                ((VolatileImage)image).validate(getGraphicsConfiguration());
+            if (result == VolatileImage.IMAGE_INCOMPATIBLE) {
+                image = createSprite();
+                result = VolatileImage.IMAGE_RESTORED;
+            }
+            if (result == VolatileImage.IMAGE_RESTORED) {
+                Graphics g = image.getGraphics();
+                g.setColor(color);
+                g.fillRect(0, 0, image.getWidth(null), image.getHeight(null));
+            }
+        }
+    }
+    class BISpriteBall extends SpriteBall {
+        public BISpriteBall(int x, int y) {
+            super(x, y);
+        }
+        public Image createSprite() {
+            return new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
+        }
+    }
+
+
+    public void renderOffscreen() {
+        Graphics2D g2d = (Graphics2D) vimg.getGraphics();
+        synchronized (balls) {
+            for (Ball b : balls) {
+                b.paint(g2d, getBackground());
+                b.move();
+                b.paint(g2d, null);
+            }
+        }
+        g2d.dispose();
+    }
+
+    public void renderToBS() {
+        width = getWidth();
+        height = getHeight();
+
+        do {
+            Graphics2D g2d = (Graphics2D)bufferStrategy.getDrawGraphics();
+
+            g2d.clearRect(0, 0, width, height);
+            synchronized (balls) {
+                for (Ball b : balls) {
+                    b.move();
+                    b.paint(g2d, null);
+                }
+            }
+            g2d.dispose();
+        } while (bufferStrategy.contentsLost() ||
+                bufferStrategy.contentsRestored());
+    }
+
+    public void render(Graphics g)  {
+        do {
+            height = getBounds().height;
+            width = getBounds().width;
+            if (vimg == null) {
+                vimg = createVolatileImage(width, height);
+                renderOffscreen();
+            }
+            int returnCode = vimg.validate(getGraphicsConfiguration());
+            if (returnCode == VolatileImage.IMAGE_RESTORED) {
+                renderOffscreen();
+            } else if (returnCode == VolatileImage.IMAGE_INCOMPATIBLE) {
+                vimg = getGraphicsConfiguration().
+                    createCompatibleVolatileImage(width, height);
+                renderOffscreen();
+            } else if (returnCode == VolatileImage.IMAGE_OK) {
+                renderOffscreen();
+            }
+            g.drawImage(vimg, 0, 0, this);
+        } while (vimg.contentsLost());
+    }
+
+    public static void main(String args[])  {
+        for (String arg : args) {
+            if (arg.equalsIgnoreCase("-auto")) {
+                autoMode = true;
+                System.err.println("Running in automatic mode using Robot");
+            } else if (arg.equalsIgnoreCase("-usebs")) {
+                useBS = true;
+                System.err.println("Using BufferStrategy instead of VI");
+            } else if (arg.equalsIgnoreCase("-changedm")) {
+                changeDM= true;
+                System.err.println("The test will change display mode");
+            } else if (arg.equalsIgnoreCase("-vi")) {
+                spriteType = SpriteType.VIMAGES;
+            } else if (arg.equalsIgnoreCase("-bi")) {
+                spriteType = SpriteType.BIMAGES;
+            } else if (arg.equalsIgnoreCase("-ov")) {
+                spriteType = SpriteType.OVALS;
+            } else if (arg.equalsIgnoreCase("-aaov")) {
+                spriteType = SpriteType.AAOVALS;
+            } else if (arg.equalsIgnoreCase("-tx")) {
+                spriteType = SpriteType.TEXT;
+            } else {
+                System.err.println("Usage: AltTabCrashTest [-usebs][-auto]" +
+                                   "[-changedm][-vi|-bi|-ov|-aaov|-tx]");
+                System.err.println(" -usebs: use BufferStrategy instead of VI");
+                System.err.println(" -auto: automatically alt+tab in and out" +
+                                   " of the application ");
+                System.err.println(" -changedm: change display mode");
+                System.err.println(" -(vi|bi|ov|tx|aaov) : use only VI, BI, " +
+                                   "text or [AA] [draw]Oval sprites");
+                System.exit(0);
+            }
+        }
+        if (spriteType != null) {
+            System.err.println("The test will only use "+spriteType+" sprites.");
+        }
+        new AltTabCrashTest();
+    }
+
+    private DisplayMode findDisplayMode() {
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        DisplayMode dms[] = gd.getDisplayModes();
+        DisplayMode currentDM = gd.getDisplayMode();
+        for (DisplayMode dm : dms) {
+            if (dm.getBitDepth() > 8 &&
+                dm.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI &&
+                dm.getBitDepth() != currentDM.getBitDepth() &&
+                dm.getWidth() == currentDM.getWidth() &&
+                dm.getHeight() == currentDM.getHeight())
+            {
+                // found a mode which has the same dimensions but different
+                // depth
+                return dm;
+            }
+            if (dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI &&
+                (dm.getWidth() != currentDM.getWidth() ||
+                 dm.getHeight() != currentDM.getHeight()))
+            {
+                // found a mode which has the same depth but different
+                // dimensions
+                return dm;
+            }
+        }
+
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GradientPaint/HeadlessGradientPaint.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that GradientPaint that constructors and methods do not
+ *          throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessGradientPaint
+ */
+
+public class HeadlessGradientPaint {
+    public static void main(String args[]) {
+        GradientPaint gp;
+        gp = new GradientPaint(10, 10, Color.red, 20, 20, Color.blue);
+        gp = new GradientPaint(new Point(10, 10), Color.red, new Point(20, 20), Color.blue);
+        gp = new GradientPaint(10, 10, Color.red, 20, 20, Color.blue, true);
+        gp = new GradientPaint(10, 10, Color.red, 20, 20, Color.blue, false);
+        gp = new GradientPaint(new Point(10, 10), Color.red, new Point(20, 20), Color.blue, true);
+        gp = new GradientPaint(new Point(10, 10), Color.red, new Point(20, 20), Color.blue, false);
+
+        gp = new GradientPaint(10, 10, Color.red, 20, 20, Color.blue, false);
+        gp.getPoint1();
+        gp.getColor1();
+        gp.getPoint2();
+        gp.getColor2();
+        gp.isCyclic();
+        gp.getTransparency();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/Headless/HeadlessPoint.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Point constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPoint
+ */
+
+public class HeadlessPoint {
+    public static void main(String args[]) {
+        Point p;
+        p = new Point();
+        p = new Point(new Point(1, 2));
+        p = new Point(1, 2);
+        p.getX();
+        p.getY();
+        p.getLocation();
+        p.setLocation(new Point(3, 4));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/Headless/HeadlessPolygon.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Polygon;
+
+/*
+ * @test
+ * @summary Check that Polygon constructor does not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPolygon
+ */
+
+public class HeadlessPolygon {
+    public static void main(String args[]) {
+        new Polygon();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/Headless/HeadlessRectangle.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Rectangle constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessRectangle
+ */
+
+public class HeadlessRectangle {
+    public static void main(String args[]) {
+        Rectangle r;
+        r = new Rectangle();
+        r = new Rectangle(new Rectangle());
+        r = new Rectangle(100, 200);
+        r = new Rectangle(new Point(100, 200), new Dimension(300, 400));
+        r = new Rectangle(new Point(100, 200));
+        r = new Rectangle(new Dimension(300, 400));
+        r = new Rectangle(100, 200, 300, 400);
+        r.getX();
+        r.getY();
+        r.getWidth();
+        r.getHeight();
+        r.getBounds();
+        r.getBounds2D();
+        r.getLocation();
+        r.getSize();
+        r.contains(new Point(1, 2));
+        r.contains(1, 2);
+        r.contains(new Rectangle(1, 2, 3, 4));
+        r.contains(1, 2, 3, 4);
+        r.add(1, 2);
+        r.add(new Point(1, 2));
+        r.add(new Rectangle(1, 2, 3, 4));
+        r.grow(1, 2);
+        r.isEmpty();
+        r.toString();
+        r.hashCode();
+        r.getMinX();
+        r.getMinY();
+        r.getMaxX();
+        r.getMaxY();
+        r.getCenterX();
+        r.getCenterY();
+        r.getFrame();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/ScaledCopyArea/ScaledCopyArea.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+
+/**
+ * @test
+ * @bug 8029455
+ * @summary Tests that copyarea on offscreen images works as expected when
+ *          scaled transform is set
+ * @run main ScaledCopyArea
+ */
+public final class ScaledCopyArea {
+
+    public static void main(final String[] args) {
+        final BufferedImage bi = new BufferedImage(100, 300,
+                                                   BufferedImage.TYPE_INT_RGB);
+        final Graphics2D g = bi.createGraphics();
+        g.scale(2, 2);
+        g.setColor(Color.RED);
+        g.fillRect(0, 0, 100, 300);
+        g.setColor(Color.GREEN);
+        g.fillRect(0, 100, 100, 100);
+        g.copyArea(0, 100, 100, 100, 0, -100);
+        g.dispose();
+        for (int x = 0; x < 100; ++x) {
+            for (int y = 0; y < 100; ++y) {
+                final int actual = bi.getRGB(x, y);
+                final int exp = Color.GREEN.getRGB();
+                if (actual != exp) {
+                    System.err.println("Expected:" + Integer.toHexString(exp));
+                    System.err.println("Actual:" + Integer.toHexString(actual));
+                    throw new RuntimeException("Test " + "failed");
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsConfiguration/HeadlessGraphicsConfiguration.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+
+/*
+ * @test
+ * @summary Check that GraphicsConfiguration methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessGraphicsConfiguration
+ */
+
+public class HeadlessGraphicsConfiguration {
+    public static void main(String args[]) {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        Graphics2D gd = ge.createGraphics(new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR));
+        GraphicsConfiguration gc = gd.getDeviceConfiguration();
+        GraphicsDevice gdev = gc.getDevice();
+        BufferedImage bi = gc.createCompatibleImage(100, 100);
+        bi = gc.createCompatibleImage(100, 100, Transparency.TRANSLUCENT);
+
+        ColorModel cm = gc.getColorModel();
+        cm = gc.getColorModel(Transparency.TRANSLUCENT);
+
+        AffineTransform at = gc.getDefaultTransform();
+        at = gc.getNormalizingTransform();
+
+        Rectangle r = gc.getBounds();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsDevice/HeadlessGraphicsDevice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check that GraphicsDevice methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessGraphicsDevice
+ */
+
+public class HeadlessGraphicsDevice {
+    public static void main(String args[]) {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        Graphics2D gd = ge.createGraphics(new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR));
+        GraphicsConfiguration gc = gd.getDeviceConfiguration();
+        GraphicsDevice gdev = gc.getDevice();
+
+        for (GraphicsConfiguration gcl : gdev.getConfigurations())
+            gcl.toString();
+
+        gdev.getDefaultConfiguration().toString();
+        gdev.getIDstring();
+
+        if (gdev.getType() != GraphicsDevice.TYPE_IMAGE_BUFFER)
+            throw new RuntimeException("Created GraphicsDevice that should be IMAGE_BUFFER but it isn't");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/HeadlessGraphicsEnvironment.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check that GraphicsEnvironment methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessGraphicsEnvironment
+ */
+
+public class HeadlessGraphicsEnvironment {
+    public static void main(String args[]) {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        if (!GraphicsEnvironment.isHeadless())
+            throw new RuntimeException("GraphicsEnvironment.isHeadless says it's not headless mode when it is");
+
+        boolean exceptions = false;
+        try {
+            GraphicsDevice[] gdl = ge.getScreenDevices();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when excepted");
+
+        exceptions = false;
+        try {
+            GraphicsDevice gdl = ge.getDefaultScreenDevice();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when excepted");
+
+        Graphics2D gd = ge.createGraphics(new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR));
+
+        for (Font font : ge.getAllFonts()) {
+            for (float j = 8; j < 17; j++) {
+                Font f1 = font.deriveFont(Font.PLAIN, j);
+                Font f2 = font.deriveFont(Font.BOLD, j);
+                Font f3 = font.deriveFont(Font.ITALIC, j);
+                Font f4 = font.deriveFont(Font.BOLD | Font.ITALIC, j);
+
+                f1.hasUniformLineMetrics();
+                f2.hasUniformLineMetrics();
+                f3.hasUniformLineMetrics();
+                f4.hasUniformLineMetrics();
+            }
+        }
+
+        String[] fNames = ge.getAvailableFontFamilyNames();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessAWTEventMulticaster.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+
+/*
+ * @test
+ * @summary Check for AWTEventMulticaster working in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessAWTEventMulticaster
+ */
+
+public class HeadlessAWTEventMulticaster {
+    class ComponentListenerImpl implements ComponentListener {
+        public boolean hidden = false;
+        public boolean moved = false;
+        public boolean resized = false;
+        public boolean shown = false;
+
+        public void componentHidden(ComponentEvent e) {
+            hidden = true;
+        }
+
+        public void componentMoved(ComponentEvent e) {
+            moved = true;
+        }
+
+        public void componentResized(ComponentEvent e) {
+            resized = true;
+        }
+
+        public void componentShown(ComponentEvent e) {
+            shown = true;
+        }
+    }
+
+    class ContainerListenerImpl implements ContainerListener {
+        public boolean removed = false;
+        public boolean added = false;
+
+        public void componentAdded(ContainerEvent e) {
+            added = true;
+        }
+
+        public void componentRemoved(ContainerEvent e) {
+            removed = true;
+        }
+    }
+
+    class FocusListenerImpl implements FocusListener {
+        public boolean gained = false;
+        public boolean lost = false;
+
+        public void focusGained(FocusEvent e) {
+            gained = true;
+        }
+
+        public void focusLost(FocusEvent e) {
+            lost = true;
+        }
+    }
+
+    class KeyListenerImpl implements KeyListener {
+        public boolean pressed = false;
+        public boolean released = false;
+        public boolean typed = false;
+
+        public void keyPressed(KeyEvent e) {
+            pressed = true;
+        }
+
+        public void keyReleased(KeyEvent e) {
+            released = true;
+        }
+
+        public void keyTyped(KeyEvent e) {
+            typed = true;
+        }
+    }
+
+    public static void main(String args[]) {
+        new HeadlessAWTEventMulticaster().doTest();
+    }
+
+    void doTest() {
+        ComponentListener compList;
+        ComponentListenerImpl compListImpl;
+
+        ContainerListener contList;
+        ContainerListenerImpl contListImpl;
+
+        FocusListener focList;
+        FocusListenerImpl focListImpl;
+
+        KeyListener keyList;
+        KeyListenerImpl keyListImpl;
+
+        Component component = new Component(){};
+
+        // Component resized
+        compListImpl = new ComponentListenerImpl();
+        compList = AWTEventMulticaster.add(compListImpl, null);
+        compList.componentResized(new ComponentEvent(component,
+                ComponentEvent.COMPONENT_RESIZED));
+        if (compListImpl.hidden || compListImpl.moved || compListImpl.shown) {
+            throw new RuntimeException("Wrong id delivered: hidden || moved || shown");
+        }
+        if (!compListImpl.resized) {
+            throw new RuntimeException("Expected id, resized, not delivered");
+        }
+
+        // Component moved
+        compListImpl = new ComponentListenerImpl();
+        compList = AWTEventMulticaster.add(compListImpl, null);
+        compList.componentMoved(new ComponentEvent(component,
+                ComponentEvent.COMPONENT_MOVED));
+        if (compListImpl.hidden || compListImpl.resized || compListImpl.shown) {
+            throw new RuntimeException("Wrong id delivered: hidden || resized || shown");
+        }
+        if (!compListImpl.moved) {
+            throw new RuntimeException("Expected id, moved, not delivered");
+        }
+
+        // Component shown
+        compListImpl = new ComponentListenerImpl();
+        compList = AWTEventMulticaster.add(compListImpl, null);
+        compList.componentShown(new ComponentEvent(component,
+                ComponentEvent.COMPONENT_SHOWN));
+        if (compListImpl.hidden || compListImpl.resized || compListImpl.moved) {
+            throw new RuntimeException("Wrong id delivered: hidden || resized || moved");
+        }
+        if (!compListImpl.shown) {
+            throw new RuntimeException("Expected id, shown, not delivered");
+        }
+
+        // Component hidden
+        compListImpl = new ComponentListenerImpl();
+        compList = AWTEventMulticaster.add(compListImpl, null);
+        compList.componentHidden(new ComponentEvent(component,
+                ComponentEvent.COMPONENT_HIDDEN));
+        if (compListImpl.shown || compListImpl.resized || compListImpl.moved) {
+            throw new RuntimeException("Wrong id delivered: shown || resized || moved");
+        }
+        if (!compListImpl.hidden) {
+            throw new RuntimeException("Expected id, hidden, not delivered");
+        }
+
+        // Component added
+        contListImpl = new ContainerListenerImpl();
+        contList = AWTEventMulticaster.add(contListImpl, null);
+        contList.componentAdded(new ContainerEvent(component,
+                ContainerEvent.COMPONENT_ADDED, component));
+        if (contListImpl.removed) {
+            throw new RuntimeException("Wrong id delivered: removed");
+        }
+        if (!contListImpl.added) {
+            throw new RuntimeException("Expected id, added, not delivered");
+        }
+
+        // Component removed
+        contListImpl = new ContainerListenerImpl();
+        contList = AWTEventMulticaster.add(contListImpl, null);
+        contList.componentRemoved(new ContainerEvent(component,
+                ContainerEvent.COMPONENT_REMOVED, component));
+        if (contListImpl.added) {
+            throw new RuntimeException("Wrong id delivered: added");
+        }
+        if (!contListImpl.removed) {
+            throw new RuntimeException("Expected id, removed, not delivered");
+        }
+
+        // Focus gained
+        focListImpl = new FocusListenerImpl();
+        focList = AWTEventMulticaster.add(focListImpl, null);
+        focList.focusGained(new FocusEvent(component, FocusEvent.FOCUS_GAINED));
+        if (focListImpl.lost) {
+            throw new RuntimeException("Wrong id delivered: lost");
+        }
+        if (!focListImpl.gained) {
+            throw new RuntimeException("Expected id, gained, not delivered");
+        }
+
+        // Focus lost
+        focListImpl = new FocusListenerImpl();
+        focList = AWTEventMulticaster.add(focListImpl, null);
+        focList.focusLost(new FocusEvent(component, FocusEvent.FOCUS_LOST));
+        if (focListImpl.gained) {
+            throw new RuntimeException("Wrong id delivered: gained");
+        }
+        if (!focListImpl.lost) {
+            throw new RuntimeException("Expected id, lost, not delivered");
+        }
+
+        // Key typed
+        keyListImpl = new KeyListenerImpl();
+        keyList = AWTEventMulticaster.add(keyListImpl, null);
+        keyList.keyTyped(new KeyEvent(component,
+                KeyEvent.KEY_TYPED, 0L, 0, 0));
+        if (keyListImpl.pressed || keyListImpl.released)
+            throw new RuntimeException("Wrong id delivered: pressed || released");
+
+        if (!keyListImpl.typed)
+            throw new RuntimeException("Expected id, typed, not delivered");
+
+        // Key pressed
+        keyListImpl = new KeyListenerImpl();
+        keyList = AWTEventMulticaster.add(keyListImpl, null);
+        keyList.keyPressed(new KeyEvent(component,
+                KeyEvent.KEY_PRESSED, 0L, 0, 0));
+        if (keyListImpl.typed || keyListImpl.released)
+            throw new RuntimeException("Wrong id delivered: typed || released");
+
+        if (!keyListImpl.pressed)
+            throw new RuntimeException("Expected id, pressed, not delivered");
+
+        // Key released
+        keyListImpl = new KeyListenerImpl();
+        keyList = AWTEventMulticaster.add(keyListImpl, null);
+        keyList.keyReleased(new KeyEvent(component,
+                KeyEvent.KEY_RELEASED, 0L, 0, 0));
+        if (keyListImpl.pressed || keyListImpl.typed)
+            throw new RuntimeException("Wrong id delivered: pressed || typed");
+
+        if (!keyListImpl.released)
+            throw new RuntimeException("Expected id, released, not delivered");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessAWTException.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that AWTException can be created in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessAWTException
+ */
+
+public class HeadlessAWTException {
+
+    public static void main (String[] args) {
+        AWTException e = new AWTException("aa");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessBasicStroke.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that BasicStroke constructors and get-methods do not
+ *          throw exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBasicStroke
+ */
+
+
+public class HeadlessBasicStroke {
+    public static void main (String[] args) {
+        BasicStroke bs;
+
+        // Constructors without exceptions
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT,
+                    BasicStroke.JOIN_BEVEL, 3, null, -1);
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 3,
+                    new float[]{(float) 2.0, (float) 3.0}, 0);
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 3,
+                    new float[]{(float) 2.0, (float) 3.0}, 1);
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, (float) 3);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, (float) 3);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, (float) 3);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 3);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND, 3);
+
+        bs = new BasicStroke(1, BasicStroke.JOIN_ROUND, BasicStroke.CAP_SQUARE, 3);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
+
+        bs = new BasicStroke(1, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND);
+
+        bs = new BasicStroke(1, BasicStroke.JOIN_ROUND, BasicStroke.CAP_SQUARE);
+
+        bs = new BasicStroke((float) 0.1);
+
+        bs = new BasicStroke((float) 0.9);
+
+        bs = new BasicStroke(4);
+
+        bs = new BasicStroke(10);
+
+        bs = new BasicStroke(20);
+
+        bs = new BasicStroke(100);
+
+        bs = new BasicStroke();
+
+        // Constructors with exceptions
+        boolean exceptions = false;
+        try {
+            bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, (float) 0.2);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException when expected");
+
+        exceptions = false;
+        try {
+            bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, (float) 0.2);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException when expected");
+
+        exceptions = false;
+        try {
+            bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, (float) 0.2);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException when expected");
+
+        exceptions = false;
+        try {
+            bs = new BasicStroke(1, 5678, 92039, 3);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException when expected");
+
+        exceptions = false;
+        try {
+            bs = new BasicStroke(1, 5678, 92039);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException when expected");
+
+        exceptions = false;
+        try {
+            bs = new BasicStroke((float) -0.9);
+        } catch (IllegalArgumentException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw IllegalArgumentException when expected");
+
+        // Create stroke shape
+        bs = new BasicStroke(20);
+        bs.createStrokedShape(new Rectangle(10, 10, 10, 10));
+
+        // Get-methods
+        bs = new BasicStroke(100);
+        bs.getLineWidth();
+        bs.getEndCap();
+        bs.getLineJoin();
+        bs.getMiterLimit();
+        bs.getDashArray();
+        bs.getDashPhase();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessBorderLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check BorderLayout constructors and methods working in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBorderLayout
+ */
+
+public class HeadlessBorderLayout {
+    public static void main (String[] args) {
+        BorderLayout bl;
+        bl = new BorderLayout();
+        bl = new BorderLayout(10, 10);
+        bl.getHgap();
+        bl.setHgap(10);
+        bl.getVgap();
+        bl.setVgap(10);
+
+        bl = new BorderLayout();
+        bl.setVgap(10);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.AFTER_LAST_LINE);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.AFTER_LINE_ENDS);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.BEFORE_FIRST_LINE);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.BEFORE_LINE_BEGINS);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.PAGE_START);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.PAGE_END);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.LINE_START);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.LINE_END);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.CENTER);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.EAST);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.NORTH);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.SOUTH);
+        bl.addLayoutComponent(new Component(){}, BorderLayout.WEST);
+
+        Component cb = new Component(){};
+        bl.addLayoutComponent(cb, BorderLayout.WEST);
+        bl.removeLayoutComponent(cb);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessCardLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check whether CardLayout constructor and methods do not throw exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCardLayout
+ */
+
+public class HeadlessCardLayout {
+
+    public static void main(String args[]) {
+        CardLayout cl;
+        cl = new CardLayout();
+        cl = new CardLayout(10, 10);
+        cl.getHgap();
+        cl.setHgap(10);
+        cl.getVgap();
+        cl.setVgap(10);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessCheckboxGroup.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that CheckboxGroup constructor and toString() method do not throw
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCheckboxGroup
+ */
+
+public class HeadlessCheckboxGroup {
+    public static void main(String args[]) {
+        CheckboxGroup cbg = new CheckboxGroup();
+        cbg.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessCheckboxMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that CheckboxMenuItem constructors throw HeadlessException
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCheckboxMenuItem
+ */
+
+public class HeadlessCheckboxMenuItem {
+
+    public static void main(String args[]) {
+        CheckboxMenuItem c;
+
+        boolean exceptions = false;
+        try {
+            c = new CheckboxMenuItem();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            c = new CheckboxMenuItem("Choices...");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            c = new CheckboxMenuItem("Choices...", true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+        exceptions = false;
+        try {
+            c = new CheckboxMenuItem("Choices...", false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("Constructor did not throw HeadlessException");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessComponentOrientation.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that ComponentOrientation methods do not throw exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessComponentOrientation
+ */
+
+public class HeadlessComponentOrientation {
+    public static void main(String args[]) {
+        ComponentOrientation.LEFT_TO_RIGHT.isHorizontal();
+        ComponentOrientation.RIGHT_TO_LEFT.isHorizontal();
+        ComponentOrientation.UNKNOWN.isHorizontal();
+        ComponentOrientation.LEFT_TO_RIGHT.isLeftToRight();
+        ComponentOrientation.RIGHT_TO_LEFT.isLeftToRight();
+        ComponentOrientation.UNKNOWN.isLeftToRight();
+
+        for (Locale locale : Locale.getAvailableLocales())
+            ComponentOrientation.getOrientation(locale);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessDimension.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Dimension constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDimension
+ */
+
+public class HeadlessDimension {
+    public static void main(String args[]) {
+        Dimension d;
+        d = new Dimension();
+        d = new Dimension(new Dimension());
+
+        d = new Dimension(100, 100);
+        double f = d.getWidth();
+        f = d.getHeight();
+
+        d = new Dimension();
+        d.setSize(100.0, 100.0);
+        d.setSize(100, 100);
+
+        d = new Dimension(100, 100);
+        Dimension d2 = d.getSize();
+
+        d = new Dimension(100, 100);
+        d2 = new Dimension(200, 200);
+        d.setSize(d2);
+
+        new Dimension(100, 100).equals(new Dimension(200, 200));
+
+        d.hashCode();
+        d.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessFlowLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that FlowLayout constructor and method do not throw unexpected
+  *         exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessFlowLayout
+ */
+
+public class HeadlessFlowLayout {
+
+    public static void main(String args[]) {
+        FlowLayout bs = new FlowLayout();
+        bs.getHgap();
+        bs.setHgap(10);
+        bs.getVgap();
+        bs.setVgap(10);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessMediaTracker.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that MediaTracker constructor does not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessMediaTracker
+ */
+
+public class HeadlessMediaTracker {
+    public static void main(String args[]) {
+        new MediaTracker(new Component(){});
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Headless/HeadlessPopupMenu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that PopupMenu constructors do not throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPopupMenu
+ */
+
+public class HeadlessPopupMenu {
+    public static void main(String args[]) {
+            PopupMenu pm;
+        boolean exceptions = false;
+        try {
+            pm = new PopupMenu();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            pm = new PopupMenu("Popup menu");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Insets/HeadlessInsets.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Insets constructor does not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessInsets
+ */
+
+public class HeadlessInsets {
+    public static void main(String args[]) {
+        new Insets(1, 2, 3, 4);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Menu/Headless/HeadlessMenu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that Menu constructors do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessMenu
+ */
+
+public class HeadlessMenu {
+    public static void main(String args[]) {
+        Menu m;
+        boolean exceptions = false;
+        try {
+            m = new Menu();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            m = new Menu("A Menu");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            m = new Menu("A Menu", false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            m = new Menu("A Menu", true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Menu/Headless/HeadlessMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.KeyEvent;
+
+/*
+ * @test
+ * @summary Check that MenuItem constructors do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessMenuItem
+ */
+
+public class HeadlessMenuItem {
+
+    public static void main(String args[]) {
+        MenuItem mi;
+
+        boolean exceptions = false;
+        try {
+            mi = new MenuItem();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            mi = new MenuItem("Choose me");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            MenuShortcut ms = new MenuShortcut(KeyEvent.VK_A);
+            mi = new MenuItem("Choose me", ms);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Menu/Headless/HeadlessMenuShortcut.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.MenuShortcut;
+import java.awt.event.KeyEvent;
+
+/*
+ * @test
+ * @summary Check that MenuShortcut constructors do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessMenuShortcut
+ */
+
+public class HeadlessMenuShortcut {
+    public static void main(String args[]) {
+        MenuShortcut ms;
+        ms = new MenuShortcut(KeyEvent.VK_A);
+        ms = new MenuShortcut(KeyEvent.VK_A, true);
+        ms = new MenuShortcut(KeyEvent.VK_A, false);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/MenuBar/HeadlessMenuBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that MenuBar constructor does not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessMenuBar
+ */
+
+public class HeadlessMenuBar {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        try {
+            MenuBar m = new MenuBar();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- a/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/FrameBorderCounter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -63,11 +63,6 @@
             public void run() {
                 frame = new Frame("Frame");
                 frame.setBounds(200, 200, 100, 100);
-                frame.addWindowListener(new WindowAdapter() {
-                    public void windowClosing(WindowEvent e) {
-                        System.exit(0);
-                    }
-                });
                 frame.setVisible(true);
             }
         });
--- a/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,7 @@
 import javax.swing.JFrame;
 import javax.swing.SpringLayout;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * Base class for testing overlapping of Swing and AWT component put into GlassPane.
--- a/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -76,7 +76,6 @@
             @Override
             public void windowClosing(WindowEvent event) {
                 System.err.println("User closed the window");
-                System.exit(1);
             }
         });
 
@@ -131,7 +130,7 @@
             Thread.sleep(delay * 10);
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Robot creation exception.");
         }
 
         robot.mouseMove((int) components[0].getLocationOnScreen().x + components[0].getSize().width / 2,
@@ -595,7 +594,7 @@
     public static void createDialogWithInstructions(String[] instructions) {
         dialog = new TestDialog(new Frame(), "Instructions");
         dialog.printInstructions(instructions);
-        dialog.setVisible(true);
+        //dialog.setVisible(true);
         println("Any messages for the tester will display here.");
     }
 
@@ -603,7 +602,7 @@
         dialog = new TestDialog(new Frame(), "Instructions");
         String[] defInstr = {"Instructions will appear here. ", ""};
         dialog.printInstructions(defInstr);
-        dialog.setVisible(true);
+        //dialog.setVisible(true);
         println("Any messages for the tester will display here.");
     }
 
@@ -643,7 +642,7 @@
 
         pack();
 
-        setVisible(true);
+        //setVisible(true);
     }// TestDialog()
 
     //DO NOT call this directly, go through Sysout
--- a/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JButton
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JButtonInGlassPaneOverlapping
  */
 public class JButtonInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JButton
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JButtonOverlapping
  */
 public class JButtonOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JColorChooser
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JColorChooserOverlapping
  */
 public class JColorChooserOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,8 @@
 import javax.swing.BoxLayout;
 import javax.swing.JComboBox;
 import javax.swing.JFrame;
+import test.java.awt.regtesthelpers.Util;
+
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JCombobox } component.
@@ -40,6 +42,8 @@
 @test
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JComboBoxOverlapping
  */
 public class JComboBoxOverlapping extends OverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JEditorPaneInGlassPaneOverlapping
  */
 public class JEditorPaneInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JEditorPaneOverlapping
  */
 public class JEditorPaneOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,7 @@
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test with JInternalFrame being put in GlassPane.
@@ -43,6 +44,8 @@
 @bug 6637655 6985776
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JGlassPaneInternalFrameOverlapping
  */
 public class JGlassPaneInternalFrameOverlapping extends OverlappingTestBase {
@@ -63,7 +66,7 @@
             });
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Where is internal frame?");
         }
         // run robot
         Robot robot = Util.createRobot();
--- a/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,7 @@
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test with JInternalFrame being moved in GlassPane.
@@ -44,6 +45,8 @@
 @bug 6637655 6981919
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JGlassPaneMoveOverlapping
  */
 public class JGlassPaneMoveOverlapping extends OverlappingTestBase {
@@ -70,7 +73,7 @@
             });
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Where is internal frame?");
         }
 
         // run robot
--- a/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,7 @@
 import javax.swing.JDesktopPane;
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JInternalFrame } component during move.
@@ -40,6 +41,8 @@
 @bug 6985399
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JInternalFrameMoveOverlapping
  */
 public class JInternalFrameMoveOverlapping extends OverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,6 +30,7 @@
 import javax.swing.JDesktopPane;
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JInternalFrame } component.
@@ -39,6 +40,8 @@
 @test
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JInternalFrameOverlapping
  */
 public class JInternalFrameOverlapping extends OverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JLabelInGlassPaneOverlapping
  */
 public class JLabelInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JLabelOverlapping
  */
 public class JLabelOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JListInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JList
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JListInGlassPaneOverlapping
  */
 public class JListInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JListOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JList
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JListOverlapping
  */
 public class JListOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,6 +36,7 @@
 import javax.swing.JMenuItem;
 import javax.swing.JSeparator;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JMenuBar } and {@link javax.swing.JSeparator} components.
@@ -46,6 +47,8 @@
 @test
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JMenuBarOverlapping
  */
 public class JMenuBarOverlapping extends OverlappingTestBase {
@@ -132,7 +135,7 @@
             });
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Where is separator?");
         }
         sepLoc.translate(20, 1);
         clickAndBlink(robot, sepLoc, false);
--- a/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JPanelInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JPanel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JPanelInGlassPaneOverlapping
  */
 public class JPanelInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JPanelOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JPanel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JPanelOverlapping
  */
 public class JPanelOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,7 @@
 import javax.swing.JPopupMenu;
 import javax.swing.SpringLayout;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JPopupMenu } component.
@@ -43,6 +44,8 @@
 @test
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JPopupMenuOverlapping
  */
 public class JPopupMenuOverlapping extends OverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JProgressBar
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JProgressBarInGlassPaneOverlapping
  */
 public class JProgressBarInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JProgressBarOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JProgressBar
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JProgressBarOverlapping
  */
 public class JProgressBarOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,6 +36,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JScrollBar
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JScrollBarInGlassPaneOverlapping
  */
 public class JScrollBarInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JScrollBarOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -35,6 +35,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JScrollBar
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JScrollBarOverlapping
  */
 public class JScrollBarOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JScrollPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,7 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JScrollPane } component.
@@ -41,6 +42,8 @@
 @test
 @summary Overlapping test for javax.swing.JScrollPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JScrollPaneOverlapping
  */
 public class JScrollPaneOverlapping extends OverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JSlider
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JSliderInGlassPaneOverlapping
  */
 public class JSliderInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JSliderOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JSlider
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JSliderOverlapping
  */
 public class JSliderOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JSpinnerInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -35,6 +35,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JSpinner
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JSpinnerInGlassPaneOverlapping
  */
 public class JSpinnerInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JSpinnerOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -34,6 +34,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JSpinner
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JSpinnerOverlapping
  */
 public class JSpinnerOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,6 +36,7 @@
 import javax.swing.JScrollPane;
 import javax.swing.JSplitPane;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for {@link javax.swing.JSplitPane } component.
@@ -47,6 +48,8 @@
 @bug 6986109
 @summary Overlapping test for javax.swing.JSplitPane
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JSplitPaneOverlapping
  */
 public class JSplitPaneOverlapping extends OverlappingTestBase {
@@ -99,7 +102,7 @@
             });
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Where is splitter?");
         }
         // run robot
         Robot robot = Util.createRobot();
--- a/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JTableInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -35,6 +35,8 @@
 @test
 @summary Simple Overlapping test for JTable
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JTableInGlassPaneOverlapping
  */
 public class JTableInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JTableOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
 @test
 @summary Simple Overlapping test for JTable
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JTableOverlapping
  */
 public class JTableOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JTextAreaInGlassPaneOverlapping
  */
 public class JTextAreaInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JTextAreaOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JTextAreaOverlapping
  */
 public class JTextAreaOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JTextFieldInGlassPaneOverlapping
  */
 public class JTextFieldInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JLabel
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JTextFieldOverlapping
  */
 public class JTextFieldOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -32,6 +32,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JToggleButton
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JToggleButtonInGlassPaneOverlapping
  */
 public class JToggleButtonInGlassPaneOverlapping extends GlassPaneOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
 @test
 @summary Simple Overlapping test for javax.swing.JToggleButton
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main JToggleButtonOverlapping
  */
 public class JToggleButtonOverlapping extends SimpleOverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java	Wed Jul 09 10:42:37 2014 -0700
@@ -29,6 +29,7 @@
 import javax.swing.JFrame;
 import javax.swing.SpringLayout;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test.
@@ -40,6 +41,8 @@
 @bug 6777370
 @summary Issues when resizing the JFrame with HW components
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main MixingFrameResizing
  */
 public class MixingFrameResizing extends OverlappingTestBase {
@@ -77,7 +80,7 @@
             });
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Where is frame?");
         }
         Robot robot = Util.createRobot();
         robot.setAutoDelay(ROBOT_DELAY/2);
--- a/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,6 +26,7 @@
 import java.awt.event.InputEvent;
 import javax.swing.*;
 import java.io.*;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for Panel and JPanel behavior during resizing.
@@ -36,6 +37,8 @@
 @bug 6786219
 @summary Issues when resizing the frame after mixing of heavy weight & light weight components
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @build FrameBorderCounter
 @run main MixingPanelsResizing
  */
@@ -365,7 +368,7 @@
     public static void createDialogWithInstructions(String[] instructions) {
         dialog = new TestDialog(new Frame(), "Instructions");
         dialog.printInstructions(instructions);
-        dialog.setVisible(true);
+        //dialog.setVisible(true);
         println("Any messages for the tester will display here.");
     }
 
@@ -373,7 +376,7 @@
         dialog = new TestDialog(new Frame(), "Instructions");
         String[] defInstr = {"Instructions will appear here. ", ""};
         dialog.printInstructions(defInstr);
-        dialog.setVisible(true);
+        //dialog.setVisible(true);
         println("Any messages for the tester will display here.");
     }
 
@@ -413,7 +416,7 @@
 
         pack();
 
-        setVisible(true);
+        //setVisible(true);
     }// TestDialog()
 
     //DO NOT call this directly, go through Sysout
--- a/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -33,6 +33,7 @@
 import java.awt.event.MouseEvent;
 import javax.swing.JButton;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for opaque Swing components.
@@ -44,6 +45,8 @@
 @test
 @bug 6776743
 @summary Opaque overlapping test for each AWT component
+@library ../../regtesthelpers
+@build Util
 @run main OpaqueOverlapping
  */
 public class OpaqueOverlapping extends OverlappingTestBase {
--- a/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,8 @@
 @test
 @bug 6994264
 @summary Opaque overlapping test for Choice AWT component
+@library ../../regtesthelpers
+@build Util
 @run main OpaqueOverlappingChoice
  */
 public class OpaqueOverlappingChoice extends OpaqueOverlapping  {
--- a/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,6 +31,7 @@
 import javax.swing.*;
 import sun.awt.*;
 import java.io.*;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * <p>This class provides basis for AWT Mixing testing.
@@ -131,7 +132,7 @@
                 isFrameBorderCalculated = true;
             } catch (IOException e) {
                 e.printStackTrace();
-                System.exit(1);
+                throw new RuntimeException("Problem calculating a native border size");
             }
         }
         return borderShift;
--- a/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java	Wed Jul 09 10:42:37 2014 -0700
@@ -24,6 +24,7 @@
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * Base class for testing overlapping of Swing and AWT component put into one frame.
--- a/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java	Wed Jul 09 10:42:37 2014 -0700
@@ -37,6 +37,7 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
 
 /**
  * AWT/Swing overlapping test for viewport
@@ -49,6 +50,8 @@
 @bug 6778882
 @summary Viewport overlapping test for each AWT component
 @author sergey.grinev@oracle.com: area=awt.mixing
+@library ../../regtesthelpers
+@build Util
 @run main ViewportOverlapping
  */
 public class ViewportOverlapping extends OverlappingTestBase {
@@ -116,7 +119,7 @@
             });
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Problem preparing test GUI.");
         }
         // run robot
         Robot robot = Util.createRobot();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogFileTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047179 8044429
+ * @summary Check whether a FileDialog blocks an application modality excluded Dialog
+ *          (it shouldn't). Checks also whether setting a parent dialog to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestWindow
+ * @run main ApplicationExcludeDialogFileTest
+ */
+
+public class ApplicationExcludeDialogFileTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeDialogTest test = new ExcludeDialogTest(
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+                ExcludeDialogTest.DialogToShow.FILE_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPageSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a pageDialog blocks an application modality excluded Dialog
+ *          (it shouldn't). Checks also whether setting a parent dialog to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestWindow
+ * @run main ApplicationExcludeDialogPageSetupTest
+ */
+
+public class ApplicationExcludeDialogPageSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeDialogTest test = new ExcludeDialogTest(
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+                ExcludeDialogTest.DialogToShow.PAGE_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeDialogPrintSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a printDialog blocks an application modality excluded Dialog
+ *          (it shouldn't). Checks also whether setting a parent dialog to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestWindow
+ * @run main ApplicationExcludeDialogPrintSetupTest
+ */
+
+public class ApplicationExcludeDialogPrintSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeDialogTest test = new ExcludeDialogTest(
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+                ExcludeDialogTest.DialogToShow.PRINT_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFrameFileTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047179 8044429
+ * @summary Check whether a FileDialog blocks an application modality excluded Frame
+ *          (it shouldn't). Checks also whether setting a parent frame to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ApplicationExcludeFrameFileTest
+ */
+
+public class ApplicationExcludeFrameFileTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeFrameTest test = new ExcludeFrameTest(
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+                ExcludeFrameTest.DialogToShow.FILE_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePageSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a pageDialog blocks an application modality excluded Frame
+ *          (it shouldn't). Checks also whether setting a parent frame to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ApplicationExcludeFramePageSetupTest
+ */
+
+public class ApplicationExcludeFramePageSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeFrameTest test = new ExcludeFrameTest(
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+                ExcludeFrameTest.DialogToShow.PAGE_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ApplicationExcludeFramePrintSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a printDialog blocks an application modality excluded Frame
+ *          (it shouldn't). Checks also whether setting a parent frame to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ApplicationExcludeFramePrintSetupTest
+ */
+
+public class ApplicationExcludeFramePrintSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeFrameTest test = new ExcludeFrameTest(
+                Dialog.ModalExclusionType.APPLICATION_EXCLUDE,
+                ExcludeFrameTest.DialogToShow.PRINT_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ExcludeDialogTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.print.*;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+public class ExcludeDialogTest implements AWTEventListener {
+
+    class ParentDialog extends TestDialog {
+
+        public ParentDialog() {
+            super((Frame) null);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) {
+                window.setVisible(true);
+            }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Dialog dialog) {
+            super(dialog);
+        }
+
+        @Override
+        public void doOpenAction() {
+
+            switch (childDialogType) {
+                case PRINT_SETUP:
+                    PrinterJob.getPrinterJob().printDialog();
+                    break;
+                case PAGE_SETUP:
+                    PrinterJob.getPrinterJob().pageDialog(new PageFormat());
+                    break;
+                case FILE_DIALOG:
+                    fileDialog = new FileDialog((Dialog) null);
+                    fileDialog.setLocation(20, 200);
+                    fileDialog.setVisible(true);
+                    break;
+            }
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Dialog parent) {
+            super(parent);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+    }
+
+    private TestWindow window;
+    private TestDialog dialog;
+    private ParentDialog parent;
+    private FileDialog fileDialog;
+
+    private static final int delay = 1000;
+
+    private final ExtendedRobot robot;
+
+    private boolean windowAppeared = false;
+    private final Object windowLock;
+
+    private final Dialog.ModalExclusionType exclusionType;
+
+    public enum DialogToShow {PAGE_SETUP, PRINT_SETUP, FILE_DIALOG};
+    private DialogToShow childDialogType;
+    private String type;
+
+    @Override
+    public void eventDispatched(AWTEvent event) {
+        if (event.getID() == WindowEvent.WINDOW_OPENED) {
+            windowAppeared = true;
+            synchronized (windowLock) {
+                windowLock.notifyAll();
+            }
+        }
+    }
+
+    ExcludeDialogTest(Dialog.ModalExclusionType exclType,
+                      DialogToShow dialogType) throws Exception {
+        exclusionType = exclType;
+        childDialogType = dialogType;
+
+        type = "File";
+        if (dialogType == DialogToShow.PAGE_SETUP) {
+            type = "Page setup";
+        } else if (dialogType == DialogToShow.PRINT_SETUP) {
+            type = "Print setup";
+        }
+
+        robot = new ExtendedRobot();
+        windowLock = new Object();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+    private void createGUI() {
+        parent = new ParentDialog();
+        parent.setLocation(20, 20);
+        parent.setModalExclusionType(exclusionType);
+        dialog = new CustomDialog(parent);
+        dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
+        dialog.setLocation(220, 20);
+        window = new CustomWindow(parent);
+        window.setLocation(420, 20);
+        Toolkit.getDefaultToolkit().addAWTEventListener(
+            ExcludeDialogTest.this, AWTEvent.WINDOW_EVENT_MASK);
+        parent.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if (parent != null) { parent.dispose(); }
+        if (window != null) { window.dispose(); }
+        if (fileDialog != null) {
+            fileDialog.dispose();
+        } else {
+            robot.type(KeyEvent.VK_ESCAPE);
+        }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        parent.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        window.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        dialog.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        if (! windowAppeared) {
+            synchronized (windowLock) {
+                try {
+                    windowLock.wait(10 * delay);
+                } catch (InterruptedException e) {}
+            }
+        }
+
+        assertTrue(windowAppeared, type + " dialog didn't appear");
+
+        parent.toFront();
+        robot.waitForIdle(delay);
+
+        String excl = "";
+        if (exclusionType == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) {
+            excl = "Application";
+        } else if (exclusionType == Dialog.ModalExclusionType.TOOLKIT_EXCLUDE) {
+            excl = "Toolkit";
+        }
+
+        parent.checkUnblockedDialog(robot, excl + " modal " + type +
+                " dialog should not block this modal excluded Dialog");
+        dialog.checkUnblockedDialog(robot, excl + " modal " + type +
+                " dialog should not block this modal excluded app. modal Dialog");
+        window.checkUnblockedWindow(robot, excl + " modal " + type +
+                " dialog should not block this modal excluded Window");
+
+        robot.waitForIdle();
+        closeAll();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ExcludeFrameTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.print.*;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+public class ExcludeFrameTest implements AWTEventListener {
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (window != null) {
+                window.setVisible(true);
+            }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame frame) {
+            super(frame);
+        }
+
+        @Override
+        public void doOpenAction() {
+            switch (childDialogType) {
+                case PRINT_SETUP:
+                    PrinterJob.getPrinterJob().printDialog();
+                    break;
+                case PAGE_SETUP:
+                    PrinterJob.getPrinterJob().pageDialog(new PageFormat());
+                    break;
+                case FILE_DIALOG:
+                    fileDialog = new FileDialog((Frame) null);
+                    fileDialog.setLocation(20, 200);
+                    fileDialog.setVisible(true);
+                    break;
+            }
+        }
+    }
+
+    class CustomWindow extends TestWindow {
+
+        public CustomWindow(Frame frame) {
+            super(frame);
+        }
+
+        @Override
+        public void doOpenAction() {
+            if (dialog != null) {
+                dialog.setVisible(true);
+            }
+        }
+    }
+
+    private TestDialog dialog;
+    private TestFrame  frame;
+    private TestWindow window;
+    private FileDialog fileDialog;
+
+    private boolean windowAppeared = false;
+    private final Object windowLock;
+
+    private static final int delay = 1000;
+    private final ExtendedRobot robot;
+
+    private final Dialog.ModalExclusionType exclusionType;
+
+    public enum DialogToShow {PAGE_SETUP, PRINT_SETUP, FILE_DIALOG};
+    private final DialogToShow childDialogType;
+    private String type;
+
+    public ExcludeFrameTest(Dialog.ModalExclusionType exclType,
+                            DialogToShow dialogType) throws Exception {
+        exclusionType = exclType;
+        childDialogType = dialogType;
+
+        type = "File";
+        if (dialogType == DialogToShow.PAGE_SETUP) {
+            type = "Page setup";
+        } else if (dialogType == DialogToShow.PRINT_SETUP) {
+            type = "Print setup";
+        }
+
+        windowLock = new Object();
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait( this::createGUI );
+    }
+
+    @Override
+    public void eventDispatched(AWTEvent event) {
+        if (event.getID() == WindowEvent.WINDOW_OPENED) {
+            windowAppeared = true;
+            synchronized (windowLock) {
+                windowLock.notifyAll();
+            }
+        }
+    }
+
+    private void createGUI() {
+        frame = new CustomFrame();
+        frame.setLocation(20, 20);
+        frame.setModalExclusionType(exclusionType);
+        dialog = new CustomDialog(frame);
+        dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
+        dialog.setLocation(220, 20);
+        window = new CustomWindow(frame);
+        window.setLocation(420, 20);
+        Toolkit.getDefaultToolkit().addAWTEventListener(
+                ExcludeFrameTest.this, AWTEvent.WINDOW_EVENT_MASK);
+        frame.setVisible(true);
+    }
+
+    private void closeAll() {
+        if (dialog != null) { dialog.dispose(); }
+        if (frame  != null) { frame.dispose();  }
+        if (window != null) { window.dispose(); }
+        if (fileDialog != null) {
+            fileDialog.dispose();
+        } else {
+            robot.type(KeyEvent.VK_ESCAPE);
+        }
+    }
+
+    public void doTest() throws Exception {
+
+        robot.waitForIdle(delay);
+
+        frame.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        window.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        dialog.clickOpenButton(robot);
+        robot.waitForIdle(delay);
+
+        if (! windowAppeared) {
+            synchronized (windowLock) {
+                try {
+                    windowLock.wait(10 * delay);
+                } catch (InterruptedException e) {}
+            }
+        }
+
+        assertTrue(windowAppeared, type + " dialog didn't appear");
+
+        frame.toFront();
+        robot.waitForIdle(delay);
+
+        String excl = "";
+        if (exclusionType == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) {
+            excl = "Application";
+        } else if (exclusionType == Dialog.ModalExclusionType.TOOLKIT_EXCLUDE) {
+            excl = "Toolkit";
+        }
+
+        frame.checkUnblockedFrame(robot, excl + " modal " + type +
+                " dialog should not block this modal excluded Frame");
+        dialog.checkUnblockedDialog(robot, excl + " modal " + type +
+                " dialog should not block this modal excluded app. modal Dialog");
+        window.checkUnblockedWindow(robot, excl + " modal " + type +
+                " dialog should not block this modal excluded Window");
+
+        robot.waitForIdle();
+        closeAll();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogFileTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047179 8044429
+ * @summary Check whether a FileDialog blocks a toolkit modality excluded Dialog
+ *          (it shouldn't). Checks also whether setting a parent dialog to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ToolkitExcludeDialogFileTest
+ */
+
+public class ToolkitExcludeDialogFileTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeDialogTest test = new ExcludeDialogTest(
+                Dialog.ModalExclusionType.TOOLKIT_EXCLUDE,
+                ExcludeDialogTest.DialogToShow.FILE_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPageSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a pageDialog blocks a toolkit modality excluded Dialog
+ *          (it shouldn't). Checks also whether setting a parent dialog to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ToolkitExcludeDialogPageSetupTest
+ */
+
+public class ToolkitExcludeDialogPageSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeDialogTest test = new ExcludeDialogTest(
+                Dialog.ModalExclusionType.TOOLKIT_EXCLUDE,
+                ExcludeDialogTest.DialogToShow.PAGE_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeDialogPrintSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a printDialog blocks a toolkit modality excluded Dialog
+ *          (it shouldn't). Checks also whether setting a parent dialog to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ToolkitExcludeDialogPrintSetupTest
+ */
+
+public class ToolkitExcludeDialogPrintSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeDialogTest test = new ExcludeDialogTest(
+                Dialog.ModalExclusionType.TOOLKIT_EXCLUDE,
+                ExcludeDialogTest.DialogToShow.PRINT_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFrameFileTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 8047179 8044429
+ * @summary Check whether a FileDialog blocks a toolkit modality excluded Frame
+ *          (it shouldn't). Checks also whether setting a parent frame to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ToolkitExcludeFrameFileTest
+ */
+
+public class ToolkitExcludeFrameFileTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeFrameTest test = new ExcludeFrameTest(
+                Dialog.ModalExclusionType.TOOLKIT_EXCLUDE,
+                ExcludeFrameTest.DialogToShow.FILE_DIALOG);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePageSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a pageDialog blocks a toolkit modality excluded Frame
+ *          (it shouldn't). Checks also whether setting a parent frame to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ToolkitExcludeFramePageSetupTest
+ */
+
+public class ToolkitExcludeFramePageSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeFrameTest test = new ExcludeFrameTest(
+                Dialog.ModalExclusionType.TOOLKIT_EXCLUDE,
+                ExcludeFrameTest.DialogToShow.PAGE_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePrintSetupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dialog;
+
+/*
+ * @test
+ * @bug 7125054 8044429
+ * @summary Check whether a printDialog blocks a toolkit modality excluded Frame
+ *          (it shouldn't). Checks also whether setting a parent frame to be
+ *          modality excluded excludes its children from being blocked too.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main ToolkitExcludeFramePrintSetupTest
+ */
+
+public class ToolkitExcludeFramePrintSetupTest {
+
+    public static void main(String[] args) throws Exception {
+        ExcludeFrameTest test = new ExcludeFrameTest(
+                Dialog.ModalExclusionType.TOOLKIT_EXCLUDE,
+                ExcludeFrameTest.DialogToShow.PRINT_SETUP);
+        test.doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/helpers/Flag.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Component;
+import java.awt.IllegalComponentStateException;
+
+public class Flag {
+
+    public static final int ATTEMPTS = 50;
+
+    private volatile boolean flag;
+    private final Object monitor = new Object();
+    private final long delay;
+
+    public Flag() {
+        this.delay = 500;
+    }
+
+    public void reset() {
+        flag = false;
+    }
+
+    public void flagTriggered() {
+        synchronized (monitor) {
+            flag = true;
+            monitor.notifyAll();
+        }
+    }
+
+    public boolean flag() {
+        return flag;
+    }
+
+    public void waitForFlagTriggered() throws InterruptedException {
+        waitForFlagTriggered(delay, ATTEMPTS);
+    }
+
+    public void waitForFlagTriggered(int attempts) throws InterruptedException {
+        waitForFlagTriggered(delay, attempts);
+    }
+
+    public void waitForFlagTriggered(long delay) throws InterruptedException {
+        waitForFlagTriggered(delay, ATTEMPTS);
+    }
+
+    private void waitForFlagTriggered(long delay, int attempts) throws InterruptedException {
+        int a = 0;
+        synchronized (monitor) {
+            while (!flag && (a++ < attempts)) {
+                monitor.wait(delay);
+            }
+        }
+    }
+
+    public static void waitTillShown(final Component comp) throws InterruptedException {
+        while (true) {
+            try {
+                Thread.sleep(100);
+                comp.getLocationOnScreen();
+                break;
+            } catch (IllegalComponentStateException e) {}
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/helpers/TestDialog.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.awt.event.*;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+
+public class TestDialog extends Dialog implements ActionListener,
+    FocusListener, WindowFocusListener, WindowListener {
+
+    public Button closeButton, openButton, dummyButton;
+
+    public Flag closeClicked, openClicked, dummyClicked;
+    public Flag closeGained,  openGained,  dummyGained;
+    public Flag closeLost,    openLost,    dummyLost;
+    public Flag focusGained, focusLost;
+    public Flag activated;
+
+    public Panel topPanel;
+
+    public static int delay = 500;
+    public static int keyDelay = 100;
+
+    public TestDialog(Frame frame) {
+        super(frame);
+        initializeGUI();
+    }
+
+    public TestDialog(Dialog dialog) {
+        super(dialog);
+        initializeGUI();
+    }
+
+    public void resetStatus() {
+        activated.reset();
+        focusGained.reset();
+        closeGained.reset();
+        openGained.reset();
+        closeClicked.reset();
+        openClicked.reset();
+    }
+
+    private void initFlags() {
+        closeClicked = new Flag();
+        openClicked  = new Flag();
+        dummyClicked = new Flag();
+        closeGained  = new Flag();
+        openGained   = new Flag();
+        dummyGained  = new Flag();
+        closeLost    = new Flag();
+        openLost     = new Flag();
+        dummyLost    = new Flag();
+        focusGained  = new Flag();
+        focusLost    = new Flag();
+        activated    = new Flag();
+    }
+
+    private void initializeGUI() {
+
+        initFlags();
+        this.setTitle("Dialog");
+
+        this.addWindowFocusListener(this);
+        this.addWindowListener(this);
+
+        this.setLayout(new GridLayout(3, 1));
+
+        topPanel = new Panel();
+        topPanel.setFocusable(false);
+        this.add(topPanel);
+
+        Panel p = new Panel();
+        p.setLayout(new GridLayout(1, 3));
+
+        closeButton = new Button("Close");
+        closeButton.addActionListener(this);
+        closeButton.addFocusListener(this);
+
+        openButton = new Button("Open");
+        openButton.addActionListener(this);
+        openButton.addFocusListener(this);
+
+        dummyButton = new Button("Dummy");
+        dummyButton.addActionListener(this);
+        dummyButton.addFocusListener(this);
+
+        p.add(closeButton);
+        p.add(openButton);
+        p.add(dummyButton);
+
+        this.add(p);
+
+        Panel bottomPanel = new Panel();
+        bottomPanel.setFocusable(false);
+        this.add(bottomPanel);
+
+        setSize(150, 150);
+    }
+
+    public void doOpenAction()  {}
+    public void doCloseAction() {}
+    public void doDummyAction() {}
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeClicked.flagTriggered();
+            doCloseAction();
+        } else if (openButton.equals(event.getSource())) {
+            openClicked.flagTriggered();
+            doOpenAction();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyClicked.flagTriggered();
+            doDummyAction();
+        }
+    }
+
+    @Override
+    public void focusGained(FocusEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeGained.flagTriggered();
+        } else if (openButton.equals(event.getSource())) {
+            openGained.flagTriggered();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyGained.flagTriggered();
+        }
+    }
+
+    @Override
+    public void focusLost(FocusEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeLost.flagTriggered();
+        } else if (openButton.equals(event.getSource())) {
+            openLost.flagTriggered();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyLost.flagTriggered();
+        }
+    }
+
+    @Override
+    public void windowGainedFocus(WindowEvent event) {
+        focusGained.flagTriggered();
+    }
+
+    @Override
+    public void windowLostFocus(WindowEvent event) {
+        focusLost.flagTriggered();
+    }
+
+    @Override
+    public void windowActivated(WindowEvent e) {
+        activated.flagTriggered();
+    }
+
+    @Override
+    public void windowClosed(WindowEvent e) {
+    }
+
+    @Override
+    public void windowClosing(WindowEvent e) {
+        assertTrue(false, "user closed window");
+    }
+
+    @Override
+    public void windowDeactivated(WindowEvent e) {}
+    @Override
+    public void windowDeiconified(WindowEvent e) {}
+    @Override
+    public void windowIconified(WindowEvent e) {}
+    @Override
+    public void windowOpened(WindowEvent e) {}
+
+    public void clickButton(Button b, ExtendedRobot robot) {
+
+        try {
+            Flag.waitTillShown(b);
+        } catch (InterruptedException e) {}
+
+        if ((closeButton.equals(b) || openButton.equals(b) ||
+            dummyButton.equals(b)) && robot != null) {
+            robot.mouseMove((int) b.getLocationOnScreen().x + b.getSize().width / 2,
+                            (int) b.getLocationOnScreen().y + b.getSize().height / 2);
+            robot.delay(delay);
+            robot.click();
+            robot.delay(delay);
+        }
+    }
+
+    public void clickOpenButton(ExtendedRobot robot) throws Exception {
+        openClicked.reset();
+        clickButton(openButton, robot);
+
+        openClicked.waitForFlagTriggered();
+        assertTrue(openClicked.flag(),
+            "clicking the dialog Open button did not trigger an action");
+    }
+
+    public void clickCloseButton(ExtendedRobot robot) throws Exception {
+        closeClicked.reset();
+        clickButton(closeButton, robot);
+
+        closeClicked.waitForFlagTriggered();
+        assertTrue(closeClicked.flag(),
+            "clicking the dialog Close button did not trigger an action");
+    }
+
+    public void clickDummyButton(ExtendedRobot robot) throws Exception {
+        clickDummyButton(robot, Flag.ATTEMPTS);
+    }
+
+    public void clickDummyButton(ExtendedRobot robot, int attempts) throws Exception {
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyClicked.waitForFlagTriggered(attempts);
+        assertTrue(dummyClicked.flag(),
+            "clicking the dialog Dummy button did not trigger an action");
+    }
+
+    private void clickInside(ExtendedRobot robot) throws Exception {
+
+        try {
+            Flag.waitTillShown(topPanel);
+        } catch (InterruptedException e) {}
+
+        if (robot != null) {
+            robot.mouseMove((int) topPanel.getLocationOnScreen().x + topPanel.getSize().width / 2,
+                            (int) topPanel.getLocationOnScreen().y + topPanel.getSize().height / 2);
+            robot.delay(delay);
+            robot.click();
+            robot.delay(delay);
+        }
+    }
+
+    public void transferFocusToDialog(ExtendedRobot robot,
+                                      String message,
+                                      Button b) throws Exception {
+        focusGained.reset();
+        clickInside(robot);
+        focusGained.waitForFlagTriggered();
+        assertTrue(focusGained.flag(),
+            "clicking inside the Dialog did not make it focused. " + message);
+
+        robot.waitForIdle(delay);
+        if (b != null) {
+            assertTrue(b.hasFocus(), "button " + b.getLabel() +
+                " did not gain focus when Dialog brought to top");
+        }
+    }
+
+    public void transferFocusToBlockedDialog(ExtendedRobot robot,
+                                             String message,
+                                             Button b) throws Exception {
+        focusGained.reset();
+        clickInside(robot);
+        robot.waitForIdle(delay);
+
+        assertFalse(focusGained.flag(),
+            "clicking inside a blocked Dialog made it focused. " + message);
+
+        robot.waitForIdle(delay);
+        if (b != null) {
+            assertFalse(b.hasFocus(),
+                "button " + b.getLabel() + " present in a blocked dialog gained focus");
+        }
+    }
+
+    public void checkBlockedDialog(ExtendedRobot robot,
+                                   String message) throws Exception {
+        dummyGained.reset();
+        dummyClicked.reset();
+        focusGained.reset();
+
+        clickButton(dummyButton, robot);
+
+        robot.waitForIdle(delay);
+
+        assertFalse(dummyClicked.flag(),
+            "DummyButton on blocked Dialog triggered action when clicked. " + message);
+
+        assertFalse(dummyGained.flag(),
+            "DummyButton on blocked Dialog gained focus when clicked. " + message);
+
+        assertFalse(focusGained.flag(),
+            "A blocked Dialog gained focus when component clicked. " + message);
+    }
+
+    public void checkUnblockedDialog(ExtendedRobot robot,
+                                     String message) throws Exception {
+        dummyGained.reset();
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyGained.waitForFlagTriggered();
+        assertTrue(dummyGained.flag(),
+            "DummyButton on Dialog did not gain focus when clicked. " + message);
+
+        dummyClicked.waitForFlagTriggered();
+        assertTrue(dummyClicked.flag(),
+            "DummyButton on Dialog did not trigger action when clicked. " + message);
+
+        closeGained.reset();
+        robot.type(KeyEvent.VK_TAB);
+
+        closeGained.waitForFlagTriggered();
+        assertTrue(closeGained.flag(),
+            "Tab navigation on Dialog did not happen properly. First " +
+            "button did not gain focus. " + message);
+    }
+
+    public void checkCloseButtonFocusGained() {
+        checkCloseButtonFocusGained(Flag.ATTEMPTS);
+    }
+
+    public void checkCloseButtonFocusGained(int attempts) {
+        try {
+            closeGained.waitForFlagTriggered(attempts);
+        } catch (InterruptedException e) {}
+        assertTrue(closeGained.flag(),
+            "dialog Close button did not gain focus");
+    }
+
+    public void checkOpenButtonFocusGained() {
+        try {
+            openGained.waitForFlagTriggered();
+        } catch (InterruptedException e) {}
+        assertTrue(openGained.flag(),
+            "dialog Open button did not gain focus");
+    }
+
+    public void checkOpenButtonFocusLost() {
+        checkOpenButtonFocusLost(Flag.ATTEMPTS);
+    }
+
+    public void checkOpenButtonFocusLost(int attempts) {
+        try {
+            openLost.waitForFlagTriggered(attempts);
+        } catch (InterruptedException e) {}
+        assertTrue(openLost.flag(),
+            "dialog Open button did not lose focus");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/helpers/TestFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+
+public class TestFrame extends Frame implements ActionListener,
+    FocusListener, WindowFocusListener, WindowListener {
+
+    public Button closeButton, openButton, dummyButton;
+
+    public Flag closeClicked, openClicked, dummyClicked;
+    public Flag closeGained,  openGained,  dummyGained;
+    public Flag closeLost,    openLost,    dummyLost;
+    public Flag focusGained, focusLost;
+    public Flag activated;
+
+    public Panel topPanel;
+
+    public static int delay = 500;
+    public static int keyDelay = 100;
+
+    public TestFrame() {
+        super();
+        initializeGUI();
+    }
+
+    private void initFlags() {
+        closeClicked = new Flag();
+        openClicked  = new Flag();
+        dummyClicked = new Flag();
+        closeGained  = new Flag();
+        openGained   = new Flag();
+        dummyGained  = new Flag();
+        closeLost    = new Flag();
+        openLost     = new Flag();
+        dummyLost    = new Flag();
+        focusGained  = new Flag();
+        focusLost    = new Flag();
+        activated    = new Flag();
+    }
+
+    public void resetStatus() {
+        activated.reset();
+        focusGained.reset();
+        closeGained.reset();
+        openGained.reset();
+        closeClicked.reset();
+        openClicked.reset();
+    }
+
+    private void initializeGUI() {
+
+        initFlags();
+        this.setTitle("Frame");
+
+        this.addWindowFocusListener(this);
+        this.addWindowListener(this);
+
+        this.setLayout(new GridLayout(3, 1));
+
+        topPanel = new Panel();
+        topPanel.setFocusable(false);
+        this.add(topPanel);
+
+        Panel p = new Panel();
+        p.setLayout(new GridLayout(1, 3));
+
+        closeButton = new Button("Close");
+        closeButton.addActionListener(this);
+        closeButton.addFocusListener(this);
+
+        openButton = new Button("Open");
+        openButton.addActionListener(this);
+        openButton.addFocusListener(this);
+
+        dummyButton = new Button("Dummy");
+        dummyButton.addActionListener(this);
+        dummyButton.addFocusListener(this);
+
+        p.add(closeButton);
+        p.add(openButton);
+        p.add(dummyButton);
+
+        this.add(p);
+
+        Panel bottomPanel = new Panel();
+        bottomPanel.setFocusable(false);
+        this.add(bottomPanel);
+
+        setSize(150, 150);
+    }
+
+    public void doOpenAction()  {}
+    public void doCloseAction() {}
+    public void doDummyAction() {}
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeClicked.flagTriggered();
+            doCloseAction();
+        } else if (openButton.equals(event.getSource())) {
+            openClicked.flagTriggered();
+            doOpenAction();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyClicked.flagTriggered();
+            doDummyAction();
+        }
+    }
+
+    @Override
+    public void focusGained(FocusEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeGained.flagTriggered();
+        } else if (openButton.equals(event.getSource())) {
+            openGained.flagTriggered();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyGained.flagTriggered();
+        }
+    }
+
+    @Override
+    public void focusLost(FocusEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeLost.flagTriggered();
+        } else if (openButton.equals(event.getSource())) {
+            openLost.flagTriggered();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyLost.flagTriggered();
+        }
+    }
+
+    @Override
+    public void windowGainedFocus(WindowEvent event) {
+        focusGained.flagTriggered();
+    }
+
+    @Override
+    public void windowLostFocus(WindowEvent event) {
+        focusLost.flagTriggered();
+    }
+
+    @Override
+    public void windowActivated(WindowEvent e) {
+        activated.flagTriggered();
+    }
+
+    @Override
+    public void windowClosed(WindowEvent e) {}
+
+    @Override
+    public void windowClosing(WindowEvent e) {
+        assertTrue(false, "user closed window");
+    }
+
+    @Override
+    public void windowDeactivated(WindowEvent e) {}
+    @Override
+    public void windowDeiconified(WindowEvent e) {}
+    @Override
+    public void windowIconified(WindowEvent e) {}
+    @Override
+    public void windowOpened(WindowEvent e) {}
+
+    public void clickButton(Button b, ExtendedRobot robot) {
+        try {
+            Flag.waitTillShown(b);
+        } catch (InterruptedException e) {}
+
+        if ((closeButton.equals(b) || openButton.equals(b) ||
+            dummyButton.equals(b)) && robot != null) {
+            robot.mouseMove((int) b.getLocationOnScreen().x + b.getSize().width / 2,
+                            (int) b.getLocationOnScreen().y + b.getSize().height / 2);
+            robot.delay(delay);
+            robot.click();
+            robot.delay(delay);
+        }
+    }
+
+    public void clickOpenButton(ExtendedRobot robot) throws Exception {
+        openClicked.reset();
+        clickButton(openButton, robot);
+        openClicked.waitForFlagTriggered();
+        assertTrue(openClicked.flag(),
+            "clicking the frame Open button did not trigger an action");
+    }
+
+    public void clickCloseButton(ExtendedRobot robot) throws Exception {
+        closeClicked.reset();
+        clickButton(closeButton, robot);
+        closeClicked.waitForFlagTriggered();
+        assertTrue(closeClicked.flag(),
+            "clicking the frame Close button did not trigger an action");
+    }
+
+    public void clickDummyButton(ExtendedRobot robot) throws Exception {
+        clickDummyButton(robot, Flag.ATTEMPTS);
+    }
+
+    public void clickDummyButton(ExtendedRobot robot,
+                                 int amountOfAttempts) throws Exception {
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyClicked.waitForFlagTriggered();
+        assertTrue(dummyClicked.flag(),
+            "clicking the frame Dummy button did not trigger an action");
+    }
+
+    public void clickInside(ExtendedRobot robot) throws Exception {
+        try {
+            Flag.waitTillShown(topPanel);
+        } catch (InterruptedException e) {}
+
+        if (robot != null) {
+            robot.mouseMove((int) topPanel.getLocationOnScreen().x + topPanel.getSize().width / 2,
+                            (int) topPanel.getLocationOnScreen().y + topPanel.getSize().height / 2);
+            robot.delay(delay);
+            robot.click();
+            robot.delay(delay);
+        }
+    }
+
+    public void transferFocusToFrame(ExtendedRobot robot,
+                                     String message,
+                                     Button b) throws Exception {
+        focusGained.reset();
+        clickInside(robot);
+
+        focusGained.waitForFlagTriggered();
+        assertTrue(focusGained.flag(),
+            "Clicking inside the Frame did not make it focused. " + message);
+
+        if (b != null) {
+            assertTrue(b.hasFocus(), "Button " + b.getLabel() +
+                " did not gain focus when Frame brought to top");
+        }
+    }
+
+    public void transferFocusToBlockedFrame(ExtendedRobot robot,
+                                            String message,
+                                            Button b) throws Exception {
+        focusGained.reset();
+        clickInside(robot);
+
+        robot.waitForIdle(delay);
+
+        assertFalse(focusGained.flag(),
+            "Clicking inside a blocked Frame made it focused. " + message);
+
+        robot.waitForIdle(delay);
+        if (b != null) {
+            assertFalse(b.hasFocus(), "Button " + b.getLabel() +
+                " present in a blocked frame gained focus");
+        }
+    }
+
+    public void checkBlockedFrame(
+            ExtendedRobot robot, String message) throws Exception {
+
+        dummyGained.reset();
+        dummyClicked.reset();
+        focusGained.reset();
+
+        clickButton(dummyButton, robot);
+
+        robot.waitForIdle(delay);
+
+        assertFalse(dummyClicked.flag(),
+            "DummyButton on blocked Window triggered action when clicked. " + message);
+
+        assertFalse(dummyGained.flag(),
+            "DummyButton on blocked Window gained focus when clicked. " + message);
+
+        assertFalse(focusGained.flag(),
+            "A blocked Dialog gained focus when component clicked. " + message);
+    }
+
+    public void checkUnblockedFrame(ExtendedRobot robot,
+                                    String message) throws Exception {
+        dummyGained.reset();
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyGained.waitForFlagTriggered();
+        assertTrue(dummyGained.flag(),
+            "DummyButton on Frame did not gain focus on clicking. " + message);
+
+        dummyClicked.waitForFlagTriggered();
+        assertTrue(dummyClicked.flag(),
+            "DummyButton on Frame did not trigger action on clicking. " + message);
+
+        closeGained.reset();
+        robot.type(KeyEvent.VK_TAB);
+
+        closeGained.waitForFlagTriggered();
+        assertTrue(closeGained.flag(),
+            "FAIL: Tab navigation did not happen properly on Frame. First " +
+            "button did not gain focus on tab press. " + message);
+    }
+
+    public void checkCloseButtonFocusGained() {
+        checkCloseButtonFocusGained(Flag.ATTEMPTS);
+    }
+
+    public void checkCloseButtonFocusGained(int attempts) {
+
+        try {
+            closeGained.waitForFlagTriggered(attempts);
+        } catch (InterruptedException e) {}
+
+        if (closeGained.flag()) {
+            Component focusOwner =
+                KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+            assertTrue(closeButton.equals(focusOwner),
+                "close button gained focus, but it is not the current focus owner");
+        } else {
+            assertTrue(false, "frame Close button did not gain focus");
+        }
+    }
+
+    public void checkOpenButtonFocusGained() {
+        try {
+            openGained.waitForFlagTriggered();
+        } catch (InterruptedException e) {}
+
+        if (openGained.flag()) {
+            Component focusOwner =
+                KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+            assertTrue(openButton.equals(focusOwner),
+                "open button gained focus, but it is not the current focus owner");
+        } else {
+            assertTrue(false, "frame Open button did not gain focus");
+        }
+    }
+
+    public void checkOpenButtonFocusLost() {
+        try {
+            openLost.waitForFlagTriggered();
+        } catch (InterruptedException e) {}
+
+        assertTrue(openLost.flag(), "frame Open button did not lose focus");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/helpers/TestWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+
+import static jdk.testlibrary.Asserts.*;
+
+
+
+public class TestWindow extends Window implements ActionListener,
+    FocusListener, WindowFocusListener, WindowListener {
+
+    public Button closeButton, openButton, dummyButton;
+
+    public Flag closeClicked, openClicked, dummyClicked;
+    public Flag closeGained,  openGained,  dummyGained;
+    public Flag closeLost,    openLost,    dummyLost;
+    public Flag focusGained, focusLost;
+    public Flag activated;
+
+    public static int delay = 500;
+    public static int keyDelay = 100;
+
+    public TestWindow(Frame owner) {
+        super(owner);
+        initializeGUI();
+    }
+
+    public TestWindow(Window window) {
+        super(window);
+        initializeGUI();
+    }
+
+    public void resetStatus() {
+        activated.reset();
+        focusGained.reset();
+        closeGained.reset();
+        openGained.reset();
+        closeClicked.reset();
+        openClicked.reset();
+    }
+
+    private void initFlags() {
+        closeClicked = new Flag();
+        openClicked  = new Flag();
+        dummyClicked = new Flag();
+        closeGained  = new Flag();
+        openGained   = new Flag();
+        dummyGained  = new Flag();
+        closeLost    = new Flag();
+        openLost     = new Flag();
+        dummyLost    = new Flag();
+        focusGained  = new Flag();
+        focusLost    = new Flag();
+        activated    = new Flag();
+    }
+
+    private void initializeGUI() {
+
+        initFlags();
+
+        this.addWindowFocusListener(this);
+        this.addWindowListener(this);
+
+        this.setLayout(new GridLayout(3, 1));
+
+        Panel topPanel;
+        topPanel = new Panel();
+        topPanel.setFocusable(false);
+        this.add(topPanel);
+
+        Panel p = new Panel();
+        p.setLayout(new GridLayout(1, 3));
+
+        closeButton = new Button("Close");
+        closeButton.addActionListener(this);
+        closeButton.addFocusListener(this);
+
+        openButton = new Button("Open");
+        openButton.addActionListener(this);
+        openButton.addFocusListener(this);
+
+        dummyButton = new Button("Dummy");
+        dummyButton.addActionListener(this);
+        dummyButton.addFocusListener(this);
+
+        p.add(closeButton);
+        p.add(openButton);
+        p.add(dummyButton);
+
+        this.add(p);
+
+        Panel bottomPanel = new Panel();
+        bottomPanel.setFocusable(false);
+        this.add(bottomPanel);
+
+        setSize(150, 150);
+    }
+
+    public void doOpenAction()  {}
+    public void doCloseAction() {}
+    public void doDummyAction() {}
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeClicked.flagTriggered();
+            doCloseAction();
+        } else if (openButton.equals(event.getSource())) {
+            openClicked.flagTriggered();
+            doOpenAction();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyClicked.flagTriggered();
+            doDummyAction();
+        }
+    }
+
+    @Override
+    public void focusGained(FocusEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeGained.flagTriggered();
+        } else if (openButton.equals(event.getSource())) {
+            openGained.flagTriggered();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyGained.flagTriggered();
+        }
+    }
+
+    @Override
+    public void focusLost(FocusEvent event) {
+        if (closeButton.equals(event.getSource())) {
+            closeLost.flagTriggered();
+        } else if (openButton.equals(event.getSource())) {
+            openLost.flagTriggered();
+        } else if (dummyButton.equals(event.getSource())) {
+            dummyLost.flagTriggered();
+        }
+    }
+
+    @Override
+    public void windowGainedFocus(WindowEvent event) {
+        focusGained.flagTriggered();
+    }
+
+    @Override
+    public void windowLostFocus(WindowEvent event) {
+        focusLost.flagTriggered();
+    }
+
+    @Override
+    public void windowActivated(WindowEvent e) {
+        activated.flagTriggered();
+    }
+
+    @Override
+    public void windowClosed(WindowEvent e) {}
+
+    @Override
+    public void windowClosing(WindowEvent e) {
+        System.err.println("User closed window!");
+        System.exit(1);
+    }
+
+    @Override
+    public void windowDeactivated(WindowEvent e) {}
+
+    @Override
+    public void windowDeiconified(WindowEvent e) {}
+
+    @Override
+    public void windowIconified(WindowEvent e) {}
+
+    @Override
+    public void windowOpened(WindowEvent e) {}
+
+    public void clickButton(Button b, ExtendedRobot robot) {
+        try {
+            Flag.waitTillShown(b);
+        } catch (InterruptedException e) {}
+
+        if ((closeButton.equals(b) || openButton.equals(b) ||
+            dummyButton.equals(b)) && robot != null) {
+            robot.mouseMove((int) b.getLocationOnScreen().x + b.getSize().width / 2,
+                            (int) b.getLocationOnScreen().y + b.getSize().height / 2);
+            robot.delay(delay);
+            robot.click();
+            robot.delay(delay);
+        }
+    }
+
+    public void clickOpenButton(ExtendedRobot robot) throws Exception {
+        openClicked.reset();
+        clickButton(openButton, robot);
+
+        openClicked.waitForFlagTriggered();
+        assertTrue(openClicked.flag(),
+            "clicking the window Open button did not trigger an action");
+    }
+
+    public void clickCloseButton(ExtendedRobot robot) throws Exception {
+        closeClicked.reset();
+        clickButton(closeButton, robot);
+
+        closeClicked.waitForFlagTriggered();
+        assertTrue(closeClicked.flag(),
+            "clicking the window Close button did not trigger an action");
+    }
+
+    public void clickDummyButton(ExtendedRobot robot) throws Exception {
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyClicked.waitForFlagTriggered();
+        assertTrue(dummyClicked.flag(),
+            "clicking the window Dummy button did not trigger an action");
+    }
+
+    public void checkBlockedWindow(ExtendedRobot robot,
+                                   String message) throws Exception {
+        dummyGained.reset();
+        dummyClicked.reset();
+        focusGained.reset();
+
+        clickButton(dummyButton, robot);
+
+        robot.waitForIdle(delay);
+
+        assertFalse(dummyClicked.flag(),
+            "DummyButton on blocked Window triggered action when clicked. " + message);
+
+        assertFalse(dummyGained.flag(),
+            "DummyButton on blocked Window gained focus when clicked. " + message);
+
+        assertFalse(focusGained.flag(),
+            "A blocked window gained focus when component clicked. " + message);
+    }
+
+    public void checkUnblockedWindowWithBlockedParent(
+            ExtendedRobot robot, String message) throws Exception {
+
+        dummyGained.reset();
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyClicked.waitForFlagTriggered();
+
+        assertTrue(dummyClicked.flag(),
+            "DummyButton on Window did not trigger action when clicked. " + message);
+
+        assertFalse(dummyGained.flag(),
+            "DummyButton on Window gained focus " +
+            "when its parent is non-focusable. "  + message);
+    }
+
+    public void checkUnblockedWindow(ExtendedRobot robot,
+                                     String message) throws Exception {
+        dummyGained.reset();
+        dummyClicked.reset();
+        clickButton(dummyButton, robot);
+
+        dummyGained.waitForFlagTriggered();
+        assertTrue(dummyGained.flag(),
+            "DummyButton on Window did not gain focus on clicking. " + message);
+
+        assertTrue(dummyClicked.flag(),
+            "DummyButton on Window did not trigger action on clicking. " + message);
+
+        closeGained.reset();
+        robot.type(KeyEvent.VK_TAB);
+
+        closeGained.waitForFlagTriggered();
+        assertTrue(closeGained.flag(),
+            "Tab navigation did not happen properly on Window. First " +
+            "button did not gain focus on tab press. " + message);
+    }
+
+    public void checkCloseButtonFocusGained() {
+        checkCloseButtonFocusGained(Flag.ATTEMPTS);
+    }
+
+    public void checkCloseButtonFocusGained(int attempts) {
+        try {
+            closeGained.waitForFlagTriggered(attempts);
+        } catch (InterruptedException e) {}
+        assertTrue(closeGained.flag(),
+            "window Close button did not gain focus");
+    }
+
+    public void checkOpenButtonFocusGained() {
+        checkOpenButtonFocusGained(Flag.ATTEMPTS);
+    }
+
+    public void checkOpenButtonFocusGained(int attempts) {
+        try {
+            openGained.waitForFlagTriggered(attempts);
+        } catch (InterruptedException e) {}
+        assertTrue(openGained.flag(),
+            "window Open button did not gain focus");
+    }
+
+    public void checkOpenButtonFocusLost() {
+        checkOpenButtonFocusLost(Flag.ATTEMPTS);
+    }
+
+    public void checkOpenButtonFocusLost(int attempts) {
+        try {
+            openLost.waitForFlagTriggered(attempts);
+        } catch (InterruptedException e) {}
+        assertTrue(openLost.flag(),
+            "window Open button did not lose focus");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TextField/SelectionInvisibleTest/SelectionInvisibleTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8036110
+ * @author Alexander Scherbatiy
+ * @summary In TextField can only select text visible or to the left
+ * @run main SelectionInvisibleTest
+ */
+
+public class SelectionInvisibleTest {
+
+    private static final String TEXT = "One Two Three Four Five Six Seven Eight Nine ";
+    private static final String LAST_WORD = "Ten";
+
+    public static void main(String[] args) throws Exception {
+
+        Frame frame = new Frame();
+        frame.setSize(300, 200);
+        TextField textField = new TextField(TEXT + LAST_WORD, 30);
+        Panel panel = new Panel(new FlowLayout());
+        panel.add(textField);
+        frame.add(panel);
+        frame.setVisible(true);
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        Point point = textField.getLocationOnScreen();
+        int x = point.x + textField.getWidth() / 2;
+        int y = point.y + textField.getHeight() / 2;
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        toolkit.realSync();
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        int N = 10;
+        int dx = textField.getWidth() / N;
+        for (int i = 0; i < N; i++) {
+            x += dx;
+            robot.mouseMove(x, y);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        toolkit.realSync();
+
+        if (!textField.getSelectedText().endsWith(LAST_WORD)) {
+            throw new RuntimeException("Last word is not selected!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Toolkit/Headless/HeadlessToolkit.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.event.AWTEventListener;
+import java.awt.event.KeyEvent;
+import java.awt.im.InputMethodHighlight;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.MemoryImageSource;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+/*
+ * @test
+ * @summary Check that Toolkit methods do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessToolkit
+ */
+
+public class HeadlessToolkit {
+
+    class awtEventListener implements AWTEventListener {
+        public void eventDispatched(AWTEvent e) {
+        }
+    }
+
+    class propChangeListener implements PropertyChangeListener {
+        public void propertyChange(PropertyChangeEvent e) {
+        }
+    }
+
+    public static void main(String args[]) throws IOException {
+        new HeadlessToolkit().doTest();
+    }
+
+    void doTest() throws IOException {
+        Toolkit tk = Toolkit.getDefaultToolkit();
+        String[] fl = tk.getFontList();
+        FontMetrics fm = tk.getFontMetrics(new Font(fl[0], Font.PLAIN, 10));
+        tk.sync();
+        tk.beep();
+
+        boolean exceptions = false;
+        try {
+            Dimension d = tk.getScreenSize();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            int res = tk.getScreenResolution();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+            Graphics2D gd = ge.createGraphics(new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR));
+            GraphicsConfiguration gc = gd.getDeviceConfiguration();
+            Insets res = tk.getScreenInsets(gc);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            ColorModel cm = tk.getColorModel();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            int km = tk.getMenuShortcutKeyMask();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            boolean state = tk.getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            boolean state = tk.getLockingKeyState(KeyEvent.VK_NUM_LOCK);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            boolean state = tk.getLockingKeyState(KeyEvent.VK_KANA_LOCK);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            boolean state = tk.getLockingKeyState(KeyEvent.VK_SCROLL_LOCK);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_CAPS_LOCK, true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_NUM_LOCK, true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_KANA_LOCK, true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_SCROLL_LOCK, true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_CAPS_LOCK, false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_NUM_LOCK, false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_KANA_LOCK, false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            tk.setLockingKeyState(KeyEvent.VK_SCROLL_LOCK, false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            Dimension d = tk.getBestCursorSize(32, 32);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            int n = tk.getMaximumCursorColors();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        EventQueue eq = tk.getSystemEventQueue();
+        awtEventListener el = new awtEventListener();
+        tk.addAWTEventListener(el, 0xffffffff);
+        tk.removeAWTEventListener(el);
+
+        File[] images = new File[]{new File("image.png"), new File("image.jpg"), new File("image.gif")};
+        Image im;
+        for (File image : images) {
+            String path = image.getCanonicalPath();
+            ImageIO.write(new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB), path.substring(path.lastIndexOf('.')+1), image);
+
+            im = tk.getImage(image.getAbsolutePath());
+            im.flush();
+
+            FileInputStream fis = new FileInputStream(image);
+            byte[] b = new byte[(int) (image.length())];
+            fis.read(b);
+            fis.close();
+            im = tk.createImage(b);
+            im.flush();
+
+            im = tk.createImage(image.getAbsolutePath());
+            im.flush();
+
+        }
+
+        im = tk.getImage(new URL("http://openjdk.java.net/images/openjdk.png"));
+        im.flush();
+
+        im = tk.createImage(new URL("http://openjdk.java.net/images/openjdk.png"));
+        im.flush();
+
+        MemoryImageSource mis;
+        int pixels[] = new int[50 * 50];
+        int index = 0;
+        for (int y = 0; y < 50; y++) {
+            int red = (y * 255) / 49;
+            for (int x = 0; x < 50; x++) {
+                int blue = (x * 255) / 49;
+                pixels[index++] = (255 << 24) | (red << 16) | blue;
+            }
+        }
+        mis = new MemoryImageSource(50, 50, pixels, 0, 50);
+        im = tk.createImage(mis);
+        im.flush();
+
+
+        exceptions = false;
+        try {
+            Cursor cur = tk.createCustomCursor(new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB), new Point(0, 0), "Stop");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            Cursor cur = tk.createCustomCursor(new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB), new Point(0, 0), "Stop");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            InputMethodHighlight imh = new InputMethodHighlight(true, InputMethodHighlight.CONVERTED_TEXT);
+            Map m = tk.mapInputMethodHighlight(imh);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            Clipboard cl = tk.getSystemClipboard();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/ActionCommand/ActionCommand.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check the return value of the getActionCommand method
+ *          of the ActionEvent triggered when TrayIcon is double clicked
+ *          (single clicked, on Mac)
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main ActionCommand
+ */
+
+public class ActionCommand {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    boolean actionPerformed = false;
+    Object actionLock = new Object();
+    String actionCommand = null;
+    static boolean isMacOS = false;
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+                System.err.println("Test can fail if the icon hides to a tray icons pool " +
+                        "in Windows 7, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true to " +
+                        "avoid this problem. Or change behavior only for Java SE tray icon " +
+                        "and rerun test.");
+            } else  if (System.getProperty("os.name").toLowerCase().startsWith("mac")){
+                isMacOS = true;
+            }
+
+            new ActionCommand().doTest();
+        }
+    }
+
+    void doTest() throws Exception {
+        robot = new ExtendedRobot();
+
+        EventQueue.invokeAndWait(() -> {
+            SystemTray tray = SystemTray.getSystemTray();
+            icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Sample Icon");
+            icon.addActionListener((event) -> {
+                actionPerformed = true;
+                actionCommand = event.getActionCommand();
+                synchronized (actionLock) {
+                    try {
+                        actionLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            });
+
+            if (icon.getActionCommand() != null)
+                throw new RuntimeException("FAIL: getActionCommand did not return null " +
+                        "when no action command set " + icon.getActionCommand());
+
+            icon.setActionCommand("Sample Command");
+
+            if (! "Sample Command".equals(icon.getActionCommand()))
+                throw new RuntimeException("FAIL: getActionCommand did not return the correct value. " +
+                        icon.getActionCommand() + " Expected: Sample Command");
+
+            try {
+                tray.add(icon);
+            } catch (AWTException e) {
+                throw new RuntimeException(e);
+            }
+        });
+
+        robot.waitForIdle();
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle(2000);
+        actionPerformed = false;
+        SystemTrayIconHelper.doubleClick(robot);
+
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed) {
+            throw new RuntimeException("FAIL: ActionEvent not triggered when TrayIcon is "+(isMacOS? "" : "double ")+"clicked");
+        } else if (! "Sample Command".equals(actionCommand)) {
+            throw new RuntimeException("FAIL: ActionEvent.getActionCommand did not return the correct " +
+                    "value. Returned: " + actionCommand + " ; Expected: Sample Command");
+        }
+
+        EventQueue.invokeAndWait(() -> {
+            icon.setActionCommand(null);
+            if (icon.getActionCommand() != null) {
+                throw new RuntimeException("FAIL: ActionCommand set to null. getActionCommand did " +
+                        "not return null " + icon.getActionCommand());
+            }
+        });
+
+        robot.mouseMove(0, 0);
+        robot.waitForIdle();
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+
+        actionPerformed = false;
+        actionCommand = null;
+        SystemTrayIconHelper.doubleClick(robot);
+
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed) {
+            throw new RuntimeException("FAIL: ActionEvent not triggered when ActionCommand set to " +
+                    "null and then TrayIcon is "+(isMacOS? "" : "double ")+ "clicked");
+        } else if (actionCommand != null) {
+            throw new RuntimeException("FAIL: ActionEvent.getActionCommand did not return null " +
+                    "when ActionCommand is set to null " + actionCommand);
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/ActionEventMask/ActionEventMask.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check if ActionEvent triggered when a TrayIcon is double
+ *          (single, on Mac) clicked is visible by an AWTEventListener
+ *          added to the Toolkit. It also checks if all listeners are
+ *          triggered when multiple AWTEventListeners and ActionListeners
+ *          are added.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main ActionEventMask
+ */
+
+public class ActionEventMask {
+
+    private Image image;
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    boolean actionPerformed = false;
+    boolean listenersInvoked = false;
+    Object actionLock = new Object();
+    Object listenersLock = new Object();
+    static boolean isMacOS = false;
+    static final int clickDelay = 50;
+
+    ActionListener[] listeners;
+    boolean[] listenerStatus;
+
+    Object lLock = new Object();
+    boolean doTest, listenerAdded;
+    Button b1;
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                               "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("mac")) {
+                isMacOS = true;
+            }
+            new ActionEventMask().doTest();
+        }
+    }
+
+    public ActionEventMask() throws Exception {
+        EventQueue.invokeAndWait(this::initializeGUI);
+    }
+
+    void initializeGUI() {
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Sample Icon");
+
+        Toolkit.getDefaultToolkit().addAWTEventListener(event -> {
+            if (doTest) {
+                System.out.println("ActionListener AWTEventListener");
+                if (! icon.equals(event.getSource())) {
+                    throw new RuntimeException("FAIL: ActionEvent not triggered for icon");
+                }
+                actionPerformed = true;
+                synchronized (actionLock) {
+                    try {
+                        actionLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }, AWTEvent.ACTION_EVENT_MASK);
+
+        try {
+            tray.add(icon);
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+
+        listeners = new ActionListener[3];
+        listenerStatus = new boolean[3];
+        for (int i = 0; i < listeners.length; i++) {
+            final int index = i;
+            listeners[i] = event -> {
+                listenerStatus[index] = true;
+                System.out.println("ActionListener listeners[" + index + "]");
+                for (int j = 0; j < listenerStatus.length; j++) {
+                    if (! listenerStatus[j]) {
+                        break;
+                    }
+                    listenersInvoked = true;
+                    synchronized (listenersLock) {
+                        try {
+                            listenersLock.notifyAll();
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+            };
+        }
+
+        Frame frame = new Frame("Test frame");
+        b1 = new Button("Add ActionListener");
+        b1.addActionListener(event -> {
+            for (int i = 0; i < listeners.length; i++) {
+                icon.addActionListener(listeners[i]);
+            }
+            listenerAdded = true;
+            synchronized (lLock) {
+                try {
+                    lLock.notifyAll();
+                } catch (Exception e) {
+                }
+            }
+        });
+        frame.setLayout(new FlowLayout());
+        frame.add(b1);
+        frame.setSize(200, 200);
+        frame.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent event) {
+                System.err.println("User closed the window");
+                System.exit(1);
+            }
+        });
+        frame.setVisible(true);
+    }
+
+    private void doTest() throws Exception {
+
+        robot = new ExtendedRobot();
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+
+        actionPerformed = false;
+        doTest = true;
+
+        if(isMacOS) {
+            robot.click(InputEvent.BUTTON3_MASK);
+        }else{
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(clickDelay);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            robot.delay(clickDelay);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(clickDelay);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        }
+
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed)
+            throw new RuntimeException("FAIL: AWTEventListener not notified when TrayIcon " +
+                               "is "+(isMacOS ? "" :"double ")+ "clicked");
+
+        doTest = false;
+        listenerAdded = false;
+        robot.mouseMove(b1.getLocationOnScreen().x + b1.getSize().width / 2,
+                        b1.getLocationOnScreen().y + b1.getSize().height / 2);
+        robot.waitForIdle();
+        robot.click();
+
+        if (! listenerAdded) {
+            synchronized (lLock) {
+                try {
+                    lLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! listenerAdded)
+            throw new RuntimeException("FAIL: ActionListener could not be added at runtime. " +
+                               "b1 did not trigger ActionEvent");
+
+        doTest = true;
+        actionPerformed = false;
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+
+        if(isMacOS) {
+            robot.click(InputEvent.BUTTON3_MASK);
+        }else{
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(clickDelay);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            robot.delay(clickDelay);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(clickDelay);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        }
+
+        if (! listenersInvoked) {
+            synchronized (listenersLock) {
+                try {
+                    listenersLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! listenersInvoked) {
+            System.err.println("FAIL: All the listeners not invoked!");
+            for (int i = 0; i < listenerStatus.length; i++)
+                throw new RuntimeException("Listener[" + i + "] invoked: " + listenerStatus[i]);
+        }
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed)
+            throw new RuntimeException("FAIL: AWTEventListener not notified when TrayIcon " +
+                    "is "+(isMacOS? "" : "double ")+ "clicked. A set of listeners were added after it");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/GetTrayIconsTest/GetTrayIcons.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check the getTrayIcons method of the SystemTray
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main GetTrayIcons
+ */
+
+public class GetTrayIcons {
+
+    Image image;
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported())
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        else
+            new GetTrayIcons().doTest();
+    }
+
+    GetTrayIcons() {
+        image = new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
+    }
+
+    void doTest() throws Exception {
+        SystemTray tray = SystemTray.getSystemTray();
+        TrayIcon[] icons = tray.getTrayIcons();
+        if (icons == null || icons.length > 0)
+            throw new RuntimeException("FAIL: getTrayIcons() returned incorrect " +
+                    "value when no icons are added " + icons);
+
+        TrayIcon icon = new TrayIcon(image);
+        tray.add(icon);
+
+        icons = tray.getTrayIcons();
+        if (icons == null || icons.length != 1)
+            throw new RuntimeException("FAIL: getTrayIcons() returned incorrect value " +
+                    "when one icon present " + icons);
+
+        icon = new TrayIcon(image);
+        tray.add(icon);
+
+        icons = tray.getTrayIcons();
+        if (icons == null || icons.length != 2)
+            throw new RuntimeException("FAIL: getTrayIcons() returned incorrect value " +
+                    "when two icons present " + icons);
+
+        icons = tray.getTrayIcons();
+        if (icons != null) {
+            for (int i = 0; i < icons.length; i++) {
+                tray.remove(icons[i]);
+            }
+
+            TrayIcon[] newList = tray.getTrayIcons();
+
+            if (newList == null || newList.length != 0)
+                throw new RuntimeException("FAIL: Incorrect value returned by getTrayIcons " +
+                        "after icons are added and then removed " + newList);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/InterJVMTest/InterJVM.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Check if TrayIcon added by a JVM is not visible
+ *          in another JVM
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../regtesthelpers/process/
+ * @build ProcessResults ProcessCommunicator
+ * @run main InterJVM
+ */
+
+import test.java.awt.regtesthelpers.process.ProcessCommunicator;
+import test.java.awt.regtesthelpers.process.ProcessResults;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+public class InterJVM {
+
+    static String NEW_JVM = "-doTest";
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (args == null || args.length == 0) {
+                new InterJVM().addTrayIcon();
+            } else {
+                if (args.length == 1 && NEW_JVM.equals(args[0]))
+                    new InterJVM().doTest();
+            }
+        }
+    }
+
+    void doTest() throws Exception {
+        SystemTray tray = SystemTray.getSystemTray();
+        try {
+            TrayIcon[] icons = tray.getTrayIcons();
+            System.out.println(icons.length);
+            if (icons == null || icons.length != 0)
+                throw new RuntimeException("FAIL: getTrayIcons() returned incorrect " +
+                        "value when two icons are added by a " +
+                        "separate JVM: " + icons.length);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    void addTrayIcon() throws Exception {
+
+        SystemTray tray = SystemTray.getSystemTray();
+        TrayIcon icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB));
+        tray.add(icon);
+
+        new Robot().delay(2000);
+
+        ProcessResults processResults =
+                ProcessCommunicator.executeChildProcess(this.getClass(), new String[]{NEW_JVM});
+
+        if (processResults.getExitValue() != 0)
+            throw new RuntimeException("\n"+processResults.getStdErr());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/ModalityTest/ModalityTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check for MouseEvents with all mouse buttons
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main ModalityTest
+ */
+public class ModalityTest {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+    Dialog d;
+
+    boolean actionPerformed = false;
+
+    private boolean dialogVisible = false;
+    private Object dialogLock = new Object();
+
+    Object actionLock = new Object();
+    Object pressLock = new Object();
+    Object releaseLock = new Object();
+    Object clickLock = new Object();
+    Object moveLock = new Object();
+    static final int clickDelay = 50;
+
+    boolean mousePressed = false;
+    boolean mouseReleased = false;
+    boolean mouseClicked = false;
+    boolean mouseMoved = false;
+
+    int[] buttonTypes = {
+        InputEvent.BUTTON1_MASK,
+        InputEvent.BUTTON2_MASK,
+        InputEvent.BUTTON3_MASK
+    };
+
+    String[] buttonNames = {
+        "BUTTON1",
+        "BUTTON2",
+        "BUTTON3"
+    };
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                               "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+                System.err.println("Test can fail if the icon hides to a tray icons pool " +
+                        "in Windows 7, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true " +
+                        "to avoid this problem. Or change behavior only for Java SE tray " +
+                        "icon and rerun test.");
+
+            new ModalityTest().doTest();
+        }
+    }
+
+    public ModalityTest() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeLater(this::initializeGUI);
+    }
+
+    void initializeGUI() {
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Sample Icon");
+        icon.addActionListener(event -> {
+            actionPerformed = true;
+            synchronized (actionLock) {
+                try {
+                    actionLock.notifyAll();
+                } catch (Exception e) {
+                }
+            }
+        });
+        icon.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent event) {
+                mousePressed = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mousePressed");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mousePressed: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (pressLock) {
+                    try {
+                        pressLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseReleased(MouseEvent event) {
+                mouseReleased = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseReleased");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseReleased: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (releaseLock) {
+                    try {
+                        releaseLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseClicked(MouseEvent event) {
+                mouseClicked = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseClicked");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseClicked: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (clickLock) {
+                    try {
+                        clickLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        icon.addMouseMotionListener(new MouseMotionAdapter() {
+            public void mouseMoved(MouseEvent event) {
+                mouseMoved = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseMoved");
+
+                if (!icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseMoved: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (moveLock) {
+                    try {
+                        moveLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        try {
+            tray.add(icon);
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+
+        d = new Dialog((Frame) null, "Modal Dialog");
+        d.setLocation(200, 200);
+        d.setSize(100, 100);
+        d.setModalityType(Dialog.ModalityType.TOOLKIT_MODAL);
+
+        dialogVisible = true;
+        synchronized (dialogLock) {
+            try {
+                dialogLock.notifyAll();
+            } catch (Exception e) {
+            }
+        }
+
+        d.setVisible(true);
+    }
+
+    void doTest() throws Exception {
+
+        if (! dialogVisible) {
+            synchronized (dialogLock) {
+                try {
+                    dialogLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+
+        if (! dialogVisible)
+            throw new RuntimeException("ERROR: TIMEOUT: The thread in EDT not yet complete");
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        if (! d.isVisible())
+            throw new RuntimeException("FAIL: The modal dialog is not yet visible");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle(2000);
+
+        SystemTrayIconHelper.doubleClick(robot);
+
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed)
+            throw new RuntimeException("FAIL: ActionEvent not triggered when TrayIcon is double clicked");
+
+        for (int i = 0; i < buttonTypes.length; i++) {
+            mousePressed = false;
+            robot.mousePress(buttonTypes[i]);
+
+            if (! mousePressed) {
+                synchronized (pressLock) {
+                    try {
+                        pressLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mousePressed)
+                if (! SystemTrayIconHelper.skip(buttonTypes[i]) )
+                    throw new RuntimeException("FAIL: mousePressed not triggered when " +
+                            buttonNames[i] + " pressed");
+
+            mouseReleased = false;
+            mouseClicked = false;
+            robot.mouseRelease(buttonTypes[i]);
+
+            if (! mouseReleased) {
+                synchronized (releaseLock) {
+                    try {
+                        releaseLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseReleased)
+                throw new RuntimeException("FAIL: mouseReleased not triggered when " +
+                        buttonNames[i] + " released");
+
+            if (! mouseClicked) {
+                synchronized (clickLock) {
+                    try {
+                        clickLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseClicked)
+                throw new RuntimeException("FAIL: mouseClicked not triggered when " +
+                        buttonNames[i] + " pressed & released");
+        }
+
+        mouseMoved = false;
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.glide(iconPosition.x + 100, iconPosition.y);
+
+        if (! mouseMoved)
+            if (! SystemTrayIconHelper.skip(0) )
+                throw new RuntimeException("FAIL: mouseMoved not triggered even when mouse moved over the icon");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check if MouseEvents triggered by TrayIcon are visible
+ *          by an AWTEventListener added to the Toolkit. It also
+ *          checks if all listeners are triggered when AWTEventListeners
+ *          and MouseListeners are added.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main MouseEventMaskTest
+ */
+
+public class MouseEventMaskTest {
+
+    TrayIcon icon;
+    Robot robot;
+    int[] buttonTypes = {
+        InputEvent.BUTTON1_MASK,
+        InputEvent.BUTTON2_MASK,
+        InputEvent.BUTTON3_MASK
+    };
+
+    String[] buttonNames = {
+        "BUTTON1",
+        "BUTTON2",
+        "BUTTON3"
+    };
+
+    boolean mouseEventTriggered = false;
+    boolean mouseMotionEventTriggered = false;
+    Object mouseEventLock = new Object();
+    Object mouseMotionEventLock = new Object();
+    boolean mouseMotionTest, mouseTest;
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+                System.err.println("Test can fail if the icon hides to a tray icons pool " +
+                        "in Windows 7, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true " +
+                        "to avoid this problem. Or change behavior only for Java SE tray " +
+                        "icon and rerun test.");
+            }
+            new MouseEventMaskTest().doTest();
+        }
+    }
+
+    public MouseEventMaskTest() throws Exception{
+        EventQueue.invokeAndWait(this::initializeGUI);
+    }
+
+    void initializeGUI() {
+
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Sample Icon");
+
+        Toolkit.getDefaultToolkit().addAWTEventListener(event -> {
+            if (mouseTest) {
+                if (! event.getSource().getClass().getName().contains("Canvas")) {
+                    if (!icon.equals(event.getSource()))
+                        throw new RuntimeException("FAIL: MouseEvent not triggered for icon " + event);
+
+                    mouseEventTriggered = true;
+                    synchronized (mouseEventLock) {
+                        try {
+                            mouseEventLock.notifyAll();
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+            }
+        }, AWTEvent.MOUSE_EVENT_MASK);
+        Toolkit.getDefaultToolkit().addAWTEventListener(event -> {
+            if (mouseMotionTest) {
+                if (! event.getSource().getClass().getName().contains("Canvas")) {
+                    if (!icon.equals(event.getSource()))
+                        throw new RuntimeException("FAIL: MouseMotionEvent not triggered for icon " + event);
+
+                    mouseMotionEventTriggered = true;
+                    synchronized (mouseMotionEventLock) {
+                        try {
+                            mouseMotionEventLock.notifyAll();
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+            }
+        }, AWTEvent.MOUSE_MOTION_EVENT_MASK);
+
+        try {
+            tray.add(icon);
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    void doTest() throws Exception {
+
+        robot = new Robot();
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+
+        for (int i = 0; i < buttonTypes.length; i++) {
+            System.out.println("Verify button "+buttonTypes[i]);
+            mouseTest = true;
+            mouseEventTriggered = false;
+            robot.mousePress(buttonTypes[i]);
+
+            if (! mouseEventTriggered) {
+                synchronized (mouseEventLock) {
+                    try {
+                        mouseEventLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseEventTriggered)
+                if (! SystemTrayIconHelper.skip(buttonTypes[i]) )
+                    throw new RuntimeException("FAIL: AWTEventListener not notified when " +
+                        buttonNames[i] + " pressed on TrayIcon");
+
+            mouseEventTriggered = false;
+            robot.mouseRelease(buttonTypes[i]);
+            if (! mouseEventTriggered) {
+                synchronized (mouseEventLock) {
+                    try {
+                        mouseEventLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            if (! mouseEventTriggered)
+                throw new RuntimeException("FAIL: AWTEventListener not notified when " +
+                        buttonNames[i] + " released on TrayIcon");
+        }
+
+        mouseMotionTest = true;
+        mouseTest = false;
+        mouseMotionEventTriggered = false;
+
+        for (int i = 0; i < 20; i++) {
+            robot.mouseMove(iconPosition.x + i, iconPosition.y);
+            robot.delay(25);
+        }
+        if (! mouseMotionEventTriggered) {
+            synchronized (mouseMotionEventLock) {
+                try {
+                    mouseMotionEventLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! mouseMotionEventTriggered)
+            if (! SystemTrayIconHelper.skip(0) )
+                throw new RuntimeException("FAIL: AWTEventListener not notified when " +
+                        "mouse moved");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @bug 7153700
+ * @summary Check for mouseMoved event for java.awt.TrayIcon
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main MouseMovedTest
+ */
+
+public class MouseMovedTest {
+    static volatile boolean moved;
+
+    public static void main(String[] args) throws Exception {
+        moved = false;
+
+        TrayIcon icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Test icon");
+        icon.addMouseMotionListener(new MouseMotionAdapter() {
+            public void mouseMoved(MouseEvent event) {
+                moved = true;
+                System.out.println("Mouse moved");
+            }
+        });
+        SystemTray.getSystemTray().add(icon);
+
+        ExtendedRobot robot = new ExtendedRobot();
+        Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
+        if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+            robot.glide(size.width / 2, size.height-15, size.width, size.height-15, 1, 3);
+        else
+            robot.glide(size.width / 2, 13, size.width, 13, 1, 3);
+        robot.mouseMove(size.width/2, size.height/2);
+
+        if (!moved)
+            throw new RuntimeException("Mouse moved action did not trigger");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/PropertyChangeListenerTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/*
+ * @test
+ * @summary Check if custom property change listener added
+ *          to system tray works correctly
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main PropertyChangeListenerTest
+ */
+
+public class PropertyChangeListenerTest implements PropertyChangeListener {
+
+    Object property;
+    Object lock = new Object();
+    boolean propertyChanged = false;
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            new PropertyChangeListenerTest().doTest();
+        }
+    }
+
+    public void propertyChange(PropertyChangeEvent event) {
+        if (! "trayIcons".equals(event.getPropertyName()))
+            throw new RuntimeException("ERROR: PropertyName not matching. Event " +
+                    "triggered for a different property\n"+
+                    "Property: " + event.getPropertyName());
+        property = event.getNewValue();
+        propertyChanged = true;
+        synchronized (lock) {
+            try {
+                lock.notifyAll();
+            } catch (Exception e) {
+            }
+        }
+    }
+
+    void doTest() throws Exception {
+        propertyChanged = false;
+        SystemTray tray = SystemTray.getSystemTray();
+
+        tray.addPropertyChangeListener(null, null);
+        tray.addPropertyChangeListener("trayIcons", null);
+        tray.addPropertyChangeListener("trayIcons", this);
+
+        BufferedImage img = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB);
+        Graphics g = img.createGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, 32, 32);
+        g.setColor(Color.RED);
+        g.fillRect(6, 6, 20, 20);
+        g.dispose();
+
+        TrayIcon icon = new TrayIcon(img);
+        if (propertyChanged)
+            throw new RuntimeException("FAIL: spurious property events triggered");
+
+        propertyChanged = false;
+        tray.add(icon);
+
+        if (! propertyChanged) {
+            synchronized (lock) {
+                try {
+                    lock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! propertyChanged) {
+            throw new RuntimeException("FAIL: property event did not get triggered when tray icon added");
+        } else {
+            if (! (property instanceof TrayIcon[])) {
+                throw new RuntimeException("FAIL: property is not TrayIcon[]. TrayIcon added.");
+            } else {
+                TrayIcon[] icons = (TrayIcon[]) property;
+                if (icons.length != 1 || ! icon.equals(icons[0])) {
+                    throw new RuntimeException("FAIL: TrayIcon[] returned by the " +
+                            "PropertyChangeEvent is incorrect. TrayIcon added.\n"+
+                            "icon[] length: " + icons.length);
+                }
+            }
+        }
+
+        propertyChanged = false;
+        tray.remove(icon);
+
+        if (! propertyChanged) {
+            synchronized (lock) {
+                try {
+                    lock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! propertyChanged) {
+            throw new RuntimeException("FAIL: property event did not get triggered when tray icon removed");
+        } else {
+            if (! (property instanceof TrayIcon[])) {
+                throw new RuntimeException("FAIL: property is not TrayIcon[]. TrayIcon removed.");
+            } else {
+                TrayIcon[] icons = (TrayIcon[]) property;
+                if (icons.length != 0) {
+                    throw new RuntimeException("FAIL: TrayIcon[] returned by the " +
+                            "PropertyChangeEvent is incorrect. TrayIcon removed.\n"+
+                            "icon[] length: " + icons.length);
+                }
+            }
+        }
+
+        tray.removePropertyChangeListener("trayIcons", null);
+        tray.removePropertyChangeListener("trayIcons", this);
+
+        propertyChanged = false;
+        tray.add(icon);
+
+        Thread.sleep(3000);
+        if (propertyChanged)
+            throw new RuntimeException("FAIL: property listener notified even after " +
+                    "removing the listener from SystemTray. TrayIcon added.");
+
+        propertyChanged = false;
+        tray.remove(icon);
+
+        Thread.sleep(3000);
+        if (propertyChanged)
+            throw new RuntimeException("FAIL: property listener notified even after " +
+                    "removing the listener from SystemTray. TrayIcon removed.");
+
+        tray.addPropertyChangeListener("someName", this);
+
+        propertyChanged = false;
+        tray.add(icon);
+
+        Thread.sleep(3000);
+        if (propertyChanged)
+            throw new RuntimeException("FAIL: property listener notified when " +
+                    "listener added for a different property. TrayIcon added.");
+
+        propertyChanged = false;
+        tray.remove(icon);
+
+        Thread.sleep(3000);
+        if (propertyChanged)
+            throw new RuntimeException("FAIL: property listener notified when " +
+                    "listener added for a different property. TrayIcon removed.");
+
+        tray.addPropertyChangeListener("trayIcons", this);
+        tray.addPropertyChangeListener("trayIcons", this);
+        PropertyChangeListener listener = event -> { };
+        tray.addPropertyChangeListener("trayIcons", listener);
+        tray.addPropertyChangeListener("sampleProp", event -> {});
+
+        if (tray.getPropertyChangeListeners("trayIcons").length != 3) {
+            throw new RuntimeException("FAIL: getPropertyChangeListeners did not return the " +
+                    "correct value for trayIcons property. Expected: 3, " +
+                    "Actual: " + tray.getPropertyChangeListeners("trayIcons").length);
+        } else if (! this.equals(tray.getPropertyChangeListeners("trayIcons")[0]) ||
+                   ! this.equals(tray.getPropertyChangeListeners("trayIcons")[1]) ||
+                   ! listener.equals(tray.getPropertyChangeListeners("trayIcons")[2])) {
+            throw new RuntimeException("FAIL: getPropertyChangeListeners did not return the " +
+                    "expected listeners\n" +
+                    "tray.getPropertyChangeListeners('trayIcons')[0] " + tray.getPropertyChangeListeners("trayIcons")[0]+"\n"+
+                    "tray.getPropertyChangeListeners('trayIcons')[1] " + tray.getPropertyChangeListeners("trayIcons")[1]+"\n"+
+                    "tray.getPropertyChangeListeners('trayIcons')[2] " + tray.getPropertyChangeListeners("trayIcons")[2]);
+        }
+
+        if (tray.getPropertyChangeListeners("sampleProp").length != 1)
+            throw new RuntimeException("FAIL: getPropertyChangeListeners did not return the " +
+                    "expected listener for 'sampleProp'");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check for MouseEvents with all mouse buttons
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../../lib/testlibrary ../../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main/othervm/policy=tray.policy -Djava.security.manager FunctionalityCheck
+ */
+
+public class FunctionalityCheck {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    boolean actionPerformed = false;
+    Object actionLock = new Object();
+    Object pressLock = new Object();
+    Object releaseLock = new Object();
+    Object clickLock = new Object();
+    Object moveLock = new Object();
+
+    String caption = "Sample Icon";
+    boolean mousePressed = false;
+    boolean mouseReleased = false;
+    boolean mouseClicked = false;
+    boolean mouseMoved = false;
+
+    static final int[] buttonTypes = {
+        InputEvent.BUTTON1_MASK,
+        InputEvent.BUTTON2_MASK,
+        InputEvent.BUTTON3_MASK
+    };
+
+    static final String[] buttonNames = {
+        "BUTTON1",
+        "BUTTON2",
+        "BUTTON3"
+    };
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                               "Marking the test passed");
+        } else {
+            new FunctionalityCheck().doTest();
+        }
+    }
+
+    FunctionalityCheck() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait(this::initializeGUI);
+    }
+
+    void initializeGUI() {
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption);
+        icon.addActionListener(event -> {
+            actionPerformed = true;
+            synchronized (actionLock) {
+                try {
+                    actionLock.notifyAll();
+                } catch (Exception e) {
+                }
+            }
+        });
+        icon.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent event) {
+                mousePressed = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mousePressed");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mousePressed: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (pressLock) {
+                    try {
+                        pressLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseReleased(MouseEvent event) {
+                mouseReleased = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseReleased");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseReleased: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (releaseLock) {
+                    try {
+                        releaseLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseClicked(MouseEvent event) {
+                mouseClicked = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseClicked");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseClicked: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (clickLock) {
+                    try {
+                        clickLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        icon.addMouseMotionListener(new MouseMotionAdapter() {
+            public void mouseMoved(MouseEvent event) {
+                mouseMoved = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseMoved");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseMoved: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (moveLock) {
+                    try {
+                        moveLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        try {
+            tray.add(icon);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private void doTest() throws Exception {
+
+
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle(2000);
+
+        SystemTrayIconHelper.doubleClick(robot);
+
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed)
+            throw new RuntimeException("FAIL: ActionEvent not triggered when TrayIcon is double clicked");
+
+        for (int i = 0; i < buttonTypes.length; i++) {
+            mousePressed = false;
+            robot.mousePress(buttonTypes[i]);
+
+            if (! mousePressed) {
+                synchronized (pressLock) {
+                    try {
+                        pressLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mousePressed)
+                if (! SystemTrayIconHelper.skip(buttonTypes[i]) )
+                    throw new RuntimeException("FAIL: mousePressed not triggered when " +
+                            buttonNames[i] + " pressed");
+
+            mouseReleased = false;
+            mouseClicked = false;
+            robot.mouseRelease(buttonTypes[i]);
+
+            if (! mouseReleased) {
+                synchronized (releaseLock) {
+                    try {
+                        releaseLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseReleased)
+                if (! SystemTrayIconHelper.skip(buttonTypes[i]) )
+                    throw new RuntimeException("FAIL: mouseReleased not triggered when " +
+                            buttonNames[i] + " released");
+
+            if (! mouseClicked) {
+                synchronized (clickLock) {
+                    try {
+                        clickLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseClicked)
+                throw new RuntimeException("FAIL: mouseClicked not triggered when " +
+                        buttonNames[i] + " pressed & released");
+        }
+
+        mouseMoved = false;
+        robot.mouseMove(iconPosition.x + 100, iconPosition.y);
+        robot.glide(iconPosition.x, iconPosition.y);
+
+        if (! mouseMoved)
+            if (! SystemTrayIconHelper.skip(0) )
+                throw new RuntimeException("FAIL: mouseMoved not triggered even when mouse moved over the icon");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/tray.policy	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,21 @@
+grant {
+  permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete, execute";
+  permission java.awt.AWTPermission "accessSystemTray";
+  permission java.awt.AWTPermission "createRobot";
+  permission java.util.PropertyPermission "resultsDir", "read";
+  permission java.util.PropertyPermission "user.home", "read";
+  permission java.util.PropertyPermission "os.name", "read";
+  permission java.awt.AWTPermission "accessEventQueue";
+  permission java.lang.RuntimePermission "setIO";
+  permission java.lang.RuntimePermission "accessDeclaredMembers";
+  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+  permission java.lang.RuntimePermission "accessClassInPackage.sun.lwawt.macosx";
+  permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.X11";
+  permission java.lang.RuntimePermission "accessClassInPackage.sun.awt";
+  permission java.lang.RuntimePermission "loadLibrary.stl";
+  permission java.util.PropertyPermission "java.home", "read";
+  permission java.util.PropertyPermission "java.class.path", "read";
+  permission java.awt.AWTPermission "readDisplayPixels";
+  permission java.awt.AWTPermission "watchMousePointer";
+};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SecurityCheck/NoPermissionTest/NoPermissionTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check for SecurityException occurrence if no permissions for system tray granted
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main/othervm/policy=tray.policy -Djava.security.manager NoPermissionTest
+ */
+
+public class NoPermissionTest {
+
+    public static void main(String[] args) {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray is not supported on this platform. Marking the test passed");
+        } else {
+
+            BufferedImage im = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
+            Graphics gr = im.createGraphics();
+            gr.setColor(Color.white);
+            gr.fillRect(0, 0, 16, 16);
+
+            try {
+                SystemTray.getSystemTray();
+                throw new RuntimeException("FAIL: SecurityException not thrown by getSystemTray method");
+            } catch (SecurityException ex) {
+                if (!ex.getMessage().matches(".+java.awt.AWTPermission.+accessSystemTray.*"))
+                    throw new RuntimeException("FAIL: Security exception thrown due to unexpected reason");
+            }
+
+            try {
+                TrayIcon icon = new TrayIcon(im, "Caption");
+                throw new RuntimeException("FAIL: SecurityException not thrown by TrayIcon constructor");
+            } catch (SecurityException ex) {
+                if (!ex.getMessage().matches(".+java.awt.AWTPermission.+accessSystemTray.*"))
+                    throw new RuntimeException("FAIL: Security exception thrown due to unexpected reason");
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SecurityCheck/PermissionTest/PermissionTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check for no Exception occurrence if permissions for system tray granted
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main/othervm/policy=tray.policy -Djava.security.manager PermissionTest
+ */
+
+public class PermissionTest {
+
+    public static void main(String[] args) {
+
+        if (!SystemTray.isSupported()) {
+            System.out.println("SystemTray is not supported on this platform. Marking the test passed");
+        } else {
+            BufferedImage im = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
+            Graphics gr = im.createGraphics();
+            gr.setColor(Color.white);
+            gr.fillRect(0, 0, 16, 16);
+
+            SystemTray.getSystemTray();
+            TrayIcon icon = new TrayIcon(im, "Caption");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SecurityCheck/PermissionTest/tray.policy	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,3 @@
+grant {
+  permission java.awt.AWTPermission "accessSystemTray";
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SystemTrayIconHelper.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,172 @@
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/*
+ * @summary This is a helper class to find the location of a system tray icon,
+ *          and skip some OS specific cases in tests.
+ * @library ../../../../../lib/testlibrary
+ * @build ExtendedRobot SystemTrayIconHelper
+ */
+public class SystemTrayIconHelper {
+
+    static Frame frame;
+
+    /**
+     * Call this method if the tray icon need to be followed in an automated manner
+     * This method will be called by automated testcases
+     */
+    static Point getTrayIconLocation(TrayIcon icon) throws Exception {
+        if (icon == null) {
+            return null;
+        }
+
+        //This is added just in case the tray's native menu is visible.
+        //It has to be hidden if visible. For that, we are showing a Frame
+        //and clicking on it - the assumption is, the menu will
+        //be closed if another window is clicked
+        ExtendedRobot robot = new ExtendedRobot();
+        try {
+           EventQueue.invokeAndWait(() -> {
+               frame = new Frame();
+               frame.setSize(100, 100);
+               frame.setVisible(true);
+           });
+            robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth() / 2,
+                    frame.getLocationOnScreen().y + frame.getHeight() / 2);
+            robot.waitForIdle();
+            robot.click();
+            EventQueue.invokeAndWait(frame::dispose);
+        } catch (Exception e) {
+            return null;
+        }
+
+        if (System.getProperty("os.name").startsWith("Win")) {
+            try {
+                // sun.awt.windows.WTrayIconPeer
+                Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+                Dimension iconSize = icon.getSize();
+
+                int width = (int) iconSize.getWidth();
+                int height = (int) iconSize.getHeight();
+
+                // Some previously created icons may not be removed
+                // from tray until mouse move on it. So we glide
+                // through the whole tray bar.
+                robot.glide((int) screenSize.getWidth(), (int) (screenSize.getHeight()-15), 0, (int) (screenSize.getHeight() - 15), 1, 2);
+
+                BufferedImage screen = robot.createScreenCapture(new Rectangle(screenSize));
+
+                for (int x = (int) (screenSize.getWidth()-width); x > 0; x--) {
+                    for (int y = (int) (screenSize.getHeight()-height); y > (screenSize.getHeight()-50); y--) {
+                        if (imagesEquals(((BufferedImage)icon.getImage()).getSubimage(0, 0, width, height), screen.getSubimage(x, y, width, height))) {
+                            return new Point(x+5, y+5);
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                return null;
+            }
+        } else if (System.getProperty("os.name").startsWith("Mac")) {
+            Point2D point2d;
+            try {
+                // sun.lwawt.macosx.CTrayIcon
+                Field f_peer = getField( java.awt.TrayIcon.class, "peer");
+
+                Object peer = f_peer.get(icon);
+                Method m_getModel = peer.getClass().getDeclaredMethod(
+                        "getModel");
+                m_getModel.setAccessible(true);
+                long model = (Long) (m_getModel.invoke(peer, new Object[]{}));
+                Method m_getLocation = peer.getClass().getDeclaredMethod(
+                        "nativeGetIconLocation", new Class[]{Long.TYPE});
+                m_getLocation.setAccessible(true);
+                point2d = (Point2D)m_getLocation.invoke(peer, new Object[]{model});
+                Point po = new Point((int)(point2d.getX()), (int)(point2d.getY()));
+                po.translate(10, -5);
+                return po;
+            }catch(Exception e) {
+                e.printStackTrace();
+                return null;
+            }
+        } else {
+            try {
+                // sun.awt.X11.XTrayIconPeer
+                Field f_peer = getField(java.awt.TrayIcon.class, "peer");
+
+                Object peer = f_peer.get(icon);
+                Method m_getLOS = peer.getClass().getDeclaredMethod(
+                        "getLocationOnScreen", new Class[]{});
+                m_getLOS.setAccessible(true);
+                Point point = (Point)m_getLOS.invoke(peer, new Object[]{});
+                point.translate(5, 5);
+                return point;
+            } catch (Exception e) {
+                e.printStackTrace();
+                return null;
+            }
+        }
+        return null;
+    }
+
+    static Field getField(final Class clz, final String fieldName) {
+        Field res = null;
+        try {
+            res = (Field)AccessController.doPrivileged((PrivilegedExceptionAction) () -> {
+                Field f = clz.getDeclaredField(fieldName);
+                f.setAccessible(true);
+                return f;
+            });
+        } catch (PrivilegedActionException ex) {
+            ex.printStackTrace();
+        }
+        return res;
+    }
+
+    static boolean imagesEquals(BufferedImage img1, BufferedImage img2) {
+        for (int x = 0; x < img1.getWidth(); x++) {
+            for (int y = 0; y < img1.getHeight(); y++) {
+                if (img1.getRGB(x, y) != img2.getRGB(x, y))
+                    return false;
+            }
+        }
+        return true;
+    }
+
+    static void doubleClick(Robot robot) {
+        if (System.getProperty("os.name").startsWith("Mac")) {
+            robot.mousePress(InputEvent.BUTTON3_MASK);
+            robot.delay(50);
+            robot.mouseRelease(InputEvent.BUTTON3_MASK);
+        } else {
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(50);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            robot.delay(50);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.delay(50);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        }
+    }
+
+    // Method for skipping some OS specific cases
+    static boolean skip(int button) {
+        if (System.getProperty("os.name").toLowerCase().startsWith("win")){
+            if (button == InputEvent.BUTTON1_MASK){
+                // See JDK-6827035
+                return true;
+            }
+        } else if (System.getProperty("os.name").toLowerCase().contains("os x")){
+            // See JDK-7153700
+            return true;
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check the getSystemTray method of the SystemTray. Checks if
+ *          a proper instance is returned in supported platforms and a proper
+ *          exception is thrown in unsupported platforms
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main/othervm -DSystemTraySupport=TRUE SystemTrayInstanceTest
+ */
+
+public class SystemTrayInstanceTest {
+
+    private static boolean supported = false;
+
+    public static void main(String[] args) throws Exception {
+        String sysTraySupport = System.getProperty("SystemTraySupport");
+        if (sysTraySupport == null)
+            throw new RuntimeException("SystemTray support status unknown!");
+
+        if ("TRUE".equals(sysTraySupport)) {
+            System.out.println("System tray is supported on the platform under test");
+            supported = true;
+        }
+
+        new SystemTrayInstanceTest().doTest();
+    }
+
+    private void doTest() throws Exception {
+        boolean flag = SystemTray.isSupported();
+        if (supported != flag)
+            throw new RuntimeException("FAIL: isSupported did not return the correct value"+
+                    (supported ?
+                            "SystemTray is supported on the platform under test" :
+                            "SystemTray is not supported on the platform under test") +
+                    "SystemTray.isSupported() method returned " + flag);
+
+        if (supported) {
+            SystemTray tray = SystemTray.getSystemTray();
+        } else {
+            try {
+                SystemTray tray = SystemTray.getSystemTray();
+            } catch (UnsupportedOperationException uoe) {
+                System.out.println("UnsupportedOperationException thrown correctly");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconAddTest/TrayIconAddTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+
+/*
+ * @test
+ * @summary Tests the add method of the SystemTray. Checks if it
+ *          throws proper exceptions in case of invalid arguments and adds the
+ *          TrayIcon correctly in case of a proper argument
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main TrayIconAddTest
+ */
+
+public class TrayIconAddTest {
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            new TrayIconAddTest().doTest();
+        }
+    }
+
+    void doTest() throws Exception {
+        SystemTray tray = SystemTray.getSystemTray();
+        try {
+            tray.add(null);
+        } catch (NullPointerException npe) {
+            System.out.println("NullPointerException thrown correctly when add(null) called");
+        }
+
+        TrayIcon icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB));
+
+        tray.add(icon);
+
+        try {
+            tray.add(icon);
+        } catch (IllegalArgumentException iae) {
+            System.out.println("IllegalArgumentException rightly thrown when tray icon is added twice");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.image.BufferedImage;
+
+
+/*
+ * @test
+ * @summary Check if MouseEvent has the proper modifiers when
+ *          TrayIcon is clicked pressing the modifier keys
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main TrayIconEventModifiersTest
+ */
+
+public class TrayIconEventModifiersTest {
+
+    Image image;
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    Object mouseLock = new Object();
+
+    String caption = "Sample Icon";
+    boolean mousePressed = false;
+    boolean mouseReleased = false;
+    boolean mouseClicked = false;
+    int modifiers, releaseModifiers, clickModifiers;
+
+    int[] buttonTypes = {
+        InputEvent.BUTTON1_MASK,
+        InputEvent.BUTTON2_MASK,
+        InputEvent.BUTTON3_MASK
+    };
+
+    String[] buttonNames = {
+        "BUTTON1",
+        "BUTTON2",
+        "BUTTON3"
+    };
+
+    int[] buttonMasks = {
+        InputEvent.BUTTON1_DOWN_MASK,
+        InputEvent.BUTTON2_DOWN_MASK,
+        InputEvent.BUTTON3_DOWN_MASK
+    };
+
+    static int[] keyTypes = {
+        KeyEvent.VK_SHIFT,
+        KeyEvent.VK_CONTROL
+    };
+
+    static String[] keyNames = {
+        "SHIFT",
+        "CONTROL"
+    };
+
+    static int[] keyMasks = {
+        KeyEvent.SHIFT_DOWN_MASK,
+        KeyEvent.CTRL_DOWN_MASK
+    };
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+                System.err.println("Test can fail if the icon hides to a tray icons pool" +
+                        "in Windows 7, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true " +
+                        "to avoid this problem. Or change behavior only for Java SE tray " +
+                        "icon and rerun test.");
+
+            System.out.println(System.getProperty("os.arch"));
+            if (System.getProperty("os.name").indexOf("Sun") != -1 &&
+                    System.getProperty("os.arch").indexOf("sparc") != -1) {
+                keyTypes = new int[]{
+                        KeyEvent.VK_SHIFT,
+                        KeyEvent.VK_CONTROL,
+                        KeyEvent.VK_META
+                };
+
+                keyNames = new String[]{
+                        "SHIFT",
+                        "CONTROL",
+                        "META"
+                };
+                keyMasks = new int[]{
+                        KeyEvent.SHIFT_DOWN_MASK,
+                        KeyEvent.CTRL_DOWN_MASK,
+                        KeyEvent.META_DOWN_MASK
+                };
+            }
+
+            new TrayIconEventModifiersTest().doTest();
+        }
+    }
+
+    public TrayIconEventModifiersTest() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait(this::initializeGUI);
+    }
+
+    private void initializeGUI() {
+
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption);
+        icon.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent event) {
+                if (!icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mousePressed: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                mousePressed = true;
+                modifiers = event.getModifiersEx();
+                System.out.println("Icon mousePressed " + modifiers);
+                synchronized (mouseLock) {
+                    try {
+                        mouseLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseReleased(MouseEvent event) {
+                if (!icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseReleased: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                mouseReleased = true;
+                releaseModifiers = event.getModifiersEx();
+                System.out.println("Icon mouseReleased " + releaseModifiers);
+                synchronized (mouseLock) {
+                    try {
+                        mouseLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseClicked(MouseEvent event) {
+                if (!icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseClicked: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                mouseClicked = true;
+                clickModifiers = event.getModifiersEx();
+                System.out.println("Icon mouseClickedd " + clickModifiers);
+                synchronized (mouseLock) {
+                    try {
+                        mouseLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        try {
+            tray.add(icon);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    void doTest() throws Exception {
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+
+        for (int i = 0; i < buttonTypes.length; i++) {
+            for (int j = 0; j < keyTypes.length; j++) {
+                mousePressed = false;
+
+                robot.keyPress(keyTypes[j]);
+                robot.mousePress(buttonTypes[i]);
+
+                if (! mousePressed) {
+                    synchronized (mouseLock) {
+                        try {
+                            mouseLock.wait(3000);
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+                if (! mousePressed) {
+                    if (! SystemTrayIconHelper.skip(buttonTypes[i]))
+                        throw new RuntimeException("FAIL: mousePressed not triggered when " +
+                                keyNames[j] + " + " + buttonNames[i] + " pressed");
+                } else {
+                    int onMask = buttonMasks[i] | keyMasks[j];
+                    if ((modifiers & onMask) != onMask) {
+                        throw new RuntimeException("FAIL: getModifiersEx did not return " +
+                                "the correct value when " + keyNames[j] + " + " +
+                                buttonNames[i] + " pressed");
+                    }
+                }
+
+                mouseReleased = false;
+                mouseClicked = false;
+                robot.mouseRelease(buttonTypes[i]);
+
+                if (! mouseReleased) {
+                    synchronized (mouseLock) {
+                        try {
+                            mouseLock.wait(3000);
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+
+                robot.waitForIdle(1000);
+                robot.keyRelease(keyTypes[j]);
+                robot.waitForIdle(1000);
+
+                if (! mouseReleased) {
+                    if (! SystemTrayIconHelper.skip(buttonTypes[i]))
+                        throw new RuntimeException("FAIL: mouseReleased not triggered when " +
+                                keyNames[j] + " + " + buttonNames[i] + " released");
+                } else {
+                    int onMask = keyMasks[j];
+                    if ((releaseModifiers & onMask) != onMask)
+                        throw new RuntimeException("FAIL: getModifiersEx did not return " +
+                                "the correct value when " + keyNames[j] + " + " +
+                                buttonNames[i] + " released");
+                }
+                if (! mouseClicked) {
+                    throw new RuntimeException("FAIL: mouseClicked not triggered when " +
+                            keyNames[j] + " + " + buttonNames[i] +
+                            " pressed & released");
+                } else {
+                    int onMask = keyMasks[j];
+                    if ((clickModifiers & onMask) != onMask)
+                        throw new RuntimeException("FAIL: getModifiersEx did not return " +
+                                "the correct value when " + keyNames[j] + " + " +
+                                buttonNames[i] + " pressed & released");
+                }
+                robot.type(KeyEvent.VK_ESCAPE);
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+
+/*
+ * @test
+ * @summary Check for MouseEvents with all mouse buttons
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main TrayIconEventsTest
+ */
+
+public class TrayIconEventsTest {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    boolean actionPerformed = false;
+    Object actionLock = new Object();
+    Object pressLock = new Object();
+    Object releaseLock = new Object();
+    Object clickLock = new Object();
+    Object moveLock = new Object();
+
+    String caption = "Sample Icon";
+    boolean mousePressed = false;
+    boolean mouseReleased = false;
+    boolean mouseClicked = false;
+    boolean mouseMoved = false;
+
+    int[] buttonTypes = {
+        InputEvent.BUTTON1_MASK,
+        InputEvent.BUTTON2_MASK,
+        InputEvent.BUTTON3_MASK
+    };
+
+    String[] buttonNames = {
+        "BUTTON1",
+        "BUTTON2",
+        "BUTTON3"
+    };
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                               "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+                System.err.println("Test can fail if the icon hides to a tray icons pool " +
+                        "in Windows 7, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true " +
+                        "to avoid this problem. Or change behavior only for Java SE " +
+                        "tray icon.");
+            new TrayIconEventsTest().doTest();
+        }
+    }
+
+    public TrayIconEventsTest() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait(this::initializeGUI);
+    }
+
+    private void initializeGUI(){
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption);
+        icon.addActionListener(event -> {
+            actionPerformed = true;
+            synchronized (actionLock) {
+                try {
+
+                    actionLock.notifyAll();
+                } catch (Exception e) {
+                }
+            }
+        });
+        icon.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent event) {
+                mousePressed = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mousePressed");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mousePressed: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (pressLock) {
+                    try {
+                        pressLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseReleased(MouseEvent event) {
+                mouseReleased = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseReleased");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseReleased: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (releaseLock) {
+                    try {
+                        releaseLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+
+            public void mouseClicked(MouseEvent event) {
+                mouseClicked = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseClicked");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseClicked: MouseEvent.getSource " +
+                                       "did not return TrayIcon object");
+
+                synchronized (clickLock) {
+                    try {
+                        clickLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        icon.addMouseMotionListener(new MouseMotionAdapter() {
+            public void mouseMoved(MouseEvent event) {
+                mouseMoved = true;
+                Point p = event.getPoint();
+                if (p.x != event.getX() || p.y != event.getY())
+                    throw new RuntimeException("FAIL: MouseEvent.getPoint() did " +
+                            "not return the same value as getX/getY " +
+                            "for mouseMoved");
+
+                if (! icon.equals(event.getSource()))
+                    throw new RuntimeException("FAIL: mouseMoved: MouseEvent.getSource " +
+                            "did not return TrayIcon object");
+
+                synchronized (moveLock) {
+                    try {
+                        moveLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+
+        try {
+            tray.add(icon);
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    void doTest() throws Exception {
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle(2000);
+
+        SystemTrayIconHelper.doubleClick(robot);
+
+        if (! actionPerformed) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(10000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! actionPerformed)
+            throw new RuntimeException("FAIL: ActionEvent not triggered when TrayIcon is double clicked");
+
+        for (int i = 0; i < buttonTypes.length; i++) {
+            mousePressed = false;
+            robot.mousePress(buttonTypes[i]);
+
+            if (! mousePressed) {
+                synchronized (pressLock) {
+                    try {
+                        pressLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mousePressed)
+                if (! SystemTrayIconHelper.skip(buttonTypes[i]) )
+                    throw new RuntimeException("FAIL: mousePressed not triggered when " +
+                            buttonNames[i] + " pressed");
+
+            mouseReleased = false;
+            mouseClicked = false;
+            robot.mouseRelease(buttonTypes[i]);
+
+            if (! mouseReleased) {
+                synchronized (releaseLock) {
+                    try {
+                        releaseLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseReleased)
+                throw new RuntimeException("FAIL: mouseReleased not triggered when " +
+                        buttonNames[i] + " released");
+
+            if (! mouseClicked) {
+                synchronized (clickLock) {
+                    try {
+                        clickLock.wait(3000);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+            if (! mouseClicked)
+                throw new RuntimeException("FAIL: mouseClicked not triggered when " +
+                        buttonNames[i] + " pressed & released");
+        }
+
+        mouseMoved = false;
+        robot.mouseMove(iconPosition.x + 100, iconPosition.y);
+        robot.glide(iconPosition.x, iconPosition.y);
+
+        if (! mouseMoved)
+            if (! SystemTrayIconHelper.skip(0) )
+                throw new RuntimeException("FAIL: mouseMoved not triggered even when mouse moved over the icon");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconMethodsTest/TrayIconMethodsTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check various methods of the TrayIcon - whether the methods
+ *          return the proper values, throws the proper exceptions etc
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main TrayIconMethodsTest
+ */
+
+public class TrayIconMethodsTest {
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            new TrayIconMethodsTest().doTest();
+        }
+    }
+
+    void doTest() throws Exception {
+        SystemTray tray = SystemTray.getSystemTray();
+
+        String toolTip = "Sample Icon";
+        PopupMenu pm = new PopupMenu();
+        pm.add(new MenuItem("Sample"));
+
+        Image image = new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
+        TrayIcon icon = new TrayIcon(image, toolTip, pm);
+
+        ActionListener al1 = event -> {};
+        ActionListener al2 = event -> {};
+        MouseMotionListener mml1 = new MouseMotionAdapter() {};
+        MouseMotionListener mml2 = new MouseMotionAdapter() {};
+        MouseListener ml1 = new MouseAdapter() {};
+        MouseListener ml2 = new MouseAdapter() {};
+
+        icon.addActionListener(al1);
+        icon.addActionListener(al2);
+        icon.addMouseMotionListener(mml1);
+        icon.addMouseMotionListener(mml2);
+        icon.addMouseListener(ml1);
+        icon.addMouseListener(ml2);
+        tray.add(icon);
+
+        ActionListener[] actionListeners = icon.getActionListeners();
+        if (actionListeners == null || actionListeners.length != 2)
+            throw new RuntimeException("FAIL: getActionListeners did not return the correct value " +
+                    "when there were two listeners present " + actionListeners);
+
+        if (! isPresent(actionListeners, al1) || ! isPresent(actionListeners, al2))
+            throw new RuntimeException("FAIL: All the action listeners added are not returned " +
+                    "by the method");
+
+        MouseListener[] mouseListeners = icon.getMouseListeners();
+        if (mouseListeners == null || mouseListeners.length != 2)
+            throw new RuntimeException("FAIL: getMouseListeners did not return the correct value " +
+                    "when there were two listeners present " + mouseListeners);
+
+        if (! isPresent(mouseListeners, ml1) || ! isPresent(mouseListeners, ml2))
+            throw new RuntimeException("FAIL: All the mouse listeners added are not returned " +
+                    "by the method");
+
+        MouseMotionListener[] mouseMotionListeners = icon.getMouseMotionListeners();
+        if (mouseMotionListeners == null || mouseMotionListeners.length != 2)
+            throw new RuntimeException("FAIL: getMouseMotionListeners did not return the correct value " +
+                    "when there were two listeners present " + mouseMotionListeners);
+
+        if (! isPresent(mouseMotionListeners, mml1) || ! isPresent(mouseMotionListeners, mml2))
+            throw new RuntimeException("FAIL: All the mouse motion listeners added are not returned " +
+                    "by the method");
+
+        Image im = icon.getImage();
+        if (! image.equals(im))
+            throw new RuntimeException("FAIL: Images are not the same getImage()=" + im +
+                    " Image=" + image);
+
+        if (! pm.equals(icon.getPopupMenu()))
+            throw new RuntimeException("FAIL: PopupMenus are not the same getPopupMenu()=" +
+                    icon.getPopupMenu() + " PopupMenu=" + pm);
+
+        if (! toolTip.equals(icon.getToolTip()))
+            throw new RuntimeException("FAIL: ToolTips are not the same getToolTip()=" +
+                               icon.getToolTip() + " ToolTip=" + toolTip);
+
+        if (icon.isImageAutoSize())
+            throw new RuntimeException("FAIL: Auto size property is true by default");
+
+        icon.setImageAutoSize(true);
+        if (! icon.isImageAutoSize())
+            throw new RuntimeException("FAIL: Auto size property is not set to " +
+                    "true by call to setImageAutoSize(true)");
+
+        icon.removeActionListener(al1);
+        icon.removeActionListener(al2);
+        actionListeners = icon.getActionListeners();
+        if (actionListeners == null || actionListeners.length != 0)
+            throw new RuntimeException("FAIL: removeActionListener did not " +
+                    "remove the ActionListeners added " + actionListeners);
+
+        icon.removeMouseListener(ml1);
+        icon.removeMouseListener(ml2);
+        mouseListeners = icon.getMouseListeners();
+        if (mouseListeners == null || mouseListeners.length != 0)
+            throw new RuntimeException("FAIL: removeMouseListener did not " +
+                    "remove the MouseListeners added " + mouseListeners);
+
+        icon.removeMouseMotionListener(mml1);
+        icon.removeMouseMotionListener(mml2);
+        mouseMotionListeners = icon.getMouseMotionListeners();
+        if (mouseMotionListeners == null || mouseMotionListeners.length != 0)
+            throw new RuntimeException("FAIL: removeMouseMotionListener did not " +
+                    "remove the MouseMotionListeners added " + mouseMotionListeners);
+
+        try {
+            icon.setImage(null);
+            throw new RuntimeException("FAIL: setImage(null) did not throw NullPointerException");
+        } catch (NullPointerException npe) {
+        }
+    }
+
+    boolean isPresent(Object[] array, Object obj) {
+        if (array == null || array.length == 0 || obj == null) {
+            return false;
+        }
+        for (int i = 0; i < array.length; i++) {
+            if (obj.equals(array[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check if ActionEvent is triggered by a TrayIcon only when
+ *          it is double clicked using mouse button 1 (or single clicked
+ *          with button 3 (on Mac OS X))
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main TrayIconMouseTest
+ */
+
+public class TrayIconMouseTest {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    boolean actionPerformed = false;
+    Object actionLock = new Object();
+    static boolean isMacOS = false;
+
+    String caption = "Sample Icon";
+
+    int[] buttonTypes = {
+        InputEvent.BUTTON1_MASK,
+        InputEvent.BUTTON2_MASK,
+        InputEvent.BUTTON3_MASK
+    };
+
+    String[] buttonNames = {
+        "BUTTON1",
+        "BUTTON2",
+        "BUTTON3"
+    };
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("mac")) {
+                isMacOS = true;
+            }
+            new TrayIconMouseTest().doTest();
+        }
+    }
+
+    TrayIconMouseTest() throws Exception{
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait(this::initializeGUI);
+    }
+
+    void initializeGUI() {
+
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption);
+        icon.addActionListener(event -> {
+            actionPerformed = true;
+            synchronized (actionLock) {
+                try {
+                    actionLock.notifyAll();
+                } catch (Exception e) {
+                }
+            }
+        });
+        try {
+            tray.add(icon);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private void doTest() throws Exception {
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+
+        for (int i = 0; i < buttonTypes.length; i++) {
+            actionPerformed = false;
+            robot.click(buttonTypes[i]);
+            robot.waitForIdle(2000);
+
+            if (isMacOS && actionPerformed && i == 2) {
+
+            }else if (isMacOS && i == 2) {
+                throw new RuntimeException("FAIL: ActionEvent NOT triggered when " +
+                        buttonNames[i] + " is single clicked on Mac OS");
+            }else if (actionPerformed) {
+                throw new RuntimeException("FAIL: ActionEvent triggered when " +
+                        buttonNames[i] + " is single clicked");
+            }
+        }
+
+        if(!isMacOS) {
+            for (int i = 0; i < buttonTypes.length; i++) {
+                for (int j = 0; j < buttonTypes.length; j++) {
+                    if (j != i) {
+                        actionPerformed = false;
+                        robot.mousePress(buttonTypes[i]);
+                        robot.mousePress(buttonTypes[j]);
+                        robot.mouseRelease(buttonTypes[j]);
+                        robot.mouseRelease(buttonTypes[i]);
+
+                        robot.waitForIdle();
+
+                        if (actionPerformed)
+                            throw new RuntimeException("FAIL: ActionEvent triggered when " +
+                                    buttonNames[i] + " and " + buttonNames[j] +
+                                    " is clicked and released");
+                    }
+                }
+            }
+
+            for (int i = 0; i < buttonTypes.length; i++) {
+                actionPerformed = false;
+                robot.mousePress(buttonTypes[i]);
+                robot.delay(50);
+                robot.mouseRelease(buttonTypes[i]);
+                robot.delay(50);
+                robot.mousePress(buttonTypes[i]);
+                robot.delay(50);
+                robot.mouseRelease(buttonTypes[i]);
+
+                if (i == 0) {
+                    if (! actionPerformed) {
+                        synchronized (actionLock) {
+                            try {
+                                actionLock.wait(3000);
+                            } catch (Exception e) {
+                            }
+                        }
+                    }
+                    if (! actionPerformed)
+                        throw new RuntimeException("FAIL: ActionEvent not triggered when " +
+                                buttonNames[i] + " is double clicked");
+                } else {
+                    robot.waitForIdle();
+
+                    if (actionPerformed)
+                        throw new RuntimeException("FAIL: ActionEvent triggered when " +
+                                buttonNames[i] + " is double clicked");
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check if a JPopupMenu can be displayed when TrayIcon is
+ *          right clicked. It uses a JWindow as the parent of the JPopupMenu
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary ../
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main TrayIconPopupTest
+ */
+
+public class TrayIconPopupTest {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+
+    boolean actionPerformed = false;
+    Object actionLock = new Object();
+    static final int ATTEMPTS = 50;
+
+    PopupMenu popup;
+    Dialog window;
+
+    public static void main(String[] args) throws Exception {
+        if (!SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+                System.err.println("Test can fail if the icon hides to a tray icons pool " +
+                        "in Windows 7, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true " +
+                        "to avoid this problem. Or change behavior only for Java SE " +
+                        "tray icon.");
+            new TrayIconPopupTest().doTest();
+        }
+    }
+
+    TrayIconPopupTest() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait(this::initializeGUI);
+        robot.waitForIdle(1000);
+        EventQueue.invokeAndWait( () ->  window.setLocation(100, 100));
+        robot.waitForIdle(1000);
+    }
+
+    private void initializeGUI() {
+        window = new Dialog((Frame) null);
+        window.setSize(5, 5);
+        window.setVisible(true);
+
+        popup = new PopupMenu("");
+
+        MenuItem item = new MenuItem("Sample");
+        item.addActionListener(event -> {
+            actionPerformed = true;
+
+            synchronized (actionLock) {
+                try {
+                    actionLock.notifyAll();
+                } catch (Exception e) {
+                }
+            }
+        });
+        popup.add(item);
+        popup.add(new MenuItem("Item2"));
+        popup.add(new MenuItem("Item3"));
+
+        window.add(popup);
+
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Sample Icon");
+        icon.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent event) {
+                if (event.isPopupTrigger()) {
+                    popup.show(window, 0, 0);
+                }
+            }
+
+            public void mouseReleased(MouseEvent event) {
+                if (event.isPopupTrigger()) {
+                    popup.show(window, 0, 0);
+                }
+            }
+        });
+        try {
+            tray.add(icon);
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    void doTest() throws Exception {
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+        robot.mousePress(InputEvent.BUTTON3_MASK);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON3_MASK);
+        robot.delay(1000);
+
+        robot.mouseMove(window.getLocation().x + 10, window.getLocation().y + 10);
+        robot.mousePress(InputEvent.BUTTON3_MASK);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON3_MASK);
+
+        int attempts = 0;
+        while (!actionPerformed && attempts++ < ATTEMPTS) {
+            synchronized (actionLock) {
+                try {
+                    actionLock.wait(3000);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (!actionPerformed)
+            throw new RuntimeException("FAIL: ActionEvent not triggered when " +
+                    "JPopupMenu shown and menu item selected using keyboard");
+
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconRemoveTest/TrayIconRemoveTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Test the remove method of the TrayIcon
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main TrayIconRemoveTest
+ */
+
+public class TrayIconRemoveTest {
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                               "Marking the test passed");
+        } else {
+            new TrayIconRemoveTest().doTest();
+        }
+    }
+
+    private void doTest() throws Exception {
+        Image image = new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
+        SystemTray tray = SystemTray.getSystemTray();
+        tray.remove(null);
+
+        TrayIcon icon1 = new TrayIcon(image);
+        tray.add(icon1);
+
+        tray.remove(icon1);
+
+        TrayIcon[] icons = tray.getTrayIcons();
+        if (icons.length != 0)
+            throw new RuntimeException("FAIL: There are icons still present even after " +
+                    "removing the added icon" + "\n"+
+                    "No. of icons present: " + icons.length);
+
+        TrayIcon icon2 = new TrayIcon(image);
+        tray.remove(icon2);
+
+        TrayIcon icon3 = new TrayIcon(image);
+        tray.add(icon3);
+
+        TrayIcon newIcon = new TrayIcon(image);
+        tray.remove(newIcon);
+
+        tray.remove(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/TrayIcon/TrayIconSizeTest/TrayIconSizeTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+
+/*
+ * @test
+ * @summary Test the methods TrayIcon.getSize and SystemTray.getTrayIconSize.
+ *          There is no way to check whether the values returned are correct,
+ *          so its checked whether the value is greater than a minimum
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @run main TrayIconSizeTest
+ */
+
+public class TrayIconSizeTest {
+
+    public static void main(String[] args) throws Exception {
+        if (! SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            new TrayIconSizeTest().doTest();
+        }
+    }
+
+    void doTest() throws Exception {
+
+        SystemTray tray = SystemTray.getSystemTray();
+        Dimension dim = tray.getTrayIconSize();
+
+        if (dim.width <= 5 || dim.height <= 5)
+            throw new RuntimeException("FAIL: value returned by getTrayIconSize is not correct: " + dim);
+
+        TrayIcon icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB));
+
+        if (! icon.getSize().equals(dim))
+            throw new RuntimeException("FAIL: TrayIcon.getSize did not return the same value as " +
+                    "getTrayIconSize when TrayIcon not added" + "\n" +
+                    "SystemTray.getTrayIconSize(): " + dim + "\n" +
+                    "TrayIcon.getSize(): " + icon.getSize());
+
+        tray.add(icon);
+
+        if (icon.getSize().width <= 5 || icon.getSize().height <= 5)
+            throw new RuntimeException("FAIL: value returned by TrayIcon.getSize is not correct: " + icon.getSize());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/Common.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.geom.Area;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.security.SecureRandom;
+
+
+/*
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ */
+public abstract class Common {
+
+    ExtendedRobot robot;
+    Class<? extends Frame> windowClass;
+    Frame background;
+    BufferedImage foreground;
+    Window window;
+    Container componentsContainer;
+
+    float opacity = 1.0f;
+    static final int STATIC_STEP = 30;
+    static final int STATIC_WIDTH = 25;
+    static final int STATIC_BLOCKS = 30;
+    static final Color BG_COLOR = Color.BLUE;
+    static final Color FG_COLOR = Color.RED;
+    static final int delay = 1000;
+    static final SecureRandom random = new SecureRandom();
+    static final int dl = 100;
+    static final Class[] WINDOWS_TO_TEST = { Window.class, Frame.class, Dialog.class };
+
+    public Common(Class windowClass, float opacity) throws Exception{
+        this.opacity = opacity;
+        robot = new ExtendedRobot();
+        this.windowClass = windowClass;
+        EventQueue.invokeAndWait(this::initBackgroundFrame);
+        EventQueue.invokeAndWait(this::initGUI);
+    }
+
+    public Common(Class windowClass) throws Exception{
+        this(windowClass, 1.0f);
+    }
+
+    public void doTest() throws Exception {
+        robot.waitForIdle(delay);
+    };
+
+    public void dispose() {
+        window.dispose();
+        background.dispose();
+    }
+
+    public abstract void applyShape();
+
+    public void applyDynamicShape() {
+        final Area a = new Area();
+        Dimension size = window.getSize();
+        for (int x = 0; x < 3; x++) {
+            for (int y = 0; y < 3; y++) {
+                a.add(new Area(new Rectangle2D.Double(
+                        x * size.getWidth() / 17*6, y * size.getHeight() / 17*6,
+                        size.getWidth() / 17*5, size.getHeight() / 17*5)));
+            }
+        }
+        window.setShape(a);
+    }
+
+    public void applyStaticShape() {
+        final Area a = new Area();
+        for (int x = 0; x < STATIC_BLOCKS; x++) {
+            for (int y = 0; y < STATIC_BLOCKS; y++) {
+                a.add(new Area(new Rectangle2D.Float(
+                        x*STATIC_STEP, y*STATIC_STEP,
+                        STATIC_WIDTH, STATIC_WIDTH)));
+            }
+        }
+        window.setShape(a);
+    }
+
+    public BufferedImage getForegroundWindow() throws Exception {
+        final BufferedImage f[] = new BufferedImage[1];
+        EventQueue.invokeAndWait( () -> {
+            f[0] = new BufferedImage(window.getWidth(),
+                    window.getHeight(), BufferedImage.TYPE_INT_RGB);
+            window.printAll(f[0].createGraphics());
+        });
+        robot.waitForIdle(delay);
+        return f[0];
+    }
+
+    public static boolean checkTranslucencyMode(GraphicsDevice.WindowTranslucency mode) {
+
+        if (!GraphicsEnvironment
+                .getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice()
+                .isWindowTranslucencySupported(mode)){
+            System.out.println(mode+" translucency mode isn't supported");
+            return false;
+        } else {
+            return true;
+        }
+
+    }
+
+    public void applyAppDragNResizeSupport() {
+        MouseAdapter m = new MouseAdapter() {
+
+            private Point dragOrigin = null;
+            private Dimension origSize = null;
+            private Point origLoc = null;
+            private boolean left = false;
+            private boolean top = false;
+            private boolean bottom = false;
+            private boolean right = false;
+
+            public void mousePressed(MouseEvent e) {
+                dragOrigin = e.getLocationOnScreen();
+                origSize = window.getSize();
+                origLoc = window.getLocationOnScreen();
+                right = (origLoc.x + window.getWidth() - dragOrigin.x) < 5;
+                left = !right && dragOrigin.x - origLoc.x < 5;
+                bottom = (origLoc.y + window.getHeight() - dragOrigin.y) < 5;
+                top = !bottom && dragOrigin.y - origLoc.y < 5;
+            }
+
+            public void mouseReleased(MouseEvent e) { resize(e); }
+            public void mouseDragged(MouseEvent e) { resize(e); }
+
+            void resize(MouseEvent e) {
+                Point dragDelta = e.getLocationOnScreen();
+                dragDelta.translate(-dragOrigin.x, -dragOrigin.y);
+                Point newLoc = new Point(origLoc);
+                newLoc.translate(dragDelta.x, dragDelta.y);
+                Dimension newSize = new Dimension(origSize);
+                if (left || right) {
+                    newSize.width += right ? dragDelta.x : -dragDelta.x;
+                }
+                if (top || bottom) {
+                    newSize.height += bottom ? dragDelta.y : -dragDelta.y;
+                }
+                if (right || (top || bottom) && !left) {
+                    newLoc.x = origLoc.x;
+                }
+                if (bottom || (left || right) && !top) {
+                    newLoc.y = origLoc.y;
+                }
+                window.setBounds(newLoc.x, newLoc.y, newSize.width, newSize.height);
+            }
+        };
+        for (Component comp : window.getComponents()) {
+            comp.addMouseListener(m);
+            comp.addMouseMotionListener(m);
+        }
+
+        window.addMouseListener(m);
+        window.addMouseMotionListener(m);
+    }
+
+    public void checkTranslucentShape() throws Exception {
+        foreground = getForegroundWindow();
+        Point[] points = new Point[4];
+
+        Dimension size = window.getSize();
+        Point location = window.getLocationOnScreen();
+
+        points[0] = new Point(20, 20);
+        points[1] = new Point(20, size.height-20);
+        points[2] = new Point(size.width-20, 20);
+        points[3] = new Point(size.width-20, size.height-20);
+
+        for (Point p : points){
+            p.translate(location.x, location.y);
+            Color actual = robot.getPixelColor(p.x, p.y);
+            if (actual.equals(BG_COLOR)|| actual.equals(FG_COLOR))
+                throw new RuntimeException("Error in point "+p+": "+actual+" equals to foreground or background color");
+            else
+                System.out.println("OK with foreground point "+p);
+        }
+    }
+
+    public void checkStaticShape() throws Exception {
+        Point[] points = new Point[4];
+
+        Dimension size = window.getSize();
+        int xFactor = (int) Math.floor(size.getWidth()/STATIC_STEP)-1;
+        int yFactor = (int) Math.floor(size.getHeight()/STATIC_STEP)-1;
+
+        // background
+        points[0] = new Point((STATIC_STEP+STATIC_WIDTH)/2, (STATIC_STEP+STATIC_WIDTH)/2);
+        points[1] = new Point(STATIC_STEP*xFactor+(STATIC_STEP+STATIC_WIDTH)/2, STATIC_STEP*yFactor+(STATIC_STEP+STATIC_WIDTH)/2);
+        points[2] = new Point((STATIC_STEP+STATIC_WIDTH)/2, STATIC_STEP*yFactor+(STATIC_STEP+STATIC_WIDTH)/2);
+        points[3] = new Point(STATIC_STEP*xFactor+(STATIC_STEP+STATIC_WIDTH)/2, (STATIC_STEP+STATIC_WIDTH)/2);
+        checkShape(points, true);
+
+        // foreground
+        if (opacity < 1.0f){
+            checkTranslucentShape();
+        } else {
+            points[0] = new Point((STATIC_WIDTH) / 2, (STATIC_WIDTH) / 2);
+            points[1] = new Point(STATIC_STEP * xFactor + (STATIC_WIDTH) / 2, STATIC_STEP * yFactor + (STATIC_WIDTH) / 2);
+            points[2] = new Point((STATIC_WIDTH) / 2, STATIC_STEP * yFactor + (STATIC_WIDTH) / 2);
+            points[3] = new Point(STATIC_STEP * xFactor + (STATIC_WIDTH) / 2, (STATIC_WIDTH) / 2);
+            checkShape(points, false);
+        }
+    }
+
+    public void checkDynamicShape() throws Exception {
+        Point[] points = new Point[4];
+
+        Dimension size = window.getSize();
+
+        int blockSizeX = (int) (size.getWidth() / 17);
+        int blockSizeY = (int) (size.getHeight() / 17);
+
+        // background
+        points[0] = new Point((int) (blockSizeX * 5.5), (int) (blockSizeY * 5.5));
+        points[1] = new Point((int) (size.getWidth() - blockSizeX * 5.5), (int) (size.getHeight() - blockSizeY * 5.5));
+        points[2] = new Point((int) (blockSizeX * 5.5), (int) (size.getHeight() - blockSizeY * 5.5));
+        points[3] = new Point((int) (size.getWidth() - blockSizeX * 5.5), (int) (blockSizeY * 5.5));
+        checkShape(points, true);
+
+        // foreground
+        if (opacity < 1.0f){
+            checkTranslucentShape();
+        } else {
+            points[0] = new Point(3 * blockSizeX, 3 * blockSizeY);
+            points[1] = new Point(14 * blockSizeX, 14 * blockSizeY);
+            points[2] = new Point(3 * blockSizeX, 14 * blockSizeY);
+            points[3] = new Point(14 * blockSizeX, 3 * blockSizeY);
+            checkShape(points, false);
+        }
+    }
+
+    public void checkShape(Point[] points, boolean areBackgroundPoints) throws Exception {
+
+        Point location = window.getLocationOnScreen();
+
+        for (Point p : points) {
+            p.translate(location.x, location.y);
+            if (areBackgroundPoints) {
+                if (!robot.getPixelColor(p.x, p.y).equals(BG_COLOR))
+                    throw new RuntimeException("Background point " + p + " color " + robot.getPixelColor(p.x, p.y) +
+                            " does not equal to background color " + BG_COLOR);
+                else
+                    System.out.println("OK with background point " + p);
+            } else {
+                if (robot.getPixelColor(p.x, p.y).equals(BG_COLOR))
+                    throw new RuntimeException("Foreground point " + p +
+                            " equals to background color " + BG_COLOR);
+                else
+                    System.out.println("OK with foreground point " + p);
+            }
+        }
+    }
+
+    public void initBackgroundFrame() {
+        background = new Frame();
+        background.setUndecorated(true);
+        background.setBackground(BG_COLOR);
+        background.setSize(500, 500);
+        background.setLocation(dl, dl);
+        background.setVisible(true);
+    }
+
+    public void initGUI() {
+        if (windowClass.equals(Frame.class)) {
+            window = new Frame();
+            ((Frame) window).setUndecorated(true);
+        } else  if (windowClass.equals(Dialog.class)) {
+            window = new Dialog(background);
+            ((Dialog) window).setUndecorated(true);
+        } else {
+            window = new Window(background);
+        }
+
+        window.setBackground(FG_COLOR);
+        componentsContainer = new Panel();
+        window.add(componentsContainer, BorderLayout.CENTER);
+        window.setLocation(2 * dl, 2 * dl);
+        window.setSize(255, 255);
+        if (opacity < 1.0f)
+            window.setOpacity(opacity);
+        window.addComponentListener(new ComponentAdapter() {
+            public void componentResized(ComponentEvent e) {
+                applyShape();
+            }
+        });
+        applyShape();
+        window.setVisible(true);
+        applyAppDragNResizeSupport();
+        window.toFront();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/FocusAWTTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowFocusListener;
+import java.awt.geom.Area;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
+import java.util.HashMap;
+
+/*
+ * @test
+ * @bug 8013450
+ * @summary Check if the window events (Focus and Activation) are triggered correctly
+ *          when clicked on visible and clipped areas.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build Common ExtendedRobot
+ * @run main FocusAWTTest
+ */
+
+public class FocusAWTTest extends Common {
+
+    ExtendedRobot robot;
+    int dx;
+    int dy;
+    static final int x = 20;
+    static final int y = 400;
+
+    static volatile HashMap<String, Boolean> flags = new HashMap<String, Boolean>();
+    static {
+        flags.put("backgroundWindowActivated", false);
+        flags.put("backgroundWindowDeactivated", false);
+        flags.put("backgroundWindowGotFocus", false);
+        flags.put("backgroundWindowLostFocus", false);
+        flags.put("foregroundWindowGotFocus", false);
+        flags.put("foregroundWindowLostFocus", false);
+        flags.put("foregroundWindowActivated", false);
+        flags.put("foregroundWindowDeactivated", false);
+    }
+
+    public static void main(String[] ignored) throws Exception{
+        if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+            for (Class<Window> windowClass: WINDOWS_TO_TEST) {
+                new FocusAWTTest(windowClass).doTest();
+            }
+    }
+
+    public FocusAWTTest(Class windowClass) throws Exception {
+        super(windowClass);
+        this.robot = new ExtendedRobot();
+        robot.waitForIdle();
+        EventQueue.invokeAndWait(() -> {
+            dx = background.getX() - x;
+            dy = background.getY() - y;
+        });
+        robot.waitForIdle();
+    }
+
+    @Override
+    public void initBackgroundFrame() {
+        background = new Frame();
+        background.setSize(300, 300);
+        background.setLocation(x, y);
+        background.setFocusable(true);
+        background.setFocusableWindowState(true);
+
+        background.addWindowFocusListener(new WindowFocusListener() {
+            public void windowGainedFocus(WindowEvent e) { flags.put("backgroundWindowGotFocus", true); }
+            public void windowLostFocus(WindowEvent e) { flags.put("backgroundWindowLostFocus", true); }
+        });
+
+        background.addWindowListener(new WindowAdapter() {
+            public void windowActivated(WindowEvent e) { flags.put("backgroundWindowActivated", true); }
+            public void windowDeactivated(WindowEvent e) { flags.put("backgroundWindowDeactivated", true); }
+        });
+        background.add(new TextArea());
+        background.setVisible(true);
+    }
+
+    @Override
+    public void initGUI() {
+        if (windowClass.equals(Frame.class)) {
+            window = new Frame() {
+                public void paint(Graphics g) {
+                    g.setColor(Color.BLUE);
+                    g.fillRect(0, 0, 200, 200);
+                }
+            };
+            ((Frame) window).setUndecorated(true);
+        } else if (windowClass.equals(Dialog.class)) {
+            window = new Dialog(background) {
+                public void paint(Graphics g) {
+                    g.setColor(Color.BLUE);
+                    g.fillRect(0, 0, 200, 200);
+                }
+            };
+            ((Dialog) window).setUndecorated(true);
+        } else {
+            window = new Window(background) {
+                public void paint(Graphics g) {
+                    g.setColor(Color.BLUE);
+                    g.fillRect(0, 0, 200, 200);
+                }
+            };
+            window.setFocusable(true);
+            window.setFocusableWindowState(true);
+        }
+
+        window.setPreferredSize(new Dimension(200, 200));
+        window.setLocation(70 + dx, 450 + dy);
+        window.setLayout(new BorderLayout());
+
+        window.addWindowFocusListener(new WindowFocusListener() {
+            public void windowGainedFocus(WindowEvent e) { flags.put("foregroundWindowGotFocus", true); }
+            public void windowLostFocus(WindowEvent e) { flags.put("foregroundWindowLostFocus", true); }
+        });
+
+        window.addWindowListener(new WindowAdapter() {
+            public void windowActivated(WindowEvent e) { flags.put("foregroundWindowActivated", true); }
+            public void windowDeactivated(WindowEvent e) { flags.put("foregroundWindowDeactivated", true); }
+        });
+
+        applyShape();
+        window.pack();
+        window.setAlwaysOnTop(true);
+        window.setVisible(true);
+    }
+
+    public void doTest() throws Exception {
+        super.doTest();
+        final Point wls = new Point();
+        final Dimension size = new Dimension();
+        EventQueue.invokeAndWait(() -> {
+            window.requestFocus();
+            wls.setLocation(window.getLocationOnScreen());
+            window.getSize(size);
+        });
+
+        robot.waitForIdle();
+
+        check(wls.x + size.width - 5, wls.y + 5, wls.x + size.width / 3, wls.y + size.height / 3);
+        check(wls.x + size.width / 2, wls.y + size.height / 2, wls.x + size.width * 2 / 3, wls.y + size.height * 2 / 3);
+
+        EventQueue.invokeAndWait(() -> {
+            background.dispose();
+            window.dispose();
+        });
+
+        robot.waitForIdle();
+    }
+
+    @Override
+    public void applyShape() {
+        Shape shape;
+        Area a = new Area(new Rectangle2D.Float(0, 0, 200, 200));
+        GeneralPath gp;
+        gp = new GeneralPath();
+        gp.moveTo(190, 0);
+        gp.lineTo(200, 0);
+        gp.lineTo(200, 10);
+        gp.lineTo(10, 200);
+        gp.lineTo(0, 200);
+        gp.lineTo(0, 190);
+        gp.closePath();
+        a.subtract(new Area(gp));
+        shape = a;
+
+        window.setShape(shape);
+    }
+
+    private void check(int xb, int yb, int xw, int yw) throws Exception {
+        checkClick(xb, yb, "backgroundWindowGotFocus");
+        checkClick(xw, yw, "foregroundWindowGotFocus");
+        checkClick(xb, yb, "foregroundWindowLostFocus");
+        checkClick(xw, yw, "backgroundWindowLostFocus");
+
+        if (window instanceof Dialog || window instanceof Frame) {
+            checkClick(xb, yb, "backgroundWindowActivated");
+            checkClick(xw, yw, "foregroundWindowActivated");
+            checkClick(xb, yb, "foregroundWindowDeactivated");
+            checkClick(xw, yw, "backgroundWindowDeactivated");
+        }
+
+    }
+
+    private void checkClick(int x, int y, String flag) throws Exception {
+        System.out.println("Trying to click point " + x + ", " + y + ", looking for " + flag + " to trigger.");
+
+        flags.put(flag, false);
+
+        robot.mouseMove(x, y);
+        robot.click();
+        int i = 0;
+        while (i < 5000 && !flags.get(flag)) {
+            robot.waitForIdle(50);
+            i += 50;
+        }
+
+        if (!flags.get(flag))
+            throw new RuntimeException(flag + " is not triggered for click on point " + x + ", " + y + " for " + windowClass + "!");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/Shaped.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+
+/*
+ * @test
+ * @summary Check if dynamically shaped window is moved and resized
+ *          by robot correctly
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build Common ExtendedRobot
+ * @run main Shaped
+ */
+public class Shaped extends Common{
+
+    public static void main(String[] args) throws Exception {
+        if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+            for (Class<Window> windowClass: WINDOWS_TO_TEST){
+                new Shaped(windowClass).doTest();
+            }
+    }
+
+    public Shaped(Class windowClass) throws Exception{
+        super(windowClass);
+    }
+    public void applyShape(){ applyDynamicShape(); }
+
+    public void doTest() throws Exception{
+        super.doTest();
+
+        checkDynamicShape();
+
+        // Drag
+        Point location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
+        robot.waitForIdle(delay);
+        checkDynamicShape();
+
+        // Resize
+        location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
+        robot.waitForIdle(delay);
+        checkDynamicShape();
+
+        dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/ShapedByAPI.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+
+/*
+ * @test
+ * @summary Check if dynamically shaped window is moved and resized
+ *          using API correctly
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @run main ShapedByAPI
+ */
+public class ShapedByAPI extends Common {
+
+    public static void main(String[] args) throws Exception {
+        if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+            for (Class<Window> windowClass: WINDOWS_TO_TEST){
+                new ShapedByAPI(windowClass).doTest();
+            }
+    }
+
+    public ShapedByAPI(Class windowClass) throws Exception{
+        super(windowClass);
+    }
+    public void applyShape(){ applyDynamicShape(); }
+
+    public void doTest() throws Exception{
+        super.doTest();
+
+        checkDynamicShape();
+
+        EventQueue.invokeAndWait(() -> {
+            Point location = window.getLocationOnScreen();
+            location.translate(random.nextInt(dl), random.nextInt(dl));
+            window.setLocation(location);
+        });
+        robot.waitForIdle(delay);
+        checkDynamicShape();
+
+        EventQueue.invokeAndWait(() -> {
+            Dimension size = window.getSize();
+            window.setSize(size.width+random.nextInt(2*dl)-dl, size.height+random.nextInt(2*dl)-dl);
+        });
+        robot.waitForIdle(delay);
+        checkDynamicShape();
+
+        dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check if a translucent shaped window is dragged and
+ *          resized correctly.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build Common ExtendedRobot
+ * @run main ShapedTranslucent
+ */
+public class ShapedTranslucent extends Common {
+
+    public static void main(String[] args) throws Exception {
+        if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.TRANSLUCENT) &&
+            checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+            for (Class<Window> windowClass: WINDOWS_TO_TEST){
+                new ShapedTranslucent(windowClass).doTest();
+            }
+    }
+
+    public ShapedTranslucent(Class windowClass) throws Exception{
+        super(windowClass, 0.3f);
+    }
+
+    public void applyShape(){ applyDynamicShape(); }
+
+    public void doTest() throws Exception{
+        super.doTest();
+
+        checkDynamicShape();
+
+        // Drag
+        Point location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
+        robot.waitForIdle(delay);
+        checkDynamicShape();
+
+        // Resize
+        location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
+        robot.waitForIdle(delay);
+        checkDynamicShape();
+
+        dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/StaticallyShaped.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+
+/*
+ * @test
+ * @summary Check if statically shaped window is dragged and resized
+ *          correctly.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build Common ExtendedRobot
+ * @run main StaticallyShaped
+ */
+
+public class StaticallyShaped extends Common {
+
+    public static void main(String[] args) throws Exception {
+        if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+            for (Class<Window> windowClass: WINDOWS_TO_TEST){
+                new StaticallyShaped(windowClass).doTest();
+            }
+    }
+
+    public StaticallyShaped(Class windowClass) throws Exception{ super(windowClass); }
+    public void applyShape(){ applyStaticShape(); }
+
+    public void doTest() throws Exception{
+        super.doTest();
+
+        checkStaticShape();
+
+        // Drag
+        Point location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
+        robot.waitForIdle(delay);
+        checkStaticShape();
+
+        // Resize
+        location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
+        robot.waitForIdle(delay);
+        checkStaticShape();
+
+        dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Window/ShapedAndTranslucentWindows/Translucent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check if translucent window is dragged and resized
+            correctly.
+ * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
+ * @library ../../../../lib/testlibrary
+ * @build Common ExtendedRobot
+ * @run main Translucent
+ */
+public class Translucent extends Common {
+
+    public static void main(String[] args) throws Exception {
+        if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.TRANSLUCENT) &&
+            checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+            for (Class<Window> windowClass: WINDOWS_TO_TEST){
+                new Translucent(windowClass).doTest();
+            }
+    }
+
+    public Translucent(Class windowClass) throws Exception{
+        super(windowClass, 0.3f);
+    }
+
+    public void applyShape(){ }
+
+    public void doTest() throws Exception{
+        super.doTest();
+
+        checkTranslucentShape();
+
+        // Drag
+        Point location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
+        robot.waitForIdle(delay);
+        checkTranslucentShape();
+
+        // Resize
+        location = window.getLocationOnScreen();
+        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
+        robot.waitForIdle(delay);
+        checkTranslucentShape();
+
+        dispose();
+        robot.waitForIdle(delay);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/applet/Applet/HeadlessApplet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.applet.Applet;
+import java.awt.HeadlessException;
+
+/*
+ * @test
+ * @summary Check HeadlessException occurrence when trying to create Applet
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessApplet
+ */
+
+public class HeadlessApplet {
+
+    public static void main(String args[]) {
+        boolean noExceptions = true;
+
+        try {
+            Applet a = new Applet();
+        } catch (HeadlessException e) {
+            noExceptions = false;
+        }
+
+        if (noExceptions) {
+            throw new RuntimeException("No HeadlessException occured when creating Applet in headless mode");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/CustomClassLoaderTransferTest/AnotherInterface.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,3 @@
+import java.io.*;
+
+public interface AnotherInterface extends Serializable {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/CustomClassLoaderTransferTest/CustomClassLoaderTransferTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,63 @@
+/*
+  @test
+  @bug 4932376
+  @summary verifies that data transfer within one JVM works correctly if
+           the transfer data was created with a custom class loader.
+  @author das@sparc.spb.su area=datatransfer
+  @library ../../regtesthelpers
+  @build TransferableList AnotherInterface CopyClassFile CustomClassLoaderTransferTest
+  @run main CopyClassFile -r ListInterface subdir/
+  @run main CopyClassFile -r TransferableList subdir/
+  @run main CustomClassLoaderTransferTest
+*/
+
+import java.awt.*;
+import java.awt.datatransfer.*;
+import java.io.*;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+public class CustomClassLoaderTransferTest {
+    public static class DFTransferable implements Transferable {
+        private final DataFlavor df;
+        private final Object obj;
+        public DFTransferable(DataFlavor df, Object obj) {
+            this.df = df;
+            this.obj = obj;
+        }
+
+        @Override
+        public Object getTransferData(DataFlavor flavor)
+          throws UnsupportedFlavorException, IOException {
+            if (df.equals(flavor)) {
+                return obj;
+            } else {
+                throw new UnsupportedFlavorException(flavor);
+            }
+        }
+
+        @Override
+        public DataFlavor[] getTransferDataFlavors(){
+            return new DataFlavor[] { df };
+        }
+
+        @Override
+        public boolean isDataFlavorSupported(DataFlavor flavor) {
+            return df.equals(flavor);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
+        URL url = new File("./subdir/").toURL();
+        ClassLoader classLoader = new URLClassLoader(new URL[] { url },
+                CustomClassLoaderTransferTest.class.getClassLoader());
+        Class clazz = Class.forName("TransferableList", true, classLoader);
+        DataFlavor df = new DataFlavor(clazz, "Transferable List");
+        Object obj = clazz.newInstance();
+        Transferable t = new DFTransferable(df, obj);
+        c.setContents(t, null);
+        Transferable ct = c.getContents(null);
+        ct.getTransferData(df);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/CustomClassLoaderTransferTest/TransferableList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,30 @@
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+
+public class TransferableList extends ArrayList {
+    private static class NullInvocationHandler implements InvocationHandler, Serializable {
+        public Object invoke(Object proxy, Method method, Object[] args)
+          throws Throwable {
+            throw new Error("UNIMPLEMENTED");
+        }
+    }
+
+    public TransferableList() {
+        try {
+            InvocationHandler handler = new NullInvocationHandler();
+            Class<?> proxyClass = Proxy.getProxyClass(
+                ListInterface.class.getClassLoader(),
+                new Class[] { ListInterface.class, AnotherInterface.class });
+            AnotherInterface obj = (AnotherInterface) proxyClass.
+                    getConstructor(new Class[]{InvocationHandler.class}).
+                    newInstance(handler);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
+
+interface ListInterface extends Serializable {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/DataFlavorCloneTest/DataFlavorCloneTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4181601
+  @summary tests that DataFlavor.clone method doesn't throw exception
+  @author xianfa: area=
+  @run main DataFlavorCloneTest
+*/
+
+
+import java.awt.datatransfer.DataFlavor;
+
+public class DataFlavorCloneTest {
+
+    public static void main(String[] args) throws Exception {
+        DataFlavor df1 = null;
+        Object df2 = null;
+        try {
+            df1 = new DataFlavor();
+            df2 = df1.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new RuntimeException("FAILED: Unexpected exception: " + e);
+        } catch (NullPointerException e) {
+            throw new RuntimeException("FAILED: Got Null pointer exception");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/DataFlavorEqualsNullTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4175731
+  @summary DataFlavor.equals(null) throws NullPointerException
+  @author prs@sparc.spb.su: area=
+  @run main DataFlavorEqualsNullTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+
+public class DataFlavorEqualsNullTest {
+    public static boolean finished = false;
+    static boolean noexc = true;
+    static boolean eq = false;
+    static DataFlavor df = null;
+
+    public static void main(String[] args) throws Exception {
+
+        try {
+            df = new DataFlavor("application/postscript;class=java.awt.datatransfer.DataFlavor");
+        } catch (ClassNotFoundException e) {
+            // This should never happen
+        }
+        try {
+            eq = df.equals((Object) null);
+            if (eq) noexc = false;
+            eq = df.equals((DataFlavor) null);
+            if (eq) noexc = false;
+            eq = df.equals((String) null);
+            if (eq) noexc = false;
+        } catch (NullPointerException e1) {
+            noexc = false;
+        }
+        finished = true;
+        if (!noexc)
+            throw new RuntimeException("Test FAILED");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/DataFlavorEqualsTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4175341
+  @summary DataFlavor.equals throws NullPointerException
+  @author prs@sparc.spb.su: area=
+  @run main DataFlavorEqualsTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+
+public class DataFlavorEqualsTest {
+     public static boolean finished = false;
+     static boolean noexc = true;
+     static boolean eq = false;
+     static DataFlavor df = null;
+
+     public static void main(String[] args) {
+         df = new DataFlavor();
+         try {
+             eq = df.equals((Object)new DataFlavor());
+             if (!eq) noexc = false;
+             eq = df.equals(new DataFlavor());
+             if (!eq) noexc = false;
+             eq = df.equals("application/postscript;class=java.awt.datatransfer.DataFlavor");
+             if (eq) noexc = false;
+         } catch (NullPointerException e1) {
+             noexc = false;
+         }
+         finished = true;
+         if (!noexc)
+             throw new RuntimeException("Test FAILED");
+
+     }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/DataFlavorFileListTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4172848
+  @summary DataFlavor.isFlavorJavaFileListType works wrong
+  @author prs@sparc.spb.su: area=
+  @run main DataFlavorFileListTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+
+public class DataFlavorFileListTest {
+     public static boolean finished = false;
+     static DataFlavor df = null;
+
+     public static void main(String[] args) throws Exception {
+         df = new DataFlavor("application/x-java-file-list;class=java.util.ArrayList");
+         boolean fl = df.isFlavorJavaFileListType();
+         finished = true;
+         if (!fl)
+             throw new RuntimeException("Test FAILED");
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/DataFlavorSerializedTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4174020
+  @summary DataFlavor.isMimeTypeSerializedObject works wrong
+  @author prs@sparc.spb.su: area=
+  @run main DataFlavorSerializedTest
+*/
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+
+public class DataFlavorSerializedTest {
+     public static boolean finished = false;
+     static DataFlavor df = null;
+
+     public static void main(String[] args) throws Exception {
+         df = new DataFlavor("application/x-java-serialized-object;class=java.io.Serializable");
+         boolean fl = df.isMimeTypeSerializedObject();
+         finished = true;
+         if (!fl)
+             throw new RuntimeException("Test FAILED");
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/DefaultMatchTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4250750
+  @summary tests that DataFlavor.match() does not throw NPE.
+  @author prs@sparc.spb.su: area=
+  @run main DefaultMatchTest
+*/
+
+
+import java.awt.datatransfer.DataFlavor;
+
+public class DefaultMatchTest {
+
+    static DataFlavor df1, df2, df3;
+
+    public static void main(String[] args) throws Exception {
+        boolean passed = true;
+        try {
+            df1 = new DataFlavor("application/postscript");
+            df2 = new DataFlavor();
+            df3 = new DataFlavor();
+        } catch (ClassNotFoundException e1) {
+            throw new RuntimeException("Could not create DataFlavors. This should never happen.");
+        } catch (IllegalArgumentException e2) {
+            passed = false;
+        }
+        try {
+            boolean b;
+            b = df1.match(df2);
+            b = df2.match(df1);
+            b = df2.match(df3);
+        } catch (NullPointerException e) {
+            throw new RuntimeException("The test FAILED: DataFlavor.match still throws NPE");
+        }
+        if (!passed) {
+            throw new RuntimeException("Test FAILED");
+        }
+        System.out.println("Test PASSED");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/EqualHashCodeTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4157612
+  @summary tests that certain awt classes do not break basic hashCode() contract.
+  @author prs@sparc.spb.su: area=
+  @run main EqualHashCodeTest
+*/
+
+import java.awt.*;
+import java.awt.color.ColorSpace;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
+
+public class EqualHashCodeTest {
+
+     static DataFlavor df1, df2;
+     static Insets insets1, insets2;
+     static Dimension dim1, dim2;
+     static ColorModel cm1, cm2;
+     static int[] ColorModelBits = { 8, 8, 8, 8 };
+
+     public static void main(String[] args) throws Exception {
+         boolean passed = true;
+         try {
+             df1 = new DataFlavor( "application/postscript" );
+             df2 = new DataFlavor( "application/*" );
+         } catch (ClassNotFoundException e1) {
+             throw new RuntimeException("Could not create DataFlavors. This should never happen.");
+         } catch (IllegalArgumentException e2) {
+             passed = false;
+         }
+         if (df1.hashCode() != df2.hashCode()) {
+             passed = false;
+         }
+         dim1 = new Dimension(3, 18);
+         dim2 = new Dimension(3, 18);
+         if (dim1.hashCode() != dim2.hashCode()) {
+             passed = false;
+         }
+         insets1 = new Insets(3, 4, 7, 11);
+         insets2 = new Insets(3, 4, 7, 11);
+         if (insets1.hashCode() != insets2.hashCode()) {
+             passed = false;
+         }
+         cm1 = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                                       ColorModelBits, true, true,
+                                       Transparency.OPAQUE, 0);
+         cm2 = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                                       ColorModelBits, true, true,
+                                       Transparency.OPAQUE, 0);
+         if (cm1.hashCode() != cm2.hashCode()) {
+             passed = false;
+         }
+         if (!passed)
+             throw new RuntimeException("Test FAILED");
+     }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/ExternalizeTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4274267
+  @summary Tests that externalized DataFlavor is restored properly
+  @author prs@sparc.spb.su: area=
+  @run main ExternalizeTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+public class ExternalizeTest {
+
+   public static void main(String[] args) {
+       DataFlavor df = new DataFlavor("text/enriched; charset=ascii", "Enrich Flavor");
+
+       storeDataFlavor(df);
+       DataFlavor df1 = retrieveDataFlavor();
+
+       if (!df.equals(df1)) {
+           throw new RuntimeException("FAILED: restored DataFlavor is not equal to externalized one");
+       }
+
+   }
+
+   public static void storeDataFlavor(DataFlavor dfs){
+       // To store the dataflavor into a file using writeExternal()
+       try {
+           FileOutputStream ostream = new FileOutputStream("t.tmp");
+           ObjectOutputStream p = new ObjectOutputStream(ostream);
+           dfs.writeExternal(p);
+           ostream.close();
+
+       } catch (Exception ex){
+           throw new RuntimeException("FAIL: problem occured while storing DataFlavor");
+       }
+   }
+
+
+   public static DataFlavor retrieveDataFlavor(){
+       DataFlavor df=DataFlavor.stringFlavor;
+       try {
+           FileInputStream istream = new FileInputStream("t.tmp");
+           ObjectInputStream p = new ObjectInputStream(istream);
+           df.readExternal(p);
+           istream.close();
+       } catch (Exception ex){
+           throw new RuntimeException("FAIL: problem occured while retrieving DataFlavor");
+       }
+
+       return df;
+   }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/GetReaderForTextIAEForStringSelectionTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4260874
+  @summary Tests that DataFlavor.getReaderForText do not throw NPE when transferObject is null
+  @author tdv@sparc.spb.su: area=
+  @run main GetReaderForTextIAEForStringSelectionTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.io.Reader;
+
+public class GetReaderForTextIAEForStringSelectionTest  {
+
+   public static void main(String[] args) throws Exception {
+      DataFlavor pt ;
+
+      try {
+          pt = DataFlavor.plainTextFlavor;
+          StringSelection ss = new StringSelection("ReaderExample");
+          Reader re = pt.getReaderForText(ss);
+          if(re == null) {
+              throw new RuntimeException("Test FAILED! reader==null");
+          }
+      } catch (Exception e) {
+          throw new RuntimeException("Test FAILED because of the exception: " + e);
+      }
+    }
+
+ }
+
+class FakeTransferable implements Transferable {
+    public DataFlavor[] getTransferDataFlavors() {
+        return null;
+    }
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        return false;
+    }
+    public Object getTransferData(DataFlavor flavor) throws
+        UnsupportedFlavorException, IOException {
+        return null;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/GetReaderForTextNPETest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4260874
+  @summary Tests that DataFlavor.getReaderForText do not throw NPE when transferObject is null
+  @author tdv@sparc.spb.su: area=
+  @run main GetReaderForTextNPETest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.io.Reader;
+
+public class GetReaderForTextNPETest {
+
+    public static void main(String[] args) {
+        DataFlavor df = new DataFlavor();
+        FakeTransferable t = new FakeTransferable();
+        Reader reader;
+        try {
+            reader = df.getReaderForText(null);
+        } catch (Exception e) {
+            if (!(e instanceof NullPointerException)) {
+                throw new RuntimeException("TEST FAILED: not a NPE thrown on a null argument.");
+            }
+        }
+        try {
+            reader = df.getReaderForText(t);
+        } catch (Exception e) {
+            if (!(e instanceof IllegalArgumentException)) {
+                throw new RuntimeException("FAILED: not an IllegalArgumentException thrown on a transferable with null transfer data .");
+            }
+        }
+    }
+}
+
+class FakeTransferable implements Transferable {
+    public DataFlavor[] getTransferDataFlavors() {
+        return null;
+    }
+
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        return false;
+    }
+
+    public Object getTransferData(DataFlavor flavor) throws
+            UnsupportedFlavorException, IOException {
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/MimeTypeSerializationTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4116781
+  @summary Tests that long (more than 64K) MimeType can be serialized
+           and deserialized.
+  @author gas@sparc.spb.su area=datatransfer
+  @run main MimeTypeSerializationTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Arrays;
+
+public class MimeTypeSerializationTest {
+
+    public static void main(String[] args) throws Exception {
+        boolean failed = false;
+
+        try {
+            int len = 70000;
+            char[] longValue = new char[len];
+            Arrays.fill(longValue, 'v');
+            DataFlavor longdf = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType +
+                "; class=java.lang.String; longParameter=" + new String(longValue));
+
+            DataFlavor shortdf = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType +
+                "; class=java.lang.String");
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream(100000);
+            ObjectOutputStream oos = new ObjectOutputStream(baos);
+            oos.writeObject(longdf);
+            oos.writeObject(shortdf);
+            oos.close();
+
+            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+            ObjectInputStream ois = new ObjectInputStream(bais);
+            DataFlavor longdf2 = (DataFlavor) ois.readObject();
+            DataFlavor shortdf2 = (DataFlavor) ois.readObject();
+            ois.close();
+
+            failed = !( longdf.getMimeType().equals(longdf2.getMimeType()) &&
+                shortdf.getMimeType().equals(shortdf2.getMimeType()) );
+            if (failed) {
+                System.err.println("deserialized MIME type does not match original one");
+            }
+        } catch (IOException e) {
+            failed = true;
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        if (failed) {
+            throw new RuntimeException("test failed: serialization attempt failed");
+        } else {
+            System.err.println("test passed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/NoClassParameterTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4212613
+  @summary tests that DataFlavor(String) doesn't through Exception if no "class=" specified.
+  @author prs@sparc.spb.su: area=
+  @run main NoClassParameterTest
+*/
+
+
+import java.awt.datatransfer.DataFlavor;
+
+public class NoClassParameterTest {
+     static DataFlavor df = null;
+
+     public static void main(String[] args) {
+         boolean passed = true;
+         try {
+             df = new DataFlavor("application/postscript");
+         } catch (ClassNotFoundException e1) {
+             throw new RuntimeException("This should never happen.");
+         } catch (IllegalArgumentException e2) {
+             passed = false;
+         }
+         if (!passed)
+             throw new RuntimeException("Test FAILED");
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/NormalizeMimeTypeParameter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+  @test
+  @bug 4260860
+  @summary tests that DataFlavor.normalizeMimeTypeParameter() returns parm value
+  @author ssi@sparc.spb.su area=
+  @run main NormalizeMimeTypeParameter
+*/
+
+import java.awt.datatransfer.DataFlavor;
+
+public class NormalizeMimeTypeParameter {
+
+  static class TestFlavor extends DataFlavor {
+    public String normalizeMimeType(String mimeType) {
+      return super.normalizeMimeType(mimeType);
+    }
+    public String normalizeMimeTypeParameter(String parameterName,
+                                             String parameterValue) {
+      return super.normalizeMimeTypeParameter(parameterName, parameterValue);
+    }
+  }
+
+  static TestFlavor testFlavor;
+
+  public static void main(String[] args) {
+    testFlavor = new TestFlavor();
+
+    String type = "TestType";
+    String parameter = "TestParameter";
+
+    String retValue = testFlavor.normalizeMimeTypeParameter(type, parameter);
+    if(!retValue.equals(parameter)) {
+      throw new RuntimeException("Test FAILED: " + retValue);
+    }
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/NullDataFlavorTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4682039
+  @summary Tests that DataTransferer.getFormatsForFlavors() does not throw
+           NullPointerException if some of given as parameter data flavors
+           are null.
+  @author gas@sparc.spb.su area=datatransfer
+  @run main NullDataFlavorTest
+*/
+
+import java.awt.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+
+public class NullDataFlavorTest {
+
+    private final static Clipboard clipboard =
+        Toolkit.getDefaultToolkit().getSystemClipboard();
+
+    public static void main(String[] args) throws Exception {
+        boolean failed = false;
+
+        try {
+            clipboard.setContents(new NullSelection("DATA1",
+                new DataFlavor[] { null, null, null }), null);
+            clipboard.setContents(new NullSelection("DATA2",
+                new DataFlavor[] { null, DataFlavor.stringFlavor, null }), null);
+            clipboard.setContents(new NullSelection("DATA3", null), null);
+        } catch (NullPointerException e) {
+            failed = true;
+            e.printStackTrace();
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+
+        if (failed) {
+            throw new RuntimeException("test failed: NullPointerException " +
+            "has been thrown");
+        } else {
+            System.err.println("test passed");
+        }
+    }
+}
+
+class NullSelection implements Transferable {
+
+    private final DataFlavor[] flavors;
+
+    private final String data;
+
+    public NullSelection(String data, DataFlavor[] flavors) {
+        this.data = data;
+        this.flavors = flavors;
+    }
+
+    @Override
+    public DataFlavor[] getTransferDataFlavors() {
+        return flavors;
+    }
+
+    @Override
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        for (DataFlavor fl : flavors) {
+            if (flavor.equals(fl)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public Object getTransferData(DataFlavor flavor)
+        throws UnsupportedFlavorException, java.io.IOException
+    {
+        for (DataFlavor fl : flavors) {
+            if (flavor.equals(fl)) {
+                return data;
+            }
+        }
+        throw new UnsupportedFlavorException(flavor);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/ReaderForUnicodeText.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4274234
+  @summary Tests that DataFlavor.getReaderForText() doesn't throw UnsupportedEncodingException for unicode text
+  @author prs@sparc.spb.su: area=
+  @run main ReaderForUnicodeText
+*/
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+
+public class ReaderForUnicodeText {
+
+   public static void main(String[] args) throws Exception {
+      DataFlavor df = DataFlavor.plainTextFlavor;
+      TextTransferable t = new TextTransferable();
+      Reader reader;
+      try {
+          reader = df.getReaderForText(t);
+      } catch (UnsupportedEncodingException e) {
+           throw new RuntimeException("FAILED: Exception thrown in getReaderForText()");
+      }
+    }
+}
+
+class TextTransferable implements Transferable {
+
+    String text = "Try to test me...";
+
+    @Override
+    public DataFlavor[] getTransferDataFlavors() {
+        DataFlavor flavors[] = {DataFlavor.plainTextFlavor};
+        return flavors;
+    }
+
+    @Override
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        if (flavor.match(DataFlavor.plainTextFlavor)) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public Object getTransferData(DataFlavor flavor) throws
+        UnsupportedFlavorException, IOException {
+
+        byte[] textBytes = null;
+
+        if (!isDataFlavorSupported(flavor)) {
+            throw new UnsupportedFlavorException(flavor);
+        }
+        String encoding = flavor.getParameter("charset");
+        if (encoding == null) {
+            textBytes = text.getBytes();
+        } else {
+            textBytes = text.getBytes(encoding);
+        }
+        return new ByteArrayInputStream(textBytes);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/SelectBestFlavorNPETest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4370469
+  @summary tests that selectBestTextFlavor doesn't throw NPE
+  @author prs@sparc.spb.su: area=
+  @run main SelectBestFlavorNPETest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+
+public class SelectBestFlavorNPETest {
+
+    public static void main(String[] args) {
+
+        DataFlavor flavor1 = new DataFlavor("text/plain; charset=unicode; class=java.io.InputStream",
+                "Flavor 1");
+        DataFlavor flavor2 = new DataFlavor("text/plain; class=java.io.InputStream", "Flavor 2");
+        DataFlavor[] flavors = new DataFlavor[]{flavor1, flavor2};
+        try {
+            DataFlavor best = DataFlavor.selectBestTextFlavor(flavors);
+            System.out.println("best=" + best);
+        } catch (NullPointerException e1) {
+            throw new RuntimeException("Test FAILED because of NPE in selectBestTextFlavor");
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/SelectBestTextFlavorBadArrayTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4386360
+  @summary tests that DataFlavor.selectBestTextFlavor() returns null when passed
+           is a null array or an empty array or an array which doesn't contain
+           a text flavor in a supported encoding.
+  @author das@sparc.spb.su area=datatransfer
+  @run main SelectBestTextFlavorBadArrayTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.util.Stack;
+import java.util.stream.Collectors;
+
+public class SelectBestTextFlavorBadArrayTest {
+
+    public static void main(String[] args) {
+        final String[] failureMessages = {
+            "DataFlavor.selectBestTextFlavor(null) doesn't return null.",
+            "DataFlavor.selectBestTextFlavor() doesn't return null for an empty array.",
+            "DataFlavor.selectBestTextFlavor() shouldn't return flavor in an unsupported encoding."
+        };
+        Stack<String> failures = new Stack<>();
+
+        DataFlavor flavor = DataFlavor.selectBestTextFlavor(null);
+        if (flavor != null) {
+            failures.push(failureMessages[0]);
+        }
+        flavor = DataFlavor.selectBestTextFlavor(new DataFlavor[0]);
+        if (flavor != null) {
+            failures.push(failureMessages[1]);
+        }
+
+        try {
+            flavor = DataFlavor.selectBestTextFlavor(new DataFlavor[]
+                { new DataFlavor("text/plain; charset=unsupported; class=java.io.InputStream") });
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+            failures.push("Exception thrown: " + e.toString());
+        }
+        if (flavor != null) {
+            failures.push(failureMessages[2]);
+        }
+
+        if (failures.size() > 0) {
+            String failureReport = failures.stream().collect(Collectors.joining("\n"));
+            throw new RuntimeException("TEST FAILED: \n" + failureReport);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/DataFlavor/ToStringNullPointerTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+  @test
+  @bug 4250768
+  @summary tests that DataFlavor.toString() does not throw NPE
+  @author prs@sparc.spb.su: area=
+  @run main ToStringNullPointerTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+
+public class ToStringNullPointerTest {
+
+     static DataFlavor df1;
+
+     public static void main(String[] args) {
+         df1 = new DataFlavor();
+         try {
+             String thisDF = df1.toString();
+         } catch (NullPointerException e) {
+             throw new RuntimeException("Test FAILED: it still throws NPE!");
+         }
+     }
+}
+
--- a/test/java/awt/datatransfer/DuplicatedNativesTest/DuplicatedNativesTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.SystemFlavorMap;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-/* @test
- * @bug 8028230
- * @summary Checks that SystemFlavorMap.getNativesForFlavor returns a list without duplicates
- * @author Petr Pchelko
- * @run main DuplicatedNativesTest
- */
-public class DuplicatedNativesTest {
-
-    public static void main(String[] args) throws Exception {
-
-        // 1. Check that returned natives do not contain duplicates.
-        SystemFlavorMap flavorMap = (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
-        for (Map.Entry<DataFlavor, String> entry : flavorMap.getNativesForFlavors(null).entrySet()) {
-            List<String> natives = flavorMap.getNativesForFlavor(entry.getKey());
-            if (new HashSet<>(natives).size() != natives.size()) {
-                throw new RuntimeException("FAILED: returned natives contain duplicates: " + Arrays.toString(natives.toArray()));
-            }
-        }
-
-        // 2. Check that even if we set a duplicate it would be ignored.
-        flavorMap.setNativesForFlavor(DataFlavor.stringFlavor, new String[] {"test", "test", "test"});
-        List<String> natives = flavorMap.getNativesForFlavor(DataFlavor.stringFlavor);
-        if (new HashSet<>(natives).size() != natives.size()) {
-            throw new RuntimeException("FAILED: duplicates were not ignored: " + Arrays.toString(natives.toArray()));
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/Headless/HeadlessClipboard.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.Clipboard;
+
+/*
+ * @test
+ * @summary Check Clipboard constructor and getName() method do not throw
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessClipboard
+ */
+
+public class HeadlessClipboard {
+    public static void main(String args[]) {
+        Clipboard cb = new Clipboard("dummy");
+        cb.getName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/Headless/HeadlessDataFlavor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.DataFlavor;
+
+/*
+ * @test
+ * @summary Check that DataFlavor constructors do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDataFlavor
+ */
+
+public class HeadlessDataFlavor {
+    public static void main(String args[]) throws Exception {
+        DataFlavor df;
+        df = new DataFlavor();
+        df = new DataFlavor("text/plain", "plain jane text");
+        df = new DataFlavor("text/html", "HTML text");
+        df = new DataFlavor("text/plain");
+        df = new DataFlavor("text/html");
+        df.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/Headless/HeadlessSystemFlavorMap.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.FlavorMap;
+import java.awt.datatransfer.SystemFlavorMap;
+
+/*
+ * @test
+ * @summary Check that SystemFlavorMap constructor does not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessSystemFlavorMap
+ */
+
+public class HeadlessSystemFlavorMap {
+    public static void main(String args[]) {
+        FlavorMap sfm = SystemFlavorMap.getDefaultFlavorMap();
+    }
+}
--- a/test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.SystemFlavorMap;
-import java.util.List;
-
-/*
-  @test
-  @bug 4512530 8027148
-  @summary tests that mappings for text flavors are generated properly
-  @author das@sparc.spb.su area=datatransfer
-*/
-
-public class MappingGenerationTest {
-
-    private static final SystemFlavorMap fm =
-        (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
-
-    public static void main(String[] args)  {
-        test1();
-        test2();
-        test3();
-        test4();
-        test5();
-        test6();
-    }
-
-    /**
-     * Verifies that Lists returned from getNativesForFlavor() and
-     * getFlavorsForNative() are not modified with a subsequent call
-     * to addUnencodedNativeForFlavor() and addFlavorForUnencodedNative()
-     * respectively.
-     */
-    public static void test1() {
-        DataFlavor df = new DataFlavor("text/plain-test1", null);
-        String nat = "native1";
-
-        List<String> natives = fm.getNativesForFlavor(df);
-        fm.addUnencodedNativeForFlavor(df, nat);
-        List<String> nativesNew = fm.getNativesForFlavor(df);
-        if (natives.equals(nativesNew)) {
-            System.err.println("orig=" + natives);
-            System.err.println("new=" + nativesNew);
-            throw new RuntimeException("Test failed");
-        }
-
-        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
-        fm.addFlavorForUnencodedNative(nat, df);
-        List<DataFlavor> flavorsNew = fm.getFlavorsForNative(nat);
-        if (flavors.equals(flavorsNew)) {
-            System.err.println("orig=" + flavors);
-            System.err.println("new=" + flavorsNew);
-            throw new RuntimeException("Test failed");
-        }
-    }
-
-    /**
-     * Verifies that SystemFlavorMap is not affected by modification of
-     * the Lists returned from getNativesForFlavor() and
-     * getFlavorsForNative().
-     */
-    public static void test2() {
-        DataFlavor df = new DataFlavor("text/plain-test2", null);
-        String nat = "native2";
-        DataFlavor extraDf = new DataFlavor("text/test", null);
-
-        List<String> natives = fm.getNativesForFlavor(df);
-        natives.add("Should not be here");
-        java.util.List nativesNew = fm.getNativesForFlavor(df);
-        if (natives.equals(nativesNew)) {
-            System.err.println("orig=" + natives);
-            System.err.println("new=" + nativesNew);
-            throw new RuntimeException("Test failed");
-        }
-
-        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
-        flavors.add(extraDf);
-        java.util.List flavorsNew = fm.getFlavorsForNative(nat);
-        if (flavors.equals(flavorsNew)) {
-            System.err.println("orig=" + flavors);
-            System.err.println("new=" + flavorsNew);
-            throw new RuntimeException("Test failed");
-        }
-    }
-
-    /**
-     * Verifies that addUnencodedNativeForFlavor() for a particular text flavor
-     * doesn't affect mappings for other flavors.
-     */
-    public static void test3() {
-        DataFlavor df1 = new DataFlavor("text/plain-test3", null);
-        DataFlavor df2 = new DataFlavor("text/plain-test3; charset=Unicode; class=java.io.Reader", null);
-        String nat = "native3";
-        List<String> natives = fm.getNativesForFlavor(df2);
-        fm.addUnencodedNativeForFlavor(df1, nat);
-        List<String> nativesNew = fm.getNativesForFlavor(df2);
-        if (!natives.equals(nativesNew)) {
-            System.err.println("orig=" + natives);
-            System.err.println("new=" + nativesNew);
-            throw new RuntimeException("Test failed");
-        }
-    }
-
-    /**
-     * Verifies that addUnencodedNativeForFlavor() really adds the specified
-     * flavor-to-native mapping to the existing mappings.
-     */
-    public static void test4() {
-        DataFlavor df = new DataFlavor("text/plain-test4; charset=Unicode; class=java.io.Reader", null);
-        String nat = "native4";
-        List<String> natives = fm.getNativesForFlavor(df);
-        if (!natives.contains(nat)) {
-            fm.addUnencodedNativeForFlavor(df, nat);
-            List<String> nativesNew = fm.getNativesForFlavor(df);
-            natives.add(nat);
-            if (!natives.equals(nativesNew)) {
-                System.err.println("orig=" + natives);
-                System.err.println("new=" + nativesNew);
-                throw new RuntimeException("Test failed");
-            }
-        }
-    }
-
-    /**
-     * Verifies that a flavor doesn't have any flavor-to-native mappings after
-     * a call to setNativesForFlavor() with this flavor and an empty native
-     * array as arguments.
-     */
-    public static void test5() {
-        final DataFlavor flavor =
-            new DataFlavor("text/plain-TEST5; charset=Unicode", null);
-
-        fm.getNativesForFlavor(flavor);
-
-        fm.setNativesForFlavor(flavor, new String[0]);
-
-        List<String> natives = fm.getNativesForFlavor(flavor);
-
-        if (!natives.isEmpty()) {
-            System.err.println("natives=" + natives);
-            throw new RuntimeException("Test failed");
-        }
-    }
-
-    /**
-     * Verifies that a native doesn't have any native-to-flavor mappings after
-     * a call to setFlavorsForNative() with this native and an empty flavor
-     * array as arguments.
-     */
-    public static void test6() {
-        final String nat = "STRING";
-        fm.getFlavorsForNative(nat);
-        fm.setFlavorsForNative(nat, new DataFlavor[0]);
-
-        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
-
-        if (!flavors.isEmpty()) {
-            System.err.println("flavors=" + flavors);
-            throw new RuntimeException("Test failed");
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/AbsoluteComponentCenterCalculator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+class AbsoluteComponentCenterCalculator {
+    private AbsoluteComponentCenterCalculator() {
+    }
+
+    public static int calculateXCenterCoordinate(Component component) {
+        return (int) component.getLocationOnScreen().getX() + (component.getWidth() / 2);
+    }
+
+    public static int calculateYCenterCoordinate(Component component) {
+        return (int) component.getLocationOnScreen().getY() + (component.getHeight() / 2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/DataFlavorSearcher.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.FlavorTable;
+import java.awt.datatransfer.SystemFlavorMap;
+import java.util.Arrays;
+
+public class DataFlavorSearcher {
+    static public String[] HTML_NAMES = new String[]{"HTML", "HTML Format"};
+    static public String[] RICH_TEXT_NAMES = new String[]{"RICH_TEXT", "Rich Text Format"};
+
+    static public DataFlavor getByteDataFlavorForNative(String[] nats) {
+        FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();
+
+        for (String nat : nats) {
+            java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
+            for (DataFlavor flavor : flavors) {
+                if (flavor != null
+                        && flavor.getRepresentationClass().equals(byte[].class)) {
+                    return flavor;
+                }
+            }
+        }
+        throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/InterprocessMessages.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+interface InterprocessMessages {
+    final static int EXECUTION_IS_SUCCESSFULL = 0;
+    final static int DATA_IS_CORRUPTED = 212;
+    final static int NO_DROP_HAPPENED = 112;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,48 @@
+<!--
+ Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
+<html>
+<!--  
+  @test
+  @bug 8005932 8017456
+  @summary Java 7 on mac os x only provides text clipboard formats
+  @author mikhail.cherkasov@oracle.com
+  @library ../../regtesthelpers
+  @library ../../regtesthelpers/process
+  @build Util
+  @build ProcessResults ProcessCommunicator
+  @run applet/othervm MissedHtmlAndRtfBug.html
+-->
+
+<head>
+    <title>Java 7 on mac os x only provides text clipboard formats</title>
+</head>
+<body>
+
+<h1> MissedHtmlAndRtfBug <br>Bug ID: 8005932 </h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="MissedHtmlAndRtfBug.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.event.*;
+import java.applet.Applet;
+import java.io.File;
+import java.util.ArrayList;
+
+import test.java.awt.regtesthelpers.process.ProcessCommunicator;
+import test.java.awt.regtesthelpers.process.ProcessResults;
+import test.java.awt.regtesthelpers.Util;
+import sun.awt.OSInfo;
+
+import static java.lang.Thread.sleep;
+
+public class MissedHtmlAndRtfBug extends Applet {
+
+    public void init() {
+        setLayout(new BorderLayout());
+    }//End  init()
+
+    public void start() {
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX
+                && OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
+            System.out.println("This test is for Windows and Mac only. Passed.");
+            return;
+        }
+
+        final Frame sourceFrame = new Frame("Source frame");
+        final SourcePanel sourcePanel = new SourcePanel();
+        sourceFrame.add(sourcePanel);
+        sourceFrame.pack();
+        sourceFrame.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent e) {
+                sourceFrame.dispose();
+            }
+        });
+        sourceFrame.setVisible(true);
+
+        Util.waitForIdle(null);
+
+        NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame);
+
+        ArrayList<String> args = new ArrayList<String>(5);
+        args.add(String.valueOf(positionCalculator.getNextLocationX()));
+        args.add(String.valueOf(positionCalculator.getNextLocationY()));
+        args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)));
+        args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)));
+        args.add(concatStrings(DataFlavorSearcher.RICH_TEXT_NAMES));
+
+        ProcessResults processResults =
+                ProcessCommunicator.executeChildProcess(this.getClass(),
+                        "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
+
+        verifyTestResults(processResults);
+
+        args.set(args.size() - 1, concatStrings(DataFlavorSearcher.HTML_NAMES));
+
+        ProcessCommunicator.executeChildProcess(this.getClass(),
+                "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
+        verifyTestResults(processResults);
+
+
+    }// start()
+
+    private String concatStrings(String[] strings) {
+        StringBuffer result = new StringBuffer("\"");
+        for (int i = 0; i < strings.length; i++) {
+            result.append(strings[i]);
+            result.append(",");
+        }
+        result.append("\"");
+        return result.toString();
+    }
+
+
+    private static void verifyTestResults(ProcessResults processResults) {
+        if (InterprocessMessages.DATA_IS_CORRUPTED ==
+                processResults.getExitValue()) {
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("TEST IS FAILED: Target has received" +
+                    " corrupted data.");
+        }
+        if (InterprocessMessages.NO_DROP_HAPPENED ==
+                processResults.getExitValue()) {
+            processResults.printProcessErrorOutput(System.err);
+            throw new RuntimeException("Error. Drop did not happen." +
+                " Target frame is possibly covered by a window of other application." +
+                " Please, rerun the test with all windows minimized.");
+        }
+        processResults.verifyStdErr(System.err);
+        processResults.verifyProcessExitValue(System.err);
+        processResults.printProcessStandartOutput(System.out);
+    }
+
+    //We cannot make an instance of the applet without the default constructor
+    public MissedHtmlAndRtfBug() {
+        super();
+    }
+
+    //We need in this constructor to pass frame position between JVMs
+    public MissedHtmlAndRtfBug(Point targetFrameLocation, Point dragSourcePoint, DataFlavor df)
+            throws InterruptedException {
+        final Frame targetFrame = new Frame("Target frame");
+        final TargetPanel targetPanel = new TargetPanel(targetFrame, df);
+        targetFrame.add(targetPanel);
+        targetFrame.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent e) {
+                targetFrame.dispose();
+            }
+        });
+        targetFrame.setLocation(targetFrameLocation);
+        targetFrame.pack();
+        targetFrame.setVisible(true);
+
+        doTest(dragSourcePoint, targetPanel);
+    }
+
+    private void doTest(Point dragSourcePoint, TargetPanel targetPanel) {
+        Util.waitForIdle(null);
+
+        final Robot robot = Util.createRobot();
+
+        robot.mouseMove((int) dragSourcePoint.getX(), (int) dragSourcePoint.getY());
+        try {
+            sleep(100);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            sleep(100);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            sleep(100);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        Util.drag(robot, dragSourcePoint, new Point(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(targetPanel),
+                AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(targetPanel)),
+                InputEvent.BUTTON1_MASK);
+    }
+
+
+    enum InterprocessArguments {
+        TARGET_FRAME_X_POSITION_ARGUMENT,
+        TARGET_FRAME_Y_POSITION_ARGUMENT,
+        DRAG_SOURCE_POINT_X_ARGUMENT,
+        DRAG_SOURCE_POINT_Y_ARGUMENT,
+        DATA_FLAVOR_NAMES;
+
+        int extractInt(String[] args) {
+            return Integer.parseInt(args[this.ordinal()]);
+        }
+
+        String[] extractStringArray(String[] args) {
+            return args[this.ordinal()].replaceAll("\"", "").split(",");
+        }
+    }
+
+    public static void main(String[] args) throws InterruptedException {
+        Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extractInt(args),
+                InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extractInt(args));
+        Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extractInt(args),
+                InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extractInt(args));
+        String[] names = InterprocessArguments.DATA_FLAVOR_NAMES.extractStringArray(args);
+
+        DataFlavor df = DataFlavorSearcher.getByteDataFlavorForNative(names);
+        try {
+            new MissedHtmlAndRtfBug(targetFrameLocation, dragSourcePoint, df);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        sleep(5000);
+        System.exit(InterprocessMessages.NO_DROP_HAPPENED);
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/MyTransferable.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.*;
+import java.io.IOException;
+
+class MyTransferable implements Transferable {
+
+    public static final String TEST_DATA = "<b>Test</b>";
+    private DataFlavor[] dataFlavors;
+
+    public MyTransferable() {
+        dataFlavors = new DataFlavor[]{DataFlavorSearcher.getByteDataFlavorForNative(DataFlavorSearcher.HTML_NAMES),
+                DataFlavorSearcher.getByteDataFlavorForNative(DataFlavorSearcher.RICH_TEXT_NAMES)};
+    }
+
+
+    @Override
+    public DataFlavor[] getTransferDataFlavors() {
+        return dataFlavors;
+    }
+
+    @Override
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        for (DataFlavor f : dataFlavors) {
+            if (f.equals(flavor)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public Object getTransferData(DataFlavor flavor)
+            throws UnsupportedFlavorException, IOException {
+        if (isDataFlavorSupported(flavor)) {
+            return TEST_DATA.getBytes("UTF-16");
+        } else {
+            throw new UnsupportedFlavorException(flavor);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/NextFramePositionCalculator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+
+class NextFramePositionCalculator {
+
+    private final Frame currentFrame;
+
+    public NextFramePositionCalculator(Frame currentFrame) {
+        this.currentFrame = currentFrame;
+    }
+
+    public int getNextLocationX() {
+        return currentFrame.getX() + currentFrame.getWidth();
+    }
+
+    public int getNextLocationY() {
+        return currentFrame.getY();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/SourcePanel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.*;
+
+public class SourcePanel extends Panel {
+
+    private final MyDragGestureListener dragGestureListener =
+            new MyDragGestureListener();
+
+    public SourcePanel() {
+        setPreferredSize(new Dimension(200, 200));
+        DragSource defaultDragSource =
+                DragSource.getDefaultDragSource();
+        defaultDragSource.createDefaultDragGestureRecognizer(this,
+                DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);
+        setBackground(Color.RED);
+    }
+
+    private class MyDragGestureListener implements DragGestureListener {
+        public void dragGestureRecognized(DragGestureEvent dge) {
+            dge.startDrag(null, new MyTransferable());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/MissedHtmlAndRtfBug/TargetPanel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.*;
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.util.Timer;
+import java.util.TimerTask;
+
+public class TargetPanel extends Panel implements DropTargetListener {
+
+
+    //private final CustomDropTargetListener dropTargetListener = new CustomDropTargetListener();
+
+    private Frame frame;
+    DataFlavor dataFlavor;
+
+    public TargetPanel(Frame frame, DataFlavor dataFlavor) {
+        this.dataFlavor = dataFlavor;
+        this.frame = frame;
+        setBackground(Color.DARK_GRAY);
+        setPreferredSize(new Dimension(200, 200));
+        setDropTarget(new DropTarget(this, this));
+    }
+
+    public void dragEnter(DropTargetDragEvent dtde) {
+        if (dtde.isDataFlavorSupported(dataFlavor)) {
+            dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
+        }
+    }
+
+    public void dragOver(DropTargetDragEvent dtde) {
+        if (dtde.isDataFlavorSupported(dataFlavor)) {
+            dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
+        }
+    }
+
+    public void dropActionChanged(DropTargetDragEvent dtde) {
+        if (dtde.isDataFlavorSupported(dataFlavor)) {
+            dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
+        }
+    }
+
+    public void dragExit(DropTargetEvent dte) {
+
+    }
+
+    public void drop(DropTargetDropEvent dtde) {
+        dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
+        if (dtde.isDataFlavorSupported(dataFlavor)) {
+            String result = null;
+            try {
+                Transferable t = dtde.getTransferable();
+                byte[] data = (byte[]) dtde.getTransferable().getTransferData(dataFlavor);
+                result = new String(data, "UTF-16");
+                repaint();
+            } catch (UnsupportedFlavorException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            dtde.dropComplete(true);
+
+
+            if (result != null && result.contains(MyTransferable.TEST_DATA)) {
+                System.err.println(InterprocessMessages.EXECUTION_IS_SUCCESSFULL);
+                Timer t = new Timer();
+                t.schedule(new TimerTask() {
+                    @Override
+                    public void run() {
+                        System.exit(0);
+                    }
+                }, 2000);
+                return;
+
+            }
+        }
+        dtde.rejectDrop();
+        System.err.println(InterprocessMessages.DATA_IS_CORRUPTED);
+        System.exit(InterprocessMessages.DATA_IS_CORRUPTED);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/SystemFlavorMap/DuplicateMappingTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4493189
+  @summary tests that addUnencodedNativeForFlavor()/addFlavorForUnencodedNative()
+           do not allow to duplicate mappings
+  @author das@sparc.spb.su area=datatransfer
+  @run main DuplicateMappingTest
+*/
+
+import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.SystemFlavorMap;
+import java.util.Iterator;
+
+public class DuplicateMappingTest {
+
+    public static void main(String[] args) throws Exception {
+
+        final String nativeString = "NATIVE";
+        final DataFlavor dataFlavor = new DataFlavor();
+
+        final SystemFlavorMap fm =
+                (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
+
+        fm.addUnencodedNativeForFlavor(dataFlavor, nativeString);
+        fm.addUnencodedNativeForFlavor(dataFlavor, nativeString);
+
+        final java.util.List natives =
+                fm.getNativesForFlavor(dataFlavor);
+        boolean found = false;
+
+        for (final Iterator i = natives.iterator(); i.hasNext(); ) {
+            if (nativeString.equals(i.next())) {
+                if (found) {
+                    throw new RuntimeException("getNativesForFlavor() returns:" +
+                            natives);
+                } else {
+                    found = true;
+                }
+            }
+        }
+
+        if (!found) {
+            throw new RuntimeException("getNativesForFlavor() returns:" +
+                    natives);
+        }
+
+        fm.addFlavorForUnencodedNative(nativeString, dataFlavor);
+        fm.addFlavorForUnencodedNative(nativeString, dataFlavor);
+
+        final java.util.List flavors =
+                fm.getFlavorsForNative(nativeString);
+        found = false;
+
+        for (final Iterator i = flavors.iterator(); i.hasNext(); ) {
+            if (dataFlavor.equals(i.next())) {
+                if (found) {
+                    throw new RuntimeException("getFlavorsForNative() returns:" +
+                            flavors);
+                } else {
+                    found = true;
+                }
+            }
+        }
+
+        if (!found) {
+            throw new RuntimeException("getFlavorsForNative() returns:" +
+                    natives);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/SystemFlavorMap/DuplicatedNativesTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.SystemFlavorMap;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+/* @test
+ * @bug 8028230
+ * @summary Checks that SystemFlavorMap.getNativesForFlavor returns a list without duplicates
+ * @author Petr Pchelko
+ * @run main DuplicatedNativesTest
+ */
+public class DuplicatedNativesTest {
+
+    public static void main(String[] args) throws Exception {
+
+        // 1. Check that returned natives do not contain duplicates.
+        SystemFlavorMap flavorMap = (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
+        for (Map.Entry<DataFlavor, String> entry : flavorMap.getNativesForFlavors(null).entrySet()) {
+            List<String> natives = flavorMap.getNativesForFlavor(entry.getKey());
+            if (new HashSet<>(natives).size() != natives.size()) {
+                throw new RuntimeException("FAILED: returned natives contain duplicates: " + Arrays.toString(natives.toArray()));
+            }
+        }
+
+        // 2. Check that even if we set a duplicate it would be ignored.
+        flavorMap.setNativesForFlavor(DataFlavor.stringFlavor, new String[] {"test", "test", "test"});
+        List<String> natives = flavorMap.getNativesForFlavor(DataFlavor.stringFlavor);
+        if (new HashSet<>(natives).size() != natives.size()) {
+            throw new RuntimeException("FAILED: duplicates were not ignored: " + Arrays.toString(natives.toArray()));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/SystemFlavorMap/GetNativesForFlavorTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4493178
+  @summary tests that getNativesForFlavor() synthesizes an encoded String native
+           only if there are no mappings for the DataFlavor and the mappings
+           were not explicitly removed
+  @author das@sparc.spb.su area=datatransfer
+  @run main GetNativesForFlavorTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.SystemFlavorMap;
+import java.util.Iterator;
+
+public class GetNativesForFlavorTest {
+
+    final static SystemFlavorMap fm =
+            (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
+
+    public static void main(String[] args) throws Exception {
+        // 1.Check that the encoded native is not added if there are other
+        // natives for this DataFlavor.
+        test1();
+
+        // 2.Check that the encoded native is not added if all mappings were
+        // explicitly removed for this DataFlavor.
+        test2();
+
+        // 3.Check that only the encoded native is added for text DataFlavors
+        // that has no mappings and that DataFlavor is properly encoded.
+        test3();
+
+        // 4.Verifies that the encoded native is added only for DataFlavors
+        // that has no mappings and that DataFlavor is properly encoded.
+        test4();
+    }
+
+    /**
+     * Verifies that the encoded native is not added if there are other
+     * natives mapped to this DataFlavor.
+     */
+    public static void test1() throws ClassNotFoundException {
+        final DataFlavor flavor =
+                new DataFlavor("text/plain-TEST; charset=Unicode");
+
+        final java.util.List natives = fm.getNativesForFlavor(flavor);
+
+        if (natives.size() > 1) {
+            for (final Iterator i = natives.iterator(); i.hasNext(); ) {
+                String element = (String) i.next();
+                if (SystemFlavorMap.isJavaMIMEType(element)) {
+                    throw new RuntimeException("getFlavorsForNative() returns: "
+                            + natives);
+                }
+            }
+        }
+    }
+
+    /**
+     * Verifies that the encoded native is not added if all mappings were
+     * explicitly removed for this DataFlavor.
+     */
+    public static void test2() throws ClassNotFoundException {
+        final DataFlavor flavor =
+                new DataFlavor("text/plain-TEST; charset=Unicode");
+
+        fm.setNativesForFlavor(flavor, new String[0]);
+
+        final java.util.List natives = fm.getNativesForFlavor(flavor);
+
+        if (!natives.isEmpty()) {
+            throw new RuntimeException("getFlavorsForNative() returns:" +
+                    natives);
+        }
+    }
+
+    /**
+     * Verifies that only the encoded native is added for text DataFlavors
+     * that has no mappings and that DataFlavor is properly encoded.
+     */
+    public static void test3() throws ClassNotFoundException {
+        //
+        final DataFlavor flavor =
+                new DataFlavor("text/plain-TEST-nocharset; class=java.nio.ByteBuffer");
+
+        final java.util.List natives = fm.getNativesForFlavor(flavor);
+        boolean encodedNativeFound = false;
+
+        if (natives.size() == 0) {
+            throw new RuntimeException("getFlavorsForNative() returns:" +
+                    natives);
+        }
+
+        if (natives.size() == 1) {
+            String element = (String) natives.get(0);
+            if (SystemFlavorMap.isJavaMIMEType(element)) {
+                final DataFlavor decodedFlavor =
+                        SystemFlavorMap.decodeDataFlavor(element);
+                if (!flavor.equals(decodedFlavor)) {
+                    System.err.println("DataFlavor is not properly incoded:");
+                    System.err.println("    encoded flavor: " + flavor);
+                    System.err.println("    decoded flavor: " + decodedFlavor);
+                    throw new RuntimeException("getFlavorsForNative() returns:"
+                            + natives);
+                }
+            }
+        } else {
+            for (final Iterator i = natives.iterator(); i.hasNext(); ) {
+                String element = (String) i.next();
+                if (SystemFlavorMap.isJavaMIMEType(element)) {
+                    throw new RuntimeException("getFlavorsForNative() returns:"
+                            + natives);
+                }
+            }
+        }
+    }
+
+    /**
+     * Verifies that the encoded native is added only for DataFlavors
+     * that has no mappings and that DataFlavor is properly encoded.
+     */
+    public static void test4() throws ClassNotFoundException {
+        final DataFlavor flavor =
+                new DataFlavor("unknown/unknown");
+
+        final java.util.List natives = fm.getNativesForFlavor(flavor);
+
+        if (natives.size() == 1) {
+            String element = (String) natives.get(0);
+            if (SystemFlavorMap.isJavaMIMEType(element)) {
+                final DataFlavor decodedFlavor =
+                        SystemFlavorMap.decodeDataFlavor(element);
+                if (!flavor.equals(decodedFlavor)) {
+                    System.err.println("DataFlavor is not properly incoded:");
+                    System.err.println("    encoded flavor: " + flavor);
+                    System.err.println("    decoded flavor: " + decodedFlavor);
+                    throw new RuntimeException("getFlavorsForNative() returns:"
+                            + natives);
+                }
+            }
+        } else {
+            throw new RuntimeException("getFlavorsForNative() returns:"
+                    + natives);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/SystemFlavorMap/MappingGenerationTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.SystemFlavorMap;
+import java.util.List;
+
+/*
+  @test
+  @bug 4512530 8027148
+  @summary tests that mappings for text flavors are generated properly
+  @author das@sparc.spb.su area=datatransfer
+*/
+
+public class MappingGenerationTest {
+
+    private static final SystemFlavorMap fm =
+        (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
+
+    public static void main(String[] args)  {
+        test1();
+        test2();
+        test3();
+        test4();
+        test5();
+        test6();
+    }
+
+    /**
+     * Verifies that Lists returned from getNativesForFlavor() and
+     * getFlavorsForNative() are not modified with a subsequent call
+     * to addUnencodedNativeForFlavor() and addFlavorForUnencodedNative()
+     * respectively.
+     */
+    public static void test1() {
+        DataFlavor df = new DataFlavor("text/plain-test1", null);
+        String nat = "native1";
+
+        List<String> natives = fm.getNativesForFlavor(df);
+        fm.addUnencodedNativeForFlavor(df, nat);
+        List<String> nativesNew = fm.getNativesForFlavor(df);
+        if (natives.equals(nativesNew)) {
+            System.err.println("orig=" + natives);
+            System.err.println("new=" + nativesNew);
+            throw new RuntimeException("Test failed");
+        }
+
+        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
+        fm.addFlavorForUnencodedNative(nat, df);
+        List<DataFlavor> flavorsNew = fm.getFlavorsForNative(nat);
+        if (flavors.equals(flavorsNew)) {
+            System.err.println("orig=" + flavors);
+            System.err.println("new=" + flavorsNew);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that SystemFlavorMap is not affected by modification of
+     * the Lists returned from getNativesForFlavor() and
+     * getFlavorsForNative().
+     */
+    public static void test2() {
+        DataFlavor df = new DataFlavor("text/plain-test2", null);
+        String nat = "native2";
+        DataFlavor extraDf = new DataFlavor("text/test", null);
+
+        List<String> natives = fm.getNativesForFlavor(df);
+        natives.add("Should not be here");
+        java.util.List nativesNew = fm.getNativesForFlavor(df);
+        if (natives.equals(nativesNew)) {
+            System.err.println("orig=" + natives);
+            System.err.println("new=" + nativesNew);
+            throw new RuntimeException("Test failed");
+        }
+
+        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
+        flavors.add(extraDf);
+        java.util.List flavorsNew = fm.getFlavorsForNative(nat);
+        if (flavors.equals(flavorsNew)) {
+            System.err.println("orig=" + flavors);
+            System.err.println("new=" + flavorsNew);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that addUnencodedNativeForFlavor() for a particular text flavor
+     * doesn't affect mappings for other flavors.
+     */
+    public static void test3() {
+        DataFlavor df1 = new DataFlavor("text/plain-test3", null);
+        DataFlavor df2 = new DataFlavor("text/plain-test3; charset=Unicode; class=java.io.Reader", null);
+        String nat = "native3";
+        List<String> natives = fm.getNativesForFlavor(df2);
+        fm.addUnencodedNativeForFlavor(df1, nat);
+        List<String> nativesNew = fm.getNativesForFlavor(df2);
+        if (!natives.equals(nativesNew)) {
+            System.err.println("orig=" + natives);
+            System.err.println("new=" + nativesNew);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that addUnencodedNativeForFlavor() really adds the specified
+     * flavor-to-native mapping to the existing mappings.
+     */
+    public static void test4() {
+        DataFlavor df = new DataFlavor("text/plain-test4; charset=Unicode; class=java.io.Reader", null);
+        String nat = "native4";
+        List<String> natives = fm.getNativesForFlavor(df);
+        if (!natives.contains(nat)) {
+            fm.addUnencodedNativeForFlavor(df, nat);
+            List<String> nativesNew = fm.getNativesForFlavor(df);
+            natives.add(nat);
+            if (!natives.equals(nativesNew)) {
+                System.err.println("orig=" + natives);
+                System.err.println("new=" + nativesNew);
+                throw new RuntimeException("Test failed");
+            }
+        }
+    }
+
+    /**
+     * Verifies that a flavor doesn't have any flavor-to-native mappings after
+     * a call to setNativesForFlavor() with this flavor and an empty native
+     * array as arguments.
+     */
+    public static void test5() {
+        final DataFlavor flavor =
+            new DataFlavor("text/plain-TEST5; charset=Unicode", null);
+
+        fm.getNativesForFlavor(flavor);
+
+        fm.setNativesForFlavor(flavor, new String[0]);
+
+        List<String> natives = fm.getNativesForFlavor(flavor);
+
+        if (!natives.isEmpty()) {
+            System.err.println("natives=" + natives);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    /**
+     * Verifies that a native doesn't have any native-to-flavor mappings after
+     * a call to setFlavorsForNative() with this native and an empty flavor
+     * array as arguments.
+     */
+    public static void test6() {
+        final String nat = "STRING";
+        fm.getFlavorsForNative(nat);
+        fm.setFlavorsForNative(nat, new DataFlavor[0]);
+
+        List<DataFlavor> flavors = fm.getFlavorsForNative(nat);
+
+        if (!flavors.isEmpty()) {
+            System.err.println("flavors=" + flavors);
+            throw new RuntimeException("Test failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/datatransfer/SystemFlavorMap/SetNativesForFlavorTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4478912
+  @summary tests that getNativesForFlavor()/getFlavorsForNative() return the
+           same list as was set with setNativesForFlavor()/setFlavorsForNative()
+  @author das@sparc.spb.su area=datatransfer
+  @run main SetNativesForFlavorTest
+*/
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.SystemFlavorMap;
+
+public class SetNativesForFlavorTest  {
+
+    public static void main(String[] args) throws Exception {
+            final String nativeString = "NATIVE";
+
+            final SystemFlavorMap fm =
+                (SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
+
+            fm.setNativesForFlavor(DataFlavor.plainTextFlavor,
+                                   new String[] { nativeString });
+
+            final java.util.List natives =
+                fm.getNativesForFlavor(DataFlavor.plainTextFlavor);
+
+            if (natives.size() != 1 || !natives.contains(nativeString)) {
+                throw new RuntimeException("getNativesForFlavor() returns:" +
+                                           natives);
+            }
+
+            final DataFlavor dataFlavor =
+                new DataFlavor("text/unknown; class=java.lang.String");
+
+            fm.setFlavorsForNative(nativeString, new DataFlavor[] { dataFlavor });
+
+            final java.util.List flavors = fm.getFlavorsForNative(nativeString);
+
+            if (flavors.size() != 1 || !flavors.contains(dataFlavor)) {
+                throw new RuntimeException("getFlavorsForNative() returns:" +
+                                           flavors);
+            }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/font/FontNames/TrueTypeFontLocaleNameTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,74 @@
+
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8043509
+ * @summary Test locale famlly falls back to same language before English
+ * @run main/othervm TrueTypeFontLocaleNameTest
+ */
+
+import java.awt.Font;
+import java.util.Locale;
+
+public class TrueTypeFontLocaleNameTest {
+
+    public static void main(String[] args) {
+
+        String os = System.getProperty("os.name", "");
+        if (!os.toLowerCase().startsWith("win")) {
+            return;
+        }
+        System.setProperty("user.language", "de");
+        System.setProperty("user.country", "AT");
+        Locale de_atLocale = new Locale("de", "AT");
+        Locale.setDefault(de_atLocale);
+
+        String family = "Verdana";
+        Font font = new Font(family, Font.BOLD, 12);
+        if (!font.getFamily(Locale.ENGLISH).equals(family)) {
+            System.out.println(family + " not found - skipping test.");
+            return;
+        }
+
+        String atFontName = font.getFontName();
+        Locale deGELocale = new Locale("de", "GE");
+        String deFontName = font.getFontName(deGELocale);
+        System.out.println("Austrian font name: " + atFontName);
+        System.out.println("German font name: " + deFontName);
+
+        String deLangFullName = "Verdana Fett";
+        // We expect "Fett" for "Bold" when the language is German.
+        // This font does have that so these should both be equal and
+        // say "Verdana Fett"
+        if (!deFontName.equals(atFontName)) {
+            throw new RuntimeException("Font names differ " +
+                                       deFontName + " " + atFontName);
+        }
+        if (!deLangFullName.equals(deFontName)) {
+            throw new RuntimeException("Font name is not " + deLangFullName +
+                                       " instead got " + deFontName);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/geom/Path2D/EmptyCapacity.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.geom.Path2D;
+
+/**
+ * @test
+ * @bug 8042103
+ * @summary Path2D.moveTo() should work if empty initial capacity was set.
+ * @author Sergey Bylokhov
+ */
+public final class EmptyCapacity {
+
+    public static void main(final String[] args) {
+        final Path2D path1 = new Path2D.Double(Path2D.WIND_EVEN_ODD, 0);
+        path1.moveTo(10, 10);
+        path1.lineTo(20, 20);
+        final Path2D path2 = new Path2D.Float(Path2D.WIND_EVEN_ODD, 0);
+        path2.moveTo(10, 10);
+        path2.lineTo(20, 20);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/im/8041990/bug8041990.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+/*
+  @test
+  @bug 8041990
+  @summary Language specific keys does not work in applets when opened outside the browser
+  @author Petr Pchelko
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.InputMethodEvent;
+import java.awt.font.TextHitInfo;
+import java.text.AttributedString;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class bug8041990 {
+    private static JFrame frame;
+    private static JComponent component;
+
+    public static void main(String[] args) throws Exception {
+        ThreadGroup stubTG = new ThreadGroup(getRootThreadGroup(), "Stub Thread Group");
+        ThreadGroup swingTG = new ThreadGroup(getRootThreadGroup(), "SwingTG");
+        try {
+            Thread stubThread = new Thread(stubTG, SunToolkit::createNewAppContext);
+            stubThread.start();
+            stubThread.join();
+
+            CountDownLatch startSwingLatch = new CountDownLatch(1);
+            new Thread(swingTG, () -> {
+                SunToolkit.createNewAppContext();
+                SwingUtilities.invokeLater(() -> {
+                    frame = new JFrame();
+                    component = new JLabel("Test Text");
+                    frame.add(component);
+                    frame.setBounds(100, 100, 100, 100);
+                    frame.setVisible(true);
+                    startSwingLatch.countDown();
+                });
+            }).start();
+            startSwingLatch.await();
+
+            AtomicReference<Exception> caughtException = new AtomicReference<>();
+            Thread checkThread = new Thread(getRootThreadGroup(), () -> {
+                try {
+                    // If the bug is present this will throw exception
+                    new InputMethodEvent(component,
+                            InputMethodEvent.CARET_POSITION_CHANGED,
+                            TextHitInfo.leading(0),
+                            TextHitInfo.trailing(0));
+                } catch (Exception e) {
+                    caughtException.set(e);
+                }
+            });
+            checkThread.start();
+            checkThread.join();
+
+            if (caughtException.get() != null) {
+                throw new RuntimeException("Failed. Caught exception!", caughtException.get());
+            }
+        } finally {
+            new Thread(swingTG, () -> SwingUtilities.invokeLater(() -> {
+                if (frame != null) {
+                    frame.dispose();
+                }
+            })).start();
+        }
+    }
+
+    private static ThreadGroup getRootThreadGroup() {
+        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
+        ThreadGroup parentTG = currentTG.getParent();
+        while (parentTG != null) {
+            currentTG = parentTG;
+            parentTG = currentTG.getParent();
+        }
+        return currentTG;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/im/Headless/HeadlessInputContext.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.im.InputContext;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that InputContext methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessInputContext
+ */
+
+public class HeadlessInputContext {
+    public static void main(String args[]) {
+        InputContext ic = InputContext.getInstance();
+
+        for (Locale locale : Locale.getAvailableLocales())
+            ic.selectInputMethod(locale);
+
+        ic.getLocale();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/im/Headless/HeadlessInputMethodHighlight.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.im.InputMethodHighlight;
+
+/*
+ * @test
+ * @summary Check that InputMethodHighlight constructors do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessInputMethodHighlight
+ */
+
+public class HeadlessInputMethodHighlight {
+    public static void main(String args[]) {
+        InputMethodHighlight imh;
+        imh = new InputMethodHighlight(true, InputMethodHighlight.CONVERTED_TEXT);
+        imh = new InputMethodHighlight(false,InputMethodHighlight.CONVERTED_TEXT);
+        imh = new InputMethodHighlight(true, InputMethodHighlight.RAW_TEXT);
+        imh = new InputMethodHighlight(false,InputMethodHighlight.RAW_TEXT);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectAlphaSurface2SW.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import static java.awt.Transparency.TRANSLUCENT;
+import static java.awt.image.BufferedImage.TYPE_4BYTE_ABGR;
+import static java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE;
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE;
+
+/**
+ * @test
+ * @bug 8017626
+ * @summary Tests drawing transparent volatile image to transparent BI.
+ *          Results of the blit compatibleImage to transparent BI used for
+ *          comparison.
+ * @author Sergey Bylokhov
+ */
+public final class IncorrectAlphaSurface2SW {
+
+    private static final int[] SCALES = {1, 2, 4, 8};
+    private static final int[] SIZES = {1, 2, 3, 127, 128, 254, 255, 256};
+    private static final int[] dstTypes = {TYPE_INT_ARGB, TYPE_INT_ARGB_PRE,
+            TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE};
+    private static final int[] srcTypes = {TRANSLUCENT};
+
+
+    public static void main(final String[] args) throws IOException {
+        GraphicsEnvironment ge = GraphicsEnvironment
+                .getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc = ge.getDefaultScreenDevice()
+                                     .getDefaultConfiguration();
+        BufferedImage destVI;
+        BufferedImage destBI;
+        BufferedImage sourceBI;
+        VolatileImage sourceVI;
+
+        for (final int s : SIZES) {
+            for (final int srcType : srcTypes) {
+                for (final int dstType : dstTypes) {
+                    for (final int scale : SCALES) {
+                        int sw = s * scale;
+                        destVI = new BufferedImage(sw, sw, dstType);
+                        destBI = new BufferedImage(sw, sw, dstType);
+                        sourceBI = gc.createCompatibleImage(sw, sw, srcType);
+                        sourceVI = gc.createCompatibleVolatileImage(s, s, srcType);
+
+                        // draw to dest BI using compatible image
+                        fill(sourceBI, s);
+                        Graphics2D big = destBI.createGraphics();
+                        big.setComposite(AlphaComposite.Src);
+                        big.drawImage(sourceBI, 0, 0, sw, sw, null);
+                        big.dispose();
+
+                        // draw to dest BI using compatible image
+                        fill(sourceVI, s);
+                        drawVItoBI(gc, destVI, sourceVI);
+
+                        validate(destVI, destBI);
+                        sourceVI.flush();
+                    }
+                }
+            }
+        }
+        System.out.println("Test PASSED");
+    }
+
+    private static void drawVItoBI(GraphicsConfiguration gc,
+                                   BufferedImage bi, VolatileImage vi) {
+        while (true) {
+            vi.validate(gc);
+            fill(vi, vi.getHeight());
+            if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                try {
+                    Thread.sleep(100);
+                } catch (final InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            Graphics2D big = bi.createGraphics();
+            big.setComposite(AlphaComposite.Src);
+            big.drawImage(vi, 0, 0, bi.getWidth(), bi.getHeight(), null);
+            big.dispose();
+
+            if (vi.contentsLost()) {
+                try {
+                    Thread.sleep(100);
+                } catch (final InterruptedException ignored) {
+                }
+                continue;
+            }
+            break;
+        }
+    }
+
+    private static void validate(BufferedImage bi, BufferedImage gold)
+            throws IOException {
+        for (int x = 0; x < bi.getWidth(); ++x) {
+            for (int y = 0; y < bi.getHeight(); ++y) {
+                if (gold.getRGB(x, y) != bi.getRGB(x, y)) {
+                    System.err.println("Expected color = " + gold.getRGB(x, y));
+                    System.err.println("Actual color = " + bi.getRGB(x, y));
+                    ImageIO.write(gold, "png", new File("gold.png"));
+                    ImageIO.write(bi, "png", new File("bi.png"));
+                    throw new RuntimeException("Test failed.");
+                }
+            }
+        }
+    }
+
+    /**
+     * Fills the whole image using different alpha for each row.
+     *
+     * @param image to fill
+     */
+    private static void fill(final Image image, final int size) {
+        Graphics2D graphics = (Graphics2D) image.getGraphics();
+        graphics.setComposite(AlphaComposite.Src);
+        graphics.setColor(Color.GREEN);
+        graphics.fillRect(0, 0, image.getWidth(null), image.getHeight(null));
+        int row = image.getHeight(null) / size;
+        for (int i = 0; i < size; ++i) {
+            graphics.setColor(new Color(23, 127, 189, i));
+            graphics.fillRect(0, i * row, image.getWidth(null), row);
+        }
+        graphics.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectClipSurface2SW.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Ellipse2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import static java.awt.geom.Rectangle2D.Double;
+
+/**
+ * @test
+ * @bug 8041644
+ * @summary Tests drawing volatile image to BI using different clip.
+ *          Results of the blit compatibleImage to BI used for comparison.
+ * @author Sergey Bylokhov
+ * @run main/othervm -Dsun.java2d.d3d=false IncorrectClipSurface2SW
+ */
+public final class IncorrectClipSurface2SW {
+
+    private static int[] SCALES = {1, 2, 4};
+    private static int[] SIZES = {127, 3, 2, 1};
+    private static final Shape[] SHAPES = {new Rectangle(0, 0, 0, 0),
+                                           new Rectangle(0, 0, 1, 1),
+                                           new Rectangle(0, 1, 1, 1),
+                                           new Rectangle(1, 0, 1, 1),
+                                           new Rectangle(1, 1, 1, 1),
+
+                                           new Ellipse2D.Double(0, 0, 1, 1),
+                                           new Ellipse2D.Double(0, 1, 1, 1),
+                                           new Ellipse2D.Double(1, 0, 1, 1),
+                                           new Ellipse2D.Double(1, 1, 1, 1),
+                                           new Ellipse2D.Double(.25, .25, .5,
+                                                                .5),
+
+                                           new Double(0, 0, 0.5, 0.5),
+                                           new Double(0, 0.5, 0.5, 0.5),
+                                           new Double(0.5, 0, 0.5, 0.5),
+                                           new Double(0.5, 0.5, 0.5, 0.5),
+                                           new Double(0.25, 0.25, 0.5, 0.5),
+                                           new Double(0, 0.25, 1, 0.5),
+                                           new Double(0.25, 0, 0.5, 1),
+
+                                           new Double(.10, .10, .20, .20),
+                                           new Double(.75, .75, .20, .20),
+                                           new Double(.75, .10, .20, .20),
+                                           new Double(.10, .75, .20, .20),};
+
+    public static void main(final String[] args) throws IOException {
+        GraphicsEnvironment ge = GraphicsEnvironment
+                .getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc = ge.getDefaultScreenDevice()
+                                     .getDefaultConfiguration();
+        AffineTransform at;
+        for (final int size : SIZES) {
+            for (final int scale : SCALES) {
+                final int sw = size * scale;
+                at = AffineTransform.getScaleInstance(sw, sw);
+                for (Shape clip : SHAPES) {
+                    clip = at.createTransformedShape(clip);
+                    for (Shape to : SHAPES) {
+                        to = at.createTransformedShape(to);
+                        // Prepare test images
+                        VolatileImage vi = getVolatileImage(gc, size);
+                        BufferedImage bi = getBufferedImage(sw);
+                        // Prepare gold images
+                        BufferedImage goldvi = getCompatibleImage(gc, size);
+                        BufferedImage goldbi = getBufferedImage(sw);
+                        draw(clip, to, vi, bi, scale);
+                        draw(clip, to, goldvi, goldbi, scale);
+                        validate(bi, goldbi);
+                    }
+                }
+            }
+        }
+    }
+
+    private static void draw(Shape clip, Shape to, Image vi, BufferedImage bi,
+                             int scale) {
+        Graphics2D big = bi.createGraphics();
+        big.setComposite(AlphaComposite.Src);
+        big.setClip(clip);
+        Rectangle toBounds = to.getBounds();
+        int x1 = toBounds.x;
+
+        int y1 = toBounds.y;
+        int x2 = x1 + toBounds.width;
+        int y2 = y1 + toBounds.height;
+        big.drawImage(vi, x1, y1, x2, y2, 0, 0, toBounds.width / scale,
+                      toBounds.height / scale, null);
+        big.dispose();
+        vi.flush();
+    }
+
+    private static BufferedImage getBufferedImage(int sw) {
+        BufferedImage bi = new BufferedImage(sw, sw,
+                                             BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+        g2d.setColor(Color.RED);
+        g2d.fillRect(0, 0, sw, sw);
+        return bi;
+    }
+
+    private static VolatileImage getVolatileImage(GraphicsConfiguration gc,
+                                                  int size) {
+        VolatileImage vi = gc.createCompatibleVolatileImage(size, size);
+        Graphics2D g2d = vi.createGraphics();
+        g2d.setColor(Color.GREEN);
+        g2d.fillRect(0, 0, size, size);
+        return vi;
+    }
+
+    private static BufferedImage getCompatibleImage(GraphicsConfiguration gc,
+                                                    int size) {
+        BufferedImage image = gc.createCompatibleImage(size, size);
+        Graphics2D g2d = image.createGraphics();
+        g2d.setColor(Color.GREEN);
+        g2d.fillRect(0, 0, size, size);
+        return image;
+    }
+
+    private static void validate(BufferedImage bi, BufferedImage goldbi)
+            throws IOException {
+        for (int x = 0; x < bi.getWidth(); ++x) {
+            for (int y = 0; y < bi.getHeight(); ++y) {
+                if (goldbi.getRGB(x, y) != bi.getRGB(x, y)) {
+                    ImageIO.write(bi, "png", new File("actual.png"));
+                    ImageIO.write(goldbi, "png", new File("expected.png"));
+                    throw new RuntimeException("Test failed.");
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectDestinationOffset.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+/**
+ * @test
+ * @bug 8041129
+ * @summary Destination offset should be correct in case of Surface->SW blit.
+ *          Destination outside of the drawing area should be untouched.
+ * @author Sergey Bylokhov
+ */
+public final class IncorrectDestinationOffset {
+
+    private static final int SIZE = 128;
+    private static final double[] SCALES = {0.25, 0.5, 1, 1.5, 2.0, 4};
+
+    public static void main(final String[] args) throws IOException {
+        GraphicsEnvironment ge = GraphicsEnvironment
+                .getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc = ge.getDefaultScreenDevice()
+                                     .getDefaultConfiguration();
+        VolatileImage vi = gc.createCompatibleVolatileImage(SIZE, SIZE);
+        BufferedImage bi = new BufferedImage(SIZE, SIZE,
+                                             BufferedImage.TYPE_INT_ARGB);
+        for (double scale : SCALES) {
+            while (true) {
+                // initialize Volatile Image
+                vi.validate(gc);
+                Graphics2D g2d = vi.createGraphics();
+                g2d.setColor(Color.green);
+                g2d.fillRect(0, 0, SIZE, SIZE);
+                g2d.dispose();
+
+                if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                    try {
+                        Thread.sleep(100);
+                    } catch (InterruptedException ignored) {
+                    }
+                    continue;
+                }
+                // Draw the VolatileImage to BI with scale and offsets
+                Graphics2D g = bi.createGraphics();
+                g.setComposite(AlphaComposite.Src);
+                g.setColor(Color.RED);
+                g.fillRect(0, 0, SIZE / 2, SIZE / 2);
+                g.setColor(Color.BLUE);
+                g.fillRect(SIZE / 2, 0, SIZE / 2, SIZE / 2);
+                g.setColor(Color.ORANGE);
+                g.fillRect(0, SIZE / 2, SIZE / 2, SIZE / 2);
+                g.setColor(Color.MAGENTA);
+                g.fillRect(SIZE / 2, SIZE / 2, SIZE / 2, SIZE / 2);
+
+                int point2draw = (int) (100 * scale);
+                int size2draw = (int) (SIZE * scale);
+                g.drawImage(vi, point2draw, point2draw, size2draw, size2draw,
+                            null);
+                g.dispose();
+
+                if (vi.contentsLost()) {
+                    try {
+                        Thread.sleep(100);
+                    } catch (InterruptedException ignored) {
+                    }
+                    continue;
+                }
+                validate(bi, point2draw, size2draw);
+                break;
+            }
+        }
+    }
+
+    private static void validate(BufferedImage bi, int point2draw,
+                                 int size2draw)
+            throws IOException {
+        for (int x = 0; x < SIZE; ++x) {
+            for (int y = 0; y < SIZE; ++y) {
+                if (isInsideGreenArea(point2draw, size2draw, x, y)) {
+                    if (bi.getRGB(x, y) != Color.green.getRGB()) {
+                        ImageIO.write(bi, "png", new File("image.png"));
+                        throw new RuntimeException("Test failed.");
+                    }
+                } else {
+                    if (isRedArea(x, y)) {
+                        if (bi.getRGB(x, y) != Color.red.getRGB()) {
+                            ImageIO.write(bi, "png", new File("image.png"));
+                            throw new RuntimeException("Test failed.");
+                        }
+                    }
+                    if (isBlueArea(x, y)) {
+                        if (bi.getRGB(x, y) != Color.blue.getRGB()) {
+                            ImageIO.write(bi, "png", new File("image.png"));
+                            throw new RuntimeException("Test failed.");
+                        }
+                    }
+                    if (isOrangeArea(x, y)) {
+                        if (bi.getRGB(x, y) != Color.orange.getRGB()) {
+                            ImageIO.write(bi, "png", new File("image.png"));
+                            throw new RuntimeException("Test failed.");
+                        }
+                    }
+                    if (isMagentaArea(x, y)) {
+                        if (bi.getRGB(x, y) != Color.magenta.getRGB()) {
+                            ImageIO.write(bi, "png", new File("image.png"));
+                            throw new RuntimeException("Test failed.");
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private static boolean isRedArea(int x, int y) {
+        return x < SIZE / 2 && y < SIZE / 2;
+    }
+
+    private static boolean isBlueArea(int x, int y) {
+        return x >= SIZE / 2 && y < SIZE / 2;
+    }
+
+    private static boolean isOrangeArea(int x, int y) {
+        return x < SIZE / 2 && y >= SIZE / 2;
+    }
+
+    private static boolean isMagentaArea(int x, int y) {
+        return x >= SIZE / 2 && y >= SIZE / 2;
+    }
+
+    private static boolean isInsideGreenArea(int point2draw, int size2draw,
+                                             int x, int y) {
+        return x >= point2draw && x < point2draw + size2draw && y >=
+                point2draw && y < point2draw + size2draw;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectSourceOffset.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+/**
+ * @test
+ * @bug 8041129
+ * @summary Tests asymmetric source offsets.
+ * @author Sergey Bylokhov
+ */
+public final class IncorrectSourceOffset {
+
+    public static void main(final String[] args) throws IOException {
+        GraphicsEnvironment ge = GraphicsEnvironment
+                .getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc = ge.getDefaultScreenDevice()
+                                     .getDefaultConfiguration();
+        VolatileImage vi = gc.createCompatibleVolatileImage(511, 255);
+        BufferedImage bi = new BufferedImage(511, 255,
+                                             BufferedImage.TYPE_INT_ARGB);
+        BufferedImage gold = new BufferedImage(511, 255,
+                                               BufferedImage.TYPE_INT_ARGB);
+        fill(gold);
+        while (true) {
+            vi.validate(gc);
+            fill(vi);
+            if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+                try {
+                    Thread.sleep(100);
+                } catch (final InterruptedException ignored) {
+                }
+                continue;
+            }
+
+            Graphics2D big = bi.createGraphics();
+            big.drawImage(vi, 7, 11, 127, 111, 7, 11, 127, 111, null);
+            big.dispose();
+            if (vi.contentsLost()) {
+                try {
+                    Thread.sleep(100);
+                } catch (final InterruptedException ignored) {
+                }
+                continue;
+            }
+            break;
+        }
+
+        for (int x = 7; x < 127; ++x) {
+            for (int y = 11; y < 111; ++y) {
+                if (gold.getRGB(x, y) != bi.getRGB(x, y)) {
+                    ImageIO.write(gold, "png", new File("gold.png"));
+                    ImageIO.write(bi, "png", new File("bi.png"));
+                    throw new RuntimeException("Test failed.");
+                }
+            }
+        }
+    }
+
+    private static void fill(Image image) {
+        Graphics2D graphics = (Graphics2D) image.getGraphics();
+        graphics.setComposite(AlphaComposite.Src);
+        for (int i = 0; i < image.getHeight(null); ++i) {
+            graphics.setColor(new Color(i, 0, 0));
+            graphics.fillRect(0, i, image.getWidth(null), 1);
+        }
+        graphics.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessAffineTransformOp.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.geom.AffineTransform;
+import java.awt.image.AffineTransformOp;
+
+/*
+ * @test
+ * @summary Check that AffineTransformOp constructors  and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessAffineTransformOp
+ */
+
+public class HeadlessAffineTransformOp {
+    public static void main(String args[]) {
+        AffineTransformOp ato;
+
+        ato = new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BILINEAR);
+        ato = new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
+        ato = new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BILINEAR);
+        ato.getInterpolationType();
+        ato.getTransform();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessAreaAveragingScaleFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.AreaAveragingScaleFilter;
+
+/*
+ * @test
+ * @summary Check that AreaAveragingScaleFilter constructor and clone() method
+ *          do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessAreaAveragingScaleFilter
+ */
+
+public class HeadlessAreaAveragingScaleFilter {
+    public static void main(String args[]) {
+        new AreaAveragingScaleFilter(100, 100).clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessBufferedImage.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check that BufferedImage constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBufferedImage
+ */
+
+public class HeadlessBufferedImage {
+
+    public static void main(String args[]) {
+        BufferedImage bi;
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_3BYTE_BGR);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_4BYTE_ABGR);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_BYTE_BINARY);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_BYTE_GRAY);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_BYTE_INDEXED);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_INT_ARGB);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_INT_ARGB_PRE);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_INT_BGR);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_INT_RGB);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_USHORT_565_RGB);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_USHORT_GRAY);
+        bi = new BufferedImage(300, 300, BufferedImage.TYPE_USHORT_555_RGB);
+        bi.getType();
+        bi.getColorModel();
+        bi.getRaster();
+        bi.getAlphaRaster();
+        bi.getRGB(1, 1);
+        bi.getWidth();
+        bi.getHeight();
+        bi.getSource();
+        bi.flush();
+        bi.getGraphics();
+        bi.createGraphics();
+        BufferedImage bi2 = bi.getSubimage(10, 10, 200, 200);
+        bi.isAlphaPremultiplied();
+        bi.coerceData(true);
+        bi.coerceData(false);
+        bi.toString();
+        bi.getSources();
+        bi.getPropertyNames();
+        bi.getMinX();
+        bi.getMinY();
+        bi.getSampleModel();
+        bi.getNumXTiles();
+        bi.getNumYTiles();
+        bi.getMinTileX();
+        bi.getMinTileY();
+        bi.getTileWidth();
+        bi.getTileHeight();
+        bi.getTileGridXOffset();
+        bi.getTileGridYOffset();
+        bi.getData();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessBufferedImageFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.*;
+import java.awt.geom.*;
+
+/*
+ * @test
+ * @summary Check that BufferedImageFilter constructor and clone() method do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBufferedImageFilter
+ */
+
+public class HeadlessBufferedImageFilter {
+    public static void main(String args[]) {
+        new BufferedImageFilter(new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BILINEAR)).clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessColorModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.*;
+
+/*
+ * @test
+ * @summary Check that ColorModel methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessColorModel
+ */
+
+public class HeadlessColorModel {
+    public static void main(String args[]) {
+        ColorModel cm = new ColorModel(32) {
+            public int getAlpha(int pixel) { return 255; }
+            public int getBlue(int pixel) { return 255; }
+            public int getGreen(int pixel) { return 255; }
+            public int getRed(int pixel) { return 255; }
+        };
+
+        cm.hasAlpha();
+        cm.isAlphaPremultiplied();
+        cm.getTransferType();
+        cm.getPixelSize();
+        cm.getComponentSize();
+        cm.getComponentSize();
+        cm.getTransparency();
+        cm.getNumComponents();
+        cm.getNumColorComponents();
+        cm.getRed(20);
+        cm.getGreen(20);
+        cm.getBlue(20);
+        cm.getAlpha(20);
+        cm.getRGB(20);
+        cm.isAlphaPremultiplied();
+        cm.isAlphaPremultiplied();
+
+        cm = ColorModel.getRGBdefault();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessCropImageFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.CropImageFilter;
+
+/*
+ * @test
+ * @summary Check that CropImageFilter constructor and clone() method
+ *          do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCropImageFilter
+ */
+
+public class HeadlessCropImageFilter {
+    public static void main (String[] args) {
+        new CropImageFilter(20, 20, 40, 50).clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessImageFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.ImageFilter;
+
+/*
+ * @test
+ * @summary Check that ImageFilter constructor and clone() method
+ *          do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessImageFilter
+ */
+
+public class HeadlessImageFilter {
+    public static void main(String args[]) {
+        new ImageFilter().clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessIndexColorModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.IndexColorModel;
+
+/*
+ * @test
+ * @summary Check that IndexColorModel constructor and methods
+ *          do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessIndexColorModel
+ */
+
+public class HeadlessIndexColorModel {
+    public static void main(String args[]) {
+        IndexColorModel cm =
+                new IndexColorModel(8, 1, new byte[]{(byte) 128}, new byte[]{(byte) 128}, new byte[]{(byte) 128});
+        cm.getTransparency();
+        cm.getComponentSize();
+        cm.isAlphaPremultiplied();
+        cm.hasAlpha();
+        cm.isAlphaPremultiplied();
+        cm.getTransferType();
+        cm.getPixelSize();
+        cm.getComponentSize();
+        cm.getNumComponents();
+        cm.getNumColorComponents();
+        cm.getRed(20);
+        cm.getGreen(20);
+        cm.getBlue(20);
+        cm.getAlpha(20);
+        cm.getRGB(20);
+        cm.isAlphaPremultiplied();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessRGBImageFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.RGBImageFilter;
+
+/*
+ * @test
+ * @summary Check that RGBImageFilter constructor and clone() method
+ *          do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessRGBImageFilter
+ */
+
+public class HeadlessRGBImageFilter {
+
+    public static void main(String args[]) {
+        new RGBImageFilter() {
+            public int filterRGB(int x, int y, int rgb) {
+                return 0;
+            }
+        }.clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/Headless/HeadlessReplicateScaleFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.image.ReplicateScaleFilter;
+
+/*
+ * @test
+ * @summary Check that ReplicateScaleFilter constructor and clone() method
+ *          do not throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessReplicateScaleFilter
+ */
+
+public class HeadlessReplicateScaleFilter {
+    public static void main(String args[]) {
+        new ReplicateScaleFilter(100, 100).clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/ImageIconHang.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+
+/*
+ * @test
+ * @bug     8032788
+ * @summary Checks that null filename argument is processed correctly
+ *
+ * @run     main ImageIconHang
+ */
+public class ImageIconHang {
+    public static void main(String[] args) throws Exception {
+        Image image = Toolkit.getDefaultToolkit().getImage((String) null);
+        MediaTracker mt = new MediaTracker(new Component() {});
+        mt.addImage(image, 1);
+        mt.waitForID(1, 5000);
+
+        int status = mt.statusID(1, false);
+
+        System.out.println("Status: " + status);
+
+        if (status != MediaTracker.ERRORED) {
+            throw new RuntimeException("MediaTracker.waitForID() hung.");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/multiresolution/MultiResolutionToolkitImageTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import static java.awt.image.ImageObserver.ALLBITS;
+import java.io.File;
+import javax.imageio.ImageIO;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+import sun.awt.image.MultiResolutionToolkitImage;
+
+/**
+ * @test
+ * @bug 8040291
+ * @author Alexander Scherbatiy
+ * @summary [macosx] Http-Images are not fully loaded when using ImageIcon
+ * @run main MultiResolutionToolkitImageTest
+ */
+public class MultiResolutionToolkitImageTest {
+
+    private static final int IMAGE_WIDTH = 300;
+    private static final int IMAGE_HEIGHT = 200;
+    private static final Color COLOR_1X = Color.GREEN;
+    private static final Color COLOR_2X = Color.BLUE;
+    private static final String IMAGE_NAME_1X = "image.png";
+    private static final String IMAGE_NAME_2X = "image@2x.png";
+    private static final int WAIT_TIME = 400;
+    private static volatile boolean isImageLoaded = false;
+    private static volatile boolean isRVObserverCalled = false;
+
+    public static void main(String[] args) throws Exception {
+
+        if (!checkOS()) {
+            return;
+        }
+        generateImages();
+        testToolkitMultiResolutionImageLoad();
+    }
+
+    static void testToolkitMultiResolutionImageLoad() throws Exception {
+        File imageFile = new File(IMAGE_NAME_1X);
+        String fileName = imageFile.getAbsolutePath();
+        Image image = Toolkit.getDefaultToolkit().getImage(fileName);
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.prepareImage(image, -1, -1, new LoadImageObserver());
+
+        final long time = WAIT_TIME + System.currentTimeMillis();
+        while ((!isImageLoaded || !isRVObserverCalled)
+                && System.currentTimeMillis() < time) {
+            Thread.sleep(50);
+        }
+
+        if(!isImageLoaded){
+            throw new RuntimeException("Image is not loaded!");
+        }
+
+        if(!isRVObserverCalled){
+            throw new RuntimeException("Resolution Variant observer is not called!");
+        }
+    }
+
+    static void generateImages() throws Exception {
+        if (!new File(IMAGE_NAME_1X).exists()) {
+            generateImage(1);
+        }
+
+        if (!new File(IMAGE_NAME_2X).exists()) {
+            generateImage(2);
+        }
+    }
+
+    static void generateImage(int scale) throws Exception {
+        BufferedImage image = new BufferedImage(scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT,
+                BufferedImage.TYPE_INT_RGB);
+        Graphics g = image.getGraphics();
+        g.setColor(scale == 1 ? COLOR_1X : COLOR_2X);
+        g.fillRect(0, 0, scale * IMAGE_WIDTH, scale * IMAGE_HEIGHT);
+        File file = new File(scale == 1 ? IMAGE_NAME_1X : IMAGE_NAME_2X);
+        ImageIO.write(image, "png", file);
+    }
+
+    static boolean checkOS() {
+        return OSInfo.getOSType() == OSInfo.OSType.MACOSX;
+    }
+
+    static class LoadImageObserver implements ImageObserver {
+
+        @Override
+        public boolean imageUpdate(Image img, int infoflags, int x, int y,
+                int width, int height) {
+
+            if (isRVObserver()) {
+                isRVObserverCalled = true;
+                SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+                Image resolutionVariant = getResolutionVariant(img);
+                int rvFlags = toolkit.checkImage(resolutionVariant, width, height,
+                        new IdleImageObserver());
+                if (rvFlags < infoflags) {
+                    throw new RuntimeException("Info flags are greater than"
+                            + " resolution varint info flags");
+                }
+            } else if ((infoflags & ALLBITS) != 0) {
+                isImageLoaded = true;
+            }
+
+            return (infoflags & ALLBITS) == 0;
+        }
+    }
+
+    static boolean isRVObserver() {
+        Exception e = new Exception();
+
+        for (StackTraceElement elem : e.getStackTrace()) {
+            if (elem.getClassName().endsWith("MultiResolutionToolkitImage")) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    static class IdleImageObserver implements ImageObserver {
+
+        @Override
+        public boolean imageUpdate(Image img, int infoflags, int x, int y,
+                int width, int height) {
+            return false;
+        }
+    }
+
+    static Image getResolutionVariant(Image image) {
+        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/keyboard/AltPlusNumberKeyCombinationsTest/AltPlusNumberKeyCombinationsTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+
+/**
+ * Test that it is possible to type "Alt code" on Windows.
+ * Windows-only test.
+ */
+/*
+@test
+@summary Test that it is possible to type "Alt code" on Windows.
+@library ../../../../lib/testlibrary
+@build ExtendedRobot
+@run main AltPlusNumberKeyCombinationsTest
+*/
+public class AltPlusNumberKeyCombinationsTest {
+
+    private Frame frame;
+    private TextField tf;
+    private TextArea ta;
+
+    private static int delay = 500;
+    private static String euroChar = "\u20AC";
+    private static String accChar = "\u00E3";
+
+    private boolean passed = true;
+    private ExtendedRobot robot;
+
+    public AltPlusNumberKeyCombinationsTest() {
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() {
+                public void run() {
+                    initializeGUI();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed;", e.getCause());
+        }
+    }
+
+    private void initializeGUI() {
+        frame = new Frame("AltPlusNumberKeyCombinationsTest");
+        frame.setLayout(new FlowLayout());
+
+        tf = new TextField(15);
+        frame.add(tf);
+
+        ta = new TextArea(8, 20);
+        frame.add(ta);
+
+        frame.setSize(250,400);
+        frame.setVisible(true);
+    }
+
+
+    private void doTest() throws Exception {
+        robot = new ExtendedRobot();
+        robot.setAutoDelay(100);
+
+        robot.waitForIdle(delay);
+
+        robot.mouseMove((int) ta.getLocationOnScreen().x + ta.getSize().width / 2,
+                        (int) ta.getLocationOnScreen().y + ta.getSize().height / 2);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_RIGHT);
+        robot.keyRelease(KeyEvent.VK_RIGHT);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.waitForIdle(delay);
+
+        if (! "".equals(ta.getText())) {
+            System.err.println("FAIL: Symbol typed in the text area when ALT + RIGHT ARROW keys typed");
+            passed = false;
+        }
+
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() {
+                public void run() {
+                    ta.setText("");
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed;", e.getCause());
+        }
+
+        // getLockingKeyState works on Windows;
+        // Alt code only make sense on Windows;
+        // so don't check availability of this and just use it.
+        if( Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_NUM_LOCK) ) {
+            robot.keyPress(KeyEvent.VK_NUM_LOCK);
+            robot.keyRelease(KeyEvent.VK_NUM_LOCK);
+        }
+
+        robot.mouseMove((int) tf.getLocationOnScreen().x + tf.getSize().width / 2,
+                        (int) tf.getLocationOnScreen().y + tf.getSize().height / 2);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_NUMPAD0);
+        robot.keyRelease(KeyEvent.VK_NUMPAD0);
+        robot.keyPress(KeyEvent.VK_NUMPAD1);
+        robot.keyRelease(KeyEvent.VK_NUMPAD1);
+        robot.keyPress(KeyEvent.VK_NUMPAD2);
+        robot.keyRelease(KeyEvent.VK_NUMPAD2);
+        robot.keyPress(KeyEvent.VK_NUMPAD8);
+        robot.keyRelease(KeyEvent.VK_NUMPAD8);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.waitForIdle(delay);
+
+        if (! euroChar.equals(tf.getText())) {
+            System.err.println("FAIL: Euro symbol not typed in the text field when " +
+                               "ALT + NUMPAD 1,2,8 keys typed");
+            passed = false;
+        }
+
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() {
+                public void run() {
+                    tf.setText("");
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed;", e.getCause());
+        }
+
+        robot.mouseMove((int) ta.getLocationOnScreen().x + ta.getSize().width / 2,
+                        (int) ta.getLocationOnScreen().y + ta.getSize().height / 2);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_NUMPAD0);
+        robot.keyRelease(KeyEvent.VK_NUMPAD0);
+        robot.keyPress(KeyEvent.VK_NUMPAD1);
+        robot.keyRelease(KeyEvent.VK_NUMPAD1);
+        robot.keyPress(KeyEvent.VK_NUMPAD2);
+        robot.keyRelease(KeyEvent.VK_NUMPAD2);
+        robot.keyPress(KeyEvent.VK_NUMPAD8);
+        robot.keyRelease(KeyEvent.VK_NUMPAD8);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.waitForIdle(delay);
+
+        if (! euroChar.equals(ta.getText())) {
+            System.err.println("FAIL: Euro symbol not typed in the text area when " +
+                               "ALT + NUMPAD 1,2,8 keys typed");
+            passed = false;
+        }
+
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() {
+                public void run() {
+                    ta.setText("");
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed;", e.getCause());
+        }
+
+        robot.mouseMove((int) tf.getLocationOnScreen().x + tf.getSize().width / 2,
+                        (int) tf.getLocationOnScreen().y + tf.getSize().height / 2);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_NUMPAD0);
+        robot.keyRelease(KeyEvent.VK_NUMPAD0);
+        robot.keyPress(KeyEvent.VK_NUMPAD2);
+        robot.keyRelease(KeyEvent.VK_NUMPAD2);
+        robot.keyPress(KeyEvent.VK_NUMPAD2);
+        robot.keyRelease(KeyEvent.VK_NUMPAD2);
+        robot.keyPress(KeyEvent.VK_NUMPAD7);
+        robot.keyRelease(KeyEvent.VK_NUMPAD7);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.waitForIdle(delay);
+
+        if (! accChar.equals(tf.getText())) {
+            System.err.println("FAIL: Symbol not typed in the text field when " +
+                               "ALT + NUMPAD 2,2,7 keys typed");
+            passed = false;
+        }
+
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() {
+                public void run() {
+                    tf.setText("");
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed;", e.getCause());
+        }
+
+        robot.mouseMove((int) ta.getLocationOnScreen().x + ta.getSize().width / 2,
+                        (int) ta.getLocationOnScreen().y + ta.getSize().height / 2);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_NUMPAD0);
+        robot.keyRelease(KeyEvent.VK_NUMPAD0);
+        robot.keyPress(KeyEvent.VK_NUMPAD2);
+        robot.keyRelease(KeyEvent.VK_NUMPAD2);
+        robot.keyPress(KeyEvent.VK_NUMPAD2);
+        robot.keyRelease(KeyEvent.VK_NUMPAD2);
+        robot.keyPress(KeyEvent.VK_NUMPAD7);
+        robot.keyRelease(KeyEvent.VK_NUMPAD7);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.waitForIdle(delay);
+
+        if (! accChar.equals(ta.getText())) {
+            System.err.println("FAIL: Symbol not typed in the text field when " +
+                               "ALT + NUMPAD 2,2,7 keys typed");
+            passed = false;
+        }
+
+        try {
+            Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(new Runnable() {
+                public void run() {
+                    ta.setText("");
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed;", e.getCause());
+        }
+
+        if (! passed) {
+            System.err.println("Test failed");
+            captureScreenAndSave();
+            throw new RuntimeException("Test failed");
+        } else {
+            System.out.println("Test passed");
+        }
+    }
+
+    public static void main(String[] args) {
+        if (System.getProperty("os.name").indexOf("Win") == -1) {
+            System.out.println("This test is supposed to be run only on Windows! Marking as passed..");
+            return;
+        }
+        try {
+            AltPlusNumberKeyCombinationsTest test = new AltPlusNumberKeyCombinationsTest();
+            test.doTest();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Fail; "+e.getMessage());
+        }
+    }
+
+    /**
+     * Do screen capture and save it as image
+     */
+    private static void captureScreenAndSave() {
+
+        try {
+            Robot robot = new Robot();
+            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+            Rectangle rectangle = new Rectangle(0, 0, screenSize.width, screenSize.height);
+            System.out.println("About to screen capture - " + rectangle);
+            java.awt.image.BufferedImage image = robot.createScreenCapture(rectangle);
+            javax.imageio.ImageIO.write(image, "jpg", new java.io.File("ScreenImage.jpg"));
+            robot.delay(3000);
+        } catch (Throwable t) {
+            System.out.println("WARNING: Exception thrown while screen capture!");
+            t.printStackTrace();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/print/Headless/HeadlessBook.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.print.Book;
+
+/*
+ * @test
+ * @summary Check that Book constructor and getNumberOfPages() method do not throw
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBook
+ */
+
+public class HeadlessBook {
+    public static void main(String args[]) {
+        new Book().getNumberOfPages();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/print/Headless/HeadlessPageFormat.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.print.PageFormat;
+import java.awt.print.Paper;
+
+/*
+ * @test
+ * @summary Check that PageFormat constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPageFormat
+ */
+
+public class HeadlessPageFormat {
+    public static void main(String args[]) {
+        PageFormat pf;
+        pf = (PageFormat) new PageFormat().clone();
+        pf.getWidth();
+        pf.getHeight();
+        pf.getImageableX();
+        pf.getImageableY();
+        pf.getImageableWidth();
+        pf.getImageableHeight();
+        pf.getPaper();
+        pf.setPaper(new Paper());
+        pf.setOrientation(PageFormat.PORTRAIT);
+        if (pf.getOrientation() != PageFormat.PORTRAIT)
+            throw new RuntimeException("Changing Orientation did not result in a change: PageFormat.PORTRAIT");
+
+        pf.setOrientation(PageFormat.LANDSCAPE);
+        if (pf.getOrientation() != PageFormat.LANDSCAPE)
+            throw new RuntimeException("Changing Orientation did not result in a change: PageFormat.LANDSCAPE");
+
+        pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
+        if (pf.getOrientation() != PageFormat.REVERSE_LANDSCAPE)
+            throw new RuntimeException("Changing Orientation did not result in a change: PageFormat.REVERSE_LANDSCAPE");
+
+        pf.getOrientation();
+        pf.getMatrix();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/print/Headless/HeadlessPaper.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.print.Paper;
+
+/*
+ * @test
+ * @summary Check that Paper constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPaper
+ */
+
+public class HeadlessPaper {
+    public static void main(String args[]) {
+        Paper p;
+        p = (Paper) new Paper().clone();
+        p.getHeight();
+        p.setSize(200.0, 300.0);
+        p.getWidth();
+        p.setImageableArea(1.0, 1.0, 300.0, 400.0);
+        p.getImageableX();
+        p.getImageableY();
+        p.getImageableWidth();
+        p.getImageableHeight();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/print/Headless/HeadlessPrinterJob.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.print.PrintService;
+import javax.print.attribute.PrintServiceAttributeSet;
+import java.awt.*;
+import java.awt.geom.Line2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.print.*;
+
+/*
+ * @test
+ * @summary Check that PrinterJob constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPrinterJob
+ */
+
+public class HeadlessPrinterJob {
+
+    class testPrintable implements Printable {
+
+        public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
+            Graphics2D g2 = (Graphics2D) graphics;
+
+            if (pageIndex >= 10) {
+                return Printable.NO_SUCH_PAGE;
+            }
+
+            int gridWidth = 400 / 6;
+            int gridHeight = 300 / 2;
+
+            int rowspacing = 5;
+            int columnspacing = 7;
+            int rectWidth = gridWidth - columnspacing;
+            int rectHeight = gridHeight - rowspacing;
+
+            Color fg3D = Color.lightGray;
+
+            g2.setPaint(fg3D);
+            g2.drawRect(80, 80, 400 - 1, 310);
+            g2.setPaint(Color.black);
+
+            int x = 85;
+            int y = 87;
+
+
+            // draw Line2D.Double
+            g2.draw(new Line2D.Double(x, y + rectHeight - 1, x + rectWidth, y));
+            x += gridWidth;
+
+            // draw Rectangle2D.Double
+            //g2.setStroke(stroke);
+            g2.draw(new Rectangle2D.Double(x, y, rectWidth, rectHeight));
+            x += gridWidth;
+
+            // draw  RoundRectangle2D.Double
+            //g2.setStroke(dashed);
+            g2.draw(new RoundRectangle2D.Double(x, y, rectWidth,
+                    rectHeight, 10, 10));
+            return Printable.PAGE_EXISTS;
+        }
+    }
+
+    class testPageable implements Pageable {
+
+        public int getNumberOfPages() {
+            return 10;
+        }
+
+        public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException {
+            PageFormat pf = null;
+            if (pageIndex >= 10) {
+                throw new IndexOutOfBoundsException("Wrong page#");
+            }
+            switch (pageIndex) {
+                case 0:
+                case 2:
+                case 4:
+                case 6:
+                case 8:
+                    pf = new PageFormat();
+                    pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
+                    break;
+                case 1:
+                case 3:
+                case 5:
+                case 7:
+                case 9:
+                    pf = new PageFormat();
+                    pf.setOrientation(PageFormat.LANDSCAPE);
+                    break;
+            }
+            return pf;
+        }
+
+        public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException {
+            if (pageIndex >= 10) {
+                throw new IndexOutOfBoundsException("Wrong page#");
+            }
+            return new testPrintable();
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        new HeadlessPrinterJob().doTest();
+    }
+
+    void doTest() throws Exception {
+        PrinterJob pj = PrinterJob.getPrinterJob();
+        for (PrintService psl : pj.lookupPrintServices()) {
+            PrintServiceAttributeSet psas = psl.getAttributes();
+            pj.setPrintService(psl);
+        }
+        PrintService ps = pj.getPrintService();
+        pj.setPrintable(new testPrintable());
+
+        pj = PrinterJob.getPrinterJob();
+        PageFormat pf = new PageFormat();
+        pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
+        pj.setPrintable(new testPrintable(), pf);
+        pj.setPageable(new testPageable());
+
+        boolean exceptions = false;
+        try {
+            pj.printDialog();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            pj = PrinterJob.getPrinterJob();
+            pf = new PageFormat();
+            pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
+            pf = pj.pageDialog(pf);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        pf = new PageFormat();
+        pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
+        pf = pj.defaultPage(pf);
+        pf = pj.defaultPage();
+
+        pf = new PageFormat();
+        pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
+        pf = pj.validatePage(pf);
+        pj.setCopies(10);
+        pj.getCopies();
+        pj.getUserName();
+        pj.setJobName("no-job-name");
+        pj.getJobName();
+    }
+}
--- a/test/java/awt/regtesthelpers/CopyClassFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/awt/regtesthelpers/CopyClassFile.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
  *
  * @build CopyClassFile
  * @run main CopyClassFile package.class dest_directory
+ *
+ * In case the source file should be removed add -r option
  */
 public class CopyClassFile {
 
@@ -48,13 +50,17 @@
     private static String className;
     private static String classFile;
 
+    private static boolean removeSource = false;
+
     public static void main(String[] args) throws Exception {
-        if (args.length != 2) {
+        if (args.length < 2) {
             throw new IllegalArgumentException("Illegal usage: class name and destination directory should be specified");
         }
 
-        destinationDir = args[1];
-        className = args[0];
+        int classNameIndex = parseOptions(args);
+
+        className = args[classNameIndex];
+        destinationDir = args[classNameIndex + 1];
         classFile = className.replaceAll("\\.", File.separator) + ".class";
 
         URL url = cl.getResource(classFile);
@@ -69,6 +75,21 @@
         Arrays.stream(files).forEach(CopyClassFile::copyFile);
     }
 
+    private static int parseOptions(String[] args) {
+        int optionsEnd = 0;
+        while (args[optionsEnd].startsWith("-")) {
+            switch (args[optionsEnd].substring(1)) {
+                case "r" :
+                    removeSource = true;
+                    break;
+                default:
+                    throw new RuntimeException("Unrecognized option passed to CopyClassFile: " + args[optionsEnd]);
+            }
+            optionsEnd++;
+        }
+        return optionsEnd;
+    }
+
     private static String cutPackageName(String className) {
         int dotIndex = className.lastIndexOf(".") + 1;
         if (dotIndex <= 0) {
@@ -87,6 +108,11 @@
             try (InputStream is = new FileInputStream(f)) {
                 Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING);
             }
+
+            if (removeSource && !f.delete()) {
+                throw new RuntimeException("Failed to delete a file");
+            }
+
         } catch (IOException ex) {
             throw new RuntimeException("Could not copy file " + f, ex);
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/7084904/Test7084904.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import bean.Derived;
+import java.lang.reflect.Method;
+/*
+ * @test
+ * @bug 7084904
+ * @summary Compares reflection and bean introspection
+ * @author Sergey Malenkov
+ */
+public class Test7084904 {
+    public static void main(String[] args) throws Exception {
+        System.setSecurityManager(new SecurityManager());
+        Derived bean = new Derived();
+        Class<?> type = bean.getClass();
+        Method method1 = test("reflection", bean, type.getMethod("isAllowed"));
+        Method method2 = test("bean introspection", bean, BeanUtils.getPropertyDescriptor(type, "allowed").getReadMethod());
+        if (!method1.equals(method2)) {
+            throw new Error("first method is not equal to the second one");
+        }
+    }
+
+    private static Method test(String name, Object bean, Method method) throws Exception {
+        System.out.println("\n === use " + name + " ===");
+        System.out.println(method);
+        System.out.println("declaring " + method.getDeclaringClass());
+        System.out.println("invocation result: " + method.invoke(bean));
+        return method;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/7084904/bean/Base.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package bean;
+
+class Base {
+    public boolean isAllowed() {
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/7084904/bean/Derived.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package bean;
+
+public class Derived extends Base {
+}
--- a/test/java/io/File/NulFile.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/io/File/NulFile.java	Wed Jul 09 10:42:37 2014 -0700
@@ -602,7 +602,10 @@
             try {
                 File.createTempFile(prefix, suffix, directory);
             } catch (IllegalArgumentException ex) {
-                if ("Prefix string too short".equals(ex.getMessage()))
+                String actual = ex.getMessage();
+                String expected = "Prefix string \"" + prefix +
+                    "\" too short: length must be at least 3";
+                if (actual != null && actual.equals(expected))
                     exceptionThrown = true;
             } catch (IOException ioe) {
                 System.err.println("IOException happens in testCreateTempFile");
--- a/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java	Wed Jul 09 10:42:37 2014 -0700
@@ -34,6 +34,7 @@
 
 import java.lang.management.*;
 import java.util.concurrent.Phaser;
+import java.util.function.Supplier;
 
 public class SynchronizationStatistics {
     private static class LockerThread extends Thread {
@@ -86,6 +87,8 @@
     private static void testBlockingOnSimpleMonitor() throws Exception {
         System.out.println("testBlockingOnSimpleMonitor");
         final Object lock1 = new Object();
+        System.out.println("Lock1 = " + lock1);
+
         final Phaser p = new Phaser(2);
         LockerThread lt = newLockerThread(new Runnable() {
             @Override
@@ -110,12 +113,12 @@
         }
 
         p.arriveAndAwaitAdvance(); // phase[2]
-        testBlocked(ti, mbean.getThreadInfo(tid), lockName, lock1);
+        testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock1);
         p.arriveAndDeregister(); // phase[3]
 
         lt.join();
 
-        System.out.println("OK");
+        printok();
     }
 
     /**
@@ -128,6 +131,9 @@
         final Object lock1 = new Object();
         final Object lock2 = new Object();
 
+        System.out.println("Lock1 = " + lock1);
+        System.out.println("Lock2 = " + lock2);
+
         final Phaser p = new Phaser(2);
         LockerThread lt = newLockerThread(new Runnable() {
             @Override
@@ -149,7 +155,6 @@
         lt.start();
         long tid = lt.getId();
         ThreadInfo ti = mbean.getThreadInfo(tid);
-        ThreadInfo ti1 = null;
         String lockName = null;
         synchronized(lock1) {
             p.arriveAndAwaitAdvance(); // phase[1]
@@ -158,9 +163,7 @@
         }
         p.arriveAndAwaitAdvance(); // phase[2]
 
-        ti1 = mbean.getThreadInfo(tid);
-        testBlocked(ti, ti1, lockName, lock1);
-        ti = ti1;
+        ti = testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock1);
 
         synchronized(lock2) {
             p.arriveAndAwaitAdvance(); // phase [3]
@@ -168,12 +171,12 @@
             lockName = mbean.getThreadInfo(tid).getLockName();
         }
         p.arriveAndAwaitAdvance(); // phase [4]
-        testBlocked(ti, mbean.getThreadInfo(tid), lockName, lock2);
+        testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock2);
         p.arriveAndDeregister();
 
         lt.join();
 
-        System.out.println("OK");
+        printok();
     }
 
     /**
@@ -209,13 +212,12 @@
         }
         p.arriveAndAwaitAdvance(); // phase[2]
 
-        ThreadInfo ti2 = mbean.getThreadInfo(lt.getId());
+        testWaited(ti1, () -> mbean.getThreadInfo(lt.getId()), 1);
         p.arriveAndDeregister(); // phase[3]
 
         lt.join();
 
-        testWaited(ti1, ti2, 1);
-        System.out.println("OK");
+        printok();
     }
 
     /**
@@ -256,12 +258,12 @@
         int phase = p.getPhase();
         while ((p.arriveAndAwaitAdvance() - phase) < 3); // phase[2-4]
 
-        ThreadInfo ti2 = mbean.getThreadInfo(lt.getId());
+        testWaited(ti1, () -> mbean.getThreadInfo(lt.getId()), 3);
         p.arriveAndDeregister(); // phase[5]
 
         lt.join();
-        testWaited(ti1, ti2, 3);
-        System.out.println("OK");
+
+        printok();
     }
 
     /**
@@ -331,44 +333,85 @@
         }
 
         p.arriveAndAwaitAdvance(); // phase[4]
-        ThreadInfo ti2 = mbean.getThreadInfo(lt.getId());
+        testWaited(ti1, () -> mbean.getThreadInfo(lt.getId()), 3);
         p.arriveAndDeregister(); // phase[5]
 
         lt.join();
-        testWaited(ti1, ti2, 3);
-        System.out.println("OK");
+        printok();
+    }
+
+    private static void printok() {
+        System.out.println("OK\n");
     }
 
-    private static void testWaited(ThreadInfo ti1, ThreadInfo ti2, int waited) throws Error {
-        long waitCntDiff = ti2.getWaitedCount() - ti1.getWaitedCount();
-        long waitTimeDiff = ti2.getWaitedTime() - ti1.getWaitedTime();
-        if (waitCntDiff < waited) {
-            throw new Error("Unexpected diff in waited count. Expecting at least "
-                            + waited + " , got " + waitCntDiff);
-        }
-        if (waitTimeDiff <= 0) {
-            throw new Error("Unexpected diff in waited time. Expecting increasing " +
-                            "value, got " + waitTimeDiff + "ms");
-        }
+    private static void testWaited(ThreadInfo ti1, Supplier<ThreadInfo> ti2, int waited)
+    throws InterruptedException {
+        boolean error;
+        do {
+            error = false;
+            ThreadInfo ti = ti2.get();
+            long waitCntDiff = ti.getWaitedCount() - ti1.getWaitedCount();
+            long waitTimeDiff = ti.getWaitedTime() - ti1.getWaitedTime();
+            if (waitCntDiff < waited) {
+                System.err.println(
+                    "Unexpected diff in waited count. Expecting at least "
+                    + waited + " , got " + waitCntDiff
+                );
+                error = true;
+            }
+            if (waitTimeDiff <= 0) {
+                System.err.println(
+                    "Unexpected diff in waited time. Expecting increasing " +
+                    "value, got " + waitTimeDiff + "ms"
+                );
+                error = true;
+            }
+            if (error) {
+                System.err.println("Retrying in 20ms ...");
+                Thread.sleep(20);
+            }
+        } while (error);
     }
 
-    private static void testBlocked(ThreadInfo ti1, ThreadInfo ti2,
+    private static ThreadInfo testBlocked(ThreadInfo ti1, Supplier<ThreadInfo> ti2,
                                     String lockName, final Object lock)
-    throws Error {
-        long blkCntDiff = ti2.getBlockedCount() - ti1.getBlockedCount();
-        long blkTimeDiff = ti2.getBlockedTime() - ti1.getBlockedTime();
-        if (blkCntDiff < 1) {
-            throw new Error("Unexpected diff in blocked count. Expecting at least 1, " +
-                            "got " + blkCntDiff);
-        }
-        if (blkTimeDiff < 0) {
-            throw new Error("Unexpected diff in blocked time. Expecting a positive " +
-                            "number, got " + blkTimeDiff);
-        }
-        if (!lockName.equals(lock.toString())) {
-            throw new Error("Unexpected blocked monitor name. Expecting " +
-                    lock.toString() + ", got " +
-                    lockName);
-        }
+    throws InterruptedException {
+        boolean error;
+        ThreadInfo ti = null;
+        do {
+            error = false;
+            ti = ti2.get();
+            long blkCntDiff = ti.getBlockedCount() - ti1.getBlockedCount();
+            long blkTimeDiff = ti.getBlockedTime() - ti1.getBlockedTime();
+
+            System.out.println("testBlocked: [" + blkCntDiff + ", " + blkTimeDiff + ", " + lockName + "]");
+
+            if (blkCntDiff < 1) {
+                System.err.println(
+                    "Unexpected diff in blocked count. Expecting at least 1, " +
+                    "got " + blkCntDiff
+                );
+                error = true;
+            }
+            if (blkTimeDiff < 0) {
+                System.err.println(
+                    "Unexpected diff in blocked time. Expecting a positive " +
+                    "number, got " + blkTimeDiff
+                );
+                error = true;
+            }
+            if (!lockName.equals(lock.toString())) {
+                System.err.println(
+                    "Unexpected blocked monitor name. Expecting " +
+                    lock.toString() + ", got " + lockName
+                );
+                error = true;
+            }
+            if (error) {
+                System.err.println("Retrying in 20ms ...");
+                Thread.sleep(20);
+            }
+        } while (error);
+        return ti;
     }
 }
--- a/test/java/net/URLPermission/nstest/lookup.sh	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/net/URLPermission/nstest/lookup.sh	Wed Jul 09 10:42:37 2014 -0700
@@ -24,9 +24,9 @@
 
 # @test
 # @library /lib/testlibrary
+# @build jdk.testlibrary.*
 # @compile -XDignore.symbol.file=true SimpleNameService.java
 #            LookupTest.java SimpleNameServiceDescriptor.java
-# @build jdk.testlibrary.*
 # @run shell/timeout=50 lookup.sh
 #
 
@@ -42,8 +42,7 @@
     ;;
 esac
 
-
-port=`${TESTJAVA}/bin/java -cp ${TESTCLASSES} LookupTest -getport`
+port=`${TESTJAVA}/bin/java -cp ${TESTCLASSPATH} LookupTest -getport`
 
 cat << POLICY > policy
 grant {
@@ -60,4 +59,4 @@
 ${TESTJAVA}/bin/java ${TESTVMOPTS} \
     -Djava.security.policy=file:./policy \
     -Dsun.net.spi.nameservice.provider.1=simple,sun \
-    -cp ${TESTCLASSES}${PS}${TESTSRC} LookupTest -runtest ${port}
+    -cp ${TESTCLASSPATH}${PS}${TESTSRC} LookupTest -runtest ${port}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Collections/CheckedListReplaceAll.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     8047795
+ * @summary Ensure that replaceAll operator cannot add bad elements
+ * @author  Mike Duigou
+ */
+
+import java.util.*;
+import java.util.function.UnaryOperator;
+
+public class CheckedListReplaceAll {
+    public static void main(String[] args) {
+        List unwrapped = Arrays.asList(new Object[]{1, 2, 3});
+        List<Object> wrapped = Collections.checkedList(unwrapped, Integer.class);
+
+        UnaryOperator evil = e -> (((int) e) % 2 != 0) ? e : "evil";
+
+        try {
+            wrapped.replaceAll(evil);
+            System.out.printf("Bwahaha! I have defeated you! %s\n", wrapped);
+            throw new RuntimeException("String added to checked List<Integer>");
+        } catch (ClassCastException thwarted) {
+            thwarted.printStackTrace(System.out);
+            System.out.println("Curses! Foiled again!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Collections/CheckedMapReplaceAll.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     8047795
+ * @summary Ensure that replaceAll operator cannot add bad elements
+ * @author  Mike Duigou
+ */
+
+import java.util.*;
+import java.util.function.BiFunction;
+
+public class CheckedMapReplaceAll {
+    public static void main(String[] args) {
+        Map<Integer,Double> unwrapped = new HashMap<>();
+        unwrapped.put(1, 1.0);
+        unwrapped.put(2, 2.0);
+        unwrapped.put(3, 3.0);
+
+        Map<Integer,Double> wrapped = Collections.checkedMap(unwrapped, Integer.class, Double.class);
+
+        BiFunction evil = (k, v) -> (((int)k) % 2 != 0) ? v : "evil";
+
+        try {
+            wrapped.replaceAll(evil);
+            System.out.printf("Bwahaha! I have defeated you! %s\n", wrapped);
+            throw new RuntimeException("String added to checked Map<Integer,Double>");
+        } catch (ClassCastException thwarted) {
+            thwarted.printStackTrace(System.out);
+            System.out.println("Curses! Foiled again!");
+        }
+    }
+}
--- a/test/java/util/Collections/CheckedQueue.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/util/Collections/CheckedQueue.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,55 +23,40 @@
 
 /*
  * @test
- * @bug 5020931
+ * @bug 5020931 8048207
  * @summary Unit test for Collections.checkedQueue
+ * @run testng CheckedQueue
  */
 
-import java.lang.reflect.Method;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.Queue;
 import java.util.concurrent.ArrayBlockingQueue;
 
-public class CheckedQueue {
-    static int status = 0;
-
-    public static void main(String[] args) throws Exception {
-        new CheckedQueue();
-    }
-
-    public CheckedQueue() throws Exception {
-        run();
-    }
-
-    private void run() throws Exception {
-        Method[] methods = this.getClass().getDeclaredMethods();
+import org.testng.annotations.Test;
+import static org.testng.Assert.fail;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertFalse;
 
-        for (int i = 0; i < methods.length; i++) {
-            Method method = methods[i];
-            String methodName = method.getName();
 
-            if (methodName.startsWith("test")) {
-                try {
-                    Object obj = method.invoke(this, new Object[0]);
-                } catch(Exception e) {
-                    throw new Exception(this.getClass().getName() + "." +
-                            methodName + " test failed, test exception "
-                            + "follows\n" + e.getCause());
-                }
-            }
-        }
-    }
+public class CheckedQueue {
 
     /**
      * This test adds items to a queue.
      */
-    private void test00() {
+    @Test
+    public void testAdd() {
         int arrayLength = 10;
-        ArrayBlockingQueue<String> abq = new ArrayBlockingQueue(arrayLength);
+        Queue<String> abq = Collections.checkedQueue(new ArrayBlockingQueue<>(arrayLength), String.class);
 
         for (int i = 0; i < arrayLength; i++) {
-            abq.add(new String(Integer.toString(i)));
+            abq.add(Integer.toString(i));
+        }
+
+        try {
+            abq.add("full");
+        } catch (IllegalStateException full) {
+
         }
     }
 
@@ -80,23 +65,17 @@
      * {@code String}s gets the checked queue, and attempt to add an Integer to
      * the checked queue.
      */
-    private void test01() throws Exception {
+    @Test(expectedExceptions = ClassCastException.class)
+    public void testAddFail1() {
         int arrayLength = 10;
         ArrayBlockingQueue<String> abq = new ArrayBlockingQueue(arrayLength + 1);
 
         for (int i = 0; i < arrayLength; i++) {
-            abq.add(new String(Integer.toString(i)));
+            abq.add(Integer.toString(i));
         }
 
         Queue q = Collections.checkedQueue(abq, String.class);
-
-        try {
-            q.add(new Integer(0));
-            throw new Exception(this.getClass().getName() + "." + "test01 test"
-                    + " failed, should throw ClassCastException.");
-        } catch(ClassCastException cce) {
-            // Do nothing.
-        }
+        q.add(0);
     }
 
     /**
@@ -104,47 +83,40 @@
      * {@code String}, gets the checked queue, and attempt to add an Integer to
      * the checked queue.
      */
-    private void test02() throws Exception {
+    @Test(expectedExceptions = ClassCastException.class)
+    public void testAddFail2() {
         ArrayBlockingQueue<String> abq = new ArrayBlockingQueue(1);
         Queue q = Collections.checkedQueue(abq, String.class);
 
-        try {
-            q.add(new Integer(0));
-            throw new Exception(this.getClass().getName() + "." + "test02 test"
-                    + " failed, should throw ClassCastException.");
-        } catch(ClassCastException e) {
-            // Do nothing.
-        }
+        q.add(0);
     }
 
     /**
      * This test tests the Collections.checkedQueue method call for nulls in
      * each and both of the parameters.
      */
-    private void test03() throws Exception {
+    @Test
+    public void testArgs() {
         ArrayBlockingQueue<String> abq = new ArrayBlockingQueue(1);
         Queue q;
 
         try {
             q = Collections.checkedQueue(null, String.class);
-            throw new Exception(this.getClass().getName() + "." + "test03 test"
-                    + " failed, should throw NullPointerException.");
+            fail( "should throw NullPointerException.");
         } catch(NullPointerException npe) {
             // Do nothing
         }
 
         try {
             q = Collections.checkedQueue(abq, null);
-            throw new Exception(this.getClass().getName() + "." + "test03 test"
-                    + " failed, should throw NullPointerException.");
+            fail( "should throw NullPointerException.");
         } catch(Exception e) {
             // Do nothing
         }
 
         try {
             q = Collections.checkedQueue(null, null);
-            throw new Exception(this.getClass().getName() + "." + "test03 test"
-                    + " failed, should throw NullPointerException.");
+            fail( "should throw NullPointerException.");
         } catch(Exception e) {
             // Do nothing
         }
@@ -153,38 +125,28 @@
     /**
      * This test tests the CheckedQueue.offer method.
      */
-    private void test04() throws Exception {
+    @Test
+    public void testOffer() {
         ArrayBlockingQueue<String> abq = new ArrayBlockingQueue(1);
         Queue q = Collections.checkedQueue(abq, String.class);
 
         try {
             q.offer(null);
-            throw new Exception(this.getClass().getName() + "." + "test04 test"
-                    + " failed, should throw NullPointerException.");
+            fail("should throw NullPointerException.");
         } catch (NullPointerException npe) {
             // Do nothing
         }
 
         try {
-            q.offer(new Integer(0));
-            throw new Exception(this.getClass().getName() + "." + "test04 test"
-                    + " failed, should throw ClassCastException.");
+            q.offer(0);
+            fail("should throw ClassCastException.");
         } catch (ClassCastException cce) {
             // Do nothing
         }
 
-        q.offer(new String("0"));
+        assertTrue(q.offer("0"), "queue should have room");
 
-        try {
-            q.offer(new String("1"));
-            throw new Exception(this.getClass().getName() + "." + "test04 test"
-                    + " failed, should throw IllegalStateException.");
-        } catch(IllegalStateException ise) {
-            // Do nothing
-        }
-    }
-
-    private void test05() {
-
+        // no room at the inn!
+        assertFalse(q.offer("1"), "queue should be full");
     }
 }
--- a/test/java/util/Currency/CheckDataVersion.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/util/Currency/CheckDataVersion.java	Wed Jul 09 10:42:37 2014 -0700
@@ -64,7 +64,8 @@
                 public Object run() {
                     try {
                         String sep = File.separator;
-                        DataInputStream dis = new DataInputStream(new FileInputStream(System.getProperty("java.home")+sep+"lib"+sep+"currency.data"));
+                        DataInputStream dis = new DataInputStream(
+                             new BufferedInputStream(getClass().getResourceAsStream("/java/util/currency.data")));
                         int magic = dis.readInt();
                         if (magic != 0x43757244) {
                             throw new RuntimeException("The magic number in the JRE's currency data is incorrect.  Expected: 0x43757244, Got: 0x"+magic);
--- a/test/java/util/Currency/CurrencyTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/util/Currency/CurrencyTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 /*
  * @test
  * @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
- *    6488442 7036905
+ *    6488442 7036905 8039317
  * @summary Basic tests for Currency class.
  */
 
--- a/test/java/util/Currency/ValidateISO4217.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/util/Currency/ValidateISO4217.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
 /*
  * @test
  * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
+ *     8039317
  * @summary Validate ISO 4217 data for Currency class.
  */
 
--- a/test/java/util/zip/ZipFile/Assortment.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/java/util/zip/ZipFile/Assortment.java	Wed Jul 09 10:42:37 2014 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4770745 6234507 6303183
+ * @bug 4770745 6234507 6303183 8048990
  * @summary test a variety of zip file entries
  * @author Martin Buchholz
  */
@@ -137,8 +137,11 @@
             return fdata;
         }
 
-        void verify(ZipFile f) throws Exception {
-            ZipEntry e = f.getEntry(name);
+        void verify(ZipFile f, ZipEntry e) throws Exception {
+            verify(e, getData(f, e));
+        }
+
+        void verify(ZipEntry e, byte[] eData) throws Exception {
             byte[] data  = (this.data == null) ? new byte[]{} : this.data;
             byte[] extra = (this.extra != null && this.extra.length == 0) ?
                 null : this.extra;
@@ -148,21 +151,23 @@
                    && (e.getComment() == null))
                   || comment.equals(e.getComment()));
             check(equalsExtraData(extra, e.getExtra()));
-            check(Arrays.equals(data, getData(f, e)));
+            check(Arrays.equals(data, eData));
             check(e.getSize() == data.length);
             check((method == ZipEntry.DEFLATED) ||
                   (e.getCompressedSize() == data.length));
         }
 
-        void verify(JarInputStream jis) throws Exception {
-            // JarInputStream "automatically" reads the manifest
-            if (name.equals("meta-iNf/ManIfEst.Mf"))
-                return;
-            ZipEntry e = jis.getNextEntry();
+        void verify(ZipFile f) throws Exception {
+            ZipEntry e = f.getEntry(name);
+            verify(e, getData(f, e));
+        }
+
+        void verifyZipInputStream(ZipInputStream s) throws Exception {
+            ZipEntry e = s.getNextEntry();
 
             byte[] data = (this.data == null) ? new byte[]{} : this.data;
             byte[] otherData = new byte[data.length];
-            jis.read(otherData);
+            s.read(otherData);
             check(Arrays.equals(data, otherData));
 
             byte[] extra = (this.extra != null && this.extra.length == 0) ?
@@ -173,7 +178,14 @@
             check(e.getSize() == -1 || e.getSize() == data.length);
             check((method == ZipEntry.DEFLATED) ||
                   (e.getCompressedSize() == data.length));
+        }
 
+        void verifyJarInputStream(JarInputStream s) throws Exception {
+            // JarInputStream "automatically" reads the manifest
+            if (name.equals("meta-iNf/ManIfEst.Mf"))
+                return;
+
+            verifyZipInputStream(s);
         }
     }
 
@@ -225,7 +237,7 @@
                               "Can manifests have comments??"));
 
         // The emptiest possible entry
-        entries.add(new Entry("", ZipEntry.STORED,   null, null, ""));
+        entries.add(new Entry("", ZipEntry.STORED, null, null, ""));
 
         for (String name : names)
             for (int method : methods)
@@ -246,30 +258,66 @@
         }
 
         //----------------------------------------------------------------
-        // Verify zip file contents using JarFile class
+        // Verify zip file contents using ZipFile.getEntry()
+        //----------------------------------------------------------------
+        try (ZipFile f = new ZipFile(zipName)) {
+            for (Entry e : entries)
+                e.verify(f);
+        }
+
+        //----------------------------------------------------------------
+        // Verify zip file contents using JarFile.getEntry()
         //----------------------------------------------------------------
-        JarFile f = new JarFile(zipName);
+        try (JarFile f = new JarFile(zipName)) {
+            check(f.getManifest() != null);
+            for (Entry e : entries)
+                e.verify(f);
+        }
+
+        //----------------------------------------------------------------
+        // Verify zip file contents using ZipFile.entries()
+        //----------------------------------------------------------------
+        try (ZipFile f = new ZipFile(zipName)) {
+            Enumeration<? extends ZipEntry> en = f.entries();
+            for (Entry e : entries)
+                e.verify(f, en.nextElement());
 
-        check(f.getManifest() != null);
+            check(!en.hasMoreElements());
+        }
+
+        //----------------------------------------------------------------
+        // Verify zip file contents using JarFile.entries()
+        //----------------------------------------------------------------
+        try (JarFile f = new JarFile(zipName)) {
+            Enumeration<? extends ZipEntry> en = f.entries();
+            for (Entry e : entries)
+                e.verify(f, en.nextElement());
 
-        for (Entry e : entries)
-            e.verify(f);
+            check(!en.hasMoreElements());
+        }
 
-        f.close();
+        //----------------------------------------------------------------
+        // Verify zip file contents using ZipInputStream class
+        //----------------------------------------------------------------
+        try (FileInputStream fis = new FileInputStream(zipName);
+             ZipInputStream s = new ZipInputStream(fis)) {
+
+            for (Entry e : entries)
+                e.verifyZipInputStream(s);
+        }
 
         //----------------------------------------------------------------
         // Verify zip file contents using JarInputStream class
         //----------------------------------------------------------------
-        JarInputStream jis = new JarInputStream(
-            new FileInputStream(zipName));
+        try (FileInputStream fis = new FileInputStream(zipName);
+             JarInputStream s = new JarInputStream(fis)) {
 
-        // JarInputStream "automatically" reads the manifest
-        check(jis.getManifest() != null);
+            // JarInputStream "automatically" reads the manifest
+            check(s.getManifest() != null);
 
-        for (Entry e : entries)
-            e.verify(jis);
-
-        jis.close();
+            for (Entry e : entries)
+                e.verifyJarInputStream(s);
+        }
 
 //      String cmd = "unzip -t " + zipName.getPath() + " >/dev/tty";
 //      new ProcessBuilder(new String[]{"/bin/sh", "-c", cmd}).start().waitFor();
--- a/test/javax/management/MBeanServer/MBeanFallbackTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/management/MBeanServer/MBeanFallbackTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -35,7 +35,7 @@
  * @author Jaroslav Bachorik
  * @run clean MBeanFallbackTest
  * @run build MBeanFallbackTest
- * @run main MBeanFallbackTest
+ * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MBeanFallbackTest
  */
 public class MBeanFallbackTest {
     private static interface PrivateMBean {
@@ -51,7 +51,6 @@
     private static int failures = 0;
 
     public static void main(String[] args) throws Exception {
-        System.setProperty("jdk.jmx.mbeans.allowNonPublic", "true");
         testPrivate(PrivateMBean.class, new Private());
 
         if (failures == 0)
--- a/test/javax/management/ObjectName/SerialCompatTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/management/ObjectName/SerialCompatTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -28,7 +28,7 @@
  * @author Eamonn McManus, Daniel Fuchs
  * @run clean SerialCompatTest
  * @run build SerialCompatTest
- * @run main/othervm SerialCompatTest
+ * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true -Djmx.serial.form=1.0 SerialCompatTest
  */
 
 import java.io.*;
@@ -223,8 +223,6 @@
     }
 
     public static void main(String[] args) throws Exception {
-        System.setProperty("jmx.serial.form", "1.0");
-
         /* Check that we really are in jmx.serial.form=1.0 mode.
         The property is frozen the first time the ObjectName class
         is referenced so checking that it is set to the correct
--- a/test/javax/management/mxbean/MXBeanFallbackTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/management/mxbean/MXBeanFallbackTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -30,7 +30,7 @@
  * @author Jaroslav Bachorik
  * @run clean MXBeanFallbackTest
  * @run build MXBeanFallbackTest
- * @run main MXBeanFallbackTest
+ * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MXBeanFallbackTest
  */
 
 import javax.management.MBeanServer;
@@ -40,7 +40,6 @@
 
 public class MXBeanFallbackTest {
     public static void main(String[] args) throws Exception {
-        System.setProperty("jdk.jmx.mbeans.allowNonPublic", "true");
         testPrivateMXBean("Private", new Private());
 
         if (failures == 0)
--- a/test/javax/management/proxy/JMXProxyFallbackTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/management/proxy/JMXProxyFallbackTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -36,7 +36,7 @@
  * @author Jaroslav Bachorik
  * @run clean JMXProxyFallbackTest
  * @run build JMXProxyFallbackTest
- * @run main JMXProxyFallbackTest
+ * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true JMXProxyFallbackTest
  */
 public class JMXProxyFallbackTest {
     private static interface PrivateMBean {
@@ -56,7 +56,6 @@
     private static int failures = 0;
 
     public static void main(String[] args) throws Exception {
-        System.setProperty("jdk.jmx.mbeans.allowNonPublic", "true");
         testPrivate(PrivateMBean.class);
         testPrivate(PrivateMXBean.class);
 
--- a/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,7 +38,7 @@
 public class RMIConnector_NPETest {
     public static void main(String argv[]) throws Exception {
         RMID rmid = RMID.createRMID();
-        rmid.start();
+        rmid.start(Long.MAX_VALUE);
         int rmidPort = rmid.getPort();
         Exception failureCause = null;
         RMIConnector agent = null;
--- a/test/javax/security/auth/Subject/Generic.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/security/auth/Subject/Generic.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
  */
 
 import java.security.*;
-import javax.security.auth.*;
+import javax.security.auth.Subject;
 
 public class Generic {
     public static void main(String[] args) throws Exception {
--- a/test/javax/security/auth/Subject/Serial.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/javax/security/auth/Subject/Serial.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * @run main/othervm/policy=Serial.policy Serial
  */
 
-import javax.security.auth.*;
+import javax.security.auth.Subject;
 import java.io.*;
 import java.util.*;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/security/auth/Subject/Subject.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * An implementation of the Subject class that provides basic functionality
+ * for the construction of Subject objects with null Principal elements.
+ * This is a helper class for serialization tests tied to bug 8015081
+ * (see SubjectNullTests.java).
+ */
+package jjjjj.security.auth;
+
+import sun.misc.HexDumpEncoder;
+import javax.management.remote.JMXPrincipal;
+import javax.security.auth.kerberos.KerberosPrincipal;
+import javax.security.auth.x500.X500Principal;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.lang.Exception;
+import java.lang.RuntimeException;
+import java.security.Principal;
+import java.util.AbstractSet;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Set;
+
+import java.io.FileOutputStream;
+
+public class Subject implements java.io.Serializable {
+
+    private static final long serialVersionUID = -8308522755600156056L;
+
+    Set<Principal> principals;
+    private volatile boolean readOnly = false;
+    private static final int PRINCIPAL_SET = 1;
+
+    public Subject(Set<? extends Principal> principals) {
+        this.principals = Collections.synchronizedSet(new SecureSet<Principal>
+                (this, PRINCIPAL_SET, principals));
+    }
+
+    public Set<Principal> getPrincipals() {
+        return principals;
+    }
+
+    private static class SecureSet<E>
+            extends AbstractSet<E>
+            implements java.io.Serializable {
+
+        private static final long serialVersionUID = 7911754171111800359L;
+        private static final ObjectStreamField[] serialPersistentFields = {
+                new ObjectStreamField("this$0", Subject.class),
+                new ObjectStreamField("elements", LinkedList.class),
+                new ObjectStreamField("which", int.class)
+        };
+
+        Subject subject;
+        LinkedList<E> elements;
+        private int which;
+
+        SecureSet(Subject subject, int which, Set<? extends E> set) {
+            this.subject = subject;
+            this.which = which;
+            this.elements = new LinkedList<E>(set);
+        }
+
+        public Iterator<E> iterator() {
+            return elements.iterator();
+        }
+
+        public int size() {
+            return elements.size();
+        }
+
+        private void writeObject(java.io.ObjectOutputStream oos)
+                throws java.io.IOException {
+
+            ObjectOutputStream.PutField fields = oos.putFields();
+            fields.put("this$0", subject);
+            fields.put("elements", elements);
+            fields.put("which", which);
+            oos.writeFields();
+        }
+    }
+
+    public static byte[] enc(Object obj) {
+        try {
+            HexDumpEncoder hex = new HexDumpEncoder();
+            ByteArrayOutputStream bout;
+            bout = new ByteArrayOutputStream();
+            new ObjectOutputStream(bout).writeObject(obj);
+            byte[] data = bout.toByteArray();
+            for (int i = 0; i < data.length - 5; i++) {
+                if (data[i] == 'j' && data[i + 1] == 'j' && data[i + 2] == 'j'
+                        && data[i + 3] == 'j' && data[i + 4] == 'j') {
+                    System.arraycopy("javax".getBytes(), 0, data, i, 5);
+                }
+            }
+            return data;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/security/auth/Subject/SubjectNullTests.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,852 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8015081
+ * @compile Subject.java
+ * @compile SubjectNullTests.java
+ * @build SubjectNullTests
+ * @run main SubjectNullTests
+ * @summary javax.security.auth.Subject.toString() throws NPE
+ */
+
+import java.io.File;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.ObjectInputStream;
+import java.io.IOException;
+import java.security.Principal;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import javax.management.remote.JMXPrincipal;
+import javax.security.auth.Subject;
+import javax.security.auth.x500.X500Principal;
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+public class SubjectNullTests {
+
+    // Value templates for the constructor
+    private static Principal[] princVals = {
+        new X500Principal("CN=Tom Sawyer, ST=Missouri, C=US"),
+        new JMXPrincipal("Huckleberry Finn"),
+        new KerberosPrincipal("mtwain/author@LITERATURE.US")
+    };
+    private static String[] pubVals = {"tsawyer", "hfinn", "mtwain"};
+    private static String[] privVals = {"th3R!v3r", "oNth3R4ft", "5Cl3M3nz"};
+
+    // Templates for collection-based modifiers for the Subject
+    private static Principal[] tmplAddPrincs = {
+        new X500Principal("CN=John Doe, O=Bogus Corp."),
+        new KerberosPrincipal("jdoe/admin@BOGUSCORP.COM")
+    };
+    private static String[] tmplAddPubVals = {"jdoe", "djoe"};
+    private static String[] tmplAddPrvVals = {"b4dpa55w0rd", "pass123"};
+
+    /**
+     * Byte arrays used for deserialization:
+     * These byte arrays contain serialized Subjects and SecureSets,
+     * either with or without nulls.  These use
+     * jjjjj.security.auth.Subject, which is a modified Subject
+     * implementation that allows the addition of null elements
+     */
+    private static final byte[] SUBJ_NO_NULL =
+        jjjjj.security.auth.Subject.enc(makeSubjWithNull(false));
+    private static final byte[] SUBJ_WITH_NULL =
+        jjjjj.security.auth.Subject.enc(makeSubjWithNull(true));
+    private static final byte[] PRIN_NO_NULL =
+        jjjjj.security.auth.Subject.enc(makeSecSetWithNull(false));
+    private static final byte[] PRIN_WITH_NULL =
+        jjjjj.security.auth.Subject.enc(makeSecSetWithNull(true));
+
+    /**
+     * Method to allow creation of a subject that can optionally
+     * insert a null reference into the principals Set.
+     */
+    private static jjjjj.security.auth.Subject makeSubjWithNull(
+            boolean nullPrinc) {
+        Set<Principal> setPrinc = new HashSet<>(Arrays.asList(princVals));
+        if (nullPrinc) {
+            setPrinc.add(null);
+        }
+
+        return (new jjjjj.security.auth.Subject(setPrinc));
+    }
+
+    /**
+     * Method to allow creation of a SecureSet that can optionally
+     * insert a null reference.
+     */
+    private static Set<Principal> makeSecSetWithNull(boolean nullPrinc) {
+        Set<Principal> setPrinc = new HashSet<>(Arrays.asList(princVals));
+        if (nullPrinc) {
+            setPrinc.add(null);
+        }
+
+        jjjjj.security.auth.Subject subj =
+            new jjjjj.security.auth.Subject(setPrinc);
+
+        return subj.getPrincipals();
+    }
+
+    /**
+     * Construct a subject, and optionally place a null in any one
+     * of the three Sets used to initialize a Subject's values
+     */
+    private static Subject makeSubj(boolean nullPrinc, boolean nullPub,
+                             boolean nullPriv) {
+        Set<Principal> setPrinc = new HashSet<>(Arrays.asList(princVals));
+        Set<String> setPubCreds = new HashSet<>(Arrays.asList(pubVals));
+        Set<String> setPrvCreds = new HashSet<>(Arrays.asList(privVals));
+
+        if (nullPrinc) {
+            setPrinc.add(null);
+        }
+
+        if (nullPub) {
+            setPubCreds.add(null);
+        }
+
+        if (nullPriv) {
+            setPrvCreds.add(null);
+        }
+
+        return (new Subject(false, setPrinc, setPubCreds, setPrvCreds));
+    }
+
+    /**
+     * Provide a simple interface for abstracting collection-on-collection
+     * functions
+     */
+    public interface Function {
+        boolean execCollection(Set<?> subjSet, Collection<?> actorData);
+    }
+
+    public static final Function methAdd = new Function() {
+        @SuppressWarnings("unchecked")
+        @Override
+        public boolean execCollection(Set<?> subjSet, Collection<?> actorData) {
+            return subjSet.addAll((Collection)actorData);
+        }
+    };
+
+    public static final Function methContains = new Function() {
+        @Override
+        public boolean execCollection(Set<?> subjSet, Collection<?> actorData) {
+            return subjSet.containsAll(actorData);
+        }
+    };
+
+    public static final Function methRemove = new Function() {
+        @Override
+        public boolean execCollection(Set<?> subjSet, Collection<?> actorData) {
+            return subjSet.removeAll(actorData);
+        }
+    };
+
+    public static final Function methRetain = new Function() {
+        @Override
+        public boolean execCollection(Set<?> subjSet, Collection<?> actorData) {
+            return subjSet.retainAll(actorData);
+        }
+    };
+
+    /**
+     * Run a test using a specified Collection method upon a Subject's
+     * SecureSet fields. This method expects NullPointerExceptions
+     * to be thrown, and throws RuntimeException when the operation
+     * succeeds
+     */
+    private static void nullTestCollection(Function meth, Set<?> subjSet,
+           Collection<?> actorData) {
+        try {
+            meth.execCollection(subjSet, actorData);
+            throw new RuntimeException("Failed to throw NullPointerException");
+        } catch (NullPointerException npe) {
+            System.out.println("Caught expected NullPointerException [PASS]");
+        }
+    }
+
+    /**
+     * Run a test using a specified Collection method upon a Subject's
+     * SecureSet fields. This method expects the function and arguments
+     * passed in to complete without exception.  It returns false
+     * if either an exception occurs or the result of the operation is
+     * false.
+     */
+    private static boolean validTestCollection(Function meth, Set<?> subjSet,
+           Collection<?> actorData) {
+        boolean result = false;
+
+        try {
+            result = meth.execCollection(subjSet, actorData);
+        } catch (Exception exc) {
+            System.out.println("Caught exception " + exc);
+        }
+
+        return result;
+    }
+
+    /**
+     * Deserialize an object from a byte array.
+     *
+     * @param type The {@code Class} that the serialized file is supposed
+     *             to contain.
+     * @param serBuffer The byte array containing the serialized object data
+     *
+     * @return An object of the type specified in the {@code type} parameter
+     */
+    private static <T> T deserializeBuffer(Class<T> type, byte[] serBuffer)
+            throws IOException, ClassNotFoundException {
+
+        ByteArrayInputStream bis = new ByteArrayInputStream(serBuffer);
+        ObjectInputStream ois = new ObjectInputStream(bis);
+
+        T newObj = type.cast(ois.readObject());
+        ois.close();
+        bis.close();
+
+        return newObj;
+    }
+
+    private static void testCTOR() {
+        System.out.println("------ constructor ------");
+
+        try {
+            // Case 1: Create a subject with a null principal
+            // Expected result: NullPointerException
+            Subject mtSubj = makeSubj(true, false, false);
+            throw new RuntimeException(
+                    "constructor [principal w/ null]: Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println("constructor [principal w/ null]: " +
+                    "NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 2: Create a subject with a null public credential element
+            // Expected result: NullPointerException
+            Subject mtSubj = makeSubj(false, true, false);
+            throw new RuntimeException(
+                    "constructor [pub cred w/ null]: Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println("constructor [pub cred w/ null]: " +
+                    "NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 3: Create a subject with a null private credential element
+            // Expected result: NullPointerException
+            Subject mtSubj = makeSubj(false, false, true);
+            throw new RuntimeException(
+                    "constructor [priv cred w/ null]: Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println("constructor [priv cred w/ null]: " +
+                    "NullPointerException [PASS]");
+        }
+
+        // Case 4: Create a new subject using the principals, public
+        // and private credentials from another well-formed subject
+        // Expected result: Successful construction
+        Subject srcSubj = makeSubj(false, false, false);
+        Subject mtSubj = new Subject(false, srcSubj.getPrincipals(),
+                srcSubj.getPublicCredentials(),
+                srcSubj.getPrivateCredentials());
+        System.out.println("Construction from another well-formed Subject's " +
+                "principals/creds [PASS]");
+    }
+
+    @SuppressWarnings("unchecked")
+    private static void testDeserialize() throws Exception {
+        System.out.println("------ deserialize -----");
+
+        Subject subj = null;
+        Set<Principal> prin = null;
+
+        // Case 1: positive deserialization test of a Subject
+        // Expected result: well-formed Subject
+        subj = deserializeBuffer(Subject.class, SUBJ_NO_NULL);
+        System.out.println("Positive deserialization test (Subject) passed");
+
+        // Case 2: positive deserialization test of a SecureSet
+        // Expected result: well-formed Set
+        prin = deserializeBuffer(Set.class, PRIN_NO_NULL);
+        System.out.println("Positive deserialization test (SecureSet) passed");
+
+        System.out.println(
+                "* Testing deserialization with null-poisoned objects");
+        // Case 3: deserialization test of a null-poisoned Subject
+        // Expected result: NullPointerException
+        try {
+            subj = deserializeBuffer(Subject.class, SUBJ_WITH_NULL);
+            throw new RuntimeException("Failed to throw NullPointerException");
+        } catch (NullPointerException npe) {
+            System.out.println("Caught expected NullPointerException [PASS]");
+        }
+
+        // Case 4: deserialization test of a null-poisoned SecureSet
+        // Expected result: NullPointerException
+        try {
+            prin = deserializeBuffer(Set.class, PRIN_WITH_NULL);
+            throw new RuntimeException("Failed to throw NullPointerException");
+        } catch (NullPointerException npe) {
+            System.out.println("Caught expected NullPointerException [PASS]");
+        }
+    }
+
+    private static void testAdd() {
+        System.out.println("------ add() ------");
+        // Create a well formed subject
+        Subject mtSubj = makeSubj(false, false, false);
+
+        try {
+            // Case 1: Attempt to add null values to principal
+            // Expected result: NullPointerException
+            mtSubj.getPrincipals().add(null);
+            throw new RuntimeException(
+                    "PRINCIPAL add(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PRINCIPAL add(null): NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 2: Attempt to add null into the public creds
+            // Expected result: NullPointerException
+            mtSubj.getPublicCredentials().add(null);
+            throw new RuntimeException(
+                    "PUB CRED add(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PUB CRED add(null): NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 3: Attempt to add null into the private creds
+            // Expected result: NullPointerException
+            mtSubj.getPrivateCredentials().add(null);
+            throw new RuntimeException(
+                    "PRIV CRED add(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PRIV CRED add(null): NullPointerException [PASS]");
+        }
+    }
+
+    private static void testRemove() {
+        System.out.println("------ remove() ------");
+        // Create a well formed subject
+        Subject mtSubj = makeSubj(false, false, false);
+
+        try {
+            // Case 1: Attempt to remove null values from principal
+            // Expected result: NullPointerException
+            mtSubj.getPrincipals().remove(null);
+            throw new RuntimeException(
+                    "PRINCIPAL remove(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PRINCIPAL remove(null): NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 2: Attempt to remove null from the public creds
+            // Expected result: NullPointerException
+            mtSubj.getPublicCredentials().remove(null);
+            throw new RuntimeException(
+                    "PUB CRED remove(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PUB CRED remove(null): NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 3: Attempt to remove null from the private creds
+            // Expected result: NullPointerException
+            mtSubj.getPrivateCredentials().remove(null);
+            throw new RuntimeException(
+                    "PRIV CRED remove(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PRIV CRED remove(null): NullPointerException [PASS]");
+        }
+    }
+
+    private static void testContains() {
+        System.out.println("------ contains() ------");
+        // Create a well formed subject
+        Subject mtSubj = makeSubj(false, false, false);
+
+        try {
+            // Case 1: Attempt to check for null values in principals
+            // Expected result: NullPointerException
+            mtSubj.getPrincipals().contains(null);
+            throw new RuntimeException(
+                    "PRINCIPAL contains(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PRINCIPAL contains(null): NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 2: Attempt to check for null in public creds
+            // Expected result: NullPointerException
+            mtSubj.getPublicCredentials().contains(null);
+            throw new RuntimeException(
+                    "PUB CRED contains(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PUB CRED contains(null): NullPointerException [PASS]");
+        }
+
+        try {
+            // Case 3: Attempt to check for null in private creds
+            // Expected result: NullPointerException
+            mtSubj.getPrivateCredentials().contains(null);
+            throw new RuntimeException(
+                    "PRIV CRED contains(null): Failed to throw NPE");
+        } catch (NullPointerException npe) {
+            System.out.println(
+                    "PRIV CRED contains(null): NullPointerException [PASS]");
+        }
+    }
+
+    private static void testAddAll() {
+        // Create a well formed subject and additional collections
+        Subject mtSubj = makeSubj(false, false, false);
+        Set<Principal> morePrincs = new HashSet<>(Arrays.asList(tmplAddPrincs));
+        Set<Object> morePubVals = new HashSet<>(Arrays.asList(tmplAddPubVals));
+        Set<Object> morePrvVals = new HashSet<>(Arrays.asList(tmplAddPrvVals));
+
+        // Run one success test for each Subject family to verify the
+        // overloaded method works as intended.
+        Set<Principal> setPrin = mtSubj.getPrincipals();
+        Set<Object> setPubCreds = mtSubj.getPublicCredentials();
+        Set<Object> setPrvCreds = mtSubj.getPrivateCredentials();
+        int prinOrigSize = setPrin.size();
+        int pubOrigSize = setPubCreds.size();
+        int prvOrigSize = setPrvCreds.size();
+
+        System.out.println("------ addAll() -----");
+
+        // Add the new members, then check the resulting size of the
+        // Subject attributes to verify they've increased by the proper
+        // amounts.
+        if ((validTestCollection(methAdd, setPrin, morePrincs) != true) ||
+            (setPrin.size() != prinOrigSize + morePrincs.size()))
+        {
+            throw new RuntimeException("Failed addAll() on principals");
+        }
+        if ((validTestCollection(methAdd, setPubCreds,
+                morePubVals) != true) ||
+            (setPubCreds.size() != pubOrigSize + morePubVals.size()))
+        {
+            throw new RuntimeException("Failed addAll() on public creds");
+        }
+        if ((validTestCollection(methAdd, setPrvCreds,
+                morePrvVals) != true) ||
+            (setPrvCreds.size() != prvOrigSize + morePrvVals.size()))
+        {
+            throw new RuntimeException("Failed addAll() on private creds");
+        }
+        System.out.println("Positive addAll() test passed");
+
+        // Now add null elements into each container, then retest
+        morePrincs.add(null);
+        morePubVals.add(null);
+        morePrvVals.add(null);
+
+        System.out.println("* Testing addAll w/ null values on Principals");
+        nullTestCollection(methAdd, mtSubj.getPrincipals(), null);
+        nullTestCollection(methAdd, mtSubj.getPrincipals(), morePrincs);
+
+        System.out.println("* Testing addAll w/ null values on Public Creds");
+        nullTestCollection(methAdd, mtSubj.getPublicCredentials(), null);
+        nullTestCollection(methAdd, mtSubj.getPublicCredentials(),
+                morePubVals);
+
+        System.out.println("* Testing addAll w/ null values on Private Creds");
+        nullTestCollection(methAdd, mtSubj.getPrivateCredentials(), null);
+        nullTestCollection(methAdd, mtSubj.getPrivateCredentials(),
+                morePrvVals);
+    }
+
+    private static void testRemoveAll() {
+        // Create a well formed subject and additional collections
+        Subject mtSubj = makeSubj(false, false, false);
+        Set<Principal> remPrincs = new HashSet<>();
+        Set<Object> remPubVals = new HashSet<>();
+        Set<Object> remPrvVals = new HashSet<>();
+
+        remPrincs.add(new KerberosPrincipal("mtwain/author@LITERATURE.US"));
+        remPubVals.add("mtwain");
+        remPrvVals.add("5Cl3M3nz");
+
+        // Run one success test for each Subject family to verify the
+        // overloaded method works as intended.
+        Set<Principal> setPrin = mtSubj.getPrincipals();
+        Set<Object> setPubCreds = mtSubj.getPublicCredentials();
+        Set<Object> setPrvCreds = mtSubj.getPrivateCredentials();
+        int prinOrigSize = setPrin.size();
+        int pubOrigSize = setPubCreds.size();
+        int prvOrigSize = setPrvCreds.size();
+
+        System.out.println("------ removeAll() -----");
+
+        // Remove the specified members, then check the resulting size of the
+        // Subject attributes to verify they've decreased by the proper
+        // amounts.
+        if ((validTestCollection(methRemove, setPrin, remPrincs) != true) ||
+            (setPrin.size() != prinOrigSize - remPrincs.size()))
+        {
+            throw new RuntimeException("Failed removeAll() on principals");
+        }
+        if ((validTestCollection(methRemove, setPubCreds,
+                remPubVals) != true) ||
+            (setPubCreds.size() != pubOrigSize - remPubVals.size()))
+        {
+            throw new RuntimeException("Failed removeAll() on public creds");
+        }
+        if ((validTestCollection(methRemove, setPrvCreds,
+                remPrvVals) != true) ||
+            (setPrvCreds.size() != prvOrigSize - remPrvVals.size()))
+        {
+            throw new RuntimeException("Failed removeAll() on private creds");
+        }
+        System.out.println("Positive removeAll() test passed");
+
+        // Now add null elements into each container, then retest
+        remPrincs.add(null);
+        remPubVals.add(null);
+        remPrvVals.add(null);
+
+        System.out.println("* Testing removeAll w/ null values on Principals");
+        nullTestCollection(methRemove, mtSubj.getPrincipals(), null);
+        nullTestCollection(methRemove, mtSubj.getPrincipals(), remPrincs);
+
+        System.out.println(
+                "* Testing removeAll w/ null values on Public Creds");
+        nullTestCollection(methRemove, mtSubj.getPublicCredentials(), null);
+        nullTestCollection(methRemove, mtSubj.getPublicCredentials(),
+                remPubVals);
+
+        System.out.println(
+                "* Testing removeAll w/ null values on Private Creds");
+        nullTestCollection(methRemove, mtSubj.getPrivateCredentials(), null);
+        nullTestCollection(methRemove, mtSubj.getPrivateCredentials(),
+                remPrvVals);
+    }
+
+    private static void testContainsAll() {
+        // Create a well formed subject and additional collections
+        Subject mtSubj = makeSubj(false, false, false);
+        Set<Principal> testPrincs = new HashSet<>(Arrays.asList(princVals));
+        Set<Object> testPubVals = new HashSet<>(Arrays.asList(pubVals));
+        Set<Object> testPrvVals = new HashSet<>(Arrays.asList(privVals));
+
+        System.out.println("------ containsAll() -----");
+
+        // Run one success test for each Subject family to verify the
+        // overloaded method works as intended.
+        if ((validTestCollection(methContains, mtSubj.getPrincipals(),
+                 testPrincs) == false) &&
+            (validTestCollection(methContains, mtSubj.getPublicCredentials(),
+                 testPubVals) == false) &&
+            (validTestCollection(methContains,
+                 mtSubj.getPrivateCredentials(), testPrvVals) == false)) {
+            throw new RuntimeException("Valid containsAll() check failed");
+        }
+        System.out.println("Positive containsAll() test passed");
+
+        // Now let's add a null into each collection and watch the fireworks.
+        testPrincs.add(null);
+        testPubVals.add(null);
+        testPrvVals.add(null);
+
+        System.out.println(
+                "* Testing containsAll w/ null values on Principals");
+        nullTestCollection(methContains, mtSubj.getPrincipals(), null);
+        nullTestCollection(methContains, mtSubj.getPrincipals(), testPrincs);
+
+        System.out.println(
+                "* Testing containsAll w/ null values on Public Creds");
+        nullTestCollection(methContains, mtSubj.getPublicCredentials(),
+                null);
+        nullTestCollection(methContains, mtSubj.getPublicCredentials(),
+                testPubVals);
+
+        System.out.println(
+                "* Testing containsAll w/ null values on Private Creds");
+        nullTestCollection(methContains, mtSubj.getPrivateCredentials(),
+                null);
+        nullTestCollection(methContains, mtSubj.getPrivateCredentials(),
+                testPrvVals);
+    }
+
+    private static void testRetainAll() {
+        // Create a well formed subject and additional collections
+        Subject mtSubj = makeSubj(false, false, false);
+        Set<Principal> remPrincs = new HashSet<>(Arrays.asList(tmplAddPrincs));
+        Set<Object> remPubVals = new HashSet<>(Arrays.asList(tmplAddPubVals));
+        Set<Object> remPrvVals = new HashSet<>(Arrays.asList(tmplAddPrvVals));
+
+        // Add in values that exist within the Subject
+        remPrincs.add(princVals[2]);
+        remPubVals.add(pubVals[2]);
+        remPrvVals.add(privVals[2]);
+
+        // Run one success test for each Subject family to verify the
+        // overloaded method works as intended.
+        Set<Principal> setPrin = mtSubj.getPrincipals();
+        Set<Object> setPubCreds = mtSubj.getPublicCredentials();
+        Set<Object> setPrvCreds = mtSubj.getPrivateCredentials();
+        int prinOrigSize = setPrin.size();
+        int pubOrigSize = setPubCreds.size();
+        int prvOrigSize = setPrvCreds.size();
+
+        System.out.println("------ retainAll() -----");
+
+        // Retain the specified members (those that exist in the Subject)
+        // and validate the results.
+        if (validTestCollection(methRetain, setPrin, remPrincs) == false ||
+            setPrin.size() != 1 || setPrin.contains(princVals[2]) == false)
+        {
+            throw new RuntimeException("Failed retainAll() on principals");
+        }
+
+        if (validTestCollection(methRetain, setPubCreds,
+                remPubVals) == false ||
+            setPubCreds.size() != 1 ||
+            setPubCreds.contains(pubVals[2]) == false)
+        {
+            throw new RuntimeException("Failed retainAll() on public creds");
+        }
+        if (validTestCollection(methRetain, setPrvCreds,
+                remPrvVals) == false ||
+            setPrvCreds.size() != 1 ||
+            setPrvCreds.contains(privVals[2]) == false)
+        {
+            throw new RuntimeException("Failed retainAll() on private creds");
+        }
+        System.out.println("Positive retainAll() test passed");
+
+        // Now add null elements into each container, then retest
+        remPrincs.add(null);
+        remPubVals.add(null);
+        remPrvVals.add(null);
+
+        System.out.println("* Testing retainAll w/ null values on Principals");
+        nullTestCollection(methRetain, mtSubj.getPrincipals(), null);
+        nullTestCollection(methRetain, mtSubj.getPrincipals(), remPrincs);
+
+        System.out.println(
+                "* Testing retainAll w/ null values on Public Creds");
+        nullTestCollection(methRetain, mtSubj.getPublicCredentials(), null);
+        nullTestCollection(methRetain, mtSubj.getPublicCredentials(),
+                remPubVals);
+
+        System.out.println(
+                "* Testing retainAll w/ null values on Private Creds");
+        nullTestCollection(methRetain, mtSubj.getPrivateCredentials(), null);
+        nullTestCollection(methRetain, mtSubj.getPrivateCredentials(),
+                remPrvVals);
+    }
+
+    private static void testIsEmpty() {
+        Subject populatedSubj = makeSubj(false, false, false);
+        Subject emptySubj = new Subject();
+
+        System.out.println("------ isEmpty() -----");
+
+        if (populatedSubj.getPrincipals().isEmpty()) {
+            throw new RuntimeException(
+                    "Populated Subject Principals incorrectly returned empty");
+        }
+        if (emptySubj.getPrincipals().isEmpty() == false) {
+            throw new RuntimeException(
+                    "Empty Subject Principals incorrectly returned non-empty");
+        }
+        System.out.println("isEmpty() test passed");
+    }
+
+    private static void testSecureSetEquals() {
+        System.out.println("------ SecureSet.equals() -----");
+
+        Subject subj = makeSubj(false, false, false);
+        Subject subjComp = makeSubj(false, false, false);
+
+        // Case 1: null comparison [expect false]
+        if (subj.getPublicCredentials().equals(null) != false) {
+            throw new RuntimeException(
+                    "equals(null) incorrectly returned true");
+        }
+
+        // Case 2: Self-comparison [expect true]
+        Set<Principal> princs = subj.getPrincipals();
+        princs.equals(subj.getPrincipals());
+
+        // Case 3: Comparison with non-Set type [expect false]
+        List<Principal> listPrinc = new LinkedList<>(Arrays.asList(princVals));
+        if (subj.getPublicCredentials().equals(listPrinc) != false) {
+            throw new RuntimeException(
+                    "equals([Non-Set]) incorrectly returned true");
+        }
+
+        // Case 4: SecureSets of differing sizes [expect false]
+        Subject subj1princ = new Subject();
+        Subject subj2princ = new Subject();
+        subj1princ.getPrincipals().add(
+                new X500Principal("CN=Tom Sawyer, ST=Missouri, C=US"));
+        subj1princ.getPrincipals().add(
+                new X500Principal("CN=John Doe, O=Bogus Corp."));
+        subj2princ.getPrincipals().add(
+                new X500Principal("CN=Tom Sawyer, ST=Missouri, C=US"));
+        if (subj1princ.getPrincipals().equals(
+                    subj2princ.getPrincipals()) != false) {
+            throw new RuntimeException(
+                    "equals([differing sizes]) incorrectly returned true");
+        }
+
+        // Case 5: Content equality test [expect true]
+        Set<Principal> equalSet = new HashSet<>(Arrays.asList(princVals));
+        if (subj.getPrincipals().equals(equalSet) != true) {
+            throw new RuntimeException(
+                    "equals([equivalent set]) incorrectly returned false");
+        }
+
+        // Case 5: Content inequality test [expect false]
+        // Note: to not fall into the size inequality check the two
+        // sets need to have the same number of elements.
+        Set<Principal> inequalSet =
+            new HashSet<Principal>(Arrays.asList(tmplAddPrincs));
+        inequalSet.add(new JMXPrincipal("Samuel Clemens"));
+
+        if (subj.getPrincipals().equals(inequalSet) != false) {
+            throw new RuntimeException(
+                    "equals([equivalent set]) incorrectly returned false");
+        }
+        System.out.println("SecureSet.equals() tests passed");
+    }
+
+    private static void testSecureSetHashCode() {
+        System.out.println("------ SecureSet.hashCode() -----");
+
+        Subject subj = makeSubj(false, false, false);
+
+        // Make sure two other Set types that we know are equal per
+        // SecureSet.equals() and verify their hashCodes are also the same
+        Set<Principal> equalHashSet = new HashSet<>(Arrays.asList(princVals));
+
+        if (subj.getPrincipals().hashCode() != equalHashSet.hashCode()) {
+            throw new RuntimeException(
+                    "SecureSet and HashSet hashCodes() differ");
+        }
+        System.out.println("SecureSet.hashCode() tests passed");
+    }
+
+    private static void testToArray() {
+        System.out.println("------ toArray() -----");
+
+        Subject subj = makeSubj(false, false, false);
+
+        // Case 1: no-parameter toArray with equality comparison
+        // Expected result: true
+        List<Object> alSubj = Arrays.asList(subj.getPrincipals().toArray());
+        List<Principal> alPrincs = Arrays.asList(princVals);
+
+        if (alSubj.size() != alPrincs.size() ||
+                alSubj.containsAll(alPrincs) != true) {
+            throw new RuntimeException(
+                    "Unexpected inequality on returned toArray()");
+        }
+
+        // Case 2: generic-type toArray where passed array is of sufficient
+        //         size.
+        // Expected result: returned Array is reference-equal to input param
+        // and content equal to data used to construct the originating Subject.
+        Principal[] pBlock = new Principal[3];
+        Principal[] pBlockRef = subj.getPrincipals().toArray(pBlock);
+        alSubj = Arrays.asList((Object[])pBlockRef);
+
+        if (pBlockRef != pBlock) {
+            throw new RuntimeException(
+                    "Unexpected reference-inequality on returned toArray(T[])");
+        } else if (alSubj.size() != alPrincs.size() ||
+                alSubj.containsAll(alPrincs) != true) {
+            throw new RuntimeException(
+                    "Unexpected content-inequality on returned toArray(T[])");
+        }
+
+        // Case 3: generic-type toArray where passed array is of
+        //         insufficient size.
+        // Expected result: returned Array is not reference-equal to
+        // input param but is content equal to data used to construct the
+        // originating Subject.
+        pBlock = new Principal[1];
+        pBlockRef = subj.getPrincipals().toArray(pBlock);
+        alSubj = Arrays.asList((Object[])pBlockRef);
+
+        if (pBlockRef == pBlock) {
+            throw new RuntimeException(
+                    "Unexpected reference-equality on returned toArray(T[])");
+        } else if (alSubj.size() != alPrincs.size() ||
+                alSubj.containsAll(alPrincs) != true) {
+            throw new RuntimeException(
+                    "Unexpected content-inequality on returned toArray(T[])");
+        }
+        System.out.println("toArray() tests passed");
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        testCTOR();
+
+        testDeserialize();
+
+        testAdd();
+
+        testRemove();
+
+        testContains();
+
+        testAddAll();
+
+        testRemoveAll();
+
+        testContainsAll();
+
+        testRetainAll();
+
+        testIsEmpty();
+
+        testSecureSetEquals();
+
+        testSecureSetHashCode();
+
+        testToArray();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessAbstractSpinnerModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that AbstractSpinnerModel constructor and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessAbstractSpinnerModel
+ */
+
+public class HeadlessAbstractSpinnerModel {
+    public static void main (String[] args){
+        AbstractSpinnerModel model = new AbstractSpinnerModel(){
+            public Object getValue() { return null; }
+            public void setValue(Object value) {}
+            public Object getNextValue() { return null; }
+            public Object getPreviousValue() { return null; }
+        };
+        model.getPreviousValue();
+        model.getNextValue();
+        model.setValue("next");
+        model.getValue();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessBox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that Box constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBox
+ */
+
+public class HeadlessBox {
+
+    public static void main(String args[]) {
+        for (Box b : new Box[]{new Box(BoxLayout.X_AXIS), new Box(BoxLayout.Y_AXIS)}) {
+            b = Box.createHorizontalBox();
+            b = Box.createVerticalBox();
+            b = new Box(BoxLayout.Y_AXIS);
+            b.getAccessibleContext();
+            b.requestFocus();
+            b.requestFocusInWindow();
+            b.getPreferredSize();
+            b.getMaximumSize();
+            b.getMinimumSize();
+            b.contains(1, 2);
+            Component c1 = b.add(new Component() {
+            });
+            Component c2 = b.add(new Component() {
+            });
+            Component c3 = b.add(new Component() {
+            });
+            b.getComponentCount();
+            b.countComponents();
+            b.getComponent(1);
+            b.getComponent(2);
+            Component[] cs = b.getComponents();
+
+            boolean exceptions = false;
+            try {
+                b.setLayout(new BoxLayout(new Container(), BoxLayout.Y_AXIS));
+            } catch (AWTError e) {
+                exceptions = true;
+            }
+            if (!exceptions)
+                throw new RuntimeException("AWTError did not occur when expected");
+
+            exceptions = false;
+            try {
+                b.setLayout(new BoxLayout(new Container(), BoxLayout.X_AXIS));
+            } catch (AWTError e) {
+                exceptions = true;
+            }
+            if (!exceptions)
+                throw new RuntimeException("AWTError did not occur when expected");
+
+            b.getLayout();
+            b.invalidate();
+            b.validate();
+            b.revalidate();
+
+            Insets ins = b.getInsets();
+            b.getAlignmentY();
+            b.getAlignmentX();
+            b.getGraphics();
+            b.setVisible(false);
+            b.setVisible(true);
+            b.setEnabled(false);
+            b.setEnabled(true);
+            b.setForeground(Color.red);
+            b.setBackground(Color.red);
+
+            for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+                for (int j = 8; j < 17; j++) {
+                    Font f1 = new Font(font, Font.PLAIN, j);
+                    Font f2 = new Font(font, Font.BOLD, j);
+                    Font f3 = new Font(font, Font.ITALIC, j);
+                    Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                    b.setFont(f1);
+                    b.setFont(f2);
+                    b.setFont(f3);
+                    b.setFont(f4);
+
+                    b.getFontMetrics(f1);
+                    b.getFontMetrics(f2);
+                    b.getFontMetrics(f3);
+                    b.getFontMetrics(f4);
+
+                }
+            }
+
+            b.enable();
+            b.disable();
+            b.reshape(10, 10, 10, 10);
+            b.getBounds(new Rectangle(1, 1, 1, 1));
+            b.getSize(new Dimension(1, 2));
+            b.getSize(new Dimension(1, 2));
+            b.getLocation(new Point(1, 2));
+            b.getX();
+            b.getY();
+            b.getWidth();
+            b.getHeight();
+            b.isOpaque();
+            b.isValidateRoot();
+            b.isOptimizedDrawingEnabled();
+            b.isDoubleBuffered();
+
+            b.remove(0);
+            b.remove(c2);
+            b.removeAll();
+            b.layout();
+            b.preferredSize();
+            b.minimumSize();
+            b.getComponentAt(1, 2);
+            b.locate(1, 2);
+            b.getComponentAt(new Point(1, 2));
+            b.isFocusCycleRoot(new Container());
+            b.transferFocusBackward();
+            b.setName("goober");
+            b.getName();
+            b.getParent();
+            b.getPeer();
+            b.getGraphicsConfiguration();
+            b.getTreeLock();
+            b.getToolkit();
+            b.isValid();
+            b.isDisplayable();
+            b.isVisible();
+            b.isShowing();
+            b.isEnabled();
+            b.enable(false);
+            b.enable(true);
+            b.enableInputMethods(false);
+            b.enableInputMethods(true);
+            b.show();
+            b.show(false);
+            b.show(true);
+            b.hide();
+            b.getForeground();
+            b.isForegroundSet();
+            b.getBackground();
+            b.isBackgroundSet();
+            b.getFont();
+            b.isFontSet();
+            b.getLocale();
+            for (Locale locale : Locale.getAvailableLocales())
+                b.setLocale(locale);
+
+            b.getColorModel();
+            b.getLocation();
+
+            exceptions = false;
+            try {
+                b.getLocationOnScreen();
+            } catch (IllegalComponentStateException e) {
+                exceptions = true;
+            }
+            if (!exceptions)
+                throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+            b.location();
+            b.setLocation(1, 2);
+            b.move(1, 2);
+            b.setLocation(new Point(1, 2));
+            b.getSize();
+            b.size();
+            b.setSize(1, 32);
+            b.resize(1, 32);
+            b.setSize(new Dimension(1, 32));
+            b.resize(new Dimension(1, 32));
+            b.getBounds();
+            b.bounds();
+            b.setBounds(10, 10, 10, 10);
+            b.setBounds(new Rectangle(10, 10, 10, 10));
+            b.isLightweight();
+            b.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+            b.getCursor();
+            b.isCursorSet();
+            b.inside(1, 2);
+            b.contains(new Point(1, 2));
+            b.isFocusTraversable();
+            b.isFocusable();
+            b.setFocusable(true);
+            b.setFocusable(false);
+            b.transferFocus();
+            b.getFocusCycleRootAncestor();
+            b.nextFocus();
+            b.transferFocusUpCycle();
+            b.hasFocus();
+            b.isFocusOwner();
+            b.toString();
+            b.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+            b.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+            b.setComponentOrientation(ComponentOrientation.UNKNOWN);
+            b.getComponentOrientation();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessBox_Filler.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that Box.Filler constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessBox_Filler
+ */
+
+public class HeadlessBox_Filler {
+    public static void main(String args[]) {
+        Box.Filler bf = new Box.Filler(new Dimension(10, 10),
+                new Dimension(20, 20),
+                new Dimension(30, 30));
+        bf.getMinimumSize();
+        bf.getPreferredSize();
+        bf.getMaximumSize();
+        bf.getAccessibleContext();
+        bf.requestFocus();
+        bf.requestFocusInWindow();
+        bf.contains(1, 2);
+        Component c1 = bf.add(new Component(){});
+        Component c2 = bf.add(new Component(){});
+        Component c3 = bf.add(new Component(){});
+        Insets ins = bf.getInsets();
+        bf.getAlignmentY();
+        bf.getAlignmentX();
+        bf.getGraphics();
+        bf.setVisible(false);
+        bf.setVisible(true);
+        bf.setEnabled(false);
+        bf.setEnabled(true);
+        bf.setForeground(Color.red);
+        bf.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                bf.setFont(f1);
+                bf.setFont(f2);
+                bf.setFont(f3);
+                bf.setFont(f4);
+
+                bf.getFontMetrics(f1);
+                bf.getFontMetrics(f2);
+                bf.getFontMetrics(f3);
+                bf.getFontMetrics(f4);
+            }
+        }
+        bf.enable();
+        bf.disable();
+        bf.reshape(10, 10, 10, 10);
+        bf.getBounds(new Rectangle(1, 1, 1, 1));
+        bf.getSize(new Dimension(1, 2));
+        bf.getLocation(new Point(1, 2));
+        bf.getX();
+        bf.getY();
+        bf.getWidth();
+        bf.getHeight();
+        bf.isOpaque();
+        bf.isValidateRoot();
+        bf.isOptimizedDrawingEnabled();
+        bf.isDoubleBuffered();
+        bf.getComponentCount();
+        bf.countComponents();
+        bf.getComponent(1);
+        bf.getComponent(2);
+        Component[] cs = bf.getComponents();
+        bf.getLayout();
+        bf.setLayout(new FlowLayout());
+        bf.doLayout();
+        bf.layout();
+        bf.invalidate();
+        bf.validate();
+        bf.preferredSize();
+        bf.remove(0);
+        bf.remove(c2);
+        bf.removeAll();
+        bf.minimumSize();
+        bf.getComponentAt(1, 2);
+        bf.locate(1, 2);
+        bf.getComponentAt(new Point(1, 2));
+        bf.isFocusCycleRoot(new Container());
+        bf.transferFocusBackward();
+        bf.setName("goober");
+        bf.getName();
+        bf.getParent();
+        bf.getPeer();
+        bf.getGraphicsConfiguration();
+        bf.getTreeLock();
+        bf.getToolkit();
+        bf.isValid();
+        bf.isDisplayable();
+        bf.isVisible();
+        bf.isShowing();
+        bf.isEnabled();
+        bf.enable(false);
+        bf.enable(true);
+        bf.enableInputMethods(false);
+        bf.enableInputMethods(true);
+        bf.show();
+        bf.show(false);
+        bf.show(true);
+        bf.hide();
+        bf.getForeground();
+        bf.isForegroundSet();
+        bf.getBackground();
+        bf.isBackgroundSet();
+        bf.getFont();
+        bf.isFontSet();
+
+        Container c = new Container();
+        c.add(bf);
+        bf.getLocale();
+
+        for (Locale locale : Locale.getAvailableLocales())
+            bf.setLocale(locale);
+
+        bf.getColorModel();
+        bf.getLocation();
+
+        boolean exceptions = false;
+        try {
+            bf.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        bf.setLocation(1, 2);
+        bf.move(1, 2);
+        bf.setLocation(new Point(1, 2));
+        bf.getSize();
+        bf.size();
+        bf.setSize(1, 32);
+        bf.resize(1, 32);
+        bf.setSize(new Dimension(1, 32));
+        bf.resize(new Dimension(1, 32));
+        bf.getBounds();
+        bf.bounds();
+        bf.setBounds(10, 10, 10, 10);
+        bf.setBounds(new Rectangle(10, 10, 10, 10));
+        bf.isLightweight();
+        bf.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        bf.getCursor();
+        bf.isCursorSet();
+        bf.inside(1, 2);
+        bf.contains(new Point(1, 2));
+        bf.isFocusTraversable();
+        bf.isFocusable();
+        bf.setFocusable(true);
+        bf.setFocusable(false);
+        bf.transferFocus();
+        bf.getFocusCycleRootAncestor();
+        bf.nextFocus();
+        bf.transferFocusUpCycle();
+        bf.hasFocus();
+        bf.isFocusOwner();
+        bf.toString();
+        bf.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        bf.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        bf.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        bf.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessCellRendererPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that CellRendererPane constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessCellRendererPane
+ */
+
+public class HeadlessCellRendererPane {
+    public static void main(String args[]) {
+        CellRendererPane crp = new CellRendererPane();
+        Component c1 = crp.add(new Component(){});
+        Component c2 = crp.add(new Component(){});
+        Component c3 = crp.add(new Component(){});
+        crp.setLayout(new FlowLayout());
+        crp.invalidate();
+        crp.getAccessibleContext();
+        crp.getComponentCount();
+        crp.countComponents();
+        crp.getComponent(1);
+        crp.getComponent(2);
+        Component[] cs = crp.getComponents();
+        Insets ins = crp.getInsets();
+        ins = crp.insets();
+        crp.getLayout();
+        crp.setLayout(new FlowLayout());
+        crp.setLayout(new FlowLayout());
+        crp.doLayout();
+        crp.layout();
+        crp.invalidate();
+        crp.validate();
+        crp.remove(0);
+        crp.remove((Component) c2);
+        crp.removeAll();
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                crp.setFont(f1);
+                crp.setFont(f2);
+                crp.setFont(f3);
+                crp.setFont(f4);
+
+                crp.getFontMetrics(f1);
+                crp.getFontMetrics(f2);
+                crp.getFontMetrics(f3);
+                crp.getFontMetrics(f4);
+            }
+        }
+        crp.getPreferredSize();
+        crp.preferredSize();
+        crp.getMinimumSize();
+        crp.minimumSize();
+        crp.getMaximumSize();
+        crp.getAlignmentX();
+        crp.getAlignmentY();
+        crp.getComponentAt(1, 2);
+        crp.locate(1, 2);
+        crp.getComponentAt(new Point(1, 2));
+        crp.isFocusCycleRoot(new Container());
+        crp.transferFocusBackward();
+        crp.setName("goober");
+        crp.getName();
+        crp.getParent();
+        crp.getPeer();
+        crp.getGraphicsConfiguration();
+        crp.getTreeLock();
+        crp.getToolkit();
+        crp.isValid();
+        crp.isDisplayable();
+        crp.isVisible();
+        crp.isShowing();
+        crp.isEnabled();
+        crp.setEnabled(false);
+        crp.setEnabled(true);
+        crp.enable();
+        crp.enable(false);
+        crp.enable(true);
+        crp.disable();
+        crp.isDoubleBuffered();
+        crp.enableInputMethods(false);
+        crp.enableInputMethods(true);
+        crp.setVisible(false);
+        crp.setVisible(true);
+        crp.show();
+        crp.show(false);
+        crp.show(true);
+        crp.hide();
+        crp.getForeground();
+        crp.setForeground(Color.red);
+        crp.isForegroundSet();
+        crp.getBackground();
+        crp.setBackground(Color.red);
+        crp.isBackgroundSet();
+        crp.getFont();
+        crp.isFontSet();
+
+        boolean exceptions = false;
+        try {
+            Container c = new Container();
+            c.add(crp);
+            crp.getLocale();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        for (Locale locale : Locale.getAvailableLocales())
+            crp.setLocale(locale);
+
+        crp.getColorModel();
+        crp.getLocation();
+
+        exceptions = false;
+        try {
+            crp.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        crp.location();
+        crp.setLocation(1, 2);
+        crp.move(1, 2);
+        crp.setLocation(new Point(1, 2));
+        crp.getSize();
+        crp.size();
+        crp.setSize(1, 32);
+        crp.resize(1, 32);
+        crp.setSize(new Dimension(1, 32));
+        crp.resize(new Dimension(1, 32));
+        crp.getBounds();
+        crp.bounds();
+        crp.setBounds(10, 10, 10, 10);
+        crp.reshape(10, 10, 10, 10);
+        crp.setBounds(new Rectangle(10, 10, 10, 10));
+        crp.getX();
+        crp.getY();
+        crp.getWidth();
+        crp.getHeight();
+        crp.getBounds(new Rectangle(1, 1, 1, 1));
+        crp.getSize(new Dimension(1, 2));
+        crp.getLocation(new Point(1, 2));
+        crp.isOpaque();
+        crp.isLightweight();
+        crp.getGraphics();
+        crp.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        crp.getCursor();
+        crp.isCursorSet();
+        crp.contains(1, 2);
+        crp.inside(1, 2);
+        crp.contains(new Point(1, 2));
+        crp.isFocusTraversable();
+        crp.isFocusable();
+        crp.setFocusable(true);
+        crp.setFocusable(false);
+        crp.requestFocus();
+        crp.requestFocusInWindow();
+        crp.transferFocus();
+        crp.getFocusCycleRootAncestor();
+        crp.nextFocus();
+        crp.transferFocusUpCycle();
+        crp.hasFocus();
+        crp.isFocusOwner();
+        crp.toString();
+        crp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        crp.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        crp.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        crp.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessDefaultListCellRenderer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that DefaultListCellRenderer constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDefaultListCellRenderer
+ */
+
+public class HeadlessDefaultListCellRenderer {
+    public static void main(String args[]) {
+        DefaultListCellRenderer dcr = new DefaultListCellRenderer();
+        Component c1 = dcr.add(new Component(){});
+        Component c2 = dcr.add(new Component(){});
+        Component c3 = dcr.add(new Component(){});
+        dcr.setLayout(new FlowLayout());
+        dcr.invalidate();
+        dcr.validate();
+        dcr.getAccessibleContext();
+        dcr.requestFocus();
+        dcr.requestFocusInWindow();
+        dcr.getPreferredSize();
+        dcr.getMaximumSize();
+        dcr.getMinimumSize();
+        dcr.contains(1, 2);
+        Insets ins = dcr.getInsets();
+        dcr.getAlignmentY();
+        dcr.getAlignmentX();
+        dcr.getGraphics();
+        dcr.setVisible(false);
+        dcr.setVisible(true);
+        dcr.setEnabled(false);
+        dcr.setEnabled(true);
+        dcr.setForeground(Color.red);
+        dcr.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                dcr.setFont(f1);
+                dcr.setFont(f2);
+                dcr.setFont(f3);
+                dcr.setFont(f4);
+
+                dcr.getFontMetrics(f1);
+                dcr.getFontMetrics(f2);
+                dcr.getFontMetrics(f3);
+                dcr.getFontMetrics(f4);
+            }
+        }
+        dcr.enable();
+        dcr.disable();
+        dcr.reshape(10, 10, 10, 10);
+        dcr.getBounds(new Rectangle(1, 1, 1, 1));
+        dcr.getSize(new Dimension(1, 2));
+        dcr.getLocation(new Point(1, 2));
+        dcr.getX();
+        dcr.getY();
+        dcr.getWidth();
+        dcr.getHeight();
+        dcr.isOpaque();
+        dcr.isValidateRoot();
+        dcr.isOptimizedDrawingEnabled();
+        dcr.isDoubleBuffered();
+        dcr.getComponentCount();
+        dcr.countComponents();
+        dcr.getComponent(1);
+        dcr.getComponent(2);
+        Component[] cs = dcr.getComponents();
+        ins = dcr.insets();
+        dcr.remove(0);
+        dcr.remove((java.awt.Component) c2);
+        dcr.removeAll();
+        dcr.getLayout();
+        dcr.setLayout(new FlowLayout());
+        dcr.doLayout();
+        dcr.layout();
+        dcr.invalidate();
+        dcr.validate();
+        dcr.revalidate();
+        dcr.preferredSize();
+        dcr.minimumSize();
+        dcr.getComponentAt(1, 2);
+        dcr.locate(1, 2);
+        dcr.getComponentAt(new Point(1, 2));
+        dcr.isFocusCycleRoot(new Container());
+        dcr.transferFocusBackward();
+        dcr.setName("goober");
+        dcr.getName();
+        dcr.getParent();
+        dcr.getPeer();
+        dcr.getGraphicsConfiguration();
+        dcr.getTreeLock();
+        dcr.getToolkit();
+        dcr.isValid();
+        dcr.isDisplayable();
+        dcr.isVisible();
+        dcr.isShowing();
+        dcr.isEnabled();
+        dcr.enable(false);
+        dcr.enable(true);
+        dcr.enableInputMethods(false);
+        dcr.enableInputMethods(true);
+        dcr.show();
+        dcr.show(false);
+        dcr.show(true);
+        dcr.hide();
+        dcr.getForeground();
+        dcr.isForegroundSet();
+        dcr.getBackground();
+        dcr.isBackgroundSet();
+        dcr.getFont();
+        dcr.isFontSet();
+
+        Container c = new Container();
+        c.add(dcr);
+        dcr.getLocale();
+
+        for (Locale locale : Locale.getAvailableLocales())
+            dcr.setLocale(locale);
+
+        dcr.getColorModel();
+        dcr.getLocation();
+
+        boolean exceptions = false;
+        try {
+            dcr.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        dcr.location();
+        dcr.setLocation(1, 2);
+        dcr.move(1, 2);
+        dcr.setLocation(new Point(1, 2));
+        dcr.getSize();
+        dcr.size();
+        dcr.setSize(1, 32);
+        dcr.resize(1, 32);
+        dcr.setSize(new Dimension(1, 32));
+        dcr.resize(new Dimension(1, 32));
+        dcr.getBounds();
+        dcr.bounds();
+        dcr.setBounds(10, 10, 10, 10);
+        dcr.setBounds(new Rectangle(10, 10, 10, 10));
+        dcr.isLightweight();
+        dcr.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        dcr.getCursor();
+        dcr.isCursorSet();
+        dcr.inside(1, 2);
+        dcr.contains(new Point(1, 2));
+        dcr.isFocusTraversable();
+        dcr.isFocusable();
+        dcr.setFocusable(true);
+        dcr.setFocusable(false);
+        dcr.transferFocus();
+        dcr.getFocusCycleRootAncestor();
+        dcr.nextFocus();
+        dcr.transferFocusUpCycle();
+        dcr.hasFocus();
+        dcr.isFocusOwner();
+        dcr.toString();
+        dcr.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        dcr.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        dcr.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        dcr.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessDefaultListCellRenderer_UIResource.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that DefaultListCellRenderer.UIResource constructors and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessDefaultListCellRenderer_UIResource
+ */
+
+public class HeadlessDefaultListCellRenderer_UIResource {
+    public static void main(String args[]) {
+        DefaultListCellRenderer.UIResource dcr = new DefaultListCellRenderer.UIResource();
+        Component c1 = dcr.add(new Component(){});
+        Component c2 = dcr.add(new Component(){});
+        Component c3 = dcr.add(new Component(){});
+        dcr.setLayout(new FlowLayout());
+        dcr.invalidate();
+        dcr.validate();
+        dcr.getAccessibleContext();
+        dcr.requestFocus();
+        dcr.requestFocusInWindow();
+        dcr.getPreferredSize();
+        dcr.getMaximumSize();
+        dcr.getMinimumSize();
+        dcr.contains(1, 2);
+        Insets ins = dcr.getInsets();
+        dcr.getAlignmentY();
+        dcr.getAlignmentX();
+        dcr.getGraphics();
+        dcr.setVisible(false);
+        dcr.setVisible(true);
+        dcr.setEnabled(false);
+        dcr.setEnabled(true);
+        dcr.setForeground(Color.red);
+        dcr.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                dcr.setFont(f1);
+                dcr.setFont(f2);
+                dcr.setFont(f3);
+                dcr.setFont(f4);
+
+                dcr.getFontMetrics(f1);
+                dcr.getFontMetrics(f2);
+                dcr.getFontMetrics(f3);
+                dcr.getFontMetrics(f4);
+            }
+        }
+        dcr.enable();
+        dcr.disable();
+        dcr.reshape(10, 10, 10, 10);
+        dcr.getBounds(new Rectangle(1, 1, 1, 1));
+        dcr.getSize(new Dimension(1, 2));
+        dcr.getLocation(new Point(1, 2));
+        dcr.getX();
+        dcr.getY();
+        dcr.getWidth();
+        dcr.getHeight();
+        dcr.isOpaque();
+        dcr.isValidateRoot();
+        dcr.isOptimizedDrawingEnabled();
+        dcr.isDoubleBuffered();
+        dcr.getComponentCount();
+        dcr.countComponents();
+        dcr.getComponent(1);
+        dcr.getComponent(2);
+        Component[] cs = dcr.getComponents();
+        ins = dcr.insets();
+        dcr.remove(0);
+        dcr.remove((java.awt.Component) c2);
+        dcr.removeAll();
+        dcr.getLayout();
+        dcr.setLayout(new FlowLayout());
+        dcr.doLayout();
+        dcr.layout();
+        dcr.invalidate();
+        dcr.validate();
+        dcr.revalidate();
+        dcr.preferredSize();
+        dcr.minimumSize();
+        dcr.getComponentAt(1, 2);
+        dcr.locate(1, 2);
+        dcr.getComponentAt(new Point(1, 2));
+        dcr.isFocusCycleRoot(new Container());
+        dcr.transferFocusBackward();
+        dcr.setName("goober");
+        dcr.getName();
+        dcr.getParent();
+        dcr.getPeer();
+        dcr.getGraphicsConfiguration();
+        dcr.getTreeLock();
+        dcr.getToolkit();
+        dcr.isValid();
+        dcr.isDisplayable();
+        dcr.isVisible();
+        dcr.isShowing();
+        dcr.isEnabled();
+        dcr.enable(false);
+        dcr.enable(true);
+        dcr.enableInputMethods(false);
+        dcr.enableInputMethods(true);
+        dcr.show();
+        dcr.show(false);
+        dcr.show(true);
+        dcr.hide();
+        dcr.getForeground();
+        dcr.isForegroundSet();
+        dcr.getBackground();
+        dcr.isBackgroundSet();
+        dcr.getFont();
+        dcr.isFontSet();
+
+        Container c = new Container();
+        c.add(dcr);
+        dcr.getLocale();
+
+        for (Locale locale : Locale.getAvailableLocales())
+            dcr.setLocale(locale);
+
+        dcr.getColorModel();
+        dcr.getLocation();
+
+        boolean exceptions = false;
+        try {
+            dcr.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        dcr.location();
+        dcr.setLocation(1, 2);
+        dcr.move(1, 2);
+        dcr.setLocation(new Point(1, 2));
+        dcr.getSize();
+        dcr.size();
+        dcr.setSize(1, 32);
+        dcr.resize(1, 32);
+        dcr.setSize(new Dimension(1, 32));
+        dcr.resize(new Dimension(1, 32));
+        dcr.getBounds();
+        dcr.bounds();
+        dcr.setBounds(10, 10, 10, 10);
+        dcr.setBounds(new Rectangle(10, 10, 10, 10));
+        dcr.isLightweight();
+        dcr.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        dcr.getCursor();
+        dcr.isCursorSet();
+        dcr.inside(1, 2);
+        dcr.contains(new Point(1, 2));
+        dcr.isFocusTraversable();
+        dcr.isFocusable();
+        dcr.setFocusable(true);
+        dcr.setFocusable(false);
+        dcr.transferFocus();
+        dcr.getFocusCycleRootAncestor();
+        dcr.nextFocus();
+        dcr.transferFocusUpCycle();
+        dcr.hasFocus();
+        dcr.isFocusOwner();
+        dcr.toString();
+        dcr.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        dcr.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        dcr.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        dcr.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessGrayFilter.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that GrayFilter constructor and clone() method do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessGrayFilter
+ */
+
+public class HeadlessGrayFilter {
+    public static void main(String args[]) {
+         new GrayFilter(true, 60).clone();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJApplet.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.JApplet;
+import java.awt.HeadlessException;
+
+/*
+ * @test
+ * @summary Check that JApplet constructor throws HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJApplet
+ */
+
+public class HeadlessJApplet {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        try {
+            new JApplet();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JButton constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJButton
+ */
+
+public class HeadlessJButton {
+    public static void main(String args[]) {
+        JButton b = new JButton();
+        b = new JButton("Press me");
+        b.getAccessibleContext();
+        b.isFocusTraversable();
+        b.setEnabled(false);
+        b.setEnabled(true);
+        b.requestFocus();
+        b.requestFocusInWindow();
+        b.getPreferredSize();
+        b.getMaximumSize();
+        b.getMinimumSize();
+        b.contains(1, 2);
+        Component c1 = b.add(new Component(){});
+        Component c2 = b.add(new Component(){});
+        Component c3 = b.add(new Component(){});
+        Insets ins = b.getInsets();
+        b.getAlignmentY();
+        b.getAlignmentX();
+        b.getGraphics();
+        b.setVisible(false);
+        b.setVisible(true);
+        b.setForeground(Color.red);
+        b.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                b.setFont(f1);
+                b.setFont(f2);
+                b.setFont(f3);
+                b.setFont(f4);
+
+                b.getFontMetrics(f1);
+                b.getFontMetrics(f2);
+                b.getFontMetrics(f3);
+                b.getFontMetrics(f4);
+            }
+        }
+        b.enable();
+        b.disable();
+        b.reshape(10, 10, 10, 10);
+        b.getBounds(new Rectangle(1, 1, 1, 1));
+        b.getSize(new Dimension(1, 2));
+        b.getLocation(new Point(1, 2));
+        b.getX();
+        b.getY();
+        b.getWidth();
+        b.getHeight();
+        b.isOpaque();
+        b.isValidateRoot();
+        b.isOptimizedDrawingEnabled();
+        b.isDoubleBuffered();
+        b.getComponentCount();
+        b.countComponents();
+        b.getComponent(1);
+        b.getComponent(2);
+        Component[] cs = b.getComponents();
+        b.getLayout();
+        b.setLayout(new FlowLayout());
+        b.doLayout();
+        b.layout();
+        b.invalidate();
+        b.validate();
+        b.remove(0);
+        b.remove(c2);
+        b.removeAll();
+        b.preferredSize();
+        b.minimumSize();
+        b.getComponentAt(1, 2);
+        b.locate(1, 2);
+        b.getComponentAt(new Point(1, 2));
+        b.isFocusCycleRoot(new Container());
+        b.transferFocusBackward();
+        b.setName("goober");
+        b.getName();
+        b.getParent();
+        b.getPeer();
+        b.getGraphicsConfiguration();
+        b.getTreeLock();
+        b.getToolkit();
+        b.isValid();
+        b.isDisplayable();
+        b.isVisible();
+        b.isShowing();
+        b.isEnabled();
+        b.enable(false);
+        b.enable(true);
+        b.enableInputMethods(false);
+        b.enableInputMethods(true);
+        b.show();
+        b.show(false);
+        b.show(true);
+        b.hide();
+        b.getForeground();
+        b.isForegroundSet();
+        b.getBackground();
+        b.isBackgroundSet();
+        b.getFont();
+        b.isFontSet();
+        Container c = new Container();
+        c.add(b);
+        b.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            b.setLocale(locale);
+
+        b.getColorModel();
+        b.getLocation();
+
+        boolean exceptions = false;
+        try {
+            b.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        b.location();
+        b.setLocation(1, 2);
+        b.move(1, 2);
+        b.setLocation(new Point(1, 2));
+        b.getSize();
+        b.size();
+        b.setSize(1, 32);
+        b.resize(1, 32);
+        b.setSize(new Dimension(1, 32));
+        b.resize(new Dimension(1, 32));
+        b.getBounds();
+        b.bounds();
+        b.setBounds(10, 10, 10, 10);
+        b.setBounds(new Rectangle(10, 10, 10, 10));
+        b.isLightweight();
+        b.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        b.getCursor();
+        b.isCursorSet();
+        b.inside(1, 2);
+        b.contains(new Point(1, 2));
+        b.isFocusable();
+        b.setFocusable(true);
+        b.setFocusable(false);
+        b.transferFocus();
+        b.getFocusCycleRootAncestor();
+        b.nextFocus();
+        b.transferFocusUpCycle();
+        b.hasFocus();
+        b.isFocusOwner();
+        b.toString();
+        b.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        b.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        b.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        b.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJCheckBox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JCheckBox constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJCheckBox
+ */
+
+public class HeadlessJCheckBox {
+    public static void main(String args[]) {
+        JCheckBox ch;
+        ch = new JCheckBox();
+        ch = new JCheckBox("Press me");
+        ch = new JCheckBox("Press me", true);
+        ch = new JCheckBox("Press me", false);
+        ch.getAccessibleContext();
+        ch.isFocusTraversable();
+        ch.setEnabled(false);
+        ch.setEnabled(true);
+        ch.requestFocus();
+        ch.requestFocusInWindow();
+        ch.getPreferredSize();
+        ch.getMaximumSize();
+        ch.getMinimumSize();
+        ch.contains(1, 2);
+        Component c1 = ch.add(new Component(){});
+        Component c2 = ch.add(new Component(){});
+        Component c3 = ch.add(new Component(){});
+        Insets ins = ch.getInsets();
+        ch.getAlignmentY();
+        ch.getAlignmentX();
+        ch.getGraphics();
+        ch.setVisible(false);
+        ch.setVisible(true);
+        ch.setForeground(Color.red);
+        ch.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                ch.setFont(f1);
+                ch.setFont(f2);
+                ch.setFont(f3);
+                ch.setFont(f4);
+
+                ch.getFontMetrics(f1);
+                ch.getFontMetrics(f2);
+                ch.getFontMetrics(f3);
+                ch.getFontMetrics(f4);
+            }
+        }
+        ch.enable();
+        ch.disable();
+        ch.reshape(10, 10, 10, 10);
+        ch.getBounds(new Rectangle(1, 1, 1, 1));
+        ch.getSize(new Dimension(1, 2));
+        ch.getLocation(new Point(1, 2));
+        ch.getX();
+        ch.getY();
+        ch.getWidth();
+        ch.getHeight();
+        ch.isOpaque();
+        ch.isValidateRoot();
+        ch.isOptimizedDrawingEnabled();
+        ch.isDoubleBuffered();
+        ch.getComponentCount();
+        ch.countComponents();
+        ch.getComponent(1);
+        ch.getComponent(2);
+        Component[] cs = ch.getComponents();
+        ch.getLayout();
+        ch.setLayout(new FlowLayout());
+        ch.doLayout();
+        ch.layout();
+        ch.invalidate();
+        ch.validate();
+        ch.remove(0);
+        ch.remove(c2);
+        ch.removeAll();
+        ch.preferredSize();
+        ch.minimumSize();
+        ch.getComponentAt(1, 2);
+        ch.locate(1, 2);
+        ch.getComponentAt(new Point(1, 2));
+        ch.isFocusCycleRoot(new Container());
+        ch.transferFocusBackward();
+        ch.setName("goober");
+        ch.getName();
+        ch.getParent();
+        ch.getPeer();
+        ch.getGraphicsConfiguration();
+        ch.getTreeLock();
+        ch.getToolkit();
+        ch.isValid();
+        ch.isDisplayable();
+        ch.isVisible();
+        ch.isShowing();
+        ch.isEnabled();
+        ch.enable(false);
+        ch.enable(true);
+        ch.enableInputMethods(false);
+        ch.enableInputMethods(true);
+        ch.show();
+        ch.show(false);
+        ch.show(true);
+        ch.hide();
+        ch.getForeground();
+        ch.isForegroundSet();
+        ch.getBackground();
+        ch.isBackgroundSet();
+        ch.getFont();
+        ch.isFontSet();
+        Container c = new Container();
+        c.add(ch);
+        ch.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            ch.setLocale(locale);
+
+        ch.getColorModel();
+        ch.getLocation();
+
+        boolean exceptions = false;
+        try {
+            ch.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        ch.location();
+        ch.setLocation(1, 2);
+        ch.move(1, 2);
+        ch.setLocation(new Point(1, 2));
+        ch.getSize();
+        ch.size();
+        ch.setSize(1, 32);
+        ch.resize(1, 32);
+        ch.setSize(new Dimension(1, 32));
+        ch.resize(new Dimension(1, 32));
+        ch.getBounds();
+        ch.bounds();
+        ch.setBounds(10, 10, 10, 10);
+        ch.setBounds(new Rectangle(10, 10, 10, 10));
+        ch.isLightweight();
+        ch.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        ch.getCursor();
+        ch.isCursorSet();
+        ch.inside(1, 2);
+        ch.contains(new Point(1, 2));
+        ch.isFocusable();
+        ch.setFocusable(true);
+        ch.setFocusable(false);
+        ch.transferFocus();
+        ch.getFocusCycleRootAncestor();
+        ch.nextFocus();
+        ch.transferFocusUpCycle();
+        ch.hasFocus();
+        ch.isFocusOwner();
+        ch.toString();
+        ch.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        ch.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        ch.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        ch.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJCheckBoxMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JCheckBoxMenuItem constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJCheckBoxMenuItem
+ */
+
+public class HeadlessJCheckBoxMenuItem {
+    public static void main(String args[]) {
+        JCheckBoxMenuItem ch;
+        ch = new JCheckBoxMenuItem();
+        ch.getAccessibleContext();
+        ch.isFocusTraversable();
+        ch.setEnabled(false);
+        ch.setEnabled(true);
+        ch.requestFocus();
+        ch.requestFocusInWindow();
+        ch.getPreferredSize();
+        ch.getMaximumSize();
+        ch.getMinimumSize();
+        ch.contains(1, 2);
+        Component c1 = ch.add(new Component(){});
+        Component c2 = ch.add(new Component(){});
+        Component c3 = ch.add(new Component(){});
+        Insets ins = ch.getInsets();
+        ch.getAlignmentY();
+        ch.getAlignmentX();
+        ch.getGraphics();
+        ch.setVisible(false);
+        ch.setVisible(true);
+        ch.setForeground(Color.red);
+        ch.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                ch.setFont(f1);
+                ch.setFont(f2);
+                ch.setFont(f3);
+                ch.setFont(f4);
+
+                ch.getFontMetrics(f1);
+                ch.getFontMetrics(f2);
+                ch.getFontMetrics(f3);
+                ch.getFontMetrics(f4);
+            }
+        }
+        ch.enable();
+        ch.disable();
+        ch.reshape(10, 10, 10, 10);
+        ch.getBounds(new Rectangle(1, 1, 1, 1));
+        ch.getSize(new Dimension(1, 2));
+        ch.getLocation(new Point(1, 2));
+        ch.getX();
+        ch.getY();
+        ch.getWidth();
+        ch.getHeight();
+        ch.isOpaque();
+        ch.isValidateRoot();
+        ch.isOptimizedDrawingEnabled();
+        ch.isDoubleBuffered();
+        ch.getComponentCount();
+        ch.countComponents();
+        ch.getComponent(1);
+        ch.getComponent(2);
+        Component[] cs = ch.getComponents();
+        ch.getLayout();
+        ch.setLayout(new FlowLayout());
+        ch.doLayout();
+        ch.layout();
+        ch.invalidate();
+        ch.validate();
+        ch.remove(0);
+        ch.remove(c2);
+        ch.removeAll();
+        ch.preferredSize();
+        ch.minimumSize();
+        ch.getComponentAt(1, 2);
+        ch.locate(1, 2);
+        ch.getComponentAt(new Point(1, 2));
+        ch.isFocusCycleRoot(new Container());
+        ch.transferFocusBackward();
+        ch.setName("goober");
+        ch.getName();
+        ch.getParent();
+        ch.getPeer();
+        ch.getGraphicsConfiguration();
+        ch.getTreeLock();
+        ch.getToolkit();
+        ch.isValid();
+        ch.isDisplayable();
+        ch.isVisible();
+        ch.isShowing();
+        ch.isEnabled();
+        ch.enable(false);
+        ch.enable(true);
+        ch.enableInputMethods(false);
+        ch.enableInputMethods(true);
+        ch.show();
+        ch.show(false);
+        ch.show(true);
+        ch.hide();
+        ch.getForeground();
+        ch.isForegroundSet();
+        ch.getBackground();
+        ch.isBackgroundSet();
+        ch.getFont();
+        ch.isFontSet();
+        Container c = new Container();
+        c.add(ch);
+        ch.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            ch.setLocale(locale);
+
+        ch.getColorModel();
+        ch.getLocation();
+
+        boolean exceptions = false;
+        try {
+            ch.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        ch.location();
+        ch.setLocation(1, 2);
+        ch.move(1, 2);
+        ch.setLocation(new Point(1, 2));
+        ch.getSize();
+        ch.size();
+        ch.setSize(1, 32);
+        ch.resize(1, 32);
+        ch.setSize(new Dimension(1, 32));
+        ch.resize(new Dimension(1, 32));
+        ch.getBounds();
+        ch.bounds();
+        ch.setBounds(10, 10, 10, 10);
+        ch.setBounds(new Rectangle(10, 10, 10, 10));
+        ch.isLightweight();
+        ch.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        ch.getCursor();
+        ch.isCursorSet();
+        ch.inside(1, 2);
+        ch.contains(new Point(1, 2));
+        ch.isFocusable();
+        ch.setFocusable(true);
+        ch.setFocusable(false);
+        ch.transferFocus();
+        ch.getFocusCycleRootAncestor();
+        ch.nextFocus();
+        ch.transferFocusUpCycle();
+        ch.hasFocus();
+        ch.isFocusOwner();
+        ch.toString();
+        ch.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        ch.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        ch.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        ch.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJColorChooser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JColorChooser constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJColorChooser
+ */
+
+public class HeadlessJColorChooser {
+    public static void main(String args[]) {
+        JColorChooser cc;
+        cc = new JColorChooser();
+        cc.getAccessibleContext();
+        cc.isFocusTraversable();
+        cc.setEnabled(false);
+        cc.setEnabled(true);
+        cc.requestFocus();
+        cc.requestFocusInWindow();
+        cc.getPreferredSize();
+        cc.getMaximumSize();
+        cc.getMinimumSize();
+        cc.contains(1, 2);
+        Component c1 = cc.add(new Component(){});
+        Component c2 = cc.add(new Component(){});
+        Component c3 = cc.add(new Component(){});
+        Insets ins = cc.getInsets();
+        cc.getAlignmentY();
+        cc.getAlignmentX();
+        cc.getGraphics();
+        cc.setVisible(false);
+        cc.setVisible(true);
+        cc.setForeground(Color.red);
+        cc.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                cc.setFont(f1);
+                cc.setFont(f2);
+                cc.setFont(f3);
+                cc.setFont(f4);
+
+                cc.getFontMetrics(f1);
+                cc.getFontMetrics(f2);
+                cc.getFontMetrics(f3);
+                cc.getFontMetrics(f4);
+            }
+        }
+        cc.enable();
+        cc.disable();
+        cc.reshape(10, 10, 10, 10);
+        cc.getBounds(new Rectangle(1, 1, 1, 1));
+        cc.getSize(new Dimension(1, 2));
+        cc.getLocation(new Point(1, 2));
+        cc.getX();
+        cc.getY();
+        cc.getWidth();
+        cc.getHeight();
+        cc.isOpaque();
+        cc.isValidateRoot();
+        cc.isOptimizedDrawingEnabled();
+        cc.isDoubleBuffered();
+        cc.getComponentCount();
+        cc.countComponents();
+        cc.getComponent(1);
+        cc.getComponent(2);
+        Component[] cs = cc.getComponents();
+        cc.getLayout();
+        cc.setLayout(new FlowLayout());
+        cc.doLayout();
+        cc.layout();
+        cc.invalidate();
+        cc.validate();
+        cc.remove(0);
+        cc.remove(c2);
+        cc.removeAll();
+        cc.preferredSize();
+        cc.minimumSize();
+        cc.getComponentAt(1, 2);
+        cc.locate(1, 2);
+        cc.getComponentAt(new Point(1, 2));
+        cc.isFocusCycleRoot(new Container());
+        cc.transferFocusBackward();
+        cc.setName("goober");
+        cc.getName();
+        cc.getParent();
+        cc.getPeer();
+        cc.getGraphicsConfiguration();
+        cc.getTreeLock();
+        cc.getToolkit();
+        cc.isValid();
+        cc.isDisplayable();
+        cc.isVisible();
+        cc.isShowing();
+        cc.isEnabled();
+        cc.enable(false);
+        cc.enable(true);
+        cc.enableInputMethods(false);
+        cc.enableInputMethods(true);
+        cc.show();
+        cc.show(false);
+        cc.show(true);
+        cc.hide();
+        cc.getForeground();
+        cc.isForegroundSet();
+        cc.getBackground();
+        cc.isBackgroundSet();
+        cc.getFont();
+        cc.isFontSet();
+        Container c = new Container();
+        c.add(cc);
+        cc.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            cc.setLocale(locale);
+
+        cc.getColorModel();
+        cc.getLocation();
+
+        boolean exceptions = false;
+        try {
+            cc.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        cc.location();
+        cc.setLocation(1, 2);
+        cc.move(1, 2);
+        cc.setLocation(new Point(1, 2));
+        cc.getSize();
+        cc.size();
+        cc.setSize(1, 32);
+        cc.resize(1, 32);
+        cc.setSize(new Dimension(1, 32));
+        cc.resize(new Dimension(1, 32));
+        cc.getBounds();
+        cc.bounds();
+        cc.setBounds(10, 10, 10, 10);
+        cc.setBounds(new Rectangle(10, 10, 10, 10));
+        cc.isLightweight();
+        cc.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        cc.getCursor();
+        cc.isCursorSet();
+        cc.inside(1, 2);
+        cc.contains(new Point(1, 2));
+        cc.isFocusable();
+        cc.setFocusable(true);
+        cc.setFocusable(false);
+        cc.transferFocus();
+        cc.getFocusCycleRootAncestor();
+        cc.nextFocus();
+        cc.transferFocusUpCycle();
+        cc.hasFocus();
+        cc.isFocusOwner();
+        cc.toString();
+        cc.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        cc.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        cc.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        cc.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJComboBox.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JComboBox constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJComboBox
+ */
+
+public class HeadlessJComboBox {
+    public static void main(String args[]) {
+        JComboBox ch;
+        ch = new JComboBox();
+        ch.getAccessibleContext();
+        ch.isFocusTraversable();
+        ch.setEnabled(false);
+        ch.setEnabled(true);
+        ch.requestFocus();
+        ch.requestFocusInWindow();
+        ch.getPreferredSize();
+        ch.getMaximumSize();
+        ch.getMinimumSize();
+        ch.contains(1, 2);
+        Component c1 = ch.add(new Component(){});
+        Component c2 = ch.add(new Component(){});
+        Component c3 = ch.add(new Component(){});
+        Insets ins = ch.getInsets();
+        ch.getAlignmentY();
+        ch.getAlignmentX();
+        ch.getGraphics();
+        ch.setVisible(false);
+        ch.setVisible(true);
+        ch.setForeground(Color.red);
+        ch.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                ch.setFont(f1);
+                ch.setFont(f2);
+                ch.setFont(f3);
+                ch.setFont(f4);
+
+                ch.getFontMetrics(f1);
+                ch.getFontMetrics(f2);
+                ch.getFontMetrics(f3);
+                ch.getFontMetrics(f4);
+            }
+        }
+        ch.enable();
+        ch.disable();
+        ch.reshape(10, 10, 10, 10);
+        ch.getBounds(new Rectangle(1, 1, 1, 1));
+        ch.getSize(new Dimension(1, 2));
+        ch.getLocation(new Point(1, 2));
+        ch.getX();
+        ch.getY();
+        ch.getWidth();
+        ch.getHeight();
+        ch.isOpaque();
+        ch.isValidateRoot();
+        ch.isOptimizedDrawingEnabled();
+        ch.isDoubleBuffered();
+        ch.getComponentCount();
+        ch.countComponents();
+        ch.getComponent(1);
+        ch.getComponent(2);
+        Component[] cs = ch.getComponents();
+        ch.getLayout();
+        ch.setLayout(new FlowLayout());
+        ch.doLayout();
+        ch.layout();
+        ch.invalidate();
+        ch.validate();
+        ch.remove(0);
+        ch.remove(c2);
+        ch.removeAll();
+        ch.preferredSize();
+        ch.minimumSize();
+        ch.getComponentAt(1, 2);
+        ch.locate(1, 2);
+        ch.getComponentAt(new Point(1, 2));
+        ch.isFocusCycleRoot(new Container());
+        ch.transferFocusBackward();
+        ch.setName("goober");
+        ch.getName();
+        ch.getParent();
+        ch.getPeer();
+        ch.getGraphicsConfiguration();
+        ch.getTreeLock();
+        ch.getToolkit();
+        ch.isValid();
+        ch.isDisplayable();
+        ch.isVisible();
+        ch.isShowing();
+        ch.isEnabled();
+        ch.enable(false);
+        ch.enable(true);
+        ch.enableInputMethods(false);
+        ch.enableInputMethods(true);
+        ch.show();
+        ch.show(false);
+        ch.show(true);
+        ch.hide();
+        ch.getForeground();
+        ch.isForegroundSet();
+        ch.getBackground();
+        ch.isBackgroundSet();
+        ch.getFont();
+        ch.isFontSet();
+        Container c = new Container();
+        c.add(ch);
+        ch.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            ch.setLocale(locale);
+
+        ch.getColorModel();
+        ch.getLocation();
+
+        boolean exceptions = false;
+        try {
+            ch.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        ch.location();
+        ch.setLocation(1, 2);
+        ch.move(1, 2);
+        ch.setLocation(new Point(1, 2));
+        ch.getSize();
+        ch.size();
+        ch.setSize(1, 32);
+        ch.resize(1, 32);
+        ch.setSize(new Dimension(1, 32));
+        ch.resize(new Dimension(1, 32));
+        ch.getBounds();
+        ch.bounds();
+        ch.setBounds(10, 10, 10, 10);
+        ch.setBounds(new Rectangle(10, 10, 10, 10));
+        ch.isLightweight();
+        ch.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        ch.getCursor();
+        ch.isCursorSet();
+        ch.inside(1, 2);
+        ch.contains(new Point(1, 2));
+        ch.isFocusable();
+        ch.setFocusable(true);
+        ch.setFocusable(false);
+        ch.transferFocus();
+        ch.getFocusCycleRootAncestor();
+        ch.nextFocus();
+        ch.transferFocusUpCycle();
+        ch.hasFocus();
+        ch.isFocusOwner();
+        ch.toString();
+        ch.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        ch.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        ch.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        ch.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJComponent.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JComponent constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJComponent
+ */
+
+public class HeadlessJComponent {
+    public static void main(String args[]) {
+        JComponent ch = new JComponent(){};
+        ch.getAccessibleContext();
+        ch.isFocusTraversable();
+        ch.setEnabled(false);
+        ch.setEnabled(true);
+        ch.requestFocus();
+        ch.requestFocusInWindow();
+        ch.getPreferredSize();
+        ch.getMaximumSize();
+        ch.getMinimumSize();
+        ch.contains(1, 2);
+        Component c1 = ch.add(new Component(){});
+        Component c2 = ch.add(new Component(){});
+        Component c3 = ch.add(new Component(){});
+        Insets ins = ch.getInsets();
+        ch.getAlignmentY();
+        ch.getAlignmentX();
+        ch.getGraphics();
+        ch.setVisible(false);
+        ch.setVisible(true);
+        ch.setForeground(Color.red);
+        ch.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                ch.setFont(f1);
+                ch.setFont(f2);
+                ch.setFont(f3);
+                ch.setFont(f4);
+
+                ch.getFontMetrics(f1);
+                ch.getFontMetrics(f2);
+                ch.getFontMetrics(f3);
+                ch.getFontMetrics(f4);
+            }
+        }
+        ch.enable();
+        ch.disable();
+        ch.reshape(10, 10, 10, 10);
+        ch.getBounds(new Rectangle(1, 1, 1, 1));
+        ch.getSize(new Dimension(1, 2));
+        ch.getLocation(new Point(1, 2));
+        ch.getX();
+        ch.getY();
+        ch.getWidth();
+        ch.getHeight();
+        ch.isOpaque();
+        ch.isValidateRoot();
+        ch.isOptimizedDrawingEnabled();
+        ch.isDoubleBuffered();
+        ch.getComponentCount();
+        ch.countComponents();
+        ch.getComponent(1);
+        ch.getComponent(2);
+        Component[] cs = ch.getComponents();
+        ch.getLayout();
+        ch.setLayout(new FlowLayout());
+        ch.doLayout();
+        ch.layout();
+        ch.invalidate();
+        ch.validate();
+        ch.remove(0);
+        ch.remove(c2);
+        ch.removeAll();
+        ch.preferredSize();
+        ch.minimumSize();
+        ch.getComponentAt(1, 2);
+        ch.locate(1, 2);
+        ch.getComponentAt(new Point(1, 2));
+        ch.isFocusCycleRoot(new Container());
+        ch.transferFocusBackward();
+        ch.setName("goober");
+        ch.getName();
+        ch.getParent();
+        ch.getPeer();
+        ch.getGraphicsConfiguration();
+        ch.getTreeLock();
+        ch.getToolkit();
+        ch.isValid();
+        ch.isDisplayable();
+        ch.isVisible();
+        ch.isShowing();
+        ch.isEnabled();
+        ch.enable(false);
+        ch.enable(true);
+        ch.enableInputMethods(false);
+        ch.enableInputMethods(true);
+        ch.show();
+        ch.show(false);
+        ch.show(true);
+        ch.hide();
+        ch.getForeground();
+        ch.isForegroundSet();
+        ch.getBackground();
+        ch.isBackgroundSet();
+        ch.getFont();
+        ch.isFontSet();
+        Container c = new Container();
+        c.add(ch);
+        ch.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            ch.setLocale(locale);
+
+        ch.getColorModel();
+        ch.getLocation();
+
+        boolean exceptions = false;
+        try {
+            ch.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        ch.location();
+        ch.setLocation(1, 2);
+        ch.move(1, 2);
+        ch.setLocation(new Point(1, 2));
+        ch.getSize();
+        ch.size();
+        ch.setSize(1, 32);
+        ch.resize(1, 32);
+        ch.setSize(new Dimension(1, 32));
+        ch.resize(new Dimension(1, 32));
+        ch.getBounds();
+        ch.bounds();
+        ch.setBounds(10, 10, 10, 10);
+        ch.setBounds(new Rectangle(10, 10, 10, 10));
+        ch.isLightweight();
+        ch.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        ch.getCursor();
+        ch.isCursorSet();
+        ch.inside(1, 2);
+        ch.contains(new Point(1, 2));
+        ch.isFocusable();
+        ch.setFocusable(true);
+        ch.setFocusable(false);
+        ch.transferFocus();
+        ch.getFocusCycleRootAncestor();
+        ch.nextFocus();
+        ch.transferFocusUpCycle();
+        ch.hasFocus();
+        ch.isFocusOwner();
+        ch.toString();
+        ch.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        ch.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        ch.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        ch.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJDesktopPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JDesktopPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJDesktopPane
+ */
+
+public class HeadlessJDesktopPane {
+    public static void main(String args[]) {
+        JComponent ch = new JComponent(){};
+        ch.getAccessibleContext();
+        ch.isFocusTraversable();
+        ch.setEnabled(false);
+        ch.setEnabled(true);
+        ch.requestFocus();
+        ch.requestFocusInWindow();
+        ch.getPreferredSize();
+        ch.getMaximumSize();
+        ch.getMinimumSize();
+        ch.contains(1, 2);
+        Component c1 = ch.add(new Component(){});
+        Component c2 = ch.add(new Component(){});
+        Component c3 = ch.add(new Component(){});
+        Insets ins = ch.getInsets();
+        ch.getAlignmentY();
+        ch.getAlignmentX();
+        ch.getGraphics();
+        ch.setVisible(false);
+        ch.setVisible(true);
+        ch.setForeground(Color.red);
+        ch.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                ch.setFont(f1);
+                ch.setFont(f2);
+                ch.setFont(f3);
+                ch.setFont(f4);
+
+                ch.getFontMetrics(f1);
+                ch.getFontMetrics(f2);
+                ch.getFontMetrics(f3);
+                ch.getFontMetrics(f4);
+            }
+        }
+        ch.enable();
+        ch.disable();
+        ch.reshape(10, 10, 10, 10);
+        ch.getBounds(new Rectangle(1, 1, 1, 1));
+        ch.getSize(new Dimension(1, 2));
+        ch.getLocation(new Point(1, 2));
+        ch.getX();
+        ch.getY();
+        ch.getWidth();
+        ch.getHeight();
+        ch.isOpaque();
+        ch.isValidateRoot();
+        ch.isOptimizedDrawingEnabled();
+        ch.isDoubleBuffered();
+        ch.getComponentCount();
+        ch.countComponents();
+        ch.getComponent(1);
+        ch.getComponent(2);
+        Component[] cs = ch.getComponents();
+        ch.getLayout();
+        ch.setLayout(new FlowLayout());
+        ch.doLayout();
+        ch.layout();
+        ch.invalidate();
+        ch.validate();
+        ch.remove(0);
+        ch.remove(c2);
+        ch.removeAll();
+        ch.preferredSize();
+        ch.minimumSize();
+        ch.getComponentAt(1, 2);
+        ch.locate(1, 2);
+        ch.getComponentAt(new Point(1, 2));
+        ch.isFocusCycleRoot(new Container());
+        ch.transferFocusBackward();
+        ch.setName("goober");
+        ch.getName();
+        ch.getParent();
+        ch.getPeer();
+        ch.getGraphicsConfiguration();
+        ch.getTreeLock();
+        ch.getToolkit();
+        ch.isValid();
+        ch.isDisplayable();
+        ch.isVisible();
+        ch.isShowing();
+        ch.isEnabled();
+        ch.enable(false);
+        ch.enable(true);
+        ch.enableInputMethods(false);
+        ch.enableInputMethods(true);
+        ch.show();
+        ch.show(false);
+        ch.show(true);
+        ch.hide();
+        ch.getForeground();
+        ch.isForegroundSet();
+        ch.getBackground();
+        ch.isBackgroundSet();
+        ch.getFont();
+        ch.isFontSet();
+        Container c = new Container();
+        c.add(ch);
+        ch.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            ch.setLocale(locale);
+
+        ch.getColorModel();
+        ch.getLocation();
+
+        boolean exceptions = false;
+        try {
+            ch.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        ch.location();
+        ch.setLocation(1, 2);
+        ch.move(1, 2);
+        ch.setLocation(new Point(1, 2));
+        ch.getSize();
+        ch.size();
+        ch.setSize(1, 32);
+        ch.resize(1, 32);
+        ch.setSize(new Dimension(1, 32));
+        ch.resize(new Dimension(1, 32));
+        ch.getBounds();
+        ch.bounds();
+        ch.setBounds(10, 10, 10, 10);
+        ch.setBounds(new Rectangle(10, 10, 10, 10));
+        ch.isLightweight();
+        ch.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        ch.getCursor();
+        ch.isCursorSet();
+        ch.inside(1, 2);
+        ch.contains(new Point(1, 2));
+        ch.isFocusable();
+        ch.setFocusable(true);
+        ch.setFocusable(false);
+        ch.transferFocus();
+        ch.getFocusCycleRootAncestor();
+        ch.nextFocus();
+        ch.transferFocusUpCycle();
+        ch.hasFocus();
+        ch.isFocusOwner();
+        ch.toString();
+        ch.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        ch.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        ch.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        ch.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJDialog.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that JDialog constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJDialog
+ */
+
+public class HeadlessJDialog {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        JDialog b;
+
+        try {
+            b = new JDialog();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            b = new JDialog(new Frame("Frame title"));
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            b = new JDialog(new Frame("Frame title"), true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            b = new JDialog(new Frame("Frame title"), false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            b = new JDialog(new Frame("Frame title"), "Dialog title");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            b = new JDialog(new Frame("Frame title"), "Dialog title", true);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            b = new JDialog(new Frame("Frame title"), "Dialog title", false);
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJEditorPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JEditorPane constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJEditorPane
+ */
+
+public class HeadlessJEditorPane {
+    public static void main(String args[]) {
+        JEditorPane b;
+        b = new JEditorPane("text/plain", "The Text");
+        b = new JEditorPane("unknown/unknown", "The Text");
+        b = new JEditorPane();
+        b.getAccessibleContext();
+        b.isFocusTraversable();
+        b.setEnabled(false);
+        b.setEnabled(true);
+        b.requestFocus();
+        b.requestFocusInWindow();
+        b.getPreferredSize();
+        b.getMaximumSize();
+        b.getMinimumSize();
+        b.contains(1, 2);
+        Component c1 = b.add(new Component(){});
+        Component c2 = b.add(new Component(){});
+        Component c3 = b.add(new Component(){});
+        Insets ins = b.getInsets();
+        b.getAlignmentY();
+        b.getAlignmentX();
+        b.getGraphics();
+        b.setVisible(false);
+        b.setVisible(true);
+        b.setForeground(Color.red);
+        b.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                b.setFont(f1);
+                b.setFont(f2);
+                b.setFont(f3);
+                b.setFont(f4);
+
+                b.getFontMetrics(f1);
+                b.getFontMetrics(f2);
+                b.getFontMetrics(f3);
+                b.getFontMetrics(f4);
+            }
+        }
+        b.enable();
+        b.disable();
+        b.reshape(10, 10, 10, 10);
+        b.getBounds(new Rectangle(1, 1, 1, 1));
+        b.getSize(new Dimension(1, 2));
+        b.getLocation(new Point(1, 2));
+        b.getX();
+        b.getY();
+        b.getWidth();
+        b.getHeight();
+        b.isOpaque();
+        b.isValidateRoot();
+        b.isOptimizedDrawingEnabled();
+        b.isDoubleBuffered();
+        b.getComponentCount();
+        b.countComponents();
+        b.getComponent(1);
+        b.getComponent(2);
+        Component[] cs = b.getComponents();
+        b.getLayout();
+        b.setLayout(new FlowLayout());
+        b.doLayout();
+        b.layout();
+        b.invalidate();
+        b.validate();
+        b.remove(0);
+        b.remove(c2);
+        b.removeAll();
+        b.preferredSize();
+        b.minimumSize();
+        b.getComponentAt(1, 2);
+        b.locate(1, 2);
+        b.getComponentAt(new Point(1, 2));
+        b.isFocusCycleRoot(new Container());
+        b.transferFocusBackward();
+        b.setName("goober");
+        b.getName();
+        b.getParent();
+        b.getPeer();
+        b.getGraphicsConfiguration();
+        b.getTreeLock();
+        b.getToolkit();
+        b.isValid();
+        b.isDisplayable();
+        b.isVisible();
+        b.isShowing();
+        b.isEnabled();
+        b.enable(false);
+        b.enable(true);
+        b.enableInputMethods(false);
+        b.enableInputMethods(true);
+        b.show();
+        b.show(false);
+        b.show(true);
+        b.hide();
+        b.getForeground();
+        b.isForegroundSet();
+        b.getBackground();
+        b.isBackgroundSet();
+        b.getFont();
+        b.isFontSet();
+        Container c = new Container();
+        c.add(b);
+        b.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            b.setLocale(locale);
+
+        b.getColorModel();
+        b.getLocation();
+
+        boolean exceptions = false;
+        try {
+            b.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        b.location();
+        b.setLocation(1, 2);
+        b.move(1, 2);
+        b.setLocation(new Point(1, 2));
+        b.getSize();
+        b.size();
+        b.setSize(1, 32);
+        b.resize(1, 32);
+        b.setSize(new Dimension(1, 32));
+        b.resize(new Dimension(1, 32));
+        b.getBounds();
+        b.bounds();
+        b.setBounds(10, 10, 10, 10);
+        b.setBounds(new Rectangle(10, 10, 10, 10));
+        b.isLightweight();
+        b.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        b.getCursor();
+        b.isCursorSet();
+        b.inside(1, 2);
+        b.contains(new Point(1, 2));
+        b.isFocusable();
+        b.setFocusable(true);
+        b.setFocusable(false);
+        b.transferFocus();
+        b.getFocusCycleRootAncestor();
+        b.nextFocus();
+        b.transferFocusUpCycle();
+        b.hasFocus();
+        b.isFocusOwner();
+        b.toString();
+        b.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        b.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        b.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        b.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJFileChooser.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JFileChooser constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJFileChooser
+ */
+
+public class HeadlessJFileChooser {
+    public static void main(String args[]) {
+        JFileChooser ch = new JFileChooser();
+        ch.getAccessibleContext();
+        ch.isFocusTraversable();
+        ch.setEnabled(false);
+        ch.setEnabled(true);
+        ch.requestFocus();
+        ch.requestFocusInWindow();
+        ch.getPreferredSize();
+        ch.getMaximumSize();
+        ch.getMinimumSize();
+        ch.contains(1, 2);
+        Component c1 = ch.add(new Component(){});
+        Component c2 = ch.add(new Component(){});
+        Component c3 = ch.add(new Component(){});
+        Insets ins = ch.getInsets();
+        ch.getAlignmentY();
+        ch.getAlignmentX();
+        ch.getGraphics();
+        ch.setVisible(false);
+        ch.setVisible(true);
+        ch.setForeground(Color.red);
+        ch.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                ch.setFont(f1);
+                ch.setFont(f2);
+                ch.setFont(f3);
+                ch.setFont(f4);
+
+                ch.getFontMetrics(f1);
+                ch.getFontMetrics(f2);
+                ch.getFontMetrics(f3);
+                ch.getFontMetrics(f4);
+            }
+        }
+        ch.enable();
+        ch.disable();
+        ch.reshape(10, 10, 10, 10);
+        ch.getBounds(new Rectangle(1, 1, 1, 1));
+        ch.getSize(new Dimension(1, 2));
+        ch.getLocation(new Point(1, 2));
+        ch.getX();
+        ch.getY();
+        ch.getWidth();
+        ch.getHeight();
+        ch.isOpaque();
+        ch.isValidateRoot();
+        ch.isOptimizedDrawingEnabled();
+        ch.isDoubleBuffered();
+        ch.getComponentCount();
+        ch.countComponents();
+        ch.getComponent(1);
+        ch.getComponent(2);
+        Component[] cs = ch.getComponents();
+        ch.getLayout();
+        ch.setLayout(new FlowLayout());
+        ch.doLayout();
+        ch.layout();
+        ch.invalidate();
+        ch.validate();
+        ch.remove(0);
+        ch.remove(c2);
+        ch.removeAll();
+        ch.preferredSize();
+        ch.minimumSize();
+        ch.getComponentAt(1, 2);
+        ch.locate(1, 2);
+        ch.getComponentAt(new Point(1, 2));
+        ch.isFocusCycleRoot(new Container());
+        ch.transferFocusBackward();
+        ch.setName("goober");
+        ch.getName();
+        ch.getParent();
+        ch.getPeer();
+        ch.getGraphicsConfiguration();
+        ch.getTreeLock();
+        ch.getToolkit();
+        ch.isValid();
+        ch.isDisplayable();
+        ch.isVisible();
+        ch.isShowing();
+        ch.isEnabled();
+        ch.enable(false);
+        ch.enable(true);
+        ch.enableInputMethods(false);
+        ch.enableInputMethods(true);
+        ch.show();
+        ch.show(false);
+        ch.show(true);
+        ch.hide();
+        ch.getForeground();
+        ch.isForegroundSet();
+        ch.getBackground();
+        ch.isBackgroundSet();
+        ch.getFont();
+        ch.isFontSet();
+        Container c = new Container();
+        c.add(ch);
+        ch.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            ch.setLocale(locale);
+
+        ch.getColorModel();
+        ch.getLocation();
+
+        boolean exceptions = false;
+        try {
+            ch.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        ch.location();
+        ch.setLocation(1, 2);
+        ch.move(1, 2);
+        ch.setLocation(new Point(1, 2));
+        ch.getSize();
+        ch.size();
+        ch.setSize(1, 32);
+        ch.resize(1, 32);
+        ch.setSize(new Dimension(1, 32));
+        ch.resize(new Dimension(1, 32));
+        ch.getBounds();
+        ch.bounds();
+        ch.setBounds(10, 10, 10, 10);
+        ch.setBounds(new Rectangle(10, 10, 10, 10));
+        ch.isLightweight();
+        ch.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        ch.getCursor();
+        ch.isCursorSet();
+        ch.inside(1, 2);
+        ch.contains(new Point(1, 2));
+        ch.isFocusable();
+        ch.setFocusable(true);
+        ch.setFocusable(false);
+        ch.transferFocus();
+        ch.getFocusCycleRootAncestor();
+        ch.nextFocus();
+        ch.transferFocusUpCycle();
+        ch.hasFocus();
+        ch.isFocusOwner();
+        ch.toString();
+        ch.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        ch.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        ch.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        ch.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJFormattedTextField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that JFormattedTextField constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJFormattedTextField
+ */
+
+public class HeadlessJFormattedTextField {
+    public static void main(String args[]) {
+        JTextField f = new JTextField("field");
+        f.selectAll();
+        f.getSelectionStart();
+        f.getSelectionEnd();
+        f.selectAll();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.JFrame;
+import java.awt.HeadlessException;
+
+/*
+ * @test
+ * @summary Check that JFrame constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJFrame
+ */
+
+public class HeadlessJFrame {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        try {
+            JFrame b = new JFrame();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            JFrame b = new JFrame("Swingin' in the window");
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJInternalFrame.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
+import javax.swing.plaf.basic.BasicInternalFrameUI;
+import java.awt.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JInternalFrame constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJInternalFrame
+ */
+
+public class HeadlessJInternalFrame {
+    public static void main(String args[]) {
+        JInternalFrame intf = new JInternalFrame("TEST");
+        intf.setUI(new BasicInternalFrameUI(intf) {
+            protected JComponent createNorthPane(JInternalFrame w) {
+                titlePane = new BasicInternalFrameTitlePane(w) {
+                    protected PropertyChangeListener createPropertyChangeListener() {
+                        return new BasicInternalFrameTitlePane.PropertyChangeHandler() {
+                            int countUI = 0;
+
+                            public void propertyChange(PropertyChangeEvent evt) {
+                                if (evt.getPropertyName().equals("UI"))
+                                    countUI++;
+                                else if (countUI > 1)
+                                    throw new RuntimeException("Test failed. Listener not removed!");
+                            }
+                        };
+                    }
+                };
+                return titlePane;
+            }
+        });
+        intf.setUI(null);
+        intf.getAccessibleContext();
+        intf.isFocusTraversable();
+        intf.setEnabled(false);
+        intf.setEnabled(true);
+        intf.requestFocus();
+        intf.requestFocusInWindow();
+        intf.getPreferredSize();
+        intf.getMaximumSize();
+        intf.getMinimumSize();
+        intf.contains(1, 2);
+        Component c1 = intf.add(new Component(){});
+        Component c2 = intf.add(new Component(){});
+        Component c3 = intf.add(new Component(){});
+        Insets ins = intf.getInsets();
+        intf.getAlignmentY();
+        intf.getAlignmentX();
+        intf.getGraphics();
+        intf.setVisible(false);
+        intf.setVisible(true);
+        intf.setForeground(Color.red);
+        intf.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                intf.setFont(f1);
+                intf.setFont(f2);
+                intf.setFont(f3);
+                intf.setFont(f4);
+
+                intf.getFontMetrics(f1);
+                intf.getFontMetrics(f2);
+                intf.getFontMetrics(f3);
+                intf.getFontMetrics(f4);
+            }
+        }
+        intf.enable();
+        intf.disable();
+        intf.reshape(10, 10, 10, 10);
+        intf.getBounds(new Rectangle(1, 1, 1, 1));
+        intf.getSize(new Dimension(1, 2));
+        intf.getLocation(new Point(1, 2));
+        intf.getX();
+        intf.getY();
+        intf.getWidth();
+        intf.getHeight();
+        intf.isOpaque();
+        intf.isValidateRoot();
+        intf.isOptimizedDrawingEnabled();
+        intf.isDoubleBuffered();
+        intf.getComponentCount();
+        intf.countComponents();
+        intf.getComponent(0);
+        Component[] cs = intf.getComponents();
+        intf.getLayout();
+        intf.setLayout(new FlowLayout());
+        intf.doLayout();
+        intf.layout();
+        intf.invalidate();
+        intf.validate();
+        intf.remove(0);
+        intf.remove(c2);
+        intf.removeAll();
+        intf.preferredSize();
+        intf.minimumSize();
+        intf.getComponentAt(1, 2);
+        intf.locate(1, 2);
+        intf.getComponentAt(new Point(1, 2));
+        intf.isFocusCycleRoot(new Container());
+        intf.transferFocusBackward();
+        intf.setName("goober");
+        intf.getName();
+        intf.getParent();
+        intf.getPeer();
+        intf.getGraphicsConfiguration();
+        intf.getTreeLock();
+        intf.getToolkit();
+        intf.isValid();
+        intf.isDisplayable();
+        intf.isVisible();
+        intf.isShowing();
+        intf.isEnabled();
+        intf.enable(false);
+        intf.enable(true);
+        intf.enableInputMethods(false);
+        intf.enableInputMethods(true);
+        intf.show();
+        intf.show(false);
+        intf.show(true);
+        intf.hide();
+        intf.getForeground();
+        intf.isForegroundSet();
+        intf.getBackground();
+        intf.isBackgroundSet();
+        intf.getFont();
+        intf.isFontSet();
+        Container c = new Container();
+        c.add(intf);
+        intf.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            intf.setLocale(locale);
+
+        intf.getColorModel();
+        intf.getLocation();
+
+        boolean exceptions = false;
+        try {
+            intf.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        intf.location();
+        intf.setLocation(1, 2);
+        intf.move(1, 2);
+        intf.setLocation(new Point(1, 2));
+        intf.getSize();
+        intf.size();
+        intf.setSize(1, 32);
+        intf.resize(1, 32);
+        intf.setSize(new Dimension(1, 32));
+        intf.resize(new Dimension(1, 32));
+        intf.getBounds();
+        intf.bounds();
+        intf.setBounds(10, 10, 10, 10);
+        intf.setBounds(new Rectangle(10, 10, 10, 10));
+        intf.isLightweight();
+        intf.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        intf.getCursor();
+        intf.isCursorSet();
+        intf.inside(1, 2);
+        intf.contains(new Point(1, 2));
+        intf.isFocusable();
+        intf.setFocusable(true);
+        intf.setFocusable(false);
+        intf.transferFocus();
+        intf.getFocusCycleRootAncestor();
+        intf.nextFocus();
+        intf.transferFocusUpCycle();
+        intf.hasFocus();
+        intf.isFocusOwner();
+        intf.toString();
+        intf.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        intf.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        intf.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        intf.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJInternalFrame_JDesktopIcon.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JInternalFrame.JDesktopIcon constructor and methods do not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJInternalFrame_JDesktopIcon
+ */
+
+public class HeadlessJInternalFrame_JDesktopIcon {
+    public static void main(String args[]) {
+        JInternalFrame.JDesktopIcon jdi = new JInternalFrame.JDesktopIcon(new JInternalFrame());
+        jdi.getAccessibleContext();
+        jdi.isFocusTraversable();
+        jdi.setEnabled(false);
+        jdi.setEnabled(true);
+        jdi.requestFocus();
+        jdi.requestFocusInWindow();
+        jdi.getPreferredSize();
+        jdi.getMaximumSize();
+        jdi.getMinimumSize();
+        jdi.contains(1, 2);
+        Component c1 = jdi.add(new Component(){});
+        Component c2 = jdi.add(new Component(){});
+        Component c3 = jdi.add(new Component(){});
+        Insets ins = jdi.getInsets();
+        jdi.getAlignmentY();
+        jdi.getAlignmentX();
+        jdi.getGraphics();
+        jdi.setVisible(false);
+        jdi.setVisible(true);
+        jdi.setForeground(Color.red);
+        jdi.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                jdi.setFont(f1);
+                jdi.setFont(f2);
+                jdi.setFont(f3);
+                jdi.setFont(f4);
+
+                jdi.getFontMetrics(f1);
+                jdi.getFontMetrics(f2);
+                jdi.getFontMetrics(f3);
+                jdi.getFontMetrics(f4);
+            }
+        }
+        jdi.enable();
+        jdi.disable();
+        jdi.reshape(10, 10, 10, 10);
+        jdi.getBounds(new Rectangle(1, 1, 1, 1));
+        jdi.getSize(new Dimension(1, 2));
+        jdi.getLocation(new Point(1, 2));
+        jdi.getX();
+        jdi.getY();
+        jdi.getWidth();
+        jdi.getHeight();
+        jdi.isOpaque();
+        jdi.isValidateRoot();
+        jdi.isOptimizedDrawingEnabled();
+        jdi.isDoubleBuffered();
+        jdi.getComponentCount();
+        jdi.countComponents();
+        jdi.getComponent(1);
+        jdi.getComponent(2);
+        Component[] cs = jdi.getComponents();
+        jdi.getLayout();
+        jdi.setLayout(new FlowLayout());
+        jdi.doLayout();
+        jdi.layout();
+        jdi.invalidate();
+        jdi.validate();
+        jdi.remove(0);
+        jdi.remove(c2);
+        jdi.removeAll();
+        jdi.preferredSize();
+        jdi.minimumSize();
+        jdi.getComponentAt(1, 2);
+        jdi.locate(1, 2);
+        jdi.getComponentAt(new Point(1, 2));
+        jdi.isFocusCycleRoot(new Container());
+        jdi.transferFocusBackward();
+        jdi.setName("goober");
+        jdi.getName();
+        jdi.getParent();
+        jdi.getPeer();
+        jdi.getGraphicsConfiguration();
+        jdi.getTreeLock();
+        jdi.getToolkit();
+        jdi.isValid();
+        jdi.isDisplayable();
+        jdi.isVisible();
+        jdi.isShowing();
+        jdi.isEnabled();
+        jdi.enable(false);
+        jdi.enable(true);
+        jdi.enableInputMethods(false);
+        jdi.enableInputMethods(true);
+        jdi.show();
+        jdi.show(false);
+        jdi.show(true);
+        jdi.hide();
+        jdi.getForeground();
+        jdi.isForegroundSet();
+        jdi.getBackground();
+        jdi.isBackgroundSet();
+        jdi.getFont();
+        jdi.isFontSet();
+        Container c = new Container();
+        c.add(jdi);
+        jdi.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            jdi.setLocale(locale);
+
+        jdi.getColorModel();
+        jdi.getLocation();
+
+        boolean exceptions = false;
+        try {
+            jdi.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        jdi.location();
+        jdi.setLocation(1, 2);
+        jdi.move(1, 2);
+        jdi.setLocation(new Point(1, 2));
+        jdi.getSize();
+        jdi.size();
+        jdi.setSize(1, 32);
+        jdi.resize(1, 32);
+        jdi.setSize(new Dimension(1, 32));
+        jdi.resize(new Dimension(1, 32));
+        jdi.getBounds();
+        jdi.bounds();
+        jdi.setBounds(10, 10, 10, 10);
+        jdi.setBounds(new Rectangle(10, 10, 10, 10));
+        jdi.isLightweight();
+        jdi.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        jdi.getCursor();
+        jdi.isCursorSet();
+        jdi.inside(1, 2);
+        jdi.contains(new Point(1, 2));
+        jdi.isFocusable();
+        jdi.setFocusable(true);
+        jdi.setFocusable(false);
+        jdi.transferFocus();
+        jdi.getFocusCycleRootAncestor();
+        jdi.nextFocus();
+        jdi.transferFocusUpCycle();
+        jdi.hasFocus();
+        jdi.isFocusOwner();
+        jdi.toString();
+        jdi.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        jdi.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        jdi.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        jdi.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJLabel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JLabel constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJLabel
+ */
+
+public class HeadlessJLabel {
+    public static void main(String args[]) {
+        JLabel l = new JLabel("<html><body><bold>Foo</bold></body></html>");
+        l.getAccessibleContext();
+        l.isFocusTraversable();
+        l.setEnabled(false);
+        l.setEnabled(true);
+        l.requestFocus();
+        l.requestFocusInWindow();
+        l.getPreferredSize();
+        l.getMaximumSize();
+        l.getMinimumSize();
+        l.contains(1, 2);
+        Component c1 = l.add(new Component(){});
+        Component c2 = l.add(new Component(){});
+        Component c3 = l.add(new Component(){});
+        Insets ins = l.getInsets();
+        l.getAlignmentY();
+        l.getAlignmentX();
+        l.getGraphics();
+        l.setVisible(false);
+        l.setVisible(true);
+        l.setForeground(Color.red);
+        l.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                l.setFont(f1);
+                l.setFont(f2);
+                l.setFont(f3);
+                l.setFont(f4);
+
+                l.getFontMetrics(f1);
+                l.getFontMetrics(f2);
+                l.getFontMetrics(f3);
+                l.getFontMetrics(f4);
+            }
+        }
+        l.enable();
+        l.disable();
+        l.reshape(10, 10, 10, 10);
+        l.getBounds(new Rectangle(1, 1, 1, 1));
+        l.getSize(new Dimension(1, 2));
+        l.getLocation(new Point(1, 2));
+        l.getX();
+        l.getY();
+        l.getWidth();
+        l.getHeight();
+        l.isOpaque();
+        l.isValidateRoot();
+        l.isOptimizedDrawingEnabled();
+        l.isDoubleBuffered();
+        l.getComponentCount();
+        l.countComponents();
+        l.getComponent(1);
+        l.getComponent(2);
+        Component[] cs = l.getComponents();
+        l.getLayout();
+        l.setLayout(new FlowLayout());
+        l.doLayout();
+        l.layout();
+        l.invalidate();
+        l.validate();
+        l.remove(0);
+        l.remove(c2);
+        l.removeAll();
+        l.preferredSize();
+        l.minimumSize();
+        l.getComponentAt(1, 2);
+        l.locate(1, 2);
+        l.getComponentAt(new Point(1, 2));
+        l.isFocusCycleRoot(new Container());
+        l.transferFocusBackward();
+        l.setName("goober");
+        l.getName();
+        l.getParent();
+        l.getPeer();
+        l.getGraphicsConfiguration();
+        l.getTreeLock();
+        l.getToolkit();
+        l.isValid();
+        l.isDisplayable();
+        l.isVisible();
+        l.isShowing();
+        l.isEnabled();
+        l.enable(false);
+        l.enable(true);
+        l.enableInputMethods(false);
+        l.enableInputMethods(true);
+        l.show();
+        l.show(false);
+        l.show(true);
+        l.hide();
+        l.getForeground();
+        l.isForegroundSet();
+        l.getBackground();
+        l.isBackgroundSet();
+        l.getFont();
+        l.isFontSet();
+        Container c = new Container();
+        c.add(l);
+        l.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            l.setLocale(locale);
+
+        l.getColorModel();
+        l.getLocation();
+
+        boolean exceptions = false;
+        try {
+            l.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        l.location();
+        l.setLocation(1, 2);
+        l.move(1, 2);
+        l.setLocation(new Point(1, 2));
+        l.getSize();
+        l.size();
+        l.setSize(1, 32);
+        l.resize(1, 32);
+        l.setSize(new Dimension(1, 32));
+        l.resize(new Dimension(1, 32));
+        l.getBounds();
+        l.bounds();
+        l.setBounds(10, 10, 10, 10);
+        l.setBounds(new Rectangle(10, 10, 10, 10));
+        l.isLightweight();
+        l.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        l.getCursor();
+        l.isCursorSet();
+        l.inside(1, 2);
+        l.contains(new Point(1, 2));
+        l.isFocusable();
+        l.setFocusable(true);
+        l.setFocusable(false);
+        l.transferFocus();
+        l.getFocusCycleRootAncestor();
+        l.nextFocus();
+        l.transferFocusUpCycle();
+        l.hasFocus();
+        l.isFocusOwner();
+        l.toString();
+        l.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        l.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        l.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        l.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJLayeredPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JLayeredPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJLayeredPane
+ */
+
+public class HeadlessJLayeredPane {
+    public static void main(String args[]) {
+        JLayeredPane lp = new JLayeredPane();
+        lp.getAccessibleContext();
+        lp.isFocusTraversable();
+        lp.setEnabled(false);
+        lp.setEnabled(true);
+        lp.requestFocus();
+        lp.requestFocusInWindow();
+        lp.getPreferredSize();
+        lp.getMaximumSize();
+        lp.getMinimumSize();
+        lp.contains(1, 2);
+        Component c1 = lp.add(new Component(){});
+        Component c2 = lp.add(new Component(){});
+        Component c3 = lp.add(new Component(){});
+        Insets ins = lp.getInsets();
+        lp.getAlignmentY();
+        lp.getAlignmentX();
+        lp.getGraphics();
+        lp.setVisible(false);
+        lp.setVisible(true);
+        lp.setForeground(Color.red);
+        lp.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                lp.setFont(f1);
+                lp.setFont(f2);
+                lp.setFont(f3);
+                lp.setFont(f4);
+
+                lp.getFontMetrics(f1);
+                lp.getFontMetrics(f2);
+                lp.getFontMetrics(f3);
+                lp.getFontMetrics(f4);
+            }
+        }
+        lp.enable();
+        lp.disable();
+        lp.reshape(10, 10, 10, 10);
+        lp.getBounds(new Rectangle(1, 1, 1, 1));
+        lp.getSize(new Dimension(1, 2));
+        lp.getLocation(new Point(1, 2));
+        lp.getX();
+        lp.getY();
+        lp.getWidth();
+        lp.getHeight();
+        lp.isOpaque();
+        lp.isValidateRoot();
+        lp.isOptimizedDrawingEnabled();
+        lp.isDoubleBuffered();
+        lp.getComponentCount();
+        lp.countComponents();
+        lp.getComponent(1);
+        lp.getComponent(2);
+        Component[] cs = lp.getComponents();
+        lp.getLayout();
+        lp.setLayout(new FlowLayout());
+        lp.doLayout();
+        lp.layout();
+        lp.invalidate();
+        lp.validate();
+        lp.remove(0);
+        lp.remove(c2);
+        lp.removeAll();
+        lp.preferredSize();
+        lp.minimumSize();
+        lp.getComponentAt(1, 2);
+        lp.locate(1, 2);
+        lp.getComponentAt(new Point(1, 2));
+        lp.isFocusCycleRoot(new Container());
+        lp.transferFocusBackward();
+        lp.setName("goober");
+        lp.getName();
+        lp.getParent();
+        lp.getPeer();
+        lp.getGraphicsConfiguration();
+        lp.getTreeLock();
+        lp.getToolkit();
+        lp.isValid();
+        lp.isDisplayable();
+        lp.isVisible();
+        lp.isShowing();
+        lp.isEnabled();
+        lp.enable(false);
+        lp.enable(true);
+        lp.enableInputMethods(false);
+        lp.enableInputMethods(true);
+        lp.show();
+        lp.show(false);
+        lp.show(true);
+        lp.hide();
+        lp.getForeground();
+        lp.isForegroundSet();
+        lp.getBackground();
+        lp.isBackgroundSet();
+        lp.getFont();
+        lp.isFontSet();
+        Container c = new Container();
+        c.add(lp);
+        lp.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            lp.setLocale(locale);
+
+        lp.getColorModel();
+        lp.getLocation();
+
+        boolean exceptions = false;
+        try {
+            lp.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        lp.location();
+        lp.setLocation(1, 2);
+        lp.move(1, 2);
+        lp.setLocation(new Point(1, 2));
+        lp.getSize();
+        lp.size();
+        lp.setSize(1, 32);
+        lp.resize(1, 32);
+        lp.setSize(new Dimension(1, 32));
+        lp.resize(new Dimension(1, 32));
+        lp.getBounds();
+        lp.bounds();
+        lp.setBounds(10, 10, 10, 10);
+        lp.setBounds(new Rectangle(10, 10, 10, 10));
+        lp.isLightweight();
+        lp.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        lp.getCursor();
+        lp.isCursorSet();
+        lp.inside(1, 2);
+        lp.contains(new Point(1, 2));
+        lp.isFocusable();
+        lp.setFocusable(true);
+        lp.setFocusable(false);
+        lp.transferFocus();
+        lp.getFocusCycleRootAncestor();
+        lp.nextFocus();
+        lp.transferFocusUpCycle();
+        lp.hasFocus();
+        lp.isFocusOwner();
+        lp.toString();
+        lp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        lp.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        lp.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        lp.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJList.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JList constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJList
+ */
+
+public class HeadlessJList {
+    public static void main(String args[]) {
+        JList l = new JList();
+        l.getAccessibleContext();
+        l.isFocusTraversable();
+        l.setEnabled(false);
+        l.setEnabled(true);
+        l.requestFocus();
+        l.requestFocusInWindow();
+        l.getPreferredSize();
+        l.getMaximumSize();
+        l.getMinimumSize();
+        l.contains(1, 2);
+        Component c1 = l.add(new Component(){});
+        Component c2 = l.add(new Component(){});
+        Component c3 = l.add(new Component(){});
+        Insets ins = l.getInsets();
+        l.getAlignmentY();
+        l.getAlignmentX();
+        l.getGraphics();
+        l.setVisible(false);
+        l.setVisible(true);
+        l.setForeground(Color.red);
+        l.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                l.setFont(f1);
+                l.setFont(f2);
+                l.setFont(f3);
+                l.setFont(f4);
+
+                l.getFontMetrics(f1);
+                l.getFontMetrics(f2);
+                l.getFontMetrics(f3);
+                l.getFontMetrics(f4);
+            }
+        }
+        l.enable();
+        l.disable();
+        l.reshape(10, 10, 10, 10);
+        l.getBounds(new Rectangle(1, 1, 1, 1));
+        l.getSize(new Dimension(1, 2));
+        l.getLocation(new Point(1, 2));
+        l.getX();
+        l.getY();
+        l.getWidth();
+        l.getHeight();
+        l.isOpaque();
+        l.isValidateRoot();
+        l.isOptimizedDrawingEnabled();
+        l.isDoubleBuffered();
+        l.getComponentCount();
+        l.countComponents();
+        l.getComponent(1);
+        l.getComponent(2);
+        Component[] cs = l.getComponents();
+        l.getLayout();
+        l.setLayout(new FlowLayout());
+        l.doLayout();
+        l.layout();
+        l.invalidate();
+        l.validate();
+        l.remove(0);
+        l.remove(c2);
+        l.removeAll();
+        l.preferredSize();
+        l.minimumSize();
+        l.getComponentAt(1, 2);
+        l.locate(1, 2);
+        l.getComponentAt(new Point(1, 2));
+        l.isFocusCycleRoot(new Container());
+        l.transferFocusBackward();
+        l.setName("goober");
+        l.getName();
+        l.getParent();
+        l.getPeer();
+        l.getGraphicsConfiguration();
+        l.getTreeLock();
+        l.getToolkit();
+        l.isValid();
+        l.isDisplayable();
+        l.isVisible();
+        l.isShowing();
+        l.isEnabled();
+        l.enable(false);
+        l.enable(true);
+        l.enableInputMethods(false);
+        l.enableInputMethods(true);
+        l.show();
+        l.show(false);
+        l.show(true);
+        l.hide();
+        l.getForeground();
+        l.isForegroundSet();
+        l.getBackground();
+        l.isBackgroundSet();
+        l.getFont();
+        l.isFontSet();
+        Container c = new Container();
+        c.add(l);
+        l.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            l.setLocale(locale);
+
+        l.getColorModel();
+        l.getLocation();
+
+        boolean exceptions = false;
+        try {
+            l.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        l.location();
+        l.setLocation(1, 2);
+        l.move(1, 2);
+        l.setLocation(new Point(1, 2));
+        l.getSize();
+        l.size();
+        l.setSize(1, 32);
+        l.resize(1, 32);
+        l.setSize(new Dimension(1, 32));
+        l.resize(new Dimension(1, 32));
+        l.getBounds();
+        l.bounds();
+        l.setBounds(10, 10, 10, 10);
+        l.setBounds(new Rectangle(10, 10, 10, 10));
+        l.isLightweight();
+        l.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        l.getCursor();
+        l.isCursorSet();
+        l.inside(1, 2);
+        l.contains(new Point(1, 2));
+        l.isFocusable();
+        l.setFocusable(true);
+        l.setFocusable(false);
+        l.transferFocus();
+        l.getFocusCycleRootAncestor();
+        l.nextFocus();
+        l.transferFocusUpCycle();
+        l.hasFocus();
+        l.isFocusOwner();
+        l.toString();
+        l.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        l.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        l.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        l.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJMenu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JMenu constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJMenu
+ */
+
+public class HeadlessJMenu {
+    public static void main(String args[]) {
+        JMenu m = new JMenu();
+        m.getAccessibleContext();
+        m.isFocusTraversable();
+        m.setEnabled(false);
+        m.setEnabled(true);
+        m.requestFocus();
+        m.requestFocusInWindow();
+        m.getPreferredSize();
+        m.getMaximumSize();
+        m.getMinimumSize();
+        m.contains(1, 2);
+        Component c1 = m.add(new Component(){});
+        Component c2 = m.add(new Component(){});
+        Component c3 = m.add(new Component(){});
+        Insets ins = m.getInsets();
+        m.getAlignmentY();
+        m.getAlignmentX();
+        m.getGraphics();
+        m.setVisible(false);
+        m.setVisible(true);
+        m.setForeground(Color.red);
+        m.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                m.setFont(f1);
+                m.setFont(f2);
+                m.setFont(f3);
+                m.setFont(f4);
+
+                m.getFontMetrics(f1);
+                m.getFontMetrics(f2);
+                m.getFontMetrics(f3);
+                m.getFontMetrics(f4);
+            }
+        }
+        m.enable();
+        m.disable();
+        m.reshape(10, 10, 10, 10);
+        m.getBounds(new Rectangle(1, 1, 1, 1));
+        m.getSize(new Dimension(1, 2));
+        m.getLocation(new Point(1, 2));
+        m.getX();
+        m.getY();
+        m.getWidth();
+        m.getHeight();
+        m.isOpaque();
+        m.isValidateRoot();
+        m.isOptimizedDrawingEnabled();
+        m.isDoubleBuffered();
+        m.getComponentCount();
+        m.countComponents();
+        Component[] cs = m.getComponents();
+        m.getLayout();
+        m.setLayout(new FlowLayout());
+        m.doLayout();
+        m.layout();
+        m.invalidate();
+        m.validate();
+        m.remove(0);
+        m.remove(c2);
+        m.removeAll();
+        m.preferredSize();
+        m.minimumSize();
+        m.getComponentAt(1, 2);
+        m.locate(1, 2);
+        m.getComponentAt(new Point(1, 2));
+        m.isFocusCycleRoot(new Container());
+        m.transferFocusBackward();
+        m.setName("goober");
+        m.getName();
+        m.getParent();
+        m.getPeer();
+        m.getGraphicsConfiguration();
+        m.getTreeLock();
+        m.getToolkit();
+        m.isValid();
+        m.isDisplayable();
+        m.isVisible();
+        m.isShowing();
+        m.isEnabled();
+        m.enable(false);
+        m.enable(true);
+        m.enableInputMethods(false);
+        m.enableInputMethods(true);
+        m.show();
+        m.show(false);
+        m.show(true);
+        m.hide();
+        m.getForeground();
+        m.isForegroundSet();
+        m.getBackground();
+        m.isBackgroundSet();
+        m.getFont();
+        m.isFontSet();
+        Container c = new Container();
+        c.add(m);
+        m.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            m.setLocale(locale);
+
+        m.getColorModel();
+        m.getLocation();
+
+        boolean exceptions = false;
+        try {
+            m.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        m.location();
+        m.setLocation(1, 2);
+        m.move(1, 2);
+        m.setLocation(new Point(1, 2));
+        m.getSize();
+        m.size();
+        m.setSize(1, 32);
+        m.resize(1, 32);
+        m.setSize(new Dimension(1, 32));
+        m.resize(new Dimension(1, 32));
+        m.getBounds();
+        m.bounds();
+        m.setBounds(10, 10, 10, 10);
+        m.setBounds(new Rectangle(10, 10, 10, 10));
+        m.isLightweight();
+        m.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        m.getCursor();
+        m.isCursorSet();
+        m.inside(1, 2);
+        m.contains(new Point(1, 2));
+        m.isFocusable();
+        m.setFocusable(true);
+        m.setFocusable(false);
+        m.transferFocus();
+        m.getFocusCycleRootAncestor();
+        m.nextFocus();
+        m.transferFocusUpCycle();
+        m.hasFocus();
+        m.isFocusOwner();
+        m.toString();
+        m.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        m.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        m.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        m.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJMenuBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JMenuBar constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJMenuBar
+ */
+
+public class HeadlessJMenuBar {
+    public static void main(String args[]) {
+        JMenuBar mb = new JMenuBar();
+        mb.getAccessibleContext();
+        mb.isFocusTraversable();
+        mb.setEnabled(false);
+        mb.setEnabled(true);
+        mb.requestFocus();
+        mb.requestFocusInWindow();
+        mb.getPreferredSize();
+        mb.getMaximumSize();
+        mb.getMinimumSize();
+        mb.contains(1, 2);
+        Component c1 = mb.add(new Component(){});
+        Component c2 = mb.add(new Component(){});
+        Component c3 = mb.add(new Component(){});
+        Insets ins = mb.getInsets();
+        mb.getAlignmentY();
+        mb.getAlignmentX();
+        mb.getGraphics();
+        mb.setVisible(false);
+        mb.setVisible(true);
+        mb.setForeground(Color.red);
+        mb.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                mb.setFont(f1);
+                mb.setFont(f2);
+                mb.setFont(f3);
+                mb.setFont(f4);
+
+                mb.getFontMetrics(f1);
+                mb.getFontMetrics(f2);
+                mb.getFontMetrics(f3);
+                mb.getFontMetrics(f4);
+            }
+        }
+        mb.enable();
+        mb.disable();
+        mb.reshape(10, 10, 10, 10);
+        mb.getBounds(new Rectangle(1, 1, 1, 1));
+        mb.getSize(new Dimension(1, 2));
+        mb.getLocation(new Point(1, 2));
+        mb.getX();
+        mb.getY();
+        mb.getWidth();
+        mb.getHeight();
+        mb.isOpaque();
+        mb.isValidateRoot();
+        mb.isOptimizedDrawingEnabled();
+        mb.isDoubleBuffered();
+        mb.getComponentCount();
+        mb.countComponents();
+        mb.getComponent(1);
+        mb.getComponent(2);
+        Component[] cs = mb.getComponents();
+        mb.getLayout();
+        mb.setLayout(new FlowLayout());
+        mb.doLayout();
+        mb.layout();
+        mb.invalidate();
+        mb.validate();
+        mb.remove(0);
+        mb.remove(c2);
+        mb.removeAll();
+        mb.preferredSize();
+        mb.minimumSize();
+        mb.getComponentAt(1, 2);
+        mb.locate(1, 2);
+        mb.getComponentAt(new Point(1, 2));
+        mb.isFocusCycleRoot(new Container());
+        mb.transferFocusBackward();
+        mb.setName("goober");
+        mb.getName();
+        mb.getParent();
+        mb.getPeer();
+        mb.getGraphicsConfiguration();
+        mb.getTreeLock();
+        mb.getToolkit();
+        mb.isValid();
+        mb.isDisplayable();
+        mb.isVisible();
+        mb.isShowing();
+        mb.isEnabled();
+        mb.enable(false);
+        mb.enable(true);
+        mb.enableInputMethods(false);
+        mb.enableInputMethods(true);
+        mb.show();
+        mb.show(false);
+        mb.show(true);
+        mb.hide();
+        mb.getForeground();
+        mb.isForegroundSet();
+        mb.getBackground();
+        mb.isBackgroundSet();
+        mb.getFont();
+        mb.isFontSet();
+        Container c = new Container();
+        c.add(mb);
+        mb.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            mb.setLocale(locale);
+
+        mb.getColorModel();
+        mb.getLocation();
+
+        boolean exceptions = false;
+        try {
+            mb.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        mb.location();
+        mb.setLocation(1, 2);
+        mb.move(1, 2);
+        mb.setLocation(new Point(1, 2));
+        mb.getSize();
+        mb.size();
+        mb.setSize(1, 32);
+        mb.resize(1, 32);
+        mb.setSize(new Dimension(1, 32));
+        mb.resize(new Dimension(1, 32));
+        mb.getBounds();
+        mb.bounds();
+        mb.setBounds(10, 10, 10, 10);
+        mb.setBounds(new Rectangle(10, 10, 10, 10));
+        mb.isLightweight();
+        mb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        mb.getCursor();
+        mb.isCursorSet();
+        mb.inside(1, 2);
+        mb.contains(new Point(1, 2));
+        mb.isFocusable();
+        mb.setFocusable(true);
+        mb.setFocusable(false);
+        mb.transferFocus();
+        mb.getFocusCycleRootAncestor();
+        mb.nextFocus();
+        mb.transferFocusUpCycle();
+        mb.hasFocus();
+        mb.isFocusOwner();
+        mb.toString();
+        mb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        mb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        mb.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        mb.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JMenuItem constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJMenuItem
+ */
+
+public class HeadlessJMenuItem {
+    public static void main(String args[]) {
+        JMenuItem mi = new JMenuItem();
+        mi.getAccessibleContext();
+        mi.isFocusTraversable();
+        mi.setEnabled(false);
+        mi.setEnabled(true);
+        mi.requestFocus();
+        mi.requestFocusInWindow();
+        mi.getPreferredSize();
+        mi.getMaximumSize();
+        mi.getMinimumSize();
+        mi.contains(1, 2);
+        Component c1 = mi.add(new Component(){});
+        Component c2 = mi.add(new Component(){});
+        Component c3 = mi.add(new Component(){});
+        Insets ins = mi.getInsets();
+        mi.getAlignmentY();
+        mi.getAlignmentX();
+        mi.getGraphics();
+        mi.setVisible(false);
+        mi.setVisible(true);
+        mi.setForeground(Color.red);
+        mi.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                mi.setFont(f1);
+                mi.setFont(f2);
+                mi.setFont(f3);
+                mi.setFont(f4);
+
+                mi.getFontMetrics(f1);
+                mi.getFontMetrics(f2);
+                mi.getFontMetrics(f3);
+                mi.getFontMetrics(f4);
+            }
+        }
+        mi.enable();
+        mi.disable();
+        mi.reshape(10, 10, 10, 10);
+        mi.getBounds(new Rectangle(1, 1, 1, 1));
+        mi.getSize(new Dimension(1, 2));
+        mi.getLocation(new Point(1, 2));
+        mi.getX();
+        mi.getY();
+        mi.getWidth();
+        mi.getHeight();
+        mi.isOpaque();
+        mi.isValidateRoot();
+        mi.isOptimizedDrawingEnabled();
+        mi.isDoubleBuffered();
+        mi.getComponentCount();
+        mi.countComponents();
+        mi.getComponent(1);
+        mi.getComponent(2);
+        Component[] cs = mi.getComponents();
+        mi.getLayout();
+        mi.setLayout(new FlowLayout());
+        mi.doLayout();
+        mi.layout();
+        mi.invalidate();
+        mi.validate();
+        mi.remove(0);
+        mi.remove(c2);
+        mi.removeAll();
+        mi.preferredSize();
+        mi.minimumSize();
+        mi.getComponentAt(1, 2);
+        mi.locate(1, 2);
+        mi.getComponentAt(new Point(1, 2));
+        mi.isFocusCycleRoot(new Container());
+        mi.transferFocusBackward();
+        mi.setName("goober");
+        mi.getName();
+        mi.getParent();
+        mi.getPeer();
+        mi.getGraphicsConfiguration();
+        mi.getTreeLock();
+        mi.getToolkit();
+        mi.isValid();
+        mi.isDisplayable();
+        mi.isVisible();
+        mi.isShowing();
+        mi.isEnabled();
+        mi.enable(false);
+        mi.enable(true);
+        mi.enableInputMethods(false);
+        mi.enableInputMethods(true);
+        mi.show();
+        mi.show(false);
+        mi.show(true);
+        mi.hide();
+        mi.getForeground();
+        mi.isForegroundSet();
+        mi.getBackground();
+        mi.isBackgroundSet();
+        mi.getFont();
+        mi.isFontSet();
+        Container c = new Container();
+        c.add(mi);
+        mi.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            mi.setLocale(locale);
+
+        mi.getColorModel();
+        mi.getLocation();
+
+        boolean exceptions = false;
+        try {
+            mi.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        mi.location();
+        mi.setLocation(1, 2);
+        mi.move(1, 2);
+        mi.setLocation(new Point(1, 2));
+        mi.getSize();
+        mi.size();
+        mi.setSize(1, 32);
+        mi.resize(1, 32);
+        mi.setSize(new Dimension(1, 32));
+        mi.resize(new Dimension(1, 32));
+        mi.getBounds();
+        mi.bounds();
+        mi.setBounds(10, 10, 10, 10);
+        mi.setBounds(new Rectangle(10, 10, 10, 10));
+        mi.isLightweight();
+        mi.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        mi.getCursor();
+        mi.isCursorSet();
+        mi.inside(1, 2);
+        mi.contains(new Point(1, 2));
+        mi.isFocusable();
+        mi.setFocusable(true);
+        mi.setFocusable(false);
+        mi.transferFocus();
+        mi.getFocusCycleRootAncestor();
+        mi.nextFocus();
+        mi.transferFocusUpCycle();
+        mi.hasFocus();
+        mi.isFocusOwner();
+        mi.toString();
+        mi.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        mi.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        mi.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        mi.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJOptionPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JOptionPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJOptionPane
+ */
+
+public class HeadlessJOptionPane {
+    public static void main(String args[]) {
+        JOptionPane op = new JOptionPane();
+        op.getAccessibleContext();
+        op.isFocusTraversable();
+        op.setEnabled(false);
+        op.setEnabled(true);
+        op.requestFocus();
+        op.requestFocusInWindow();
+        op.getPreferredSize();
+        op.getMaximumSize();
+        op.getMinimumSize();
+        op.contains(1, 2);
+        Component c1 = op.add(new Component(){});
+        Component c2 = op.add(new Component(){});
+        Component c3 = op.add(new Component(){});
+        Insets ins = op.getInsets();
+        op.getAlignmentY();
+        op.getAlignmentX();
+        op.getGraphics();
+        op.setVisible(false);
+        op.setVisible(true);
+        op.setForeground(Color.red);
+        op.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                op.setFont(f1);
+                op.setFont(f2);
+                op.setFont(f3);
+                op.setFont(f4);
+
+                op.getFontMetrics(f1);
+                op.getFontMetrics(f2);
+                op.getFontMetrics(f3);
+                op.getFontMetrics(f4);
+            }
+        }
+        op.enable();
+        op.disable();
+        op.reshape(10, 10, 10, 10);
+        op.getBounds(new Rectangle(1, 1, 1, 1));
+        op.getSize(new Dimension(1, 2));
+        op.getLocation(new Point(1, 2));
+        op.getX();
+        op.getY();
+        op.getWidth();
+        op.getHeight();
+        op.isOpaque();
+        op.isValidateRoot();
+        op.isOptimizedDrawingEnabled();
+        op.isDoubleBuffered();
+        op.getComponentCount();
+        op.countComponents();
+        op.getComponent(1);
+        op.getComponent(2);
+        Component[] cs = op.getComponents();
+        op.getLayout();
+        op.setLayout(new FlowLayout());
+        op.doLayout();
+        op.layout();
+        op.invalidate();
+        op.validate();
+        op.remove(0);
+        op.remove(c2);
+        op.removeAll();
+        op.preferredSize();
+        op.minimumSize();
+        op.getComponentAt(1, 2);
+        op.locate(1, 2);
+        op.getComponentAt(new Point(1, 2));
+        op.isFocusCycleRoot(new Container());
+        op.transferFocusBackward();
+        op.setName("goober");
+        op.getName();
+        op.getParent();
+        op.getPeer();
+        op.getGraphicsConfiguration();
+        op.getTreeLock();
+        op.getToolkit();
+        op.isValid();
+        op.isDisplayable();
+        op.isVisible();
+        op.isShowing();
+        op.isEnabled();
+        op.enable(false);
+        op.enable(true);
+        op.enableInputMethods(false);
+        op.enableInputMethods(true);
+        op.show();
+        op.show(false);
+        op.show(true);
+        op.hide();
+        op.getForeground();
+        op.isForegroundSet();
+        op.getBackground();
+        op.isBackgroundSet();
+        op.getFont();
+        op.isFontSet();
+        Container c = new Container();
+        c.add(op);
+        op.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            op.setLocale(locale);
+
+        op.getColorModel();
+        op.getLocation();
+
+        boolean exceptions = false;
+        try {
+            op.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        op.location();
+        op.setLocation(1, 2);
+        op.move(1, 2);
+        op.setLocation(new Point(1, 2));
+        op.getSize();
+        op.size();
+        op.setSize(1, 32);
+        op.resize(1, 32);
+        op.setSize(new Dimension(1, 32));
+        op.resize(new Dimension(1, 32));
+        op.getBounds();
+        op.bounds();
+        op.setBounds(10, 10, 10, 10);
+        op.setBounds(new Rectangle(10, 10, 10, 10));
+        op.isLightweight();
+        op.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        op.getCursor();
+        op.isCursorSet();
+        op.inside(1, 2);
+        op.contains(new Point(1, 2));
+        op.isFocusable();
+        op.setFocusable(true);
+        op.setFocusable(false);
+        op.transferFocus();
+        op.getFocusCycleRootAncestor();
+        op.nextFocus();
+        op.transferFocusUpCycle();
+        op.hasFocus();
+        op.isFocusOwner();
+        op.toString();
+        op.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        op.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        op.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        op.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJPanel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JPanel constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJPanel
+ */
+
+public class HeadlessJPanel {
+    public static void main(String args[]) {
+        JPanel p = new JPanel();
+        p.getAccessibleContext();
+        p.isFocusTraversable();
+        p.setEnabled(false);
+        p.setEnabled(true);
+        p.requestFocus();
+        p.requestFocusInWindow();
+        p.getPreferredSize();
+        p.getMaximumSize();
+        p.getMinimumSize();
+        p.contains(1, 2);
+        Component c1 = p.add(new Component(){});
+        Component c2 = p.add(new Component(){});
+        Component c3 = p.add(new Component(){});
+        Insets ins = p.getInsets();
+        p.getAlignmentY();
+        p.getAlignmentX();
+        p.getGraphics();
+        p.setVisible(false);
+        p.setVisible(true);
+        p.setForeground(Color.red);
+        p.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                p.setFont(f1);
+                p.setFont(f2);
+                p.setFont(f3);
+                p.setFont(f4);
+
+                p.getFontMetrics(f1);
+                p.getFontMetrics(f2);
+                p.getFontMetrics(f3);
+                p.getFontMetrics(f4);
+            }
+        }
+        p.enable();
+        p.disable();
+        p.reshape(10, 10, 10, 10);
+        p.getBounds(new Rectangle(1, 1, 1, 1));
+        p.getSize(new Dimension(1, 2));
+        p.getLocation(new Point(1, 2));
+        p.getX();
+        p.getY();
+        p.getWidth();
+        p.getHeight();
+        p.isOpaque();
+        p.isValidateRoot();
+        p.isOptimizedDrawingEnabled();
+        p.isDoubleBuffered();
+        p.getComponentCount();
+        p.countComponents();
+        p.getComponent(1);
+        p.getComponent(2);
+        Component[] cs = p.getComponents();
+        p.getLayout();
+        p.setLayout(new FlowLayout());
+        p.doLayout();
+        p.layout();
+        p.invalidate();
+        p.validate();
+        p.remove(0);
+        p.remove(c2);
+        p.removeAll();
+        p.preferredSize();
+        p.minimumSize();
+        p.getComponentAt(1, 2);
+        p.locate(1, 2);
+        p.getComponentAt(new Point(1, 2));
+        p.isFocusCycleRoot(new Container());
+        p.transferFocusBackward();
+        p.setName("goober");
+        p.getName();
+        p.getParent();
+        p.getPeer();
+        p.getGraphicsConfiguration();
+        p.getTreeLock();
+        p.getToolkit();
+        p.isValid();
+        p.isDisplayable();
+        p.isVisible();
+        p.isShowing();
+        p.isEnabled();
+        p.enable(false);
+        p.enable(true);
+        p.enableInputMethods(false);
+        p.enableInputMethods(true);
+        p.show();
+        p.show(false);
+        p.show(true);
+        p.hide();
+        p.getForeground();
+        p.isForegroundSet();
+        p.getBackground();
+        p.isBackgroundSet();
+        p.getFont();
+        p.isFontSet();
+        Container c = new Container();
+        c.add(p);
+        p.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            p.setLocale(locale);
+
+        p.getColorModel();
+        p.getLocation();
+
+        boolean exceptions = false;
+        try {
+            p.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        p.location();
+        p.setLocation(1, 2);
+        p.move(1, 2);
+        p.setLocation(new Point(1, 2));
+        p.getSize();
+        p.size();
+        p.setSize(1, 32);
+        p.resize(1, 32);
+        p.setSize(new Dimension(1, 32));
+        p.resize(new Dimension(1, 32));
+        p.getBounds();
+        p.bounds();
+        p.setBounds(10, 10, 10, 10);
+        p.setBounds(new Rectangle(10, 10, 10, 10));
+        p.isLightweight();
+        p.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        p.getCursor();
+        p.isCursorSet();
+        p.inside(1, 2);
+        p.contains(new Point(1, 2));
+        p.isFocusable();
+        p.setFocusable(true);
+        p.setFocusable(false);
+        p.transferFocus();
+        p.getFocusCycleRootAncestor();
+        p.nextFocus();
+        p.transferFocusUpCycle();
+        p.hasFocus();
+        p.isFocusOwner();
+        p.toString();
+        p.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        p.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        p.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        p.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJPasswordField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that JPasswordField constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJPasswordField
+ */
+
+public class HeadlessJPasswordField {
+    public static void main(String args[]) {
+        JPasswordField f = new JPasswordField("field");
+        f.selectAll();
+        f.getSelectionStart();
+        f.getSelectionEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJPopupMenu.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JPopupMenu constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJPopupMenu
+ */
+
+public class HeadlessJPopupMenu {
+    public static void main(String args[]) {
+        JMenu m = new JMenu();
+        m.getAccessibleContext();
+        m.isFocusTraversable();
+        m.setEnabled(false);
+        m.setEnabled(true);
+        m.requestFocus();
+        m.requestFocusInWindow();
+        m.getPreferredSize();
+        m.getMaximumSize();
+        m.getMinimumSize();
+        m.contains(1, 2);
+        Component c1 = m.add(new Component(){});
+        Component c2 = m.add(new Component(){});
+        Component c3 = m.add(new Component(){});
+        Insets ins = m.getInsets();
+        m.getAlignmentY();
+        m.getAlignmentX();
+        m.getGraphics();
+        m.setVisible(false);
+        m.setVisible(true);
+        m.setForeground(Color.red);
+        m.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                m.setFont(f1);
+                m.setFont(f2);
+                m.setFont(f3);
+                m.setFont(f4);
+
+                m.getFontMetrics(f1);
+                m.getFontMetrics(f2);
+                m.getFontMetrics(f3);
+                m.getFontMetrics(f4);
+            }
+        }
+        m.enable();
+        m.disable();
+        m.reshape(10, 10, 10, 10);
+        m.getBounds(new Rectangle(1, 1, 1, 1));
+        m.getSize(new Dimension(1, 2));
+        m.getLocation(new Point(1, 2));
+        m.getX();
+        m.getY();
+        m.getWidth();
+        m.getHeight();
+        m.isOpaque();
+        m.isValidateRoot();
+        m.isOptimizedDrawingEnabled();
+        m.isDoubleBuffered();
+        m.getComponentCount();
+        m.countComponents();
+        Component[] cs = m.getComponents();
+        m.getLayout();
+        m.setLayout(new FlowLayout());
+        m.doLayout();
+        m.layout();
+        m.invalidate();
+        m.validate();
+        m.remove(0);
+        m.remove(c2);
+        m.removeAll();
+        m.preferredSize();
+        m.minimumSize();
+        m.getComponentAt(1, 2);
+        m.locate(1, 2);
+        m.getComponentAt(new Point(1, 2));
+        m.isFocusCycleRoot(new Container());
+        m.transferFocusBackward();
+        m.setName("goober");
+        m.getName();
+        m.getParent();
+        m.getPeer();
+        m.getGraphicsConfiguration();
+        m.getTreeLock();
+        m.getToolkit();
+        m.isValid();
+        m.isDisplayable();
+        m.isVisible();
+        m.isShowing();
+        m.isEnabled();
+        m.enable(false);
+        m.enable(true);
+        m.enableInputMethods(false);
+        m.enableInputMethods(true);
+        m.show();
+        m.show(false);
+        m.show(true);
+        m.hide();
+        m.getForeground();
+        m.isForegroundSet();
+        m.getBackground();
+        m.isBackgroundSet();
+        m.getFont();
+        m.isFontSet();
+        Container c = new Container();
+        c.add(m);
+        m.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            m.setLocale(locale);
+
+        m.getColorModel();
+        m.getLocation();
+
+        boolean exceptions = false;
+        try {
+            m.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        m.location();
+        m.setLocation(1, 2);
+        m.move(1, 2);
+        m.setLocation(new Point(1, 2));
+        m.getSize();
+        m.size();
+        m.setSize(1, 32);
+        m.resize(1, 32);
+        m.setSize(new Dimension(1, 32));
+        m.resize(new Dimension(1, 32));
+        m.getBounds();
+        m.bounds();
+        m.setBounds(10, 10, 10, 10);
+        m.setBounds(new Rectangle(10, 10, 10, 10));
+        m.isLightweight();
+        m.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        m.getCursor();
+        m.isCursorSet();
+        m.inside(1, 2);
+        m.contains(new Point(1, 2));
+        m.isFocusable();
+        m.setFocusable(true);
+        m.setFocusable(false);
+        m.transferFocus();
+        m.getFocusCycleRootAncestor();
+        m.nextFocus();
+        m.transferFocusUpCycle();
+        m.hasFocus();
+        m.isFocusOwner();
+        m.toString();
+        m.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        m.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        m.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        m.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJPopupMenu_Separator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JPopupMenu.Separator constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJPopupMenu_Separator
+ */
+
+public class HeadlessJPopupMenu_Separator {
+    public static void main(String args[]) {
+        JPopupMenu.Separator s = new JPopupMenu.Separator();
+        s.getAccessibleContext();
+        s.isFocusTraversable();
+        s.setEnabled(false);
+        s.setEnabled(true);
+        s.requestFocus();
+        s.requestFocusInWindow();
+        s.getPreferredSize();
+        s.getMaximumSize();
+        s.getMinimumSize();
+        s.contains(1, 2);
+        Component c1 = s.add(new Component(){});
+        Component c2 = s.add(new Component(){});
+        Component c3 = s.add(new Component(){});
+        Insets ins = s.getInsets();
+        s.getAlignmentY();
+        s.getAlignmentX();
+        s.getGraphics();
+        s.setVisible(false);
+        s.setVisible(true);
+        s.setForeground(Color.red);
+        s.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                s.setFont(f1);
+                s.setFont(f2);
+                s.setFont(f3);
+                s.setFont(f4);
+
+                s.getFontMetrics(f1);
+                s.getFontMetrics(f2);
+                s.getFontMetrics(f3);
+                s.getFontMetrics(f4);
+            }
+        }
+        s.enable();
+        s.disable();
+        s.reshape(10, 10, 10, 10);
+        s.getBounds(new Rectangle(1, 1, 1, 1));
+        s.getSize(new Dimension(1, 2));
+        s.getLocation(new Point(1, 2));
+        s.getX();
+        s.getY();
+        s.getWidth();
+        s.getHeight();
+        s.isOpaque();
+        s.isValidateRoot();
+        s.isOptimizedDrawingEnabled();
+        s.isDoubleBuffered();
+        s.getComponentCount();
+        s.countComponents();
+        s.getComponent(1);
+        s.getComponent(2);
+        Component[] cs = s.getComponents();
+        s.getLayout();
+        s.setLayout(new FlowLayout());
+        s.doLayout();
+        s.layout();
+        s.invalidate();
+        s.validate();
+        s.remove(0);
+        s.remove(c2);
+        s.removeAll();
+        s.preferredSize();
+        s.minimumSize();
+        s.getComponentAt(1, 2);
+        s.locate(1, 2);
+        s.getComponentAt(new Point(1, 2));
+        s.isFocusCycleRoot(new Container());
+        s.transferFocusBackward();
+        s.setName("goober");
+        s.getName();
+        s.getParent();
+        s.getPeer();
+        s.getGraphicsConfiguration();
+        s.getTreeLock();
+        s.getToolkit();
+        s.isValid();
+        s.isDisplayable();
+        s.isVisible();
+        s.isShowing();
+        s.isEnabled();
+        s.enable(false);
+        s.enable(true);
+        s.enableInputMethods(false);
+        s.enableInputMethods(true);
+        s.show();
+        s.show(false);
+        s.show(true);
+        s.hide();
+        s.getForeground();
+        s.isForegroundSet();
+        s.getBackground();
+        s.isBackgroundSet();
+        s.getFont();
+        s.isFontSet();
+        Container c = new Container();
+        c.add(s);
+        s.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            s.setLocale(locale);
+
+        s.getColorModel();
+        s.getLocation();
+
+        boolean exceptions = false;
+        try {
+            s.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        s.location();
+        s.setLocation(1, 2);
+        s.move(1, 2);
+        s.setLocation(new Point(1, 2));
+        s.getSize();
+        s.size();
+        s.setSize(1, 32);
+        s.resize(1, 32);
+        s.setSize(new Dimension(1, 32));
+        s.resize(new Dimension(1, 32));
+        s.getBounds();
+        s.bounds();
+        s.setBounds(10, 10, 10, 10);
+        s.setBounds(new Rectangle(10, 10, 10, 10));
+        s.isLightweight();
+        s.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        s.getCursor();
+        s.isCursorSet();
+        s.inside(1, 2);
+        s.contains(new Point(1, 2));
+        s.isFocusable();
+        s.setFocusable(true);
+        s.setFocusable(false);
+        s.transferFocus();
+        s.getFocusCycleRootAncestor();
+        s.nextFocus();
+        s.transferFocusUpCycle();
+        s.hasFocus();
+        s.isFocusOwner();
+        s.toString();
+        s.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        s.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        s.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        s.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJProgressBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JProgressBar constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJProgressBar
+ */
+
+public class HeadlessJProgressBar {
+    public static void main(String args[]) {
+        JProgressBar pb = new JProgressBar();
+        pb.getAccessibleContext();
+        pb.isFocusTraversable();
+        pb.setEnabled(false);
+        pb.setEnabled(true);
+        pb.requestFocus();
+        pb.requestFocusInWindow();
+        pb.getPreferredSize();
+        pb.getMaximumSize();
+        pb.getMinimumSize();
+        pb.contains(1, 2);
+        Component c1 = pb.add(new Component(){});
+        Component c2 = pb.add(new Component(){});
+        Component c3 = pb.add(new Component(){});
+        Insets ins = pb.getInsets();
+        pb.getAlignmentY();
+        pb.getAlignmentX();
+        pb.getGraphics();
+        pb.setVisible(false);
+        pb.setVisible(true);
+        pb.setForeground(Color.red);
+        pb.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                pb.setFont(f1);
+                pb.setFont(f2);
+                pb.setFont(f3);
+                pb.setFont(f4);
+
+                pb.getFontMetrics(f1);
+                pb.getFontMetrics(f2);
+                pb.getFontMetrics(f3);
+                pb.getFontMetrics(f4);
+            }
+        }
+        pb.enable();
+        pb.disable();
+        pb.reshape(10, 10, 10, 10);
+        pb.getBounds(new Rectangle(1, 1, 1, 1));
+        pb.getSize(new Dimension(1, 2));
+        pb.getLocation(new Point(1, 2));
+        pb.getX();
+        pb.getY();
+        pb.getWidth();
+        pb.getHeight();
+        pb.isOpaque();
+        pb.isValidateRoot();
+        pb.isOptimizedDrawingEnabled();
+        pb.isDoubleBuffered();
+        pb.getComponentCount();
+        pb.countComponents();
+        pb.getComponent(1);
+        pb.getComponent(2);
+        Component[] cs = pb.getComponents();
+        pb.getLayout();
+        pb.setLayout(new FlowLayout());
+        pb.doLayout();
+        pb.layout();
+        pb.invalidate();
+        pb.validate();
+        pb.remove(0);
+        pb.remove(c2);
+        pb.removeAll();
+        pb.preferredSize();
+        pb.minimumSize();
+        pb.getComponentAt(1, 2);
+        pb.locate(1, 2);
+        pb.getComponentAt(new Point(1, 2));
+        pb.isFocusCycleRoot(new Container());
+        pb.transferFocusBackward();
+        pb.setName("goober");
+        pb.getName();
+        pb.getParent();
+        pb.getPeer();
+        pb.getGraphicsConfiguration();
+        pb.getTreeLock();
+        pb.getToolkit();
+        pb.isValid();
+        pb.isDisplayable();
+        pb.isVisible();
+        pb.isShowing();
+        pb.isEnabled();
+        pb.enable(false);
+        pb.enable(true);
+        pb.enableInputMethods(false);
+        pb.enableInputMethods(true);
+        pb.show();
+        pb.show(false);
+        pb.show(true);
+        pb.hide();
+        pb.getForeground();
+        pb.isForegroundSet();
+        pb.getBackground();
+        pb.isBackgroundSet();
+        pb.getFont();
+        pb.isFontSet();
+        Container c = new Container();
+        c.add(pb);
+        pb.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            pb.setLocale(locale);
+
+        pb.getColorModel();
+        pb.getLocation();
+
+        boolean exceptions = false;
+        try {
+            pb.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        pb.location();
+        pb.setLocation(1, 2);
+        pb.move(1, 2);
+        pb.setLocation(new Point(1, 2));
+        pb.getSize();
+        pb.size();
+        pb.setSize(1, 32);
+        pb.resize(1, 32);
+        pb.setSize(new Dimension(1, 32));
+        pb.resize(new Dimension(1, 32));
+        pb.getBounds();
+        pb.bounds();
+        pb.setBounds(10, 10, 10, 10);
+        pb.setBounds(new Rectangle(10, 10, 10, 10));
+        pb.isLightweight();
+        pb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        pb.getCursor();
+        pb.isCursorSet();
+        pb.inside(1, 2);
+        pb.contains(new Point(1, 2));
+        pb.isFocusable();
+        pb.setFocusable(true);
+        pb.setFocusable(false);
+        pb.transferFocus();
+        pb.getFocusCycleRootAncestor();
+        pb.nextFocus();
+        pb.transferFocusUpCycle();
+        pb.hasFocus();
+        pb.isFocusOwner();
+        pb.toString();
+        pb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        pb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        pb.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        pb.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJRadioButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JRadioButton constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJRadioButton
+ */
+
+public class HeadlessJRadioButton {
+    public static void main(String args[]) {
+        JRadioButton rb = new JRadioButton();
+        rb.getAccessibleContext();
+        rb.isFocusTraversable();
+        rb.setEnabled(false);
+        rb.setEnabled(true);
+        rb.requestFocus();
+        rb.requestFocusInWindow();
+        rb.getPreferredSize();
+        rb.getMaximumSize();
+        rb.getMinimumSize();
+        rb.contains(1, 2);
+        Component c1 = rb.add(new Component(){});
+        Component c2 = rb.add(new Component(){});
+        Component c3 = rb.add(new Component(){});
+        Insets ins = rb.getInsets();
+        rb.getAlignmentY();
+        rb.getAlignmentX();
+        rb.getGraphics();
+        rb.setVisible(false);
+        rb.setVisible(true);
+        rb.setForeground(Color.red);
+        rb.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                rb.setFont(f1);
+                rb.setFont(f2);
+                rb.setFont(f3);
+                rb.setFont(f4);
+
+                rb.getFontMetrics(f1);
+                rb.getFontMetrics(f2);
+                rb.getFontMetrics(f3);
+                rb.getFontMetrics(f4);
+            }
+        }
+        rb.enable();
+        rb.disable();
+        rb.reshape(10, 10, 10, 10);
+        rb.getBounds(new Rectangle(1, 1, 1, 1));
+        rb.getSize(new Dimension(1, 2));
+        rb.getLocation(new Point(1, 2));
+        rb.getX();
+        rb.getY();
+        rb.getWidth();
+        rb.getHeight();
+        rb.isOpaque();
+        rb.isValidateRoot();
+        rb.isOptimizedDrawingEnabled();
+        rb.isDoubleBuffered();
+        rb.getComponentCount();
+        rb.countComponents();
+        rb.getComponent(1);
+        rb.getComponent(2);
+        Component[] cs = rb.getComponents();
+        rb.getLayout();
+        rb.setLayout(new FlowLayout());
+        rb.doLayout();
+        rb.layout();
+        rb.invalidate();
+        rb.validate();
+        rb.remove(0);
+        rb.remove(c2);
+        rb.removeAll();
+        rb.preferredSize();
+        rb.minimumSize();
+        rb.getComponentAt(1, 2);
+        rb.locate(1, 2);
+        rb.getComponentAt(new Point(1, 2));
+        rb.isFocusCycleRoot(new Container());
+        rb.transferFocusBackward();
+        rb.setName("goober");
+        rb.getName();
+        rb.getParent();
+        rb.getPeer();
+        rb.getGraphicsConfiguration();
+        rb.getTreeLock();
+        rb.getToolkit();
+        rb.isValid();
+        rb.isDisplayable();
+        rb.isVisible();
+        rb.isShowing();
+        rb.isEnabled();
+        rb.enable(false);
+        rb.enable(true);
+        rb.enableInputMethods(false);
+        rb.enableInputMethods(true);
+        rb.show();
+        rb.show(false);
+        rb.show(true);
+        rb.hide();
+        rb.getForeground();
+        rb.isForegroundSet();
+        rb.getBackground();
+        rb.isBackgroundSet();
+        rb.getFont();
+        rb.isFontSet();
+        Container c = new Container();
+        c.add(rb);
+        rb.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            rb.setLocale(locale);
+
+        rb.getColorModel();
+        rb.getLocation();
+
+        boolean exceptions = false;
+        try {
+            rb.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        rb.location();
+        rb.setLocation(1, 2);
+        rb.move(1, 2);
+        rb.setLocation(new Point(1, 2));
+        rb.getSize();
+        rb.size();
+        rb.setSize(1, 32);
+        rb.resize(1, 32);
+        rb.setSize(new Dimension(1, 32));
+        rb.resize(new Dimension(1, 32));
+        rb.getBounds();
+        rb.bounds();
+        rb.setBounds(10, 10, 10, 10);
+        rb.setBounds(new Rectangle(10, 10, 10, 10));
+        rb.isLightweight();
+        rb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        rb.getCursor();
+        rb.isCursorSet();
+        rb.inside(1, 2);
+        rb.contains(new Point(1, 2));
+        rb.isFocusable();
+        rb.setFocusable(true);
+        rb.setFocusable(false);
+        rb.transferFocus();
+        rb.getFocusCycleRootAncestor();
+        rb.nextFocus();
+        rb.transferFocusUpCycle();
+        rb.hasFocus();
+        rb.isFocusOwner();
+        rb.toString();
+        rb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        rb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        rb.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        rb.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJRadioButtonMenuItem.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JRadioButtonMenuItem constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJRadioButtonMenuItem
+ */
+
+public class HeadlessJRadioButtonMenuItem {
+    public static void main(String args[]) {
+        JRadioButtonMenuItem i = new JRadioButtonMenuItem();
+        i.getAccessibleContext();
+        i.isFocusTraversable();
+        i.setEnabled(false);
+        i.setEnabled(true);
+        i.requestFocus();
+        i.requestFocusInWindow();
+        i.getPreferredSize();
+        i.getMaximumSize();
+        i.getMinimumSize();
+        i.contains(1, 2);
+        Component c1 = i.add(new Component(){});
+        Component c2 = i.add(new Component(){});
+        Component c3 = i.add(new Component(){});
+        Insets ins = i.getInsets();
+        i.getAlignmentY();
+        i.getAlignmentX();
+        i.getGraphics();
+        i.setVisible(false);
+        i.setVisible(true);
+        i.setForeground(Color.red);
+        i.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                i.setFont(f1);
+                i.setFont(f2);
+                i.setFont(f3);
+                i.setFont(f4);
+
+                i.getFontMetrics(f1);
+                i.getFontMetrics(f2);
+                i.getFontMetrics(f3);
+                i.getFontMetrics(f4);
+            }
+        }
+        i.enable();
+        i.disable();
+        i.reshape(10, 10, 10, 10);
+        i.getBounds(new Rectangle(1, 1, 1, 1));
+        i.getSize(new Dimension(1, 2));
+        i.getLocation(new Point(1, 2));
+        i.getX();
+        i.getY();
+        i.getWidth();
+        i.getHeight();
+        i.isOpaque();
+        i.isValidateRoot();
+        i.isOptimizedDrawingEnabled();
+        i.isDoubleBuffered();
+        i.getComponentCount();
+        i.countComponents();
+        i.getComponent(1);
+        i.getComponent(2);
+        Component[] cs = i.getComponents();
+        i.getLayout();
+        i.setLayout(new FlowLayout());
+        i.doLayout();
+        i.layout();
+        i.invalidate();
+        i.validate();
+        i.remove(0);
+        i.remove(c2);
+        i.removeAll();
+        i.preferredSize();
+        i.minimumSize();
+        i.getComponentAt(1, 2);
+        i.locate(1, 2);
+        i.getComponentAt(new Point(1, 2));
+        i.isFocusCycleRoot(new Container());
+        i.transferFocusBackward();
+        i.setName("goober");
+        i.getName();
+        i.getParent();
+        i.getPeer();
+        i.getGraphicsConfiguration();
+        i.getTreeLock();
+        i.getToolkit();
+        i.isValid();
+        i.isDisplayable();
+        i.isVisible();
+        i.isShowing();
+        i.isEnabled();
+        i.enable(false);
+        i.enable(true);
+        i.enableInputMethods(false);
+        i.enableInputMethods(true);
+        i.show();
+        i.show(false);
+        i.show(true);
+        i.hide();
+        i.getForeground();
+        i.isForegroundSet();
+        i.getBackground();
+        i.isBackgroundSet();
+        i.getFont();
+        i.isFontSet();
+        Container c = new Container();
+        c.add(i);
+        i.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            i.setLocale(locale);
+
+        i.getColorModel();
+        i.getLocation();
+
+        boolean exceptions = false;
+        try {
+            i.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        i.location();
+        i.setLocation(1, 2);
+        i.move(1, 2);
+        i.setLocation(new Point(1, 2));
+        i.getSize();
+        i.size();
+        i.setSize(1, 32);
+        i.resize(1, 32);
+        i.setSize(new Dimension(1, 32));
+        i.resize(new Dimension(1, 32));
+        i.getBounds();
+        i.bounds();
+        i.setBounds(10, 10, 10, 10);
+        i.setBounds(new Rectangle(10, 10, 10, 10));
+        i.isLightweight();
+        i.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        i.getCursor();
+        i.isCursorSet();
+        i.inside(1, 2);
+        i.contains(new Point(1, 2));
+        i.isFocusable();
+        i.setFocusable(true);
+        i.setFocusable(false);
+        i.transferFocus();
+        i.getFocusCycleRootAncestor();
+        i.nextFocus();
+        i.transferFocusUpCycle();
+        i.hasFocus();
+        i.isFocusOwner();
+        i.toString();
+        i.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        i.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        i.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        i.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJRootPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JRootPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJRootPane
+ */
+
+public class HeadlessJRootPane {
+    public static void main(String args[]) {
+        JRootPane rp = new JRootPane();
+        rp.getAccessibleContext();
+        rp.isFocusTraversable();
+        rp.setEnabled(false);
+        rp.setEnabled(true);
+        rp.requestFocus();
+        rp.requestFocusInWindow();
+        rp.getPreferredSize();
+        rp.getMaximumSize();
+        rp.getMinimumSize();
+        rp.contains(1, 2);
+        Component c1 = rp.add(new Component(){});
+        Component c2 = rp.add(new Component(){});
+        Component c3 = rp.add(new Component(){});
+        Insets ins = rp.getInsets();
+        rp.getAlignmentY();
+        rp.getAlignmentX();
+        rp.getGraphics();
+        rp.setVisible(false);
+        rp.setVisible(true);
+        rp.setForeground(Color.red);
+        rp.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                rp.setFont(f1);
+                rp.setFont(f2);
+                rp.setFont(f3);
+                rp.setFont(f4);
+
+                rp.getFontMetrics(f1);
+                rp.getFontMetrics(f2);
+                rp.getFontMetrics(f3);
+                rp.getFontMetrics(f4);
+            }
+        }
+        rp.enable();
+        rp.disable();
+        rp.reshape(10, 10, 10, 10);
+        rp.getBounds(new Rectangle(1, 1, 1, 1));
+        rp.getSize(new Dimension(1, 2));
+        rp.getLocation(new Point(1, 2));
+        rp.getX();
+        rp.getY();
+        rp.getWidth();
+        rp.getHeight();
+        rp.isOpaque();
+        rp.isValidateRoot();
+        rp.isOptimizedDrawingEnabled();
+        rp.isDoubleBuffered();
+        rp.getComponentCount();
+        rp.countComponents();
+        rp.getComponent(1);
+        rp.getComponent(2);
+        Component[] cs = rp.getComponents();
+        rp.getLayout();
+        rp.setLayout(new FlowLayout());
+        rp.doLayout();
+        rp.layout();
+        rp.invalidate();
+        rp.validate();
+        rp.remove(0);
+        rp.remove(c2);
+        rp.removeAll();
+        rp.preferredSize();
+        rp.minimumSize();
+        rp.getComponentAt(1, 2);
+        rp.locate(1, 2);
+        rp.getComponentAt(new Point(1, 2));
+        rp.isFocusCycleRoot(new Container());
+        rp.transferFocusBackward();
+        rp.setName("goober");
+        rp.getName();
+        rp.getParent();
+        rp.getPeer();
+        rp.getGraphicsConfiguration();
+        rp.getTreeLock();
+        rp.getToolkit();
+        rp.isValid();
+        rp.isDisplayable();
+        rp.isVisible();
+        rp.isShowing();
+        rp.isEnabled();
+        rp.enable(false);
+        rp.enable(true);
+        rp.enableInputMethods(false);
+        rp.enableInputMethods(true);
+        rp.show();
+        rp.show(false);
+        rp.show(true);
+        rp.hide();
+        rp.getForeground();
+        rp.isForegroundSet();
+        rp.getBackground();
+        rp.isBackgroundSet();
+        rp.getFont();
+        rp.isFontSet();
+        Container c = new Container();
+        c.add(rp);
+        rp.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            rp.setLocale(locale);
+
+        rp.getColorModel();
+        rp.getLocation();
+
+        boolean exceptions = false;
+        try {
+            rp.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        rp.location();
+        rp.setLocation(1, 2);
+        rp.move(1, 2);
+        rp.setLocation(new Point(1, 2));
+        rp.getSize();
+        rp.size();
+        rp.setSize(1, 32);
+        rp.resize(1, 32);
+        rp.setSize(new Dimension(1, 32));
+        rp.resize(new Dimension(1, 32));
+        rp.getBounds();
+        rp.bounds();
+        rp.setBounds(10, 10, 10, 10);
+        rp.setBounds(new Rectangle(10, 10, 10, 10));
+        rp.isLightweight();
+        rp.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        rp.getCursor();
+        rp.isCursorSet();
+        rp.inside(1, 2);
+        rp.contains(new Point(1, 2));
+        rp.isFocusable();
+        rp.setFocusable(true);
+        rp.setFocusable(false);
+        rp.transferFocus();
+        rp.getFocusCycleRootAncestor();
+        rp.nextFocus();
+        rp.transferFocusUpCycle();
+        rp.hasFocus();
+        rp.isFocusOwner();
+        rp.toString();
+        rp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        rp.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        rp.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        rp.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJScrollBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JScrollBar constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJScrollBar
+ */
+
+public class HeadlessJScrollBar {
+    public static void main(String args[]) {
+        JScrollBar sb = new JScrollBar();
+        sb.getAccessibleContext();
+        sb.isFocusTraversable();
+        sb.setEnabled(false);
+        sb.setEnabled(true);
+        sb.requestFocus();
+        sb.requestFocusInWindow();
+        sb.getPreferredSize();
+        sb.getMaximumSize();
+        sb.getMinimumSize();
+        sb.contains(1, 2);
+        Component c1 = sb.add(new Component(){});
+        Component c2 = sb.add(new Component(){});
+        Component c3 = sb.add(new Component(){});
+        Insets ins = sb.getInsets();
+        sb.getAlignmentY();
+        sb.getAlignmentX();
+        sb.getGraphics();
+        sb.setVisible(false);
+        sb.setVisible(true);
+        sb.setForeground(Color.red);
+        sb.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                sb.setFont(f1);
+                sb.setFont(f2);
+                sb.setFont(f3);
+                sb.setFont(f4);
+
+                sb.getFontMetrics(f1);
+                sb.getFontMetrics(f2);
+                sb.getFontMetrics(f3);
+                sb.getFontMetrics(f4);
+            }
+        }
+        sb.enable();
+        sb.disable();
+        sb.reshape(10, 10, 10, 10);
+        sb.getBounds(new Rectangle(1, 1, 1, 1));
+        sb.getSize(new Dimension(1, 2));
+        sb.getLocation(new Point(1, 2));
+        sb.getX();
+        sb.getY();
+        sb.getWidth();
+        sb.getHeight();
+        sb.isOpaque();
+        sb.isValidateRoot();
+        sb.isOptimizedDrawingEnabled();
+        sb.isDoubleBuffered();
+        sb.getComponentCount();
+        sb.countComponents();
+        sb.getComponent(1);
+        sb.getComponent(2);
+        Component[] cs = sb.getComponents();
+        sb.getLayout();
+        sb.setLayout(new FlowLayout());
+        sb.doLayout();
+        sb.layout();
+        sb.invalidate();
+        sb.validate();
+        sb.remove(0);
+        sb.remove(c2);
+        sb.removeAll();
+        sb.preferredSize();
+        sb.minimumSize();
+        sb.getComponentAt(1, 2);
+        sb.locate(1, 2);
+        sb.getComponentAt(new Point(1, 2));
+        sb.isFocusCycleRoot(new Container());
+        sb.transferFocusBackward();
+        sb.setName("goober");
+        sb.getName();
+        sb.getParent();
+        sb.getPeer();
+        sb.getGraphicsConfiguration();
+        sb.getTreeLock();
+        sb.getToolkit();
+        sb.isValid();
+        sb.isDisplayable();
+        sb.isVisible();
+        sb.isShowing();
+        sb.isEnabled();
+        sb.enable(false);
+        sb.enable(true);
+        sb.enableInputMethods(false);
+        sb.enableInputMethods(true);
+        sb.show();
+        sb.show(false);
+        sb.show(true);
+        sb.hide();
+        sb.getForeground();
+        sb.isForegroundSet();
+        sb.getBackground();
+        sb.isBackgroundSet();
+        sb.getFont();
+        sb.isFontSet();
+        Container c = new Container();
+        c.add(sb);
+        sb.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            sb.setLocale(locale);
+
+        sb.getColorModel();
+        sb.getLocation();
+
+        boolean exceptions = false;
+        try {
+            sb.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        sb.location();
+        sb.setLocation(1, 2);
+        sb.move(1, 2);
+        sb.setLocation(new Point(1, 2));
+        sb.getSize();
+        sb.size();
+        sb.setSize(1, 32);
+        sb.resize(1, 32);
+        sb.setSize(new Dimension(1, 32));
+        sb.resize(new Dimension(1, 32));
+        sb.getBounds();
+        sb.bounds();
+        sb.setBounds(10, 10, 10, 10);
+        sb.setBounds(new Rectangle(10, 10, 10, 10));
+        sb.isLightweight();
+        sb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        sb.getCursor();
+        sb.isCursorSet();
+        sb.inside(1, 2);
+        sb.contains(new Point(1, 2));
+        sb.isFocusable();
+        sb.setFocusable(true);
+        sb.setFocusable(false);
+        sb.transferFocus();
+        sb.getFocusCycleRootAncestor();
+        sb.nextFocus();
+        sb.transferFocusUpCycle();
+        sb.hasFocus();
+        sb.isFocusOwner();
+        sb.toString();
+        sb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        sb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        sb.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        sb.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJScrollPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JScrollPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJScrollPane
+ */
+
+public class HeadlessJScrollPane {
+    public static void main(String args[]) {
+        JScrollPane sp = new JScrollPane();
+        sp.getAccessibleContext();
+        sp.isFocusTraversable();
+        sp.setEnabled(false);
+        sp.setEnabled(true);
+        sp.requestFocus();
+        sp.requestFocusInWindow();
+        sp.getPreferredSize();
+        sp.getMaximumSize();
+        sp.getMinimumSize();
+        sp.contains(1, 2);
+        Component c1 = sp.add(new Component(){});
+        Component c2 = sp.add(new Component(){});
+        Component c3 = sp.add(new Component(){});
+        Insets ins = sp.getInsets();
+        sp.getAlignmentY();
+        sp.getAlignmentX();
+        sp.getGraphics();
+        sp.setVisible(false);
+        sp.setVisible(true);
+        sp.setForeground(Color.red);
+        sp.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                sp.setFont(f1);
+                sp.setFont(f2);
+                sp.setFont(f3);
+                sp.setFont(f4);
+
+                sp.getFontMetrics(f1);
+                sp.getFontMetrics(f2);
+                sp.getFontMetrics(f3);
+                sp.getFontMetrics(f4);
+            }
+        }
+        sp.enable();
+        sp.disable();
+        sp.reshape(10, 10, 10, 10);
+        sp.getBounds(new Rectangle(1, 1, 1, 1));
+        sp.getSize(new Dimension(1, 2));
+        sp.getLocation(new Point(1, 2));
+        sp.getX();
+        sp.getY();
+        sp.getWidth();
+        sp.getHeight();
+        sp.isOpaque();
+        sp.isValidateRoot();
+        sp.isOptimizedDrawingEnabled();
+        sp.isDoubleBuffered();
+        sp.getComponentCount();
+        sp.countComponents();
+        sp.getComponent(1);
+        sp.getComponent(2);
+        Component[] cs = sp.getComponents();
+        sp.getLayout();
+        sp.setLayout(new ScrollPaneLayout());
+        sp.doLayout();
+        sp.layout();
+        sp.invalidate();
+        sp.validate();
+        sp.remove(0);
+        sp.remove(c2);
+        sp.removeAll();
+        sp.preferredSize();
+        sp.minimumSize();
+        sp.getComponentAt(1, 2);
+        sp.locate(1, 2);
+        sp.getComponentAt(new Point(1, 2));
+        sp.isFocusCycleRoot(new Container());
+        sp.transferFocusBackward();
+        sp.setName("goober");
+        sp.getName();
+        sp.getParent();
+        sp.getPeer();
+        sp.getGraphicsConfiguration();
+        sp.getTreeLock();
+        sp.getToolkit();
+        sp.isValid();
+        sp.isDisplayable();
+        sp.isVisible();
+        sp.isShowing();
+        sp.isEnabled();
+        sp.enable(false);
+        sp.enable(true);
+        sp.enableInputMethods(false);
+        sp.enableInputMethods(true);
+        sp.show();
+        sp.show(false);
+        sp.show(true);
+        sp.hide();
+        sp.getForeground();
+        sp.isForegroundSet();
+        sp.getBackground();
+        sp.isBackgroundSet();
+        sp.getFont();
+        sp.isFontSet();
+        Container c = new Container();
+        c.add(sp);
+        sp.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            sp.setLocale(locale);
+
+        sp.getColorModel();
+        sp.getLocation();
+
+        boolean exceptions = false;
+        try {
+            sp.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        sp.location();
+        sp.setLocation(1, 2);
+        sp.move(1, 2);
+        sp.setLocation(new Point(1, 2));
+        sp.getSize();
+        sp.size();
+        sp.setSize(1, 32);
+        sp.resize(1, 32);
+        sp.setSize(new Dimension(1, 32));
+        sp.resize(new Dimension(1, 32));
+        sp.getBounds();
+        sp.bounds();
+        sp.setBounds(10, 10, 10, 10);
+        sp.setBounds(new Rectangle(10, 10, 10, 10));
+        sp.isLightweight();
+        sp.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        sp.getCursor();
+        sp.isCursorSet();
+        sp.inside(1, 2);
+        sp.contains(new Point(1, 2));
+        sp.isFocusable();
+        sp.setFocusable(true);
+        sp.setFocusable(false);
+        sp.transferFocus();
+        sp.getFocusCycleRootAncestor();
+        sp.nextFocus();
+        sp.transferFocusUpCycle();
+        sp.hasFocus();
+        sp.isFocusOwner();
+        sp.toString();
+        sp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        sp.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        sp.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        sp.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJSeparator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JSeparator constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJSeparator
+ */
+
+public class HeadlessJSeparator {
+    public static void main(String args[]) {
+        JSeparator sp = new JSeparator();
+        sp.getAccessibleContext();
+        sp.isFocusTraversable();
+        sp.setEnabled(false);
+        sp.setEnabled(true);
+        sp.requestFocus();
+        sp.requestFocusInWindow();
+        sp.getPreferredSize();
+        sp.getMaximumSize();
+        sp.getMinimumSize();
+        sp.contains(1, 2);
+        Component c1 = sp.add(new Component(){});
+        Component c2 = sp.add(new Component(){});
+        Component c3 = sp.add(new Component(){});
+        Insets ins = sp.getInsets();
+        sp.getAlignmentY();
+        sp.getAlignmentX();
+        sp.getGraphics();
+        sp.setVisible(false);
+        sp.setVisible(true);
+        sp.setForeground(Color.red);
+        sp.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                sp.setFont(f1);
+                sp.setFont(f2);
+                sp.setFont(f3);
+                sp.setFont(f4);
+
+                sp.getFontMetrics(f1);
+                sp.getFontMetrics(f2);
+                sp.getFontMetrics(f3);
+                sp.getFontMetrics(f4);
+            }
+        }
+        sp.enable();
+        sp.disable();
+        sp.reshape(10, 10, 10, 10);
+        sp.getBounds(new Rectangle(1, 1, 1, 1));
+        sp.getSize(new Dimension(1, 2));
+        sp.getLocation(new Point(1, 2));
+        sp.getX();
+        sp.getY();
+        sp.getWidth();
+        sp.getHeight();
+        sp.isOpaque();
+        sp.isValidateRoot();
+        sp.isOptimizedDrawingEnabled();
+        sp.isDoubleBuffered();
+        sp.getComponentCount();
+        sp.countComponents();
+        sp.getComponent(1);
+        sp.getComponent(2);
+        Component[] cs = sp.getComponents();
+        sp.getLayout();
+        sp.setLayout(new FlowLayout());
+        sp.doLayout();
+        sp.layout();
+        sp.invalidate();
+        sp.validate();
+        sp.remove(0);
+        sp.remove(c2);
+        sp.removeAll();
+        sp.preferredSize();
+        sp.minimumSize();
+        sp.getComponentAt(1, 2);
+        sp.locate(1, 2);
+        sp.getComponentAt(new Point(1, 2));
+        sp.isFocusCycleRoot(new Container());
+        sp.transferFocusBackward();
+        sp.setName("goober");
+        sp.getName();
+        sp.getParent();
+        sp.getPeer();
+        sp.getGraphicsConfiguration();
+        sp.getTreeLock();
+        sp.getToolkit();
+        sp.isValid();
+        sp.isDisplayable();
+        sp.isVisible();
+        sp.isShowing();
+        sp.isEnabled();
+        sp.enable(false);
+        sp.enable(true);
+        sp.enableInputMethods(false);
+        sp.enableInputMethods(true);
+        sp.show();
+        sp.show(false);
+        sp.show(true);
+        sp.hide();
+        sp.getForeground();
+        sp.isForegroundSet();
+        sp.getBackground();
+        sp.isBackgroundSet();
+        sp.getFont();
+        sp.isFontSet();
+        Container c = new Container();
+        c.add(sp);
+        sp.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            sp.setLocale(locale);
+
+        sp.getColorModel();
+        sp.getLocation();
+
+        boolean exceptions = false;
+        try {
+            sp.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        sp.location();
+        sp.setLocation(1, 2);
+        sp.move(1, 2);
+        sp.setLocation(new Point(1, 2));
+        sp.getSize();
+        sp.size();
+        sp.setSize(1, 32);
+        sp.resize(1, 32);
+        sp.setSize(new Dimension(1, 32));
+        sp.resize(new Dimension(1, 32));
+        sp.getBounds();
+        sp.bounds();
+        sp.setBounds(10, 10, 10, 10);
+        sp.setBounds(new Rectangle(10, 10, 10, 10));
+        sp.isLightweight();
+        sp.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        sp.getCursor();
+        sp.isCursorSet();
+        sp.inside(1, 2);
+        sp.contains(new Point(1, 2));
+        sp.isFocusable();
+        sp.setFocusable(true);
+        sp.setFocusable(false);
+        sp.transferFocus();
+        sp.getFocusCycleRootAncestor();
+        sp.nextFocus();
+        sp.transferFocusUpCycle();
+        sp.hasFocus();
+        sp.isFocusOwner();
+        sp.toString();
+        sp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        sp.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        sp.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        sp.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJSlider.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JSlider constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJSlider
+ */
+
+public class HeadlessJSlider {
+    public static void main(String args[]) {
+        JSlider s = new JSlider();
+        s.getAccessibleContext();
+        s.isFocusTraversable();
+        s.setEnabled(false);
+        s.setEnabled(true);
+        s.requestFocus();
+        s.requestFocusInWindow();
+        s.getPreferredSize();
+        s.getMaximumSize();
+        s.getMinimumSize();
+        s.contains(1, 2);
+        Component c1 = s.add(new Component(){});
+        Component c2 = s.add(new Component(){});
+        Component c3 = s.add(new Component(){});
+        Insets ins = s.getInsets();
+        s.getAlignmentY();
+        s.getAlignmentX();
+        s.getGraphics();
+        s.setVisible(false);
+        s.setVisible(true);
+        s.setForeground(Color.red);
+        s.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                s.setFont(f1);
+                s.setFont(f2);
+                s.setFont(f3);
+                s.setFont(f4);
+
+                s.getFontMetrics(f1);
+                s.getFontMetrics(f2);
+                s.getFontMetrics(f3);
+                s.getFontMetrics(f4);
+            }
+        }
+        s.enable();
+        s.disable();
+        s.reshape(10, 10, 10, 10);
+        s.getBounds(new Rectangle(1, 1, 1, 1));
+        s.getSize(new Dimension(1, 2));
+        s.getLocation(new Point(1, 2));
+        s.getX();
+        s.getY();
+        s.getWidth();
+        s.getHeight();
+        s.isOpaque();
+        s.isValidateRoot();
+        s.isOptimizedDrawingEnabled();
+        s.isDoubleBuffered();
+        s.getComponentCount();
+        s.countComponents();
+        s.getComponent(1);
+        s.getComponent(2);
+        Component[] cs = s.getComponents();
+        s.getLayout();
+        s.setLayout(new FlowLayout());
+        s.doLayout();
+        s.layout();
+        s.invalidate();
+        s.validate();
+        s.remove(0);
+        s.remove(c2);
+        s.removeAll();
+        s.preferredSize();
+        s.minimumSize();
+        s.getComponentAt(1, 2);
+        s.locate(1, 2);
+        s.getComponentAt(new Point(1, 2));
+        s.isFocusCycleRoot(new Container());
+        s.transferFocusBackward();
+        s.setName("goober");
+        s.getName();
+        s.getParent();
+        s.getPeer();
+        s.getGraphicsConfiguration();
+        s.getTreeLock();
+        s.getToolkit();
+        s.isValid();
+        s.isDisplayable();
+        s.isVisible();
+        s.isShowing();
+        s.isEnabled();
+        s.enable(false);
+        s.enable(true);
+        s.enableInputMethods(false);
+        s.enableInputMethods(true);
+        s.show();
+        s.show(false);
+        s.show(true);
+        s.hide();
+        s.getForeground();
+        s.isForegroundSet();
+        s.getBackground();
+        s.isBackgroundSet();
+        s.getFont();
+        s.isFontSet();
+        Container c = new Container();
+        c.add(s);
+        s.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            s.setLocale(locale);
+
+        s.getColorModel();
+        s.getLocation();
+
+        boolean exceptions = false;
+        try {
+            s.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        s.location();
+        s.setLocation(1, 2);
+        s.move(1, 2);
+        s.setLocation(new Point(1, 2));
+        s.getSize();
+        s.size();
+        s.setSize(1, 32);
+        s.resize(1, 32);
+        s.setSize(new Dimension(1, 32));
+        s.resize(new Dimension(1, 32));
+        s.getBounds();
+        s.bounds();
+        s.setBounds(10, 10, 10, 10);
+        s.setBounds(new Rectangle(10, 10, 10, 10));
+        s.isLightweight();
+        s.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        s.getCursor();
+        s.isCursorSet();
+        s.inside(1, 2);
+        s.contains(new Point(1, 2));
+        s.isFocusable();
+        s.setFocusable(true);
+        s.setFocusable(false);
+        s.transferFocus();
+        s.getFocusCycleRootAncestor();
+        s.nextFocus();
+        s.transferFocusUpCycle();
+        s.hasFocus();
+        s.isFocusOwner();
+        s.toString();
+        s.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        s.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        s.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        s.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJSpinner.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JSpinner constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJSpinner
+ */
+
+public class HeadlessJSpinner {
+    public static void main(String args[]) {
+        JSpinner s = new JSpinner();
+        s.getAccessibleContext();
+        s.isFocusTraversable();
+        s.setEnabled(false);
+        s.setEnabled(true);
+        s.requestFocus();
+        s.requestFocusInWindow();
+        s.getPreferredSize();
+        s.getMaximumSize();
+        s.getMinimumSize();
+        s.contains(1, 2);
+        Component c1 = s.add(new Component(){});
+        Component c2 = s.add(new Component(){});
+        Component c3 = s.add(new Component(){});
+        Insets ins = s.getInsets();
+        s.getAlignmentY();
+        s.getAlignmentX();
+        s.getGraphics();
+        s.setVisible(false);
+        s.setVisible(true);
+        s.setForeground(Color.red);
+        s.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                s.setFont(f1);
+                s.setFont(f2);
+                s.setFont(f3);
+                s.setFont(f4);
+
+                s.getFontMetrics(f1);
+                s.getFontMetrics(f2);
+                s.getFontMetrics(f3);
+                s.getFontMetrics(f4);
+            }
+        }
+        s.enable();
+        s.disable();
+        s.reshape(10, 10, 10, 10);
+        s.getBounds(new Rectangle(1, 1, 1, 1));
+        s.getSize(new Dimension(1, 2));
+        s.getLocation(new Point(1, 2));
+        s.getX();
+        s.getY();
+        s.getWidth();
+        s.getHeight();
+        s.isOpaque();
+        s.isValidateRoot();
+        s.isOptimizedDrawingEnabled();
+        s.isDoubleBuffered();
+        s.getComponentCount();
+        s.countComponents();
+        s.getComponent(1);
+        s.getComponent(2);
+        Component[] cs = s.getComponents();
+        s.getLayout();
+        s.setLayout(new FlowLayout());
+        s.doLayout();
+        s.layout();
+        s.invalidate();
+        s.validate();
+        s.remove(0);
+        s.remove(c2);
+        s.removeAll();
+        s.preferredSize();
+        s.minimumSize();
+        s.getComponentAt(1, 2);
+        s.locate(1, 2);
+        s.getComponentAt(new Point(1, 2));
+        s.isFocusCycleRoot(new Container());
+        s.transferFocusBackward();
+        s.setName("goober");
+        s.getName();
+        s.getParent();
+        s.getPeer();
+        s.getGraphicsConfiguration();
+        s.getTreeLock();
+        s.getToolkit();
+        s.isValid();
+        s.isDisplayable();
+        s.isVisible();
+        s.isShowing();
+        s.isEnabled();
+        s.enable(false);
+        s.enable(true);
+        s.enableInputMethods(false);
+        s.enableInputMethods(true);
+        s.show();
+        s.show(false);
+        s.show(true);
+        s.hide();
+        s.getForeground();
+        s.isForegroundSet();
+        s.getBackground();
+        s.isBackgroundSet();
+        s.getFont();
+        s.isFontSet();
+        Container c = new Container();
+        c.add(s);
+        s.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            s.setLocale(locale);
+
+        s.getColorModel();
+        s.getLocation();
+
+        boolean exceptions = false;
+        try {
+            s.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        s.location();
+        s.setLocation(1, 2);
+        s.move(1, 2);
+        s.setLocation(new Point(1, 2));
+        s.getSize();
+        s.size();
+        s.setSize(1, 32);
+        s.resize(1, 32);
+        s.setSize(new Dimension(1, 32));
+        s.resize(new Dimension(1, 32));
+        s.getBounds();
+        s.bounds();
+        s.setBounds(10, 10, 10, 10);
+        s.setBounds(new Rectangle(10, 10, 10, 10));
+        s.isLightweight();
+        s.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        s.getCursor();
+        s.isCursorSet();
+        s.inside(1, 2);
+        s.contains(new Point(1, 2));
+        s.isFocusable();
+        s.setFocusable(true);
+        s.setFocusable(false);
+        s.transferFocus();
+        s.getFocusCycleRootAncestor();
+        s.nextFocus();
+        s.transferFocusUpCycle();
+        s.hasFocus();
+        s.isFocusOwner();
+        s.toString();
+        s.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        s.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        s.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        s.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJSplitPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JSplitPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJSplitPane
+ */
+
+public class HeadlessJSplitPane {
+    public static void main(String args[]) {
+        JSplitPane s = new JSplitPane();
+        s.getAccessibleContext();
+        s.isFocusTraversable();
+        s.setEnabled(false);
+        s.setEnabled(true);
+        s.requestFocus();
+        s.requestFocusInWindow();
+        s.getPreferredSize();
+        s.getMaximumSize();
+        s.getMinimumSize();
+        s.contains(1, 2);
+        Insets ins = s.getInsets();
+        s.getAlignmentY();
+        s.getAlignmentX();
+        s.getGraphics();
+        s.setVisible(false);
+        s.setVisible(true);
+        s.setForeground(Color.red);
+        s.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                s.setFont(f1);
+                s.setFont(f2);
+                s.setFont(f3);
+                s.setFont(f4);
+
+                s.getFontMetrics(f1);
+                s.getFontMetrics(f2);
+                s.getFontMetrics(f3);
+                s.getFontMetrics(f4);
+            }
+        }
+        s.enable();
+        s.disable();
+        s.reshape(10, 10, 10, 10);
+        s.getBounds(new Rectangle(1, 1, 1, 1));
+        s.getSize(new Dimension(1, 2));
+        s.getLocation(new Point(1, 2));
+        s.getX();
+        s.getY();
+        s.getWidth();
+        s.getHeight();
+        s.isOpaque();
+        s.isValidateRoot();
+        s.isOptimizedDrawingEnabled();
+        s.isDoubleBuffered();
+        s.getComponentCount();
+        s.countComponents();
+        s.getComponent(1);
+        s.getComponent(2);
+        Component[] cs = s.getComponents();
+        s.getLayout();
+        s.setLayout(new FlowLayout());
+        s.doLayout();
+        s.layout();
+        s.invalidate();
+        s.validate();
+        s.preferredSize();
+        s.minimumSize();
+        s.getComponentAt(1, 2);
+        s.locate(1, 2);
+        s.getComponentAt(new Point(1, 2));
+        s.isFocusCycleRoot(new Container());
+        s.transferFocusBackward();
+        s.setName("goober");
+        s.getName();
+        s.getParent();
+        s.getPeer();
+        s.getGraphicsConfiguration();
+        s.getTreeLock();
+        s.getToolkit();
+        s.isValid();
+        s.isDisplayable();
+        s.isVisible();
+        s.isShowing();
+        s.isEnabled();
+        s.enable(false);
+        s.enable(true);
+        s.enableInputMethods(false);
+        s.enableInputMethods(true);
+        s.show();
+        s.show(false);
+        s.show(true);
+        s.hide();
+        s.getForeground();
+        s.isForegroundSet();
+        s.getBackground();
+        s.isBackgroundSet();
+        s.getFont();
+        s.isFontSet();
+        Container c = new Container();
+        c.add(s);
+        s.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            s.setLocale(locale);
+
+        s.getColorModel();
+        s.getLocation();
+
+        boolean exceptions = false;
+        try {
+            s.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        s.location();
+        s.setLocation(1, 2);
+        s.move(1, 2);
+        s.setLocation(new Point(1, 2));
+        s.getSize();
+        s.size();
+        s.setSize(1, 32);
+        s.resize(1, 32);
+        s.setSize(new Dimension(1, 32));
+        s.resize(new Dimension(1, 32));
+        s.getBounds();
+        s.bounds();
+        s.setBounds(10, 10, 10, 10);
+        s.setBounds(new Rectangle(10, 10, 10, 10));
+        s.isLightweight();
+        s.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        s.getCursor();
+        s.isCursorSet();
+        s.inside(1, 2);
+        s.contains(new Point(1, 2));
+        s.isFocusable();
+        s.setFocusable(true);
+        s.setFocusable(false);
+        s.transferFocus();
+        s.getFocusCycleRootAncestor();
+        s.nextFocus();
+        s.transferFocusUpCycle();
+        s.hasFocus();
+        s.isFocusOwner();
+        s.toString();
+        s.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        s.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        s.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        s.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJTabbedPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JTabbedPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJTabbedPane
+ */
+
+public class HeadlessJTabbedPane {
+    public static void main(String args[]) {
+        JTabbedPane s = new JTabbedPane();
+        s.getAccessibleContext();
+        s.isFocusTraversable();
+        s.setEnabled(false);
+        s.setEnabled(true);
+        s.requestFocus();
+        s.requestFocusInWindow();
+        s.getPreferredSize();
+        s.getMaximumSize();
+        s.getMinimumSize();
+        s.contains(1, 2);
+        Component c1 = s.add(new Component(){});
+        Component c2 = s.add(new Component(){});
+        Component c3 = s.add(new Component(){});
+        Insets ins = s.getInsets();
+        s.getAlignmentY();
+        s.getAlignmentX();
+        s.getGraphics();
+        s.setVisible(false);
+        s.setVisible(true);
+        s.setForeground(Color.red);
+        s.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                s.setFont(f1);
+                s.setFont(f2);
+                s.setFont(f3);
+                s.setFont(f4);
+
+                s.getFontMetrics(f1);
+                s.getFontMetrics(f2);
+                s.getFontMetrics(f3);
+                s.getFontMetrics(f4);
+            }
+        }
+        s.enable();
+        s.disable();
+        s.reshape(10, 10, 10, 10);
+        s.getBounds(new Rectangle(1, 1, 1, 1));
+        s.getSize(new Dimension(1, 2));
+        s.getLocation(new Point(1, 2));
+        s.getX();
+        s.getY();
+        s.getWidth();
+        s.getHeight();
+        s.isOpaque();
+        s.isValidateRoot();
+        s.isOptimizedDrawingEnabled();
+        s.isDoubleBuffered();
+        s.getComponentCount();
+        s.countComponents();
+        s.getComponent(1);
+        s.getComponent(2);
+        Component[] cs = s.getComponents();
+        s.getLayout();
+        s.setLayout(new FlowLayout());
+        s.doLayout();
+        s.layout();
+        s.invalidate();
+        s.validate();
+        s.remove(0);
+        s.remove(c2);
+        s.removeAll();
+        s.preferredSize();
+        s.minimumSize();
+        s.getComponentAt(1, 2);
+        s.locate(1, 2);
+        s.getComponentAt(new Point(1, 2));
+        s.isFocusCycleRoot(new Container());
+        s.transferFocusBackward();
+        s.setName("goober");
+        s.getName();
+        s.getParent();
+        s.getPeer();
+        s.getGraphicsConfiguration();
+        s.getTreeLock();
+        s.getToolkit();
+        s.isValid();
+        s.isDisplayable();
+        s.isVisible();
+        s.isShowing();
+        s.isEnabled();
+        s.enable(false);
+        s.enable(true);
+        s.enableInputMethods(false);
+        s.enableInputMethods(true);
+        s.show();
+        s.show(false);
+        s.show(true);
+        s.hide();
+        s.getForeground();
+        s.isForegroundSet();
+        s.getBackground();
+        s.isBackgroundSet();
+        s.getFont();
+        s.isFontSet();
+        Container c = new Container();
+        c.add(s);
+        s.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            s.setLocale(locale);
+
+        s.getColorModel();
+        s.getLocation();
+
+        boolean exceptions = false;
+        try {
+            s.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        s.location();
+        s.setLocation(1, 2);
+        s.move(1, 2);
+        s.setLocation(new Point(1, 2));
+        s.getSize();
+        s.size();
+        s.setSize(1, 32);
+        s.resize(1, 32);
+        s.setSize(new Dimension(1, 32));
+        s.resize(new Dimension(1, 32));
+        s.getBounds();
+        s.bounds();
+        s.setBounds(10, 10, 10, 10);
+        s.setBounds(new Rectangle(10, 10, 10, 10));
+        s.isLightweight();
+        s.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        s.getCursor();
+        s.isCursorSet();
+        s.inside(1, 2);
+        s.contains(new Point(1, 2));
+        s.isFocusable();
+        s.setFocusable(true);
+        s.setFocusable(false);
+        s.transferFocus();
+        s.getFocusCycleRootAncestor();
+        s.nextFocus();
+        s.transferFocusUpCycle();
+        s.hasFocus();
+        s.isFocusOwner();
+        s.toString();
+        s.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        s.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        s.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        s.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJTable.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JTable constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJTable
+ */
+
+public class HeadlessJTable {
+    public static void main(String args[]) {
+        JTable t;
+        t = new JTable();
+        final Object[][] data = {
+                {"cell_1_1", "cell_1_2", "cell_1_3"},
+                {"cell_2_1", "cell_2_2", "cell_2_3"},
+                {"cell_3_1", "cell_3_2", "cell_3_3"},
+                {"cell_4_1", "cell_4_2", "cell_4_3"},
+        };
+
+        TableModel dataModel = new AbstractTableModel() {
+            public int getColumnCount() { return 3; }
+            public int getRowCount() { return data.length;}
+            public Object getValueAt(int row, int col) {return data[row][col];}
+        };
+        t = new JTable(dataModel);
+
+        t.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
+        t.getAutoResizeMode();
+        t.getColumnModel().getColumn(1).setMinWidth(5);
+        t.getTableHeader().setReorderingAllowed(false);
+        t.getTableHeader().setResizingAllowed(false);
+
+        t.getAccessibleContext();
+        t.isFocusTraversable();
+        t.setEnabled(false);
+        t.setEnabled(true);
+        t.requestFocus();
+        t.requestFocusInWindow();
+        t.getPreferredSize();
+        t.getMaximumSize();
+        t.getMinimumSize();
+        t.contains(1, 2);
+        Component c1 = t.add(new Component(){});
+        Component c2 = t.add(new Component(){});
+        Component c3 = t.add(new Component(){});
+        Insets ins = t.getInsets();
+        t.getAlignmentY();
+        t.getAlignmentX();
+        t.getGraphics();
+        t.setVisible(false);
+        t.setVisible(true);
+        t.setForeground(Color.red);
+        t.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                t.setFont(f1);
+                t.setFont(f2);
+                t.setFont(f3);
+                t.setFont(f4);
+
+                t.getFontMetrics(f1);
+                t.getFontMetrics(f2);
+                t.getFontMetrics(f3);
+                t.getFontMetrics(f4);
+            }
+        }
+        t.enable();
+        t.disable();
+        t.reshape(10, 10, 10, 10);
+        t.getBounds(new Rectangle(1, 1, 1, 1));
+        t.getSize(new Dimension(1, 2));
+        t.getLocation(new Point(1, 2));
+        t.getX();
+        t.getY();
+        t.getWidth();
+        t.getHeight();
+        t.isOpaque();
+        t.isValidateRoot();
+        t.isOptimizedDrawingEnabled();
+        t.isDoubleBuffered();
+        t.getComponentCount();
+        t.countComponents();
+        t.getComponent(1);
+        t.getComponent(2);
+        Component[] cs = t.getComponents();
+        t.getLayout();
+        t.setLayout(new FlowLayout());
+        t.doLayout();
+        t.layout();
+        t.invalidate();
+        t.validate();
+        t.remove(0);
+        t.remove(c2);
+        t.removeAll();
+        t.preferredSize();
+        t.minimumSize();
+        t.getComponentAt(1, 2);
+        t.locate(1, 2);
+        t.getComponentAt(new Point(1, 2));
+        t.isFocusCycleRoot(new Container());
+        t.transferFocusBackward();
+        t.setName("goober");
+        t.getName();
+        t.getParent();
+        t.getPeer();
+        t.getGraphicsConfiguration();
+        t.getTreeLock();
+        t.getToolkit();
+        t.isValid();
+        t.isDisplayable();
+        t.isVisible();
+        t.isShowing();
+        t.isEnabled();
+        t.enable(false);
+        t.enable(true);
+        t.enableInputMethods(false);
+        t.enableInputMethods(true);
+        t.show();
+        t.show(false);
+        t.show(true);
+        t.hide();
+        t.getForeground();
+        t.isForegroundSet();
+        t.getBackground();
+        t.isBackgroundSet();
+        t.getFont();
+        t.isFontSet();
+        Container c = new Container();
+        c.add(t);
+        t.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            t.setLocale(locale);
+
+        t.getColorModel();
+        t.getLocation();
+
+        boolean exceptions = false;
+        try {
+            t.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        t.location();
+        t.setLocation(1, 2);
+        t.move(1, 2);
+        t.setLocation(new Point(1, 2));
+        t.getSize();
+        t.size();
+        t.setSize(1, 32);
+        t.resize(1, 32);
+        t.setSize(new Dimension(1, 32));
+        t.resize(new Dimension(1, 32));
+        t.getBounds();
+        t.bounds();
+        t.setBounds(10, 10, 10, 10);
+        t.setBounds(new Rectangle(10, 10, 10, 10));
+        t.isLightweight();
+        t.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        t.getCursor();
+        t.isCursorSet();
+        t.inside(1, 2);
+        t.contains(new Point(1, 2));
+        t.isFocusable();
+        t.setFocusable(true);
+        t.setFocusable(false);
+        t.transferFocus();
+        t.getFocusCycleRootAncestor();
+        t.nextFocus();
+        t.transferFocusUpCycle();
+        t.hasFocus();
+        t.isFocusOwner();
+        t.toString();
+        t.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        t.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        t.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        t.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJTextArea.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JTextArea constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJTextArea
+ */
+
+public class HeadlessJTextArea {
+    public static void main(String args[]) {
+        JTextArea t = new JTextArea();
+        t.selectAll();
+        t.getSelectionStart();
+        t.getSelectionEnd();
+
+        t.getAccessibleContext();
+        t.isFocusTraversable();
+        t.setEnabled(false);
+        t.setEnabled(true);
+        t.requestFocus();
+        t.requestFocusInWindow();
+        t.getPreferredSize();
+        t.getMaximumSize();
+        t.getMinimumSize();
+        t.contains(1, 2);
+        Component c1 = t.add(new Component(){});
+        Component c2 = t.add(new Component(){});
+        Component c3 = t.add(new Component(){});
+        Insets ins = t.getInsets();
+        t.getAlignmentY();
+        t.getAlignmentX();
+        t.getGraphics();
+        t.setVisible(false);
+        t.setVisible(true);
+        t.setForeground(Color.red);
+        t.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                t.setFont(f1);
+                t.setFont(f2);
+                t.setFont(f3);
+                t.setFont(f4);
+
+                t.getFontMetrics(f1);
+                t.getFontMetrics(f2);
+                t.getFontMetrics(f3);
+                t.getFontMetrics(f4);
+            }
+        }
+        t.enable();
+        t.disable();
+        t.reshape(10, 10, 10, 10);
+        t.getBounds(new Rectangle(1, 1, 1, 1));
+        t.getSize(new Dimension(1, 2));
+        t.getLocation(new Point(1, 2));
+        t.getX();
+        t.getY();
+        t.getWidth();
+        t.getHeight();
+        t.isOpaque();
+        t.isValidateRoot();
+        t.isOptimizedDrawingEnabled();
+        t.isDoubleBuffered();
+        t.getComponentCount();
+        t.countComponents();
+        t.getComponent(1);
+        t.getComponent(2);
+        Component[] cs = t.getComponents();
+        t.getLayout();
+        t.setLayout(new FlowLayout());
+        t.doLayout();
+        t.layout();
+        t.invalidate();
+        t.validate();
+        t.remove(0);
+        t.remove(c2);
+        t.removeAll();
+        t.preferredSize();
+        t.minimumSize();
+        t.getComponentAt(1, 2);
+        t.locate(1, 2);
+        t.getComponentAt(new Point(1, 2));
+        t.isFocusCycleRoot(new Container());
+        t.transferFocusBackward();
+        t.setName("goober");
+        t.getName();
+        t.getParent();
+        t.getPeer();
+        t.getGraphicsConfiguration();
+        t.getTreeLock();
+        t.getToolkit();
+        t.isValid();
+        t.isDisplayable();
+        t.isVisible();
+        t.isShowing();
+        t.isEnabled();
+        t.enable(false);
+        t.enable(true);
+        t.enableInputMethods(false);
+        t.enableInputMethods(true);
+        t.show();
+        t.show(false);
+        t.show(true);
+        t.hide();
+        t.getForeground();
+        t.isForegroundSet();
+        t.getBackground();
+        t.isBackgroundSet();
+        t.getFont();
+        t.isFontSet();
+        Container c = new Container();
+        c.add(t);
+        t.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            t.setLocale(locale);
+
+        t.getColorModel();
+        t.getLocation();
+
+        boolean exceptions = false;
+        try {
+            t.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        t.location();
+        t.setLocation(1, 2);
+        t.move(1, 2);
+        t.setLocation(new Point(1, 2));
+        t.getSize();
+        t.size();
+        t.setSize(1, 32);
+        t.resize(1, 32);
+        t.setSize(new Dimension(1, 32));
+        t.resize(new Dimension(1, 32));
+        t.getBounds();
+        t.bounds();
+        t.setBounds(10, 10, 10, 10);
+        t.setBounds(new Rectangle(10, 10, 10, 10));
+        t.isLightweight();
+        t.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        t.getCursor();
+        t.isCursorSet();
+        t.inside(1, 2);
+        t.contains(new Point(1, 2));
+        t.isFocusable();
+        t.setFocusable(true);
+        t.setFocusable(false);
+        t.transferFocus();
+        t.getFocusCycleRootAncestor();
+        t.nextFocus();
+        t.transferFocusUpCycle();
+        t.hasFocus();
+        t.isFocusOwner();
+        t.toString();
+        t.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        t.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        t.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        t.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJTextField.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JTextField constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJTextField
+ */
+
+public class HeadlessJTextField {
+    public static void main(String args[]) {
+        JTextField t = new JTextField();
+        t.selectAll();
+        t.getSelectionStart();
+        t.getSelectionEnd();
+
+        t.getAccessibleContext();
+        t.isFocusTraversable();
+        t.setEnabled(false);
+        t.setEnabled(true);
+        t.requestFocus();
+        t.requestFocusInWindow();
+        t.getPreferredSize();
+        t.getMaximumSize();
+        t.getMinimumSize();
+        t.contains(1, 2);
+        Component c1 = t.add(new Component(){});
+        Component c2 = t.add(new Component(){});
+        Component c3 = t.add(new Component(){});
+        Insets ins = t.getInsets();
+        t.getAlignmentY();
+        t.getAlignmentX();
+        t.getGraphics();
+        t.setVisible(false);
+        t.setVisible(true);
+        t.setForeground(Color.red);
+        t.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                t.setFont(f1);
+                t.setFont(f2);
+                t.setFont(f3);
+                t.setFont(f4);
+
+                t.getFontMetrics(f1);
+                t.getFontMetrics(f2);
+                t.getFontMetrics(f3);
+                t.getFontMetrics(f4);
+            }
+        }
+        t.enable();
+        t.disable();
+        t.reshape(10, 10, 10, 10);
+        t.getBounds(new Rectangle(1, 1, 1, 1));
+        t.getSize(new Dimension(1, 2));
+        t.getLocation(new Point(1, 2));
+        t.getX();
+        t.getY();
+        t.getWidth();
+        t.getHeight();
+        t.isOpaque();
+        t.isValidateRoot();
+        t.isOptimizedDrawingEnabled();
+        t.isDoubleBuffered();
+        t.getComponentCount();
+        t.countComponents();
+        t.getComponent(1);
+        t.getComponent(2);
+        Component[] cs = t.getComponents();
+        t.getLayout();
+        t.setLayout(new FlowLayout());
+        t.doLayout();
+        t.layout();
+        t.invalidate();
+        t.validate();
+        t.remove(0);
+        t.remove(c2);
+        t.removeAll();
+        t.preferredSize();
+        t.minimumSize();
+        t.getComponentAt(1, 2);
+        t.locate(1, 2);
+        t.getComponentAt(new Point(1, 2));
+        t.isFocusCycleRoot(new Container());
+        t.transferFocusBackward();
+        t.setName("goober");
+        t.getName();
+        t.getParent();
+        t.getPeer();
+        t.getGraphicsConfiguration();
+        t.getTreeLock();
+        t.getToolkit();
+        t.isValid();
+        t.isDisplayable();
+        t.isVisible();
+        t.isShowing();
+        t.isEnabled();
+        t.enable(false);
+        t.enable(true);
+        t.enableInputMethods(false);
+        t.enableInputMethods(true);
+        t.show();
+        t.show(false);
+        t.show(true);
+        t.hide();
+        t.getForeground();
+        t.isForegroundSet();
+        t.getBackground();
+        t.isBackgroundSet();
+        t.getFont();
+        t.isFontSet();
+        Container c = new Container();
+        c.add(t);
+        t.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            t.setLocale(locale);
+
+        t.getColorModel();
+        t.getLocation();
+
+        boolean exceptions = false;
+        try {
+            t.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        t.location();
+        t.setLocation(1, 2);
+        t.move(1, 2);
+        t.setLocation(new Point(1, 2));
+        t.getSize();
+        t.size();
+        t.setSize(1, 32);
+        t.resize(1, 32);
+        t.setSize(new Dimension(1, 32));
+        t.resize(new Dimension(1, 32));
+        t.getBounds();
+        t.bounds();
+        t.setBounds(10, 10, 10, 10);
+        t.setBounds(new Rectangle(10, 10, 10, 10));
+        t.isLightweight();
+        t.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        t.getCursor();
+        t.isCursorSet();
+        t.inside(1, 2);
+        t.contains(new Point(1, 2));
+        t.isFocusable();
+        t.setFocusable(true);
+        t.setFocusable(false);
+        t.transferFocus();
+        t.getFocusCycleRootAncestor();
+        t.nextFocus();
+        t.transferFocusUpCycle();
+        t.hasFocus();
+        t.isFocusOwner();
+        t.toString();
+        t.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        t.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        t.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        t.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJTextPane.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that JTextPane constructor and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJTextPane
+ */
+
+public class HeadlessJTextPane {
+
+    public static void main(String args[]) {
+        JTextPane tp;
+        tp = new JTextPane();
+        tp.getEditorKit();
+        tp.setContentType("text/html");
+        tp.getContentType();
+        tp.setText("Merry Parrot");
+        tp.getText();
+        tp.getDocument();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJToggleButton.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JToggleButton constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJToggleButton
+ */
+
+public class HeadlessJToggleButton {
+    public static void main(String args[]) {
+        JToggleButton tb = new JToggleButton();
+        tb.getAccessibleContext();
+        tb.isFocusTraversable();
+        tb.setEnabled(false);
+        tb.setEnabled(true);
+        tb.requestFocus();
+        tb.requestFocusInWindow();
+        tb.getPreferredSize();
+        tb.getMaximumSize();
+        tb.getMinimumSize();
+        tb.contains(1, 2);
+        Component c1 = tb.add(new Component(){});
+        Component c2 = tb.add(new Component(){});
+        Component c3 = tb.add(new Component(){});
+        Insets ins = tb.getInsets();
+        tb.getAlignmentY();
+        tb.getAlignmentX();
+        tb.getGraphics();
+        tb.setVisible(false);
+        tb.setVisible(true);
+        tb.setForeground(Color.red);
+        tb.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                tb.setFont(f1);
+                tb.setFont(f2);
+                tb.setFont(f3);
+                tb.setFont(f4);
+
+                tb.getFontMetrics(f1);
+                tb.getFontMetrics(f2);
+                tb.getFontMetrics(f3);
+                tb.getFontMetrics(f4);
+            }
+        }
+        tb.enable();
+        tb.disable();
+        tb.reshape(10, 10, 10, 10);
+        tb.getBounds(new Rectangle(1, 1, 1, 1));
+        tb.getSize(new Dimension(1, 2));
+        tb.getLocation(new Point(1, 2));
+        tb.getX();
+        tb.getY();
+        tb.getWidth();
+        tb.getHeight();
+        tb.isOpaque();
+        tb.isValidateRoot();
+        tb.isOptimizedDrawingEnabled();
+        tb.isDoubleBuffered();
+        tb.getComponentCount();
+        tb.countComponents();
+        tb.getComponent(1);
+        tb.getComponent(2);
+        Component[] cs = tb.getComponents();
+        tb.getLayout();
+        tb.setLayout(new FlowLayout());
+        tb.doLayout();
+        tb.layout();
+        tb.invalidate();
+        tb.validate();
+        tb.remove(0);
+        tb.remove(c2);
+        tb.removeAll();
+        tb.preferredSize();
+        tb.minimumSize();
+        tb.getComponentAt(1, 2);
+        tb.locate(1, 2);
+        tb.getComponentAt(new Point(1, 2));
+        tb.isFocusCycleRoot(new Container());
+        tb.transferFocusBackward();
+        tb.setName("goober");
+        tb.getName();
+        tb.getParent();
+        tb.getPeer();
+        tb.getGraphicsConfiguration();
+        tb.getTreeLock();
+        tb.getToolkit();
+        tb.isValid();
+        tb.isDisplayable();
+        tb.isVisible();
+        tb.isShowing();
+        tb.isEnabled();
+        tb.enable(false);
+        tb.enable(true);
+        tb.enableInputMethods(false);
+        tb.enableInputMethods(true);
+        tb.show();
+        tb.show(false);
+        tb.show(true);
+        tb.hide();
+        tb.getForeground();
+        tb.isForegroundSet();
+        tb.getBackground();
+        tb.isBackgroundSet();
+        tb.getFont();
+        tb.isFontSet();
+        Container c = new Container();
+        c.add(tb);
+        tb.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            tb.setLocale(locale);
+
+        tb.getColorModel();
+        tb.getLocation();
+
+        boolean exceptions = false;
+        try {
+            tb.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        tb.location();
+        tb.setLocation(1, 2);
+        tb.move(1, 2);
+        tb.setLocation(new Point(1, 2));
+        tb.getSize();
+        tb.size();
+        tb.setSize(1, 32);
+        tb.resize(1, 32);
+        tb.setSize(new Dimension(1, 32));
+        tb.resize(new Dimension(1, 32));
+        tb.getBounds();
+        tb.bounds();
+        tb.setBounds(10, 10, 10, 10);
+        tb.setBounds(new Rectangle(10, 10, 10, 10));
+        tb.isLightweight();
+        tb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        tb.getCursor();
+        tb.isCursorSet();
+        tb.inside(1, 2);
+        tb.contains(new Point(1, 2));
+        tb.isFocusable();
+        tb.setFocusable(true);
+        tb.setFocusable(false);
+        tb.transferFocus();
+        tb.getFocusCycleRootAncestor();
+        tb.nextFocus();
+        tb.transferFocusUpCycle();
+        tb.hasFocus();
+        tb.isFocusOwner();
+        tb.toString();
+        tb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        tb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        tb.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        tb.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJToolBar.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JToolBar constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJToolBar
+ */
+
+public class HeadlessJToolBar {
+    public static void main(String args[]) {
+        JToolBar tb = new JToolBar();
+        tb.getAccessibleContext();
+        tb.isFocusTraversable();
+        tb.setEnabled(false);
+        tb.setEnabled(true);
+        tb.requestFocus();
+        tb.requestFocusInWindow();
+        tb.getPreferredSize();
+        tb.getMaximumSize();
+        tb.getMinimumSize();
+        tb.contains(1, 2);
+        Component c1 = tb.add(new Component(){});
+        Component c2 = tb.add(new Component(){});
+        Component c3 = tb.add(new Component(){});
+        Insets ins = tb.getInsets();
+        tb.getAlignmentY();
+        tb.getAlignmentX();
+        tb.getGraphics();
+        tb.setVisible(false);
+        tb.setVisible(true);
+        tb.setForeground(Color.red);
+        tb.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                tb.setFont(f1);
+                tb.setFont(f2);
+                tb.setFont(f3);
+                tb.setFont(f4);
+
+                tb.getFontMetrics(f1);
+                tb.getFontMetrics(f2);
+                tb.getFontMetrics(f3);
+                tb.getFontMetrics(f4);
+            }
+        }
+        tb.enable();
+        tb.disable();
+        tb.reshape(10, 10, 10, 10);
+        tb.getBounds(new Rectangle(1, 1, 1, 1));
+        tb.getSize(new Dimension(1, 2));
+        tb.getLocation(new Point(1, 2));
+        tb.getX();
+        tb.getY();
+        tb.getWidth();
+        tb.getHeight();
+        tb.isOpaque();
+        tb.isValidateRoot();
+        tb.isOptimizedDrawingEnabled();
+        tb.isDoubleBuffered();
+        tb.getComponentCount();
+        tb.countComponents();
+        tb.getComponent(1);
+        tb.getComponent(2);
+        Component[] cs = tb.getComponents();
+        tb.getLayout();
+        tb.setLayout(new FlowLayout());
+        tb.doLayout();
+        tb.layout();
+        tb.invalidate();
+        tb.validate();
+        tb.remove(0);
+        tb.remove(c2);
+        tb.removeAll();
+        tb.preferredSize();
+        tb.minimumSize();
+        tb.getComponentAt(1, 2);
+        tb.locate(1, 2);
+        tb.getComponentAt(new Point(1, 2));
+        tb.isFocusCycleRoot(new Container());
+        tb.transferFocusBackward();
+        tb.setName("goober");
+        tb.getName();
+        tb.getParent();
+        tb.getPeer();
+        tb.getGraphicsConfiguration();
+        tb.getTreeLock();
+        tb.getToolkit();
+        tb.isValid();
+        tb.isDisplayable();
+        tb.isVisible();
+        tb.isShowing();
+        tb.isEnabled();
+        tb.enable(false);
+        tb.enable(true);
+        tb.enableInputMethods(false);
+        tb.enableInputMethods(true);
+        tb.show();
+        tb.show(false);
+        tb.show(true);
+        tb.hide();
+        tb.getForeground();
+        tb.isForegroundSet();
+        tb.getBackground();
+        tb.isBackgroundSet();
+        tb.getFont();
+        tb.isFontSet();
+        Container c = new Container();
+        c.add(tb);
+        tb.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            tb.setLocale(locale);
+
+        tb.getColorModel();
+        tb.getLocation();
+
+        boolean exceptions = false;
+        try {
+            tb.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        tb.location();
+        tb.setLocation(1, 2);
+        tb.move(1, 2);
+        tb.setLocation(new Point(1, 2));
+        tb.getSize();
+        tb.size();
+        tb.setSize(1, 32);
+        tb.resize(1, 32);
+        tb.setSize(new Dimension(1, 32));
+        tb.resize(new Dimension(1, 32));
+        tb.getBounds();
+        tb.bounds();
+        tb.setBounds(10, 10, 10, 10);
+        tb.setBounds(new Rectangle(10, 10, 10, 10));
+        tb.isLightweight();
+        tb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        tb.getCursor();
+        tb.isCursorSet();
+        tb.inside(1, 2);
+        tb.contains(new Point(1, 2));
+        tb.isFocusable();
+        tb.setFocusable(true);
+        tb.setFocusable(false);
+        tb.transferFocus();
+        tb.getFocusCycleRootAncestor();
+        tb.nextFocus();
+        tb.transferFocusUpCycle();
+        tb.hasFocus();
+        tb.isFocusOwner();
+        tb.toString();
+        tb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        tb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        tb.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        tb.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJToolBar_Separator.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JToolBar.Separator constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJToolBar_Separator
+ */
+
+public class HeadlessJToolBar_Separator {
+    public static void main(String args[]) {
+        JToolBar.Separator s = new JToolBar.Separator();
+        s.getAccessibleContext();
+        s.isFocusTraversable();
+        s.setEnabled(false);
+        s.setEnabled(true);
+        s.requestFocus();
+        s.requestFocusInWindow();
+        s.getPreferredSize();
+        s.getMaximumSize();
+        s.getMinimumSize();
+        s.contains(1, 2);
+        Component c1 = s.add(new Component(){});
+        Component c2 = s.add(new Component(){});
+        Component c3 = s.add(new Component(){});
+        Insets ins = s.getInsets();
+        s.getAlignmentY();
+        s.getAlignmentX();
+        s.getGraphics();
+        s.setVisible(false);
+        s.setVisible(true);
+        s.setForeground(Color.red);
+        s.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                s.setFont(f1);
+                s.setFont(f2);
+                s.setFont(f3);
+                s.setFont(f4);
+
+                s.getFontMetrics(f1);
+                s.getFontMetrics(f2);
+                s.getFontMetrics(f3);
+                s.getFontMetrics(f4);
+            }
+        }
+        s.enable();
+        s.disable();
+        s.reshape(10, 10, 10, 10);
+        s.getBounds(new Rectangle(1, 1, 1, 1));
+        s.getSize(new Dimension(1, 2));
+        s.getLocation(new Point(1, 2));
+        s.getX();
+        s.getY();
+        s.getWidth();
+        s.getHeight();
+        s.isOpaque();
+        s.isValidateRoot();
+        s.isOptimizedDrawingEnabled();
+        s.isDoubleBuffered();
+        s.getComponentCount();
+        s.countComponents();
+        s.getComponent(1);
+        s.getComponent(2);
+        Component[] cs = s.getComponents();
+        s.getLayout();
+        s.setLayout(new FlowLayout());
+        s.doLayout();
+        s.layout();
+        s.invalidate();
+        s.validate();
+        s.remove(0);
+        s.remove(c2);
+        s.removeAll();
+        s.preferredSize();
+        s.minimumSize();
+        s.getComponentAt(1, 2);
+        s.locate(1, 2);
+        s.getComponentAt(new Point(1, 2));
+        s.isFocusCycleRoot(new Container());
+        s.transferFocusBackward();
+        s.setName("goober");
+        s.getName();
+        s.getParent();
+        s.getPeer();
+        s.getGraphicsConfiguration();
+        s.getTreeLock();
+        s.getToolkit();
+        s.isValid();
+        s.isDisplayable();
+        s.isVisible();
+        s.isShowing();
+        s.isEnabled();
+        s.enable(false);
+        s.enable(true);
+        s.enableInputMethods(false);
+        s.enableInputMethods(true);
+        s.show();
+        s.show(false);
+        s.show(true);
+        s.hide();
+        s.getForeground();
+        s.isForegroundSet();
+        s.getBackground();
+        s.isBackgroundSet();
+        s.getFont();
+        s.isFontSet();
+        Container c = new Container();
+        c.add(s);
+        s.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            s.setLocale(locale);
+
+        s.getColorModel();
+        s.getLocation();
+
+        boolean exceptions = false;
+        try {
+            s.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        s.location();
+        s.setLocation(1, 2);
+        s.move(1, 2);
+        s.setLocation(new Point(1, 2));
+        s.getSize();
+        s.size();
+        s.setSize(1, 32);
+        s.resize(1, 32);
+        s.setSize(new Dimension(1, 32));
+        s.resize(new Dimension(1, 32));
+        s.getBounds();
+        s.bounds();
+        s.setBounds(10, 10, 10, 10);
+        s.setBounds(new Rectangle(10, 10, 10, 10));
+        s.isLightweight();
+        s.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        s.getCursor();
+        s.isCursorSet();
+        s.inside(1, 2);
+        s.contains(new Point(1, 2));
+        s.isFocusable();
+        s.setFocusable(true);
+        s.setFocusable(false);
+        s.transferFocus();
+        s.getFocusCycleRootAncestor();
+        s.nextFocus();
+        s.transferFocusUpCycle();
+        s.hasFocus();
+        s.isFocusOwner();
+        s.toString();
+        s.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        s.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        s.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        s.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJToolTip.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JToolTip constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJToolTip
+ */
+
+public class HeadlessJToolTip {
+    public static void main(String args[]) {
+        JToolTip tt = new JToolTip();
+        tt.getAccessibleContext();
+        tt.isFocusTraversable();
+        tt.setEnabled(false);
+        tt.setEnabled(true);
+        tt.requestFocus();
+        tt.requestFocusInWindow();
+        tt.getPreferredSize();
+        tt.getMaximumSize();
+        tt.getMinimumSize();
+        tt.contains(1, 2);
+        Component c1 = tt.add(new Component(){});
+        Component c2 = tt.add(new Component(){});
+        Component c3 = tt.add(new Component(){});
+        Insets ins = tt.getInsets();
+        tt.getAlignmentY();
+        tt.getAlignmentX();
+        tt.getGraphics();
+        tt.setVisible(false);
+        tt.setVisible(true);
+        tt.setForeground(Color.red);
+        tt.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                tt.setFont(f1);
+                tt.setFont(f2);
+                tt.setFont(f3);
+                tt.setFont(f4);
+
+                tt.getFontMetrics(f1);
+                tt.getFontMetrics(f2);
+                tt.getFontMetrics(f3);
+                tt.getFontMetrics(f4);
+            }
+        }
+        tt.enable();
+        tt.disable();
+        tt.reshape(10, 10, 10, 10);
+        tt.getBounds(new Rectangle(1, 1, 1, 1));
+        tt.getSize(new Dimension(1, 2));
+        tt.getLocation(new Point(1, 2));
+        tt.getX();
+        tt.getY();
+        tt.getWidth();
+        tt.getHeight();
+        tt.isOpaque();
+        tt.isValidateRoot();
+        tt.isOptimizedDrawingEnabled();
+        tt.isDoubleBuffered();
+        tt.getComponentCount();
+        tt.countComponents();
+        tt.getComponent(1);
+        tt.getComponent(2);
+        Component[] cs = tt.getComponents();
+        tt.getLayout();
+        tt.setLayout(new FlowLayout());
+        tt.doLayout();
+        tt.layout();
+        tt.invalidate();
+        tt.validate();
+        tt.remove(0);
+        tt.remove(c2);
+        tt.removeAll();
+        tt.preferredSize();
+        tt.minimumSize();
+        tt.getComponentAt(1, 2);
+        tt.locate(1, 2);
+        tt.getComponentAt(new Point(1, 2));
+        tt.isFocusCycleRoot(new Container());
+        tt.transferFocusBackward();
+        tt.setName("goober");
+        tt.getName();
+        tt.getParent();
+        tt.getPeer();
+        tt.getGraphicsConfiguration();
+        tt.getTreeLock();
+        tt.getToolkit();
+        tt.isValid();
+        tt.isDisplayable();
+        tt.isVisible();
+        tt.isShowing();
+        tt.isEnabled();
+        tt.enable(false);
+        tt.enable(true);
+        tt.enableInputMethods(false);
+        tt.enableInputMethods(true);
+        tt.show();
+        tt.show(false);
+        tt.show(true);
+        tt.hide();
+        tt.getForeground();
+        tt.isForegroundSet();
+        tt.getBackground();
+        tt.isBackgroundSet();
+        tt.getFont();
+        tt.isFontSet();
+        Container c = new Container();
+        c.add(tt);
+        tt.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            tt.setLocale(locale);
+
+        tt.getColorModel();
+        tt.getLocation();
+
+        boolean exceptions = false;
+        try {
+            tt.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        tt.location();
+        tt.setLocation(1, 2);
+        tt.move(1, 2);
+        tt.setLocation(new Point(1, 2));
+        tt.getSize();
+        tt.size();
+        tt.setSize(1, 32);
+        tt.resize(1, 32);
+        tt.setSize(new Dimension(1, 32));
+        tt.resize(new Dimension(1, 32));
+        tt.getBounds();
+        tt.bounds();
+        tt.setBounds(10, 10, 10, 10);
+        tt.setBounds(new Rectangle(10, 10, 10, 10));
+        tt.isLightweight();
+        tt.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        tt.getCursor();
+        tt.isCursorSet();
+        tt.inside(1, 2);
+        tt.contains(new Point(1, 2));
+        tt.isFocusable();
+        tt.setFocusable(true);
+        tt.setFocusable(false);
+        tt.transferFocus();
+        tt.getFocusCycleRootAncestor();
+        tt.nextFocus();
+        tt.transferFocusUpCycle();
+        tt.hasFocus();
+        tt.isFocusOwner();
+        tt.toString();
+        tt.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        tt.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        tt.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        tt.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJTree.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeModel;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JTree constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJTree
+ */
+
+public class HeadlessJTree {
+    public static void main(String args[]) {
+        JTree t;
+
+        DefaultMutableTreeNode root = new DefaultMutableTreeNode("JTree");
+        DefaultMutableTreeNode parent;
+
+        parent = new DefaultMutableTreeNode("colors");
+        root.add(parent);
+        parent.add(new DefaultMutableTreeNode("blue"));
+        parent.add(new DefaultMutableTreeNode("violet"));
+        parent.add(new DefaultMutableTreeNode("red"));
+        parent.add(new DefaultMutableTreeNode("yellow"));
+
+        parent = new DefaultMutableTreeNode("sports");
+        root.add(parent);
+        parent.add(new DefaultMutableTreeNode("basketball"));
+        parent.add(new DefaultMutableTreeNode("soccer"));
+        parent.add(new DefaultMutableTreeNode("football"));
+        parent.add(new DefaultMutableTreeNode("hockey"));
+
+        parent = new DefaultMutableTreeNode("food");
+        root.add(parent);
+        parent.add(new DefaultMutableTreeNode("hot dogs"));
+        parent.add(new DefaultMutableTreeNode("pizza"));
+        parent.add(new DefaultMutableTreeNode("ravioli"));
+        parent.add(new DefaultMutableTreeNode("bananas"));
+
+        t = new JTree(root);
+        t = new JTree(new DefaultTreeModel(root));
+        t.setCellRenderer(new DefaultTreeCellRenderer() {
+            public Component getTreeCellRendererComponent(
+                    JTree tree, Object value, boolean selected, boolean expanded,
+                    boolean leaf, int row, boolean hasFocus) {
+                return super.getTreeCellRendererComponent(
+                        tree, value, selected, expanded,
+                        leaf, row, hasFocus);
+            }
+        });
+        t.getCellRenderer();
+
+        t.getAccessibleContext();
+        t.isFocusTraversable();
+        t.setEnabled(false);
+        t.setEnabled(true);
+        t.requestFocus();
+        t.requestFocusInWindow();
+        t.getPreferredSize();
+        t.getMaximumSize();
+        t.getMinimumSize();
+        t.contains(1, 2);
+        Component c1 = t.add(new Component(){});
+        Component c2 = t.add(new Component(){});
+        Component c3 = t.add(new Component(){});
+        Insets ins = t.getInsets();
+        t.getAlignmentY();
+        t.getAlignmentX();
+        t.getGraphics();
+        t.setVisible(false);
+        t.setVisible(true);
+        t.setForeground(Color.red);
+        t.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                t.setFont(f1);
+                t.setFont(f2);
+                t.setFont(f3);
+                t.setFont(f4);
+
+                t.getFontMetrics(f1);
+                t.getFontMetrics(f2);
+                t.getFontMetrics(f3);
+                t.getFontMetrics(f4);
+            }
+        }
+        t.enable();
+        t.disable();
+        t.reshape(10, 10, 10, 10);
+        t.getBounds(new Rectangle(1, 1, 1, 1));
+        t.getSize(new Dimension(1, 2));
+        t.getLocation(new Point(1, 2));
+        t.getX();
+        t.getY();
+        t.getWidth();
+        t.getHeight();
+        t.isOpaque();
+        t.isValidateRoot();
+        t.isOptimizedDrawingEnabled();
+        t.isDoubleBuffered();
+        t.getComponentCount();
+        t.countComponents();
+        t.getComponent(1);
+        t.getComponent(2);
+        Component[] cs = t.getComponents();
+        t.getLayout();
+        t.setLayout(new FlowLayout());
+        t.doLayout();
+        t.layout();
+        t.invalidate();
+        t.validate();
+        t.remove(0);
+        t.remove(c2);
+        t.removeAll();
+        t.preferredSize();
+        t.minimumSize();
+        t.getComponentAt(1, 2);
+        t.locate(1, 2);
+        t.getComponentAt(new Point(1, 2));
+        t.isFocusCycleRoot(new Container());
+        t.transferFocusBackward();
+        t.setName("goober");
+        t.getName();
+        t.getParent();
+        t.getPeer();
+        t.getGraphicsConfiguration();
+        t.getTreeLock();
+        t.getToolkit();
+        t.isValid();
+        t.isDisplayable();
+        t.isVisible();
+        t.isShowing();
+        t.isEnabled();
+        t.enable(false);
+        t.enable(true);
+        t.enableInputMethods(false);
+        t.enableInputMethods(true);
+        t.show();
+        t.show(false);
+        t.show(true);
+        t.hide();
+        t.getForeground();
+        t.isForegroundSet();
+        t.getBackground();
+        t.isBackgroundSet();
+        t.getFont();
+        t.isFontSet();
+        Container c = new Container();
+        c.add(t);
+        t.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            t.setLocale(locale);
+
+        t.getColorModel();
+        t.getLocation();
+
+        boolean exceptions = false;
+        try {
+            t.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        t.location();
+        t.setLocation(1, 2);
+        t.move(1, 2);
+        t.setLocation(new Point(1, 2));
+        t.getSize();
+        t.size();
+        t.setSize(1, 32);
+        t.resize(1, 32);
+        t.setSize(new Dimension(1, 32));
+        t.resize(new Dimension(1, 32));
+        t.getBounds();
+        t.bounds();
+        t.setBounds(10, 10, 10, 10);
+        t.setBounds(new Rectangle(10, 10, 10, 10));
+        t.isLightweight();
+        t.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        t.getCursor();
+        t.isCursorSet();
+        t.inside(1, 2);
+        t.contains(new Point(1, 2));
+        t.isFocusable();
+        t.setFocusable(true);
+        t.setFocusable(false);
+        t.transferFocus();
+        t.getFocusCycleRootAncestor();
+        t.nextFocus();
+        t.transferFocusUpCycle();
+        t.hasFocus();
+        t.isFocusOwner();
+        t.toString();
+        t.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        t.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        t.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        t.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJViewport.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Locale;
+
+/*
+ * @test
+ * @summary Check that JViewport constructors and methods do not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJViewport
+ */
+
+public class HeadlessJViewport {
+    public static void main(String args[]) {
+        JViewport v = new JViewport();
+        v.getUI();
+        v.getUIClassID();
+        v.setUI(null);
+        v.updateUI();
+
+        JComponent view = new JPanel();
+        view.setMinimumSize(new Dimension(123, 456));
+        v.setView(view);
+
+        v.getAccessibleContext();
+        v.isFocusTraversable();
+        v.setEnabled(false);
+        v.setEnabled(true);
+        v.requestFocus();
+        v.requestFocusInWindow();
+        v.getPreferredSize();
+        v.getMaximumSize();
+        v.getMinimumSize();
+        v.contains(1, 2);
+        Component c1 = v.add(new Component(){});
+        Component c2 = v.add(new Component(){});
+        Component c3 = v.add(new Component(){});
+        Insets ins = v.getInsets();
+        v.getAlignmentY();
+        v.getAlignmentX();
+        v.getGraphics();
+        v.setVisible(false);
+        v.setVisible(true);
+        v.setForeground(Color.red);
+        v.setBackground(Color.red);
+        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
+            for (int j = 8; j < 17; j++) {
+                Font f1 = new Font(font, Font.PLAIN, j);
+                Font f2 = new Font(font, Font.BOLD, j);
+                Font f3 = new Font(font, Font.ITALIC, j);
+                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
+
+                v.setFont(f1);
+                v.setFont(f2);
+                v.setFont(f3);
+                v.setFont(f4);
+
+                v.getFontMetrics(f1);
+                v.getFontMetrics(f2);
+                v.getFontMetrics(f3);
+                v.getFontMetrics(f4);
+            }
+        }
+        v.enable();
+        v.disable();
+        v.reshape(10, 10, 10, 10);
+        v.getBounds(new Rectangle(1, 1, 1, 1));
+        v.getSize(new Dimension(1, 2));
+        v.getLocation(new Point(1, 2));
+        v.getX();
+        v.getY();
+        v.getWidth();
+        v.getHeight();
+        v.isOpaque();
+        v.isValidateRoot();
+        v.isOptimizedDrawingEnabled();
+        v.isDoubleBuffered();
+        v.getComponentCount();
+        v.countComponents();
+        v.getComponent(0);
+        Component[] cs = v.getComponents();
+        v.getLayout();
+        v.setLayout(new FlowLayout());
+        v.doLayout();
+        v.layout();
+        v.invalidate();
+        v.validate();
+        v.remove(0);
+        v.remove(c2);
+        v.removeAll();
+        v.preferredSize();
+        v.minimumSize();
+        v.getComponentAt(1, 2);
+        v.locate(1, 2);
+        v.getComponentAt(new Point(1, 2));
+        v.isFocusCycleRoot(new Container());
+        v.transferFocusBackward();
+        v.setName("goober");
+        v.getName();
+        v.getParent();
+        v.getPeer();
+        v.getGraphicsConfiguration();
+        v.getTreeLock();
+        v.getToolkit();
+        v.isValid();
+        v.isDisplayable();
+        v.isVisible();
+        v.isShowing();
+        v.isEnabled();
+        v.enable(false);
+        v.enable(true);
+        v.enableInputMethods(false);
+        v.enableInputMethods(true);
+        v.show();
+        v.show(false);
+        v.show(true);
+        v.hide();
+        v.getForeground();
+        v.isForegroundSet();
+        v.getBackground();
+        v.isBackgroundSet();
+        v.getFont();
+        v.isFontSet();
+        Container c = new Container();
+        c.add(v);
+        v.getLocale();
+        for (Locale locale : Locale.getAvailableLocales())
+            v.setLocale(locale);
+
+        v.getColorModel();
+        v.getLocation();
+
+        boolean exceptions = false;
+        try {
+            v.getLocationOnScreen();
+        } catch (IllegalComponentStateException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
+
+        v.location();
+        v.setLocation(1, 2);
+        v.move(1, 2);
+        v.setLocation(new Point(1, 2));
+        v.getSize();
+        v.size();
+        v.setSize(1, 32);
+        v.resize(1, 32);
+        v.setSize(new Dimension(1, 32));
+        v.resize(new Dimension(1, 32));
+        v.getBounds();
+        v.bounds();
+        v.setBounds(10, 10, 10, 10);
+        v.setBounds(new Rectangle(10, 10, 10, 10));
+        v.isLightweight();
+        v.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+        v.getCursor();
+        v.isCursorSet();
+        v.inside(1, 2);
+        v.contains(new Point(1, 2));
+        v.isFocusable();
+        v.setFocusable(true);
+        v.setFocusable(false);
+        v.transferFocus();
+        v.getFocusCycleRootAncestor();
+        v.nextFocus();
+        v.transferFocusUpCycle();
+        v.hasFocus();
+        v.isFocusOwner();
+        v.toString();
+        v.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        v.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        v.setComponentOrientation(ComponentOrientation.UNKNOWN);
+        v.getComponentOrientation();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessJWindow.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that JWindow constructors throw HeadlessException in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessJWindow
+ */
+
+public class HeadlessJWindow {
+    public static void main(String args[]) {
+        boolean exceptions = false;
+        JWindow w;
+
+        try {
+            w = new JWindow();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
+            w = new JWindow(new Frame("Frame title"));
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessLookAndFeel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.plaf.metal.MetalLookAndFeel;
+
+/*
+ * @test
+ * @summary Check that MetalLookAndFeel constructor does not throw unexpected
+ *          exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessLookAndFeel
+ */
+
+public class HeadlessLookAndFeel {
+    public static void main(String args[]) {
+        new MetalLookAndFeel();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessMenuSelectionManager.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that MenuSelectionManager constructor and defaultManager() method do not
+ *          throw unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessMenuSelectionManager
+ */
+
+public class HeadlessMenuSelectionManager {
+    public static void main(String args[]) {
+        MenuSelectionManager msm = new MenuSelectionManager();
+        msm = MenuSelectionManager.defaultManager();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessOverlayLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+/*
+ * @test
+ * @summary Check that OverlayLayout constructor does not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessOverlayLayout
+ */
+
+public class HeadlessOverlayLayout {
+    public static void main(String args[]) {
+        OverlayLayout msm = new OverlayLayout(new Container());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessPopupFactory.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that PopupFactory.getSharedInstance() method does not throw
+ *          unexpected exceptions in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessPopupFactory
+ */
+
+public class HeadlessPopupFactory {
+    public static void main(String args[]) {
+        PopupFactory msm = PopupFactory.getSharedInstance();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessScrollPaneLayout.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that ScrollPaneLayout constructor does not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessScrollPaneLayout
+ */
+
+public class HeadlessScrollPaneLayout {
+    public static void main(String args[]) {
+        ScrollPaneLayout msm = new ScrollPaneLayout();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessSizeRequirements.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that SizeRequirements constructors do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessSizeRequirements
+ */
+
+public class HeadlessSizeRequirements {
+    public static void main(String args[]) {
+        SizeRequirements sr;
+        sr = new SizeRequirements();
+        sr = new SizeRequirements(20, 20, 20, (float) 1.0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessSizeSequence.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that SizeSequence constructors do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessSizeSequence
+ */
+
+public class HeadlessSizeSequence {
+    public static void main(String args[]) {
+        SizeSequence ss;
+        ss = new SizeSequence();
+        ss = new SizeSequence(10);
+        ss = new SizeSequence(10, 10);
+        ss = new SizeSequence(new int[]{1, 2, 3, 4, 5, 6, 76, 9});
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessSpinnerListModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.util.LinkedList;
+
+/*
+ * @test
+ * @summary Check that SpinnerListModel constructors and methods do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessSpinnerListModel
+ */
+
+public class HeadlessSpinnerListModel {
+    public static void main(String args[]) {
+        LinkedList list = new LinkedList();
+        list.add("prev");
+        list.add("this");
+        list.add("next");
+        SpinnerListModel m;
+        m = new SpinnerListModel(list);
+        m = new SpinnerListModel(new String[]{"prev", "this", "next"});
+        m.getList();
+        m.setList(list);
+        m.setValue("next");
+        m.getNextValue();
+        m.getPreviousValue();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessSpinnerNumberModel.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that SpinnerNumberModel constructor and methods do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessSpinnerNumberModel
+ */
+
+public class HeadlessSpinnerNumberModel {
+    public static void main(String args[]) {
+        SpinnerNumberModel model = new SpinnerNumberModel();
+        model.setValue(5);
+        model.getValue();
+        model.getPreviousValue();
+        model.getNextValue();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/Headless/HeadlessTimer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+
+/*
+ * @test
+ * @summary Check that Timer constructors do not throw unexpected exceptions
+ *          in headless mode
+ * @run main/othervm -Djava.awt.headless=true HeadlessTimer
+ */
+
+public class HeadlessTimer {
+    public static void main(String args[]) {
+        Timer t = new Timer(100, null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/4523758/bug4523758.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 4523758
+ * @summary Directly check that torn-off combo works
+ * @library ../../../../lib/testlibrary
+ * @build ExtendedRobot
+ * @run main bug4523758
+ */
+/*
+ * There is another regression test for this bug created by ssi with a
+ * fix. It is purely AWT and designed to verify the (absence of) underlying Component issue.
+ * This functional test does test, well, functionality of the swing control.
+ *
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+
+public class bug4523758 {
+
+    private JFrame frame;
+    private JToolBar tools;
+    private JComboBox combo;
+
+    private boolean passed = true;
+    private boolean itemStateChanged = false;
+    private Object itemLock = new Object();
+
+    private static int delay = 500;
+    private static final int WAIT_EVENT_DELAY = 60000;
+
+    public bug4523758() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    initializeGUI();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Failed to initialize GUI");
+        }
+    }
+
+    private void initializeGUI() {
+        frame = new JFrame("bug4523758");
+        tools = new JToolBar();
+        frame.getContentPane().add(tools, BorderLayout.NORTH);
+        combo = new JComboBox(new Object[] { "Red", "Orange", "Yellow",
+            "Green", "Blue", "Indigo", "Violet"});
+        combo.addItemListener(new ItemListener() {
+            public void itemStateChanged(ItemEvent event) {
+                itemStateChanged = true;
+                synchronized (itemLock) {
+                    try {
+                        itemLock.notifyAll();
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        });
+        tools.add(combo);
+        frame.setSize(250,400);
+        frame.setLocation(700, 0);
+        frame.setVisible(true);
+    }
+
+    private void doTest() throws Exception {
+        ExtendedRobot robot = new ExtendedRobot();
+        robot.waitForIdle(1000);
+
+        final Point cl = combo.getLocationOnScreen();
+        final Dimension cs = combo.getSize();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.dispose();
+            }
+        });
+        robot.waitForIdle(delay);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setSize((int) cl.x - 700 + cs.width,
+                              (int) cl.y + cs.height - 5);
+                frame.setVisible(true);
+            }
+        });
+
+        robot.waitForIdle(delay*2);
+        Point comboLocation = combo.getLocationOnScreen();
+        Dimension comboSize = combo.getSize();
+
+        robot.mouseMove((int) comboLocation.x + comboSize.width / 2,
+                        (int) comboLocation.y + 5);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(100);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.waitForIdle(delay);
+
+        robot.mouseMove((int) comboLocation.x + comboSize.width / 2,
+                        (int) comboLocation.y + 60);
+        robot.waitForIdle(delay);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(100);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.waitForIdle(delay);
+
+        if (! itemStateChanged) {
+            synchronized (itemLock) {
+                try {
+                    itemLock.wait(WAIT_EVENT_DELAY);
+                } catch (Exception e) {
+                }
+            }
+        }
+        if (! itemStateChanged) {
+            System.err.println("FAIL: ItemEvent not triggered when mouse clicked on combo box drop down");
+            passed = false;
+        }
+
+        if (! passed) {
+            System.err.println("Test failed!");
+            captureScreenAndSave();
+            throw new RuntimeException("FAIL");
+        } else {
+            System.out.println("Test passed!");
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            bug4523758 test = new bug4523758();
+            test.doTest();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("FAIL");
+        }
+    }
+
+    /**
+     * Do screen capture and save it as image
+     */
+    private static void captureScreenAndSave() {
+
+        try {
+            Robot robot = new Robot();
+            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+            Rectangle rectangle = new Rectangle(0, 0, screenSize.width, screenSize.height);
+            System.out.println("About to screen capture - " + rectangle);
+            java.awt.image.BufferedImage image = robot.createScreenCapture(rectangle);
+            javax.imageio.ImageIO.write(image, "jpg", new java.io.File("ScreenImage.jpg"));
+            robot.delay(3000);
+        } catch (Throwable t) {
+            System.out.println("WARNING: Exception thrown while screen capture!");
+            t.printStackTrace();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/8019180/Test8019180.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.concurrent.CountDownLatch;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+/*
+ * @test
+ * @bug 8019180
+ * @summary Tests that combobox works if it is used as action listener
+ * @author Sergey Malenkov
+ */
+
+public class Test8019180 implements Runnable {
+    private static final CountDownLatch LATCH = new CountDownLatch(1);
+    private static final String[] ITEMS = {"First", "Second", "Third", "Fourth"};
+
+    public static void main(String[] args) throws InterruptedException {
+        SwingUtilities.invokeLater(new Test8019180());
+        LATCH.await();
+    }
+
+    private JComboBox<String> test;
+
+    @Override
+    public void run() {
+        if (this.test == null) {
+            this.test = new JComboBox<>(ITEMS);
+            this.test.addActionListener(this.test);
+            JFrame frame = new JFrame();
+            frame.add(test);
+            frame.pack();
+            frame.setVisible(true);
+            SwingUtilities.invokeLater(this);
+        } else {
+            int index = this.test.getSelectedIndex();
+            this.test.setSelectedIndex(1 + index);
+            if (0 > this.test.getSelectedIndex()) {
+                System.err.println("ERROR: no selection");
+                System.exit(8019180);
+            }
+            SwingUtilities.getWindowAncestor(this.test).dispose();
+            LATCH.countDown();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/ConsumedEscTest/ConsumedEscTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+/*
+  @test
+  @bug 8031485
+  @summary Combo box consuming escape and enter key events
+  @author Petr Pchelko
+  @library ../../../../lib/testlibrary/
+  @build ExtendedRobot
+  @run main ConsumedEscTest
+*/
+public class ConsumedEscTest {
+    private static volatile JFrame frame;
+    private static volatile boolean passed = false;
+
+    public static void main(String... args) throws Exception {
+        try {
+            SwingUtilities.invokeAndWait(() -> {
+                frame = new JFrame();
+                JComboBox<String> combo = new JComboBox<>(new String[]{"one", "two", "three"});
+                JPanel panel = new JPanel();
+                panel.add(combo);
+                combo.requestFocusInWindow();
+                frame.setBounds(100, 150, 300, 100);
+                addAction(panel);
+                frame.add(panel);
+                frame.setVisible(true);
+            });
+
+            ExtendedRobot robot = new ExtendedRobot();
+            robot.waitForIdle();
+            robot.type(KeyEvent.VK_ESCAPE);
+            robot.waitForIdle();
+            if (!passed) {
+                throw new RuntimeException("FAILED: ESC was consumed by combo box");
+            }
+        } finally {
+            if (frame != null) {
+                frame.dispose();
+            }
+        }
+    }
+
+    private static void addAction(JComponent comp) {
+        KeyStroke k = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
+        Object actionKey = "cancel";
+        comp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(k, actionKey);
+        Action cancelAction = new AbstractAction() {
+            @Override
+            public void actionPerformed(ActionEvent ev) {
+                passed = true;
+            }
+        };
+        comp.getActionMap().put(actionKey, cancelAction);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComponent/8043610/bug8043610.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+/*
+  @test
+  @bug 8043610
+  @summary Tests that JComponent invalidate, revalidate and repaint methods could
+           be called from any thread
+  @author Petr Pchelko
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class bug8043610 {
+    private static volatile JFrame frame;
+    private static volatile JComponent component;
+
+    public static void main(String[] args) throws Exception {
+        ThreadGroup stubTG = new ThreadGroup(getRootThreadGroup(), "Stub Thread Group");
+        ThreadGroup swingTG = new ThreadGroup(getRootThreadGroup(), "SwingTG");
+        try {
+            Thread stubThread = new Thread(stubTG, SunToolkit::createNewAppContext);
+            stubThread.start();
+            stubThread.join();
+
+            CountDownLatch startSwingLatch = new CountDownLatch(1);
+            new Thread(swingTG, () -> {
+                SunToolkit.createNewAppContext();
+                SwingUtilities.invokeLater(() -> {
+                    frame = new JFrame();
+                    component = new JLabel("Test Text");
+                    frame.add(component);
+                    frame.setBounds(100, 100, 100, 100);
+                    frame.setVisible(true);
+                    startSwingLatch.countDown();
+                });
+            }).start();
+            startSwingLatch.await();
+
+            AtomicReference<Exception> caughtException = new AtomicReference<>();
+            Thread checkThread = new Thread(getRootThreadGroup(), () -> {
+                try {
+                    component.invalidate();
+                    component.revalidate();
+                    component.repaint(new Rectangle(0, 0, 0, 0));
+                } catch (Exception e) {
+                    caughtException.set(e);
+                }
+            });
+            checkThread.start();
+            checkThread.join();
+
+            if (caughtException.get() != null) {
+                throw new RuntimeException("Failed. Caught exception!", caughtException.get());
+            }
+        } finally {
+            new Thread(swingTG, () -> SwingUtilities.invokeLater(() -> {
+                if (frame != null) {
+                    frame.dispose();
+                }
+            })).start();
+        }
+    }
+
+    private static ThreadGroup getRootThreadGroup() {
+        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
+        ThreadGroup parentTG = currentTG.getParent();
+        while (parentTG != null) {
+            currentTG = parentTG;
+            parentTG = currentTG.getParent();
+        }
+        return currentTG;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JDialog/WrongBackgroundColor/WrongBackgroundColor.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.ColorUIResource;
+
+/**
+ * @test
+ * @bug 8033786
+ * @summary JDialog should update background color of the native peer.
+ * @author Sergey Bylokhov
+ */
+public final class WrongBackgroundColor {
+
+    public static void main(final String[] args)
+            throws InvocationTargetException, InterruptedException {
+        SwingUtilities.invokeAndWait(() -> {
+            UIDefaults ui = UIManager.getDefaults();
+            ui.put("control", new ColorUIResource(54, 54, 54));
+            final JDialog dialog = new JDialog();
+            final JFrame frame = new JFrame();
+            frame.pack();
+            dialog.pack();
+            final Color dialogBackground = dialog.getBackground();
+            final Color frameBackground = frame.getBackground();
+            frame.dispose();
+            dialog.dispose();
+            if (!dialogBackground.equals(frameBackground)) {
+                System.err.println("Expected:" + frameBackground);
+                System.err.println("Actual:" + dialogBackground);
+                throw new RuntimeException("Wrong background color");
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JFrame/HangNonVolatileBuffer/HangNonVolatileBuffer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+/**
+ * @test
+ * @bug 8029455
+ * @summary Swing should not hang if non-volatile image is used as a backbuffer.
+ * @run main/othervm -Dswing.volatileImageBufferEnabled=false HangNonVolatileBuffer
+ */
+public final class HangNonVolatileBuffer {
+
+    private static JFrame f;
+
+    public static void main(final String[] args)
+            throws InvocationTargetException, InterruptedException {
+        SwingUtilities.invokeAndWait(() -> {
+            f = new JFrame("JFrame");
+            f.setSize(300, 300);
+            f.setLocationRelativeTo(null);
+            f.setVisible(true);
+        });
+        SwingUtilities.invokeAndWait(() -> {
+            // flush the EDT
+        });
+        Thread.sleep(1000);
+        SwingUtilities.invokeAndWait(f::dispose);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JRadioButton/8041561/bug8041561.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8041561
+ * @author Alexander Scherbatiy
+ * @summary Inconsistent opacity behaviour between JCheckBox and JRadioButton
+ * @run main bug8041561
+ */
+public class bug8041561 {
+
+    private static JRadioButton radioButton;
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                try {
+                    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+                    UIManager.setLookAndFeel(new MetalLookAndFeel());
+                    createAndShowGUI();
+                } catch (UnsupportedLookAndFeelException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+        Thread.sleep(500);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                try {
+                    Point point = radioButton.getLocationOnScreen();
+                    int x = (int) point.getX() + radioButton.getWidth() / 2;
+                    int y = (int) point.getY() + radioButton.getHeight() / 2;
+
+                    Robot robot = new Robot();
+                    Color color = robot.getPixelColor(x, y);
+                    if (!Color.BLUE.equals(color)) {
+                        throw new RuntimeException("JRadioButton is opaque");
+                    }
+                } catch (AWTException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+
+    }
+
+    private static void createAndShowGUI() {
+        JFrame frame = new JFrame();
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setBackground(Color.BLUE);
+        radioButton = new JRadioButton();
+        radioButton.setOpaque(false);
+        JPanel panel = new JPanel();
+        panel.setBackground(Color.BLUE);
+        panel.add(radioButton);
+        frame.getContentPane().add(panel);
+        frame.pack();
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTabbedPane/8007563/Test8007563.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.Robot;
+import java.util.ArrayList;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JTabbedPane;
+
+import static javax.swing.UIManager.*;
+import static javax.swing.SwingUtilities.*;
+
+/*
+ * @test
+ * @bug 8007563
+ * @summary Tests JTabbedPane background
+ * @author Sergey Malenkov
+ */
+
+public class Test8007563 implements Runnable {
+    private static final ArrayList<String> LIST = new ArrayList<>();
+    private static final LookAndFeelInfo[] INFO = getInstalledLookAndFeels();
+    private static final CountDownLatch LATCH = new CountDownLatch(INFO.length);
+    private static Robot ROBOT;
+
+    public static void main(String[] args) throws Exception {
+        ROBOT = new Robot();
+        invokeLater(new Test8007563());
+        LATCH.await();
+        if (!LIST.isEmpty()) {
+            throw new Error(LIST.toString());
+        }
+    }
+
+    private static void addOpaqueError(boolean opaque) {
+        LIST.add(getLookAndFeel().getName() + " opaque=" + opaque);
+    }
+
+    private static boolean updateLookAndFeel() {
+        int index = (int) LATCH.getCount() - 1;
+        if (index >= 0) {
+            try {
+                LookAndFeelInfo info = INFO[index];
+                System.err.println("L&F: " + info.getName());
+                setLookAndFeel(info.getClassName());
+                return true;
+            } catch (Exception exception) {
+                exception.printStackTrace();
+            }
+        }
+        return false;
+    }
+
+    private JFrame frame;
+    private JTabbedPane pane;
+
+    public void run() {
+        if (this.frame == null) {
+            if (!updateLookAndFeel()) {
+                return;
+            }
+            this.pane = new JTabbedPane();
+            this.pane.setOpaque(false);
+            this.pane.setBackground(Color.RED);
+            for (int i = 0; i < 3; i++) {
+                this.pane.addTab("Tab " + i, new JLabel("Content area " + i));
+            }
+            this.frame = new JFrame(getClass().getSimpleName());
+            this.frame.getContentPane().setBackground(Color.BLUE);
+            this.frame.add(this.pane);
+            this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+            this.frame.setSize(400, 200);
+            this.frame.setLocationRelativeTo(null);
+            this.frame.setVisible(true);
+        } else {
+            Point point = new Point(this.pane.getWidth() - 2, 2);
+            convertPointToScreen(point, this.pane);
+            Color actual = ROBOT.getPixelColor(point.x, point.y);
+
+            boolean opaque = this.pane.isOpaque();
+            Color expected = opaque
+                    ? this.pane.getBackground()
+                    : this.frame.getContentPane().getBackground();
+
+            if (!expected.equals(actual)){
+                addOpaqueError(opaque);
+            }
+            if (!opaque) {
+                this.pane.setOpaque(true);
+                this.pane.repaint();
+            } else {
+                this.frame.dispose();
+                this.frame = null;
+                this.pane = null;
+                LATCH.countDown();
+            }
+
+        }
+        invokeLater(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/plaf/synth/Test8043627.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.JButton;
+import javax.swing.plaf.synth.SynthButtonUI;
+
+/*
+ * @test
+ * @bug 8043627
+ * @summary Tests that SynthContext can be created with SecurityManager installed
+ * @author Sergey Malenkov
+ */
+
+public class Test8043627 {
+    public static void main(String[] args) {
+        System.setSecurityManager(new SecurityManager());
+        new SynthButtonUI().getContext(new JButton());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/datatype/5077522/DurationComparison.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 5077522
+ * @summary test INDETERMINATE relations
+ * @run main DurationComparison
+ */
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeConstants;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+
+/**
+ *
+ * This is a JCK failure. The implementation fails with a list of
+ * INDETERMINATE comparisons
+ *
+ *
+ * @author Joe Wang <huizhe.wang@oracle.com>
+ */
+public class DurationComparison {
+    static String errMsg;
+    int passed = 0, failed = 0;
+
+    public static void main(String[] args) {
+        DurationComparison test = new DurationComparison();
+        test.testCompareWithInderterminateRelation();
+        test.testVerifyOtherRelations();
+        test.tearDown();
+    }
+
+    /**
+     * See JDK-5077522, Duration.compare returns equal for INDETERMINATE
+     * comparisons
+     */
+    public void testCompareWithInderterminateRelation() {
+
+        final String [][] partialOrder = { // partialOrder
+           {"P1Y", "<>", "P365D"},
+           {"P1Y", "<>", "P366D"},
+           {"P1M", "<>", "P28D"},
+           {"P1M", "<>", "P29D"},
+           {"P1M", "<>", "P30D"},
+           {"P1M", "<>", "P31D"},
+           {"P5M", "<>", "P150D"},
+           {"P5M", "<>", "P151D"},
+           {"P5M", "<>", "P152D"},
+           {"P5M", "<>", "P153D"},
+           {"PT2419200S", "<>", "P1M"},
+           {"PT2678400S", "<>", "P1M"},
+           {"PT31536000S", "<>", "P1Y"},
+           {"PT31622400S", "<>", "P1Y"},
+           {"PT525600M", "<>", "P1Y"},
+           {"PT527040M", "<>", "P1Y"},
+           {"PT8760H", "<>", "P1Y"},
+           {"PT8784H", "<>", "P1Y"},
+           {"P365D", "<>", "P1Y"},
+        };
+
+        DatatypeFactory df = null;
+        try {
+            df = DatatypeFactory.newInstance();
+        } catch (DatatypeConfigurationException ex) {
+            ex.printStackTrace();
+            fail(ex.toString());
+        }
+
+        for (int valueIndex = 0; valueIndex < partialOrder.length; ++valueIndex) {
+            Duration duration1 = df.newDuration(partialOrder[valueIndex][0]);
+            Duration duration2 = df.newDuration(partialOrder[valueIndex][2]);
+            int cmp = duration1.compare(duration2);
+            int expected = ">".equals(partialOrder[valueIndex][1])
+                     ? DatatypeConstants.GREATER
+                     : "<".equals(partialOrder[valueIndex][1])
+                     ? DatatypeConstants.LESSER
+                     : "==".equals(partialOrder[valueIndex][1])
+                     ? DatatypeConstants.EQUAL
+                     : DatatypeConstants.INDETERMINATE;
+
+            if (expected != cmp) {
+                fail("returned " + cmp2str(cmp)
+                    + " for durations \'" + duration1 + "\' and "
+                    + duration2 + "\', but expected " + cmp2str(expected));
+            } else {
+                success("Comparing " + duration1 + " and " + duration2 +
+                        ": INDETERMINATE");
+            }
+        }
+    }
+
+    /**
+     * Verify cases around the INDETERMINATE relations
+     */
+    public void testVerifyOtherRelations() {
+
+        final String [][] partialOrder = { // partialOrder
+           {"P1Y", ">", "P364D"},
+           {"P1Y", "<", "P367D"},
+           {"P1Y2D", ">", "P366D"},
+           {"P1M", ">", "P27D"},
+           {"P1M", "<", "P32D"},
+           {"P1M", "<", "P31DT1H"},
+           {"P5M", ">", "P149D"},
+           {"P5M", "<", "P154D"},
+           {"P5M", "<", "P153DT1H"},
+           {"PT2419199S", "<", "P1M"},  //PT2419200S -> P28D
+           {"PT2678401S", ">", "P1M"},  //PT2678400S -> P31D
+           {"PT31535999S", "<", "P1Y"}, //PT31536000S -> P365D
+           {"PT31622401S", ">", "P1Y"}, //PT31622400S -> P366D
+           {"PT525599M59S", "<", "P1Y"},  //PT525600M -> P365D
+           {"PT527040M1S", ">", "P1Y"},  //PT527040M -> P366D
+           {"PT8759H59M59S", "<", "P1Y"},    //PT8760H -> P365D
+           {"PT8784H1S", ">", "P1Y"},    //PT8784H -> P366D
+        };
+
+        DatatypeFactory df = null;
+        try {
+            df = DatatypeFactory.newInstance();
+        } catch (DatatypeConfigurationException ex) {
+            ex.printStackTrace();
+            fail(ex.toString());
+        }
+
+        for (int valueIndex = 0; valueIndex < partialOrder.length; ++valueIndex) {
+            Duration duration1 = df.newDuration(partialOrder[valueIndex][0]);
+            Duration duration2 = df.newDuration(partialOrder[valueIndex][2]);
+            int cmp = duration1.compare(duration2);
+            int expected = ">".equals(partialOrder[valueIndex][1])
+                     ? DatatypeConstants.GREATER
+                     : "<".equals(partialOrder[valueIndex][1])
+                     ? DatatypeConstants.LESSER
+                     : "==".equals(partialOrder[valueIndex][1])
+                     ? DatatypeConstants.EQUAL
+                     : DatatypeConstants.INDETERMINATE;
+
+            if (expected != cmp) {
+                fail("returned " + cmp2str(cmp)
+                    + " for durations \'" + duration1 + "\' and "
+                    + duration2 + "\', but expected " + cmp2str(expected));
+            } else {
+                success("Comparing " + duration1 + " and " + duration2 +
+                        ": expected: " + cmp2str(expected) +
+                        " actual: " + cmp2str(cmp));
+            }
+        }
+    }
+    public static String cmp2str(int cmp) {
+        return cmp == DatatypeConstants.LESSER ? "LESSER"
+             : cmp == DatatypeConstants.GREATER ? "GREATER"
+             : cmp == DatatypeConstants.EQUAL ? "EQUAL"
+             : cmp == DatatypeConstants.INDETERMINATE ? "INDETERMINATE"
+             : "UNDEFINED";
+    }
+
+    public void tearDown() {
+
+        System.out.println("\nNumber of tests passed: " + passed);
+        System.out.println("Number of tests failed: " + failed + "\n");
+
+        if (errMsg != null ) {
+            throw new RuntimeException(errMsg);
+        }
+    }
+    void fail(String msg) {
+        if (errMsg == null) {
+            errMsg = msg;
+        } else {
+            errMsg = errMsg + "\n" + msg;
+        }
+        failed++;
+    }
+
+    void success(String msg) {
+        passed++;
+        System.out.println(msg);
+    }
+
+}
--- a/test/lib/testlibrary/ExtendedRobot.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/lib/testlibrary/ExtendedRobot.java	Wed Jul 09 10:42:37 2014 -0700
@@ -25,7 +25,6 @@
 
 import sun.awt.ExtendedKeyCodes;
 import sun.awt.SunToolkit;
-import sun.security.action.GetIntegerAction;
 
 import java.awt.AWTException;
 import java.awt.Robot;
@@ -34,8 +33,6 @@
 import java.awt.Point;
 import java.awt.MouseInfo;
 import java.awt.event.InputEvent;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 
 /**
  * ExtendedRobot is a subclass of {@link java.awt.Robot}. It provides some convenience methods that are
@@ -312,6 +309,48 @@
         mouseMove(position.x, position.y);
     }
 
+
+    /**
+     * Emulate native drag and drop process using {@code InputEvent.BUTTON1_DOWN_MASK}.
+     * The method successively moves mouse cursor to point with coordinates
+     * ({@code fromX}, {@code fromY}), presses mouse button 1, drag mouse to
+     * point with coordinates ({@code toX}, {@code toY}) and releases mouse
+     * button 1 at last.
+     *
+     * @param   fromX   Source point x coordinate
+     * @param   fromY   Source point y coordinate
+     * @param   toX     Destination point x coordinate
+     * @param   toY     Destination point y coordinate
+     *
+     * @see     #mousePress(int)
+     * @see     #glide(int, int, int, int)
+     */
+    public void dragAndDrop(int fromX, int fromY, int toX, int toY){
+        mouseMove(fromX, fromY);
+        mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        waitForIdle();
+        glide(toX, toY);
+        mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        waitForIdle();
+    }
+
+    /**
+     * Emulate native drag and drop process using {@code InputEvent.BUTTON1_DOWN_MASK}.
+     * The method successively moves mouse cursor to point {@code from},
+     * presses mouse button 1, drag mouse to point {@code to} and releases
+     * mouse button 1 at last.
+     *
+     * @param   from    Source point
+     * @param   to      Destination point
+     *
+     * @see     #mousePress(int)
+     * @see     #glide(int, int, int, int)
+     * @see     #dragAndDrop(int, int, int, int)
+     */
+    public void dragAndDrop(Point from, Point to){
+        dragAndDrop(from.x, from.y, to.x, to.y);
+    }
+
     /**
      * Successively presses and releases a given key.
      * <p>
--- a/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Wed Jul 09 10:42:37 2014 -0700
@@ -23,11 +23,11 @@
 
 package jdk.testlibrary;
 
-import static jdk.testlibrary.Asserts.assertNotEquals;
-import static jdk.testlibrary.Asserts.assertTrue;
+import java.io.PrintWriter;
 
-import java.util.List;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Predicate;
 
 /**
  * The helper class for starting and stopping {@link Process} in a separate thread.
@@ -54,6 +54,29 @@
         super(new ProcessRunnable(pb), threadName);
     }
 
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param threadName The name of thread
+     * @param waitfor A predicate to determine whether the target process has been initialized
+     * @param cmd The string array of program and its arguments to pass to {@link ProcessBuilder}
+     */
+    public ProcessThread(String threadName, Predicate<String> waitfor, String... cmd) {
+        super(new ProcessRunnable(new ProcessBuilder(cmd), threadName, waitfor), threadName);
+    }
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param threadName The name of thread.
+     * @param waitfor A predicate to determine whether the target process has been initialized
+     * @param pb The ProcessBuilder to execute.
+     */
+    public ProcessThread(String threadName, Predicate<String> waitfor, ProcessBuilder pb) {
+        super(new ProcessRunnable(pb, threadName, waitfor), threadName);
+    }
+
     /**
      * Stops {@link Process} started by {@code ProcessRunnable}.
      *
@@ -71,6 +94,18 @@
     }
 
     /**
+    * Returns the PID associated with this process thread
+    * @return The PID associated with this process thread
+    */
+    public long getPid() throws InterruptedException {
+        return ((ProcessRunnable)getRunnable()).getPid();
+    }
+
+    public void sendMessage(String message) throws InterruptedException {
+        ((ProcessRunnable)getRunnable()).sendMessage(message);
+    }
+
+    /**
      * {@link Runnable} interface for starting and stopping {@link Process}.
      */
     static class ProcessRunnable extends XRun {
@@ -79,6 +114,8 @@
         private final CountDownLatch latch;
         private volatile Process process;
         private volatile OutputAnalyzer output;
+        private final Predicate<String> waitfor;
+        private final String name;
 
         /**
          * Creates a new {@code ProcessRunnable} object.
@@ -86,9 +123,21 @@
          * @param pb The {@link ProcessBuilder} to run.
          */
         public ProcessRunnable(ProcessBuilder pb) {
-            super();
+            this(pb, "", null);
+        }
+
+        /**
+         * Creates a new {@code ProcessRunnable} object.
+         *
+         * @param pb The {@link ProcessBuilder} to run.
+         * @param name An optional process name; may be null
+         * @param waitfor A predicate to determine whether the target process has been initialized; may be null
+         */
+        public ProcessRunnable(ProcessBuilder pb, String name, Predicate<String> waitfor) {
             this.processBuilder = pb;
             this.latch = new CountDownLatch(1);
+            this.name = name;
+            this.waitfor = waitfor;
         }
 
         /**
@@ -99,7 +148,9 @@
          */
         @Override
         public void xrun() throws Throwable {
-            this.process = processBuilder.start();
+            this.process = ProcessTools.startProcess(
+                name, processBuilder, waitfor, -1, TimeUnit.SECONDS
+            );
             // Release when process is started
             latch.countDown();
 
@@ -138,6 +189,26 @@
         public OutputAnalyzer getOutput() {
             return output;
         }
+
+        /**
+         * Returns the PID associated with this process runnable
+         * @return The PID associated with this process runnable
+         */
+        public long getPid() throws InterruptedException {
+            return getProcess().getPid();
+        }
+
+        public void sendMessage(String message) throws InterruptedException {
+            try (PrintWriter pw = new PrintWriter(this.getProcess().getOutputStream())) {
+                pw.println(message);
+                pw.flush();
+            }
+        }
+
+        private Process getProcess() throws InterruptedException {
+            latch.await();
+            return process;
+        }
     }
 
 }
--- a/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Jul 09 10:42:37 2014 -0700
@@ -41,6 +41,8 @@
 import java.util.concurrent.TimeoutException;
 import java.util.function.Predicate;
 import java.util.function.Consumer;
+import java.util.stream.Collector;
+import java.util.stream.Collectors;
 
 import sun.management.VMManagement;
 
@@ -135,6 +137,7 @@
                                        long timeout,
                                        TimeUnit unit)
     throws IOException, InterruptedException, TimeoutException {
+        System.out.println("["+name+"]:" + processBuilder.command().stream().collect(Collectors.joining(" ")));
         Process p = processBuilder.start();
         StreamPumper stdout = new StreamPumper(p.getInputStream());
         StreamPumper stderr = new StreamPumper(p.getErrorStream());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/awt/image/bug8038000.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     8038000
+ *
+ * @summary Verifies that we could create different type of Rasters with height 1
+ * and strideline which exceeds raster width.
+ * Also checks that a set of RasterOp work correctly with such kind of Rasters.
+ *
+ * @run     main bug8038000
+ */
+
+import java.awt.*;
+import java.awt.color.ColorSpace;
+import java.awt.geom.AffineTransform;
+import java.awt.image.*;
+import java.util.Arrays;
+
+public class bug8038000 {
+
+    public static void main(String[] args) throws Exception {
+        new bug8038000().checkOps();
+
+        // No exceptions - Passed
+    }
+
+    private void checkOps() throws Exception {
+
+        RasterOp[] ops = new RasterOp[] {
+                new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                        ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), null),
+                new AffineTransformOp(AffineTransform.getScaleInstance(1, 1.1), null)
+        };
+
+
+        for (RasterOp op: ops) {
+            // Banded rasters
+            checkOp(Raster.createBandedRaster(DataBuffer.TYPE_BYTE, 10, 1, 10,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null),
+                    Raster.createBandedRaster(DataBuffer.TYPE_BYTE, 10, 1, 1001,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null), op);
+            checkOp(Raster.createBandedRaster(DataBuffer.TYPE_USHORT, 10, 1, 10,
+                    new int[] {0, 1, 2}, new int[]{2,1,0}, null),
+                    Raster.createBandedRaster(DataBuffer.TYPE_USHORT, 10, 1, 1001,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null), op);
+            checkOp(Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 1, 10,
+                    new int[] {0, 1, 2}, new int[]{2,1,0}, null),
+                    Raster.createBandedRaster(DataBuffer.TYPE_INT, 10, 1, 1001,
+                            new int[] {0, 1, 2}, new int[]{2,1,0}, null), op);
+
+            // Interleaved rasters
+            checkOp(Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,
+                            10, 1, 30, 3, new int[]{0, 1, 2}, null),
+                    Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,
+                            10, 1, 1001, 3, new int[]{0, 1, 2}, null),
+                    op);
+
+            checkOp(Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT,
+                            10, 1, 30, 3, new int[]{0, 1, 2}, null),
+                    Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT,
+                            10, 1, 1001, 3, new int[]{0, 1, 2}, null),
+                    op);
+
+            // Packed rasters
+            checkOp(Raster.createPackedRaster(new DataBufferByte(10), 10, 1, 10,
+                            new int[] {0x01, 0x02, 0x04}, null),
+                    Raster.createPackedRaster(new DataBufferByte(10), 10, 1, 2000,
+                            new int[] {0x01, 0x02, 0x04}, null),
+                    op);
+            checkOp(Raster.createPackedRaster(new DataBufferInt(10), 10, 1, 10,
+                        new int[] {0xff0000, 0x00ff00, 0x0000ff}, null),
+                    Raster.createPackedRaster(new DataBufferInt(10), 10, 1, 20,
+                            new int[] {0xff0000, 0x00ff00, 0x0000ff}, null),
+                    op);
+
+        }
+    }
+
+    /**
+     *  Takes two identical rasters (identical with the exception of scanline stride)
+     *  fills their pixels with identical data, applies the RasterOp to both rasters
+     *  and checks that the result is the same
+     */
+    private void checkOp(WritableRaster wr1, WritableRaster wr2, RasterOp op) {
+        System.out.println("Checking " + op + " with rasters: \n    " + wr1 +
+                "\n    " + wr2);
+        try {
+            WritableRaster r1 = op.filter(fillRaster(wr1), null);
+            WritableRaster r2 = op.filter(fillRaster(wr2), null);
+            compareRasters(r1, r2);
+        } catch (ImagingOpException e) {
+            System.out.println("    Skip: Op is not supported: " + e);
+        }
+    }
+
+    private WritableRaster fillRaster(WritableRaster wr) {
+        int c = 0;
+        for(int x = wr.getMinX(); x < wr.getMinX() + wr.getWidth(); x++) {
+            for(int y = wr.getMinY(); y < wr.getMinY() + wr.getHeight(); y++) {
+                for (int b = 0; b < wr.getNumBands(); b++) {
+                    wr.setSample(x, y, b, c++);
+                }
+            }
+        }
+        return wr;
+    }
+
+    private void compareRasters(Raster r1, Raster r2) {
+        Rectangle bounds = r1.getBounds();
+        if (!bounds.equals(r2.getBounds())) {
+            throw new RuntimeException("Bounds differ.");
+        }
+
+        if (r1.getNumBands() != r2.getNumBands()) {
+            throw new RuntimeException("Bands differ.");
+        }
+
+        int[] b1 = new int[r1.getNumBands()];
+        int[] b2 = new int[r1.getNumBands()];
+
+        for (int x = (int) bounds.getX(); x < bounds.getMaxX(); x++) {
+            for (int y = (int) bounds.getY(); y < bounds.getMaxY(); y++) {
+                r1.getPixel(x,y, b1);
+                r2.getPixel(x,y, b2);
+                if (!Arrays.equals(b1, b2)) {
+                    throw new RuntimeException("Pixels differ.");
+                }
+            }
+        }
+    }
+}
--- a/test/sun/java2d/AcceleratedXORModeTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/java2d/AcceleratedXORModeTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
 * @test
-* @bug     8024343
+* @bug     8024343 8042098
 * @summary Test verifies that accelerated pipelines
 *          correctly draws primitives in XOR mode.
 * @run main/othervm -Dsun.java2d.xrender=True AcceleratedXORModeTest
@@ -128,6 +128,7 @@
 
     void test() {
         createVImg();
+        BufferedImage bi = null;
         do {
             int valCode = vImg.validate(getDefaultGC());
             if (valCode == VolatileImage.IMAGE_INCOMPATIBLE) {
@@ -135,9 +136,11 @@
             }
             Graphics2D g = vImg.createGraphics();
             draw(g);
-            BufferedImage bi = vImg.getSnapshot();
+            bi = vImg.getSnapshot();
+        } while (vImg.contentsLost());
+        if (bi != null) {
             test(bi);
             write(bi);
-        } while (vImg.contentsLost());
+        }
     }
 }
--- a/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java	Wed Jul 09 10:42:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,228 +21,299 @@
  * questions.
  */
 
-import java.util.concurrent.CountDownLatch;
-import java.util.regex.*;
-import java.util.*;
-import java.net.URISyntaxException;
+import java.io.File;
 import java.io.IOException;
-import sun.jvmstat.monitor.*;
-import sun.jvmstat.monitor.event.*;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.Semaphore;
 
-public class MonitorVmStartTerminate {
+import jdk.testlibrary.OutputBuffer;
+import jdk.testlibrary.ProcessTools;
+import sun.jvmstat.monitor.MonitorException;
+import sun.jvmstat.monitor.MonitoredHost;
+import sun.jvmstat.monitor.MonitoredVm;
+import sun.jvmstat.monitor.MonitoredVmUtil;
+import sun.jvmstat.monitor.VmIdentifier;
+import sun.jvmstat.monitor.event.HostEvent;
+import sun.jvmstat.monitor.event.HostListener;
+import sun.jvmstat.monitor.event.VmStatusChangeEvent;
+
+/*
+
+ Test starts ten Java processes, each with a unique id.
 
-    private static final int SLEEPERS = 10;
-    private static final int SLEEPTIME = 5000;     // sleep time for a sleeper
-    private static final int EXECINTERVAL = 3000;   // wait time between exec's
+ Each process creates a file named after the id and then it waits for
+ the test to remove the file, at which the Java process exits.
+
+ The processes are monitored by the test to make sure notifications
+ are sent when they are started/terminated.
+
+ To avoid Java processes being left behind, in case of an unexpected
+ failure, shutdown hooks are installed that remove files when the test
+ exits. If files are not removed, i.e. due to a JVM crash, the Java
+ processes will exit themselves after 1000 s.
+
+*/
 
-    public static void main(String args[]) throws Exception {
+/*
+ * @test
+ * @bug 4990825
+ * @summary attach to external but local JVM processes
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
+ * @run main/othervm MonitorVmStartTerminate
+ */
+public final class MonitorVmStartTerminate {
 
-        long now = System.currentTimeMillis();
+    private static final int PROCESS_COUNT = 10;
+    private static final long PROCESS_TIMEOUT_IN_NS = 1000*1000_000_000L;
 
-        String sleeperArgs = SLEEPTIME + " " + now;
-        String sleeperPattern = "Sleeper " + sleeperArgs + " \\d+$";
+    public static void main(String... args) throws Exception {
 
         MonitoredHost host = MonitoredHost.getMonitoredHost("localhost");
-        host.setInterval(200);
+        host.setInterval(1); // 1 ms
+
+        String id = UUID.randomUUID().toString();
 
-        Matcher matcher = Pattern.compile(sleeperPattern).matcher("");
-        SleeperListener listener = new SleeperListener(host, matcher, SLEEPERS);
-        host.addHostListener(listener);
-
-        SleeperStarter ss = new SleeperStarter(SLEEPERS, EXECINTERVAL,
-                                               sleeperArgs);
-        ss.start();
+        List<JavaProcess> javaProcesses = new ArrayList<>();
+        for (int i = 0; i < PROCESS_COUNT; i++) {
+            javaProcesses.add(new JavaProcess(id + "_" + i));
+        }
 
-        System.out.println("Waiting for "
-                           + SLEEPERS + " sleepers to terminate");
-        try {
-            ss.join();
-        } catch (InterruptedException e) {
-            throw new Exception("Timed out waiting for sleepers");
+        Listener listener = new Listener(host, javaProcesses);
+        host.addHostListener(listener);
+        for (JavaProcess javaProcess : javaProcesses) {
+            javaProcess.start();
         }
-        listener.waitForSleepersToStart();
-        listener.waitForSleepersToTerminate();
+
+        // Wait for all processes to start before terminating
+        // them, so pids are not reused within a poll interval.
+        System.out.println("Waiting for all processes to get started notification");
+        listener.started.acquire(PROCESS_COUNT);
+
+        for (JavaProcess javaProcess : javaProcesses) {
+            javaProcess.terminate();
+        }
+        System.out.println("Waiting for all processes to get terminated notification");
+        listener.terminated.acquire(PROCESS_COUNT);
+
+        host.removeHostListener(listener);
     }
 
-    public static class SleeperListener implements HostListener {
-
-        private final List<Integer> targets =  new ArrayList<>();
-        private final CountDownLatch terminateLatch;
-        private final CountDownLatch startLatch;
+    private static final class Listener implements HostListener {
+        private final Semaphore started = new Semaphore(0);
+        private final Semaphore terminated = new Semaphore(0);
         private final MonitoredHost host;
-        private final Matcher patternMatcher;
+        private final List<JavaProcess> processes;
 
-        public SleeperListener(MonitoredHost host, Matcher matcher, int count) {
+        public Listener(MonitoredHost host, List<JavaProcess> processes) {
             this.host = host;
-            this.patternMatcher = matcher;
-            this.terminateLatch = new CountDownLatch(count);
-            this.startLatch = new CountDownLatch(count);
+            this.processes = processes;
+            printStatus();
         }
 
-        public void waitForSleepersToTerminate() throws InterruptedException {
-            terminateLatch.await();
+        @Override
+        @SuppressWarnings("unchecked")
+        public void vmStatusChanged(VmStatusChangeEvent event) {
+            releaseStarted(event.getStarted());
+            releaseTerminated(event.getTerminated());
+            printStatus();
         }
 
-        public void waitForSleepersToStart() throws InterruptedException {
-            startLatch.await();
+        private void printStatus() {
+            System.out.printf("started=%d, terminated=%d\n",
+                    started.availablePermits(), terminated.availablePermits());
+        }
+
+        @Override
+        public void disconnected(HostEvent arg0) {
+            // ignore
         }
 
-        private void printList(Set<Integer> list, String msg) {
-            System.out.println(msg + ":");
-            for (Integer lvmid : list) {
-                try {
-                    VmIdentifier vmid = new VmIdentifier("//" + lvmid.intValue());
-                    MonitoredVm target = host.getMonitoredVm(vmid);
+        private void releaseStarted(Set<Integer> ids) {
+            System.out.println("realeaseStarted(" + ids + ")");
+            for (Integer id : ids) {
+                releaseStarted(id);
+            }
+        }
 
-                    StringMonitor cmdMonitor =
-                            (StringMonitor)target.findByName("sun.rt.javaCommand");
-                    String cmd = cmdMonitor.stringValue();
-
-                    System.out.println("\t" + lvmid.intValue() + ": "
-                                       + "\"" + cmd + "\"" + ": ");
-                } catch (URISyntaxException e) {
-                    System.err.println("Unexpected URISyntaxException: "
-                                       + e.getMessage());
-                } catch (MonitorException e) {
-                    System.out.println("\t" + lvmid.intValue()
-                                       + ": error reading monitoring data: "
-                                       + " target possibly terminated?");
+        private void releaseStarted(Integer id) {
+            for (JavaProcess jp : processes) {
+                if (hasMainArgs(id, jp.getMainArgsIdentifier())) {
+                    // store id for terminated identification
+                    jp.setId(id);
+                    System.out.println("RELEASED (id=" + jp.getId() + ", args=" + jp.getMainArgsIdentifier() + ")");
+                    started.release();
+                    return;
                 }
             }
         }
 
-
-        private int addStarted(Set<Integer> started) {
-            int found = 0;
-            for (Integer lvmid : started) {
-                try {
-                    VmIdentifier vmid = new VmIdentifier("//" + lvmid.intValue());
-                    MonitoredVm target = host.getMonitoredVm(vmid);
-
-                    StringMonitor cmdMonitor =
-                            (StringMonitor)target.findByName("sun.rt.javaCommand");
-                    String cmd = cmdMonitor.stringValue();
+        private void releaseTerminated(Set<Integer> ids) {
+            System.out.println("releaseTerminated(" + ids + ")");
+            for (Integer id : ids) {
+                releaseTerminated(id);
+            }
+        }
 
-                    patternMatcher.reset(cmd);
-                    System.out.print("Started: " + lvmid.intValue()
-                                     + ": " + "\"" + cmd + "\"" + ": ");
-
-                    if (patternMatcher.matches()) {
-                        System.out.println("matches pattern - recorded");
-                        targets.add(lvmid);
-                        found++;
-                    }
-                    else {
-                        System.out.println("does not match pattern - ignored");
-                    }
-                } catch (URISyntaxException e) {
-                    System.err.println("Unexpected URISyntaxException: "
-                                       + e.getMessage());
-                } catch (MonitorException e) {
-                    System.err.println("Unexpected MonitorException: "
-                                       + e.getMessage());
+        private void releaseTerminated(Integer id) {
+            for (JavaProcess jp : processes) {
+                if (id.equals(jp.getId())) {
+                    System.out.println("RELEASED (id=" + jp.getId() + ", args=" + jp.getMainArgsIdentifier() + ")");
+                    terminated.release();
+                    return;
                 }
             }
-            return found;
         }
 
-        private int removeTerminated(Set<Integer> terminated) {
-            int found = 0;
-            for (Integer lvmid : terminated) {
-                /*
-                 * we don't attempt to attach to the target here as it's
-                 * now dead and has no jvmstat share memory file. Just see
-                 * if the process id is among those that we saved when we
-                 * started the targets (note - duplicated allowed and somewhat
-                 * expected on windows);
-                 */
-                System.out.print("Terminated: " + lvmid.intValue() + ": ");
-                if (targets.contains(lvmid)) {
-                    System.out.println("matches pattern - termination recorded");
-                    targets.remove(lvmid);
-                    found++;
+        private boolean hasMainArgs(Integer id, String args) {
+            try {
+                VmIdentifier vmid = new VmIdentifier("//" + id.intValue());
+                MonitoredVm target = host.getMonitoredVm(vmid);
+                String monitoredArgs = MonitoredVmUtil.mainArgs(target);
+                if (monitoredArgs != null && monitoredArgs.contains(args)) {
+                    return true;
                 }
-                else {
-                    System.out.println("does not match pattern - ignored");
-                }
+            } catch (URISyntaxException | MonitorException e) {
+                // ok. process probably not running
             }
-            return found;
+            return false;
+        }
+    }
+
+    public final static class JavaProcess {
+
+        private static final class ShutdownHook extends Thread {
+            private final JavaProcess javaProcess;
+
+            public ShutdownHook(JavaProcess javaProcess) {
+                this.javaProcess = javaProcess;
+            }
+
+            public void run() {
+                javaProcess.terminate();
+            }
         }
 
-        @SuppressWarnings("unchecked")
-        public void vmStatusChanged(VmStatusChangeEvent ev) {
-            printList(ev.getActive(), "Active");
-            printList(ev.getStarted(), "Started");
-            printList(ev.getTerminated(), "Terminated");
+        public static void main(String[] args) throws InterruptedException {
+            try {
+                Path path = Paths.get(args[0]);
+                createFile(path);
+                waitForRemoval(path);
+            } catch (Throwable t) {
+                t.printStackTrace();
+                System.exit(1);
+            }
+        }
 
-            int recentlyStarted = addStarted(ev.getStarted());
-            int recentlyTerminated = removeTerminated(ev.getTerminated());
+        public Integer getId() {
+            return id;
+        }
 
-            for (int i = 0; i < recentlyTerminated; i++) {
-                terminateLatch.countDown();
-            }
-            for (int i = 0; i < recentlyStarted; i++) {
-                startLatch.countDown();
+        public void setId(Integer id) {
+            this.id = id;
+        }
+
+        private static void createFile(Path path) throws IOException {
+            Files.write(path, new byte[0], StandardOpenOption.CREATE);
+            if (!Files.exists(path)) {
+                throw new Error("Newly created file " + path
+                        + " does not exist!");
             }
         }
 
-        public void disconnected(HostEvent ev) {
+        private static void waitForRemoval(Path path) {
+            long start = System.nanoTime();
+            while (true) {
+                long now = System.nanoTime();
+                long waited = now - start;
+                System.out.println("Waiting for " + path + " to be removed, " + waited + " ns");
+                if (!Files.exists(path)) {
+                    return;
+                }
+                if (waited > PROCESS_TIMEOUT_IN_NS) {
+                    System.out.println("Start: " + start);
+                    System.out.println("Now: " + now);
+                    System.out.print("Process timed out after " + waited + " ns. Abort.");
+                    System.exit(1);
+                }
+                takeNap();
+            }
         }
-    }
-
-    public static class SleeperStarter extends Thread {
 
-        private final JavaProcess[] processes;
-        private final int execInterval;
-        private final String args;
+        private static void takeNap() {
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                // ignore
+            }
+        }
 
-        public SleeperStarter(int sleepers, int execInterval, String args) {
-            this.execInterval = execInterval;
-            this.args = args;
-            this.processes = new JavaProcess[sleepers];
+        private final String mainArgsIdentifier;
+        private final ShutdownHook shutdownHook;
+        private volatile Integer id;
+
+        public JavaProcess(String mainArgsIdentifier) {
+            this.mainArgsIdentifier = mainArgsIdentifier;
+            this.shutdownHook = new ShutdownHook(this);
         }
 
-        private synchronized int active() {
-            int active = processes.length;
-            for(JavaProcess jp : processes) {
-                try {
-                    jp.exitValue();
-                    active--;
-                } catch (IllegalThreadStateException e) {
-                    // process hasn't exited yet
+        /**
+         * Starts a Java process asynchronously.
+         *
+         * The process runs until {@link #stop()} is called. If test exits
+         * unexpectedly the process will be cleaned up by a shutdown hook.
+         *
+         * @throws Exception
+         */
+        public void start() throws Exception {
+            Runtime.getRuntime().addShutdownHook(shutdownHook);
+            System.out.println("Starting " + getMainArgsIdentifier());
+
+            Runnable r = new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        executeJava();
+                    } catch (Throwable t) {
+                        t.printStackTrace();
+                    }
                 }
-            }
-            return active;
+            };
+            new Thread(r).start();
         }
 
-        public void run() {
-           System.out.println("Starting " + processes.length + " sleepers");
-
-           String[] classpath = {
-               "-classpath",
-               System.getProperty("java.class.path")
-           };
+        public void terminate() {
+            try {
+                System.out.println("Terminating " + mainArgsIdentifier);
+                Files.delete(Paths.get(mainArgsIdentifier));
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            Runtime.getRuntime().removeShutdownHook(shutdownHook);
+        }
 
-           for (int i = 0; i < processes.length; i++) {
-               try {
-                   System.out.println("Starting Sleeper " + i);
-                   synchronized(this) {
-                       processes[i] = new JavaProcess("Sleeper", args + " " + i);
-                       processes[i].addOptions(classpath);
-                   }
-                   processes[i].start();
-                   Thread.sleep(execInterval);
-               } catch (InterruptedException ignore) {
-               } catch (IOException e) {
-                   System.err.println(
-                           "IOException trying to start Sleeper " + i + ": "
-                           + e.getMessage());
-               }
-           }
+        private void executeJava() throws Exception, IOException {
+            String className = JavaProcess.class.getName();
+            String classPath = System.getProperty("test.classes");
+            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-cp",
+                    classPath, className, mainArgsIdentifier);
+            OutputBuffer ob = ProcessTools.getOutput(pb.start());
+            System.out.println("Java Process " + getMainArgsIdentifier() + " stder:"
+                    + ob.getStderr());
+            System.err.println("Java Process " + getMainArgsIdentifier() + " stdout:"
+                    + ob.getStdout());
+        }
 
-           // spin waiting for the processes to terminate
-           while (active() > 0) ;
+        public String getMainArgsIdentifier() {
+            return mainArgsIdentifier;
         }
     }
 }
-
--- a/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# @test
-# @bug 4990825
-# @summary attach to external but local JVM processes
-# @library ../../testlibrary
-# @build Sleeper
-# @build JavaProcess
-# @build MonitorVmStartTerminate
-# @run shell MonitorVmStartTerminate.sh
-#
-
-. ${TESTSRC-.}/../../testlibrary/utils.sh
-
-setup
-verify_os
-
-JAVA="${TESTJAVA}/bin/java"
-CP=${TESTJAVA}${FS}lib${FS}tools.jar${PS}${TESTCLASSES}${PS}${TESTCLASSES}${FS}..${FS}..${FS}testlibrary
-
-${JAVA} ${TESTVMOPTS} -classpath ${CP} MonitorVmStartTerminate
--- a/test/sun/jvmstat/testlibrary/JavaProcess.java	Thu Jul 03 11:37:18 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- *
- */
-
-import java.io.*;
-
-public class JavaProcess {
-
-    protected Process process = null;
-
-    private String classname;
-    private StringBuilder classArgs;
-    private StringBuilder javaOptions;
-
-    private static String java = System.getProperty("java.home")
-                                 + File.separator + "bin"
-                                 + File.separator + "java";
-
-    public JavaProcess(String classname) {
-        this(classname, "", "");
-    }
-
-    public JavaProcess(String classname, String classArgs) {
-        this(classname, "", classArgs);
-    }
-
-    public JavaProcess(String classname, String javaOptions, String classArgs) {
-        this.classname = classname;
-        this.javaOptions = new StringBuilder(javaOptions);
-        this.classArgs = new StringBuilder(classArgs);
-    }
-
-    /**
-     * add java options to the java command
-     */
-    public void addOptions(String[] opts) {
-        if (javaOptions != null && javaOptions.length() > 0) {
-            javaOptions.append(" ");
-        }
-
-        for (int i = 0; i < opts.length; i++) {
-            if (i != 0) {
-                javaOptions.append(" ");
-            }
-            javaOptions.append(opts[i]);
-        }
-    }
-
-    /**
-     * add arguments to the class arguments
-     */
-    public void addArguments(String[] args) {
-        if (classArgs != null && classArgs.length() > 0) {
-            classArgs.append(" ");
-        }
-
-        for (int i = 0; i < args.length; i++) {
-            if (i != 0) {
-                classArgs.append(" ");
-            }
-            classArgs.append(args[i]);
-        }
-    }
-
-    /**
-     * start the java process
-     */
-    public void start() throws IOException {
-        if (process != null) {
-            return;
-        }
-
-        String javaCommand = java + " " + javaOptions + " "
-                             + classname + " " + classArgs;
-
-        System.out.println("exec'ing: " + javaCommand);
-
-        process = Runtime.getRuntime().exec(javaCommand);
-    }
-
-    /**
-     * destroy the java process
-     */
-    public void destroy() {
-        if (process != null) {
-            process.destroy();
-        }
-        process = null;
-    }
-
-    public int exitValue() {
-        if (process != null) {
-            return process.exitValue();
-        }
-        throw new RuntimeException("exitValue called with process == null");
-    }
-
-    public InputStream getErrorStream() {
-        if (process != null) {
-            return process.getErrorStream();
-        }
-        throw new RuntimeException(
-                "getErrorStream() called with process == null");
-    }
-
-    public InputStream getInputStream() {
-        if (process != null) {
-            return process.getInputStream();
-        }
-        throw new RuntimeException(
-                "getInputStream() called with process == null");
-    }
-
-    public OutputStream getOutputStream() {
-        if (process != null) {
-            return process.getOutputStream();
-        }
-        throw new RuntimeException(
-                "getOutputStream() called with process == null");
-    }
-
-    public int waitFor() throws InterruptedException {
-        if (process != null) {
-            return process.waitFor();
-        }
-        throw new RuntimeException("waitFor() called with process == null");
-    }
-}
--- a/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -122,7 +122,6 @@
             );
 
             final AtomicReference<String> port = new AtomicReference<>();
-            final AtomicReference<String> pid = new AtomicReference<>();
 
             serverPrc = ProcessTools.startProcess(
                 "Launcher",
@@ -130,12 +129,10 @@
                 (String line) -> {
                     if (line.startsWith("port:")) {
                          port.set(line.split("\\:")[1]);
-                     } else  if (line.startsWith("pid:")) {
-                         pid.set(line.split("\\:")[1]);
-                     } else if (line.startsWith("waiting")) {
+                    } else if (line.startsWith("waiting")) {
                          return true;
-                     }
-                     return false;
+                    }
+                    return false;
                 },
                 5,
                 TimeUnit.SECONDS
@@ -143,7 +140,7 @@
 
             System.out.println("Attaching test manager:");
             System.out.println("=========================");
-            System.out.println("  PID           : " + pid.get());
+            System.out.println("  PID           : " + serverPrc.getPid());
             System.out.println("  shutdown port : " + port.get());
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
@@ -156,7 +153,7 @@
                     File.separator +
                     "tools.jar",
                 "TestManager",
-                pid.get(),
+                String.valueOf(serverPrc.getPid()),
                 port.get(),
                 "true"
             );
--- a/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -109,7 +109,6 @@
         Process serverPrc = null, clientPrc = null;
         try {
             final AtomicReference<String> port = new AtomicReference<>();
-            final AtomicReference<String> pid = new AtomicReference<>();
 
             serverPrc = ProcessTools.startProcess(
                 "TestApplication(" + testId + ")",
@@ -117,12 +116,10 @@
                 (String line) -> {
                     if (line.startsWith("port:")) {
                          port.set(line.split("\\:")[1]);
-                     } else  if (line.startsWith("pid:")) {
-                         pid.set(line.split("\\:")[1]);
-                     } else if (line.startsWith("waiting")) {
-                         return true;
-                     }
-                     return false;
+                    } else if (line.startsWith("waiting")) {
+                        return true;
+                    }
+                    return false;
                 },
                 5,
                 TimeUnit.SECONDS
@@ -130,7 +127,7 @@
 
             System.out.println("Attaching test manager:");
             System.out.println("=========================");
-            System.out.println("  PID           : " + pid.get());
+            System.out.println("  PID           : " + serverPrc.getPid());
             System.out.println("  shutdown port : " + port.get());
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
@@ -143,7 +140,7 @@
                     File.separator +
                     "tools.jar",
                 "TestManager",
-                pid.get(),
+                String.valueOf(serverPrc.getPid()),
                 port.get(),
                 "true"
             );
--- a/test/sun/management/jmxremote/bootstrap/TestApplication.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/management/jmxremote/bootstrap/TestApplication.java	Wed Jul 09 10:42:37 2014 -0700
@@ -26,16 +26,13 @@
  *
  * A test "application" used by unit tests -
  *   LocalManagementTest.java, CustomLauncherTest.java.
- * This application binds to some random port, prints its pid and
- * the port number to standard output, waits for somebody to connect,
- * and then shuts down.
+ * This application binds to some random port, prints the port number
+ * to standard output, waits for somebody to connect, and then shuts down.
  */
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
 
-import jdk.testlibrary.ProcessTools;
-
 public class TestApplication {
     public static void main(String[] args) throws IOException {
         // Some tests require the application to exit immediately
@@ -47,16 +44,8 @@
         ServerSocket ss = new ServerSocket(0);
         int port = ss.getLocalPort();
 
-        int pid = -1;
-        try {
-            pid = ProcessTools.getProcessId();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
         // signal test that we are started - do not remove these lines!!
         System.out.println("port:" + port);
-        System.out.println("pid:" + pid);
         System.out.println("waiting for the manager ...");
         System.out.flush();
 
--- a/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java	Wed Jul 09 10:42:37 2014 -0700
@@ -31,7 +31,6 @@
     }
 
     public static void main(String args[]) throws Exception {
-        System.out.println("pid:" + ProcessTools.getProcessId());
         System.out.println("main enter");
         System.out.flush();
         doSomething();
--- a/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/management/jmxremote/startstop/JMXStartStopTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,6 +38,7 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
 
 import javax.management.*;
@@ -52,7 +53,7 @@
  * @bug 7110104
  * @library /lib/testlibrary
  * @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething
- * @run main/othervm JMXStartStopTest
+ * @run main/othervm/timeout=600 JMXStartStopTest
  * @summary Makes sure that enabling/disabling the management agent through
  *          JCMD achieves the desired results
  */
@@ -132,13 +133,13 @@
     }
 
 
-    private static void testConnectLocal(int pid)
+    private static void testConnectLocal(long pid)
     throws Exception {
 
         String jmxUrlStr = null;
 
         try {
-            jmxUrlStr = sun.management.ConnectorAddressLink.importFrom(pid);
+            jmxUrlStr = sun.management.ConnectorAddressLink.importFrom((int)pid);
             dbg_print("Local Service URL: " +jmxUrlStr);
             if ( jmxUrlStr == null ) {
                 throw new Exception("No Service URL. Local agent not started?");
@@ -290,11 +291,14 @@
     public static void main(String args[]) throws Exception {
         for (Method m : JMXStartStopTest.class.getDeclaredMethods()) {
             if (m.getName().startsWith("test_")) {
+                long t1 = System.currentTimeMillis();
                 try {
                     m.invoke(null);
-                    System.out.println("=== PASSED\n");
+                    System.out.println("=== PASSED");
                 } catch (Throwable e) {
                     failures.add(new Failure(e, m.getName() + " failed"));
+                } finally {
+                    System.out.println("(took " + (System.currentTimeMillis() - t1) + "ms)\n");
                 }
             }
         }
@@ -313,7 +317,7 @@
         private final ProcessBuilder pb;
         private final String name;
         private final AtomicBoolean started = new AtomicBoolean(false);
-        private volatile int pid = -1;
+        private volatile long pid = -1;
 
         public Something(ProcessBuilder pb, String name) {
             this.pb = pb;
@@ -326,15 +330,11 @@
                     p = ProcessTools.startProcess(
                         "JMXStartStopDoSomething",
                         pb,
-                        (line) -> {
-                            if (line.toLowerCase().startsWith("pid:")) {
-                                pid = Integer.parseInt(line.split("\\:")[1]);
-                            }
-                            return line.equals("main enter");
-                        },
+                        (line) -> line.equals("main enter"),
                         5,
                         TimeUnit.SECONDS
                     );
+                    pid = p.getPid();
                 } catch (TimeoutException e) {
                     p.destroy();
                     p.waitFor();
@@ -343,7 +343,7 @@
             }
         }
 
-        public int getPid() {
+        public long getPid() {
             return pid;
         }
 
@@ -585,11 +585,11 @@
 
             testConnect(pa.getPort1(), pa.getPort2());
 
-            final boolean[] checks = new boolean[3];
+            final AtomicInteger checks = new AtomicInteger();
             jcmd(
                 line -> {
                     if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
-                        checks[0] = true;
+                        checks.getAndUpdate((op) -> op | 1);
                     }
                 },
                 CMD_START,
@@ -600,7 +600,7 @@
             jcmd(
                 line -> {
                     if (line.contains("java.lang.RuntimeException: Invalid agent state")) {
-                        checks[1] = true;
+                        checks.getAndUpdate((op) -> op | 2);
                     }
                 },
                 CMD_START,
@@ -611,12 +611,14 @@
             jcmd(CMD_STOP);
             jcmd(CMD_STOP);
 
+            int busyPort;
             try (ServerSocket ss = new ServerSocket(0))
             {
+                busyPort = ss.getLocalPort();
                 jcmd(
                     line -> {
-                        if (line.contains("Port already in use: " + ss.getLocalPort())) {
-                            checks[2] = true;
+                        if (line.contains("Port already in use: " + busyPort)) {
+                            checks.getAndUpdate((op) -> op | 4);
                         }
                     },
                     CMD_START,
@@ -624,19 +626,18 @@
                     "jmxremote.rmi.port=" + pa.getPort2(),
                     "jmxremote.authenticate=false",
                     "jmxremote.ssl=false");
-
-                if (!checks[0]) {
-                    throw new Exception("Starting agent on port " + pa.getPort1() + " should " +
-                                        "report an invalid agent state");
-                }
-                if (!checks[1]) {
-                    throw new Exception("Starting agent on poprt " + pa.getPort2() + " should " +
-                                        "report an invalid agent state");
-                }
-                if (!checks[2]) {
-                    throw new Exception("Starting agent on port " + ss.getLocalPort() + " should " +
-                                        "report port in use");
-                }
+            }
+            if ((checks.get() & 1) == 0) {
+                throw new Exception("Starting agent on port " + pa.getPort1() + " should " +
+                                    "report an invalid agent state");
+            }
+            if ((checks.get() & 2) == 0) {
+                throw new Exception("Starting agent on poprt " + pa.getPort2() + " should " +
+                                    "report an invalid agent state");
+            }
+            if ((checks.get() & 4) == 0) {
+                throw new Exception("Starting agent on port " + busyPort + " should " +
+                                    "report port in use");
             }
         } finally {
             s.stop();
--- a/test/sun/security/krb5/auto/HttpNegotiateServer.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/security/krb5/auto/HttpNegotiateServer.java	Wed Jul 09 10:42:37 2014 -0700
@@ -55,6 +55,8 @@
 import org.ietf.jgss.GSSManager;
 import sun.security.jgss.GSSUtil;
 import sun.security.krb5.Config;
+import sun.util.logging.PlatformLogger;
+
 import java.util.Base64;
 
 /**
@@ -148,6 +150,10 @@
     public static void main(String[] args)
             throws Exception {
 
+        String HTTPLOG = "sun.net.www.protocol.http.HttpURLConnection";
+        System.setProperty("sun.security.krb5.debug", "true");
+        PlatformLogger.getLogger(HTTPLOG).setLevel(PlatformLogger.Level.ALL);
+
         KDC kdcw = KDC.create(REALM_WEB);
         kdcw.addPrincipal(WEB_USER, WEB_PASS);
         kdcw.addPrincipalRandKey("krbtgt/" + REALM_WEB);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/ccache/EmptyRealmCC.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8048073
+ * @summary Cannot read ccache entry with a realm-less service name
+ * @compile -XDignore.symbol.file EmptyRealmCC.java
+ * @run main EmptyRealmCC
+ */
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import sun.security.krb5.internal.ccache.CredentialsCache;
+
+public class EmptyRealmCC {
+    public static void main(String[] args) throws Exception {
+        byte[] ccache = TimeInCCache.ccache;
+
+        // The service name starts at 0x52:
+        //
+        //    0050:    00 00 00 02 00 00 00 0A 4D 41 58 49 2E 4C
+        //             ----------- -----------
+        //    0060: 4F 43 41 4C 00 00 00 06 6B 72 62 74 67 74 00 00
+        //                      -----------                   -----
+        //    0070: 00 0A 4D 41 58 49 2E 4C 4F 43 41 4C
+        //          -----
+        //
+        // which contains 2 (the length of names), a 10-byte realm, a 6-byte
+        // name[0], and a 10-byte name[1].
+
+        // We will empty the realm, and pack the realm string to another
+        // name (6-byte ".LOCAL"). Finally "krbtgt/MAXI.LOCAL@MAXI.LOCAL"
+        // becomes ".LOCAL/krbtgt/MAXI.LOCAL@".
+
+        // length of names is now 3
+        ccache[0x55] = 3;
+        // The empty realm
+        System.arraycopy(new byte[4], 0, ccache, 0x56, 4);
+        // Length of inserted name is 6
+        System.arraycopy(new byte[]{0,0,0,6}, 0, ccache, 0x5A, 4);
+
+        Files.write(Paths.get("tmpcc"), TimeInCCache.ccache);
+        if (CredentialsCache.getInstance("tmpcc").getCredsList() != null) {
+            throw new Exception("Nothing should be there");
+        }
+    }
+}
--- a/test/sun/security/krb5/ccache/TimeInCCache.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/security/krb5/ccache/TimeInCCache.java	Wed Jul 09 10:42:37 2014 -0700
@@ -28,16 +28,14 @@
  */
 
 import java.io.ByteArrayInputStream;
-import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.nio.file.Files;
-import java.nio.file.Paths;
 
 import sun.security.krb5.internal.ccache.CCacheInputStream;
 import sun.security.krb5.internal.ccache.Credentials;
 
 public class TimeInCCache {
-    // Attention: this field is also used by CorruptedCC.java test
+    // Attention: this field is also used by 2 other tests:
+    // CorruptedCC.java and EmptyRealmCC.java
     public static byte[] ccache;
 
     static {
--- a/test/sun/security/krb5/config/Duplicates.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/security/krb5/config/Duplicates.java	Wed Jul 09 10:42:37 2014 -0700
@@ -38,22 +38,22 @@
         config.listTable();
         String s;
 
-        // Latter overwrites former for root section
+        // root section merged
         s = config.get("libdefaults", "default_realm");
-        if (s != null) {
+        if (!s.equals("R1")) {
             throw new Exception();
         }
-        // Latter overwrites former for strings
+        // Former is preferred to latter for strings and sections
         s = config.get("libdefaults", "default_tkt_enctypes");
-        if (!s.equals("aes256-cts")) {
+        if (!s.equals("aes128-cts")) {
             throw new Exception();
         }
-        // Latter overwrites former for sub-section
         s = config.get("realms", "R1", "kdc");
-        if (!s.equals("k2")) {
+        if (!s.equals("k1")) {
             throw new Exception(s);
         }
-        // Duplicate keys in [realms] are merged
+        // Duplicate keys in [realms] are merged, and sections with the same
+        // name in between ignored
         s = config.getAll("realms", "R2", "kdc");
         if (!s.equals("k1 k2 k3 k4")) {
             throw new Exception(s);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/config/Include.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8029994
+ * @summary Support "include" and "includedir" in krb5.conf
+ * @compile -XDignore.symbol.file Include.java
+ * @run main/othervm Include
+ */
+import sun.security.krb5.Config;
+import sun.security.krb5.KrbException;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class Include {
+    public static void main(String[] args) throws Exception {
+
+        String krb5Conf = "[section]\nkey=";        // Skeleton of a section
+
+        Path conf = Paths.get("krb5.conf");         // base krb5.conf
+
+        Path ifile = Paths.get("f");                // include f
+        Path idir = Paths.get("x");                 // includedir fx
+        Path idirdir = Paths.get("x/xx");           // sub dir, will be ignored
+        Path idirdirfile = Paths.get("x/xx/ff");    // sub dir, will be ignored
+        Path idirfile1 = Paths.get("x/f1");         // one file
+        Path idirfile2 = Paths.get("x/f2");         // another file
+        Path idirfile3 = Paths.get("x/f.3");        // third file bad name
+
+        // OK: The base file can be missing
+        System.setProperty("java.security.krb5.conf", "no-such-file");
+        tryReload(true);
+
+        System.setProperty("java.security.krb5.conf", conf.toString());
+
+        // Write base file
+        Files.write(conf,
+                ("include " + ifile.toAbsolutePath() + "\n" +
+                        "includedir " + idir.toAbsolutePath() + "\n" +
+                        krb5Conf + "base").getBytes()
+        );
+
+        // Error: Neither include nor includedir exists
+        tryReload(false);
+
+        // Error: Only includedir exists
+        Files.createDirectory(idir);
+        tryReload(false);
+
+        // Error: Both exists, but include is a cycle
+        Files.write(ifile,
+                ("include " + conf.toAbsolutePath() + "\n" +
+                    krb5Conf + "incfile").getBytes());
+        tryReload(false);
+
+        // Error: A good include exists, but no includedir
+        Files.delete(idir);
+        Files.write(ifile, (krb5Conf + "incfile").getBytes());
+        tryReload(false);
+
+        // OK: Everything is set
+        Files.createDirectory(idir);
+        tryReload(true);   // Now OK
+
+        // fx1 and fx2 will be loaded
+        Files.write(idirfile1, (krb5Conf + "incdir1").getBytes());
+        Files.write(idirfile2, (krb5Conf + "incdir2").getBytes());
+        // fx3 and fxs (and file inside it) will be ignored
+        Files.write(idirfile3, (krb5Conf + "incdir3").getBytes());
+        Files.createDirectory(idirdir);
+        Files.write(idirdirfile, (krb5Conf + "incdirdir").getBytes());
+
+        // OK: All good files read
+        tryReload(true);
+
+        String v = Config.getInstance().getAll("section", "key");
+        // The order of files in includedir could be either
+        if (!v.equals("incfile incdir1 incdir2 base") &&
+                !v.equals("incfile incdir2 incdir1 base")) {
+            throw new Exception(v);
+        }
+
+        // Error: include file not absolute
+        Files.write(conf,
+                ("include " + ifile + "\n" +
+                        "includedir " + idir.toAbsolutePath() + "\n" +
+                        krb5Conf + "base").getBytes()
+        );
+        tryReload(false);
+
+        // Error: includedir not absolute
+        Files.write(conf,
+                ("include " + ifile.toAbsolutePath() + "\n" +
+                        "includedir " + idir + "\n" +
+                        krb5Conf + "base").getBytes()
+        );
+        tryReload(false);
+
+        // OK: unsupported directive
+        Files.write(conf,
+                ("module /lib/lib.so\n" +
+                        krb5Conf + "base").getBytes()
+        );
+        tryReload(true);
+    }
+
+    private static void tryReload(boolean expected) throws Exception {
+        if (expected) {
+            Config.refresh();
+        } else {
+            try {
+                Config.refresh();
+                throw new Exception("Should be illegal");
+            } catch (KrbException ke) {
+                // OK
+            }
+        }
+    }
+}
--- a/test/sun/security/krb5/config/k1.conf	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/security/krb5/config/k1.conf	Wed Jul 09 10:42:37 2014 -0700
@@ -9,11 +9,15 @@
 R1 = {
     kdc = k1
 }
+R1 = hello
 R1 = {
     kdc = k2
 }
 R2 = {
     kdc = k1
+    kdc = {
+        foo = bar
+    }
     kdc = k2 k3
     admin_server = a1
     kdc = k4
--- a/test/sun/tools/jstat/JStatInterval.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/tools/jstat/JStatInterval.java	Wed Jul 09 10:42:37 2014 -0700
@@ -42,14 +42,12 @@
 import java.util.concurrent.atomic.AtomicInteger;
 
 public class JStatInterval {
-    private static final String PID = "PID";
     private static final String READY = "READY";
     private static final String ERROR = "!ERROR";
 
     public static class Application {
         public static void main(String[] args) {
             try {
-                System.out.println(PID + ":" + ProcessTools.getProcessId());
                 System.out.println(READY);
                 System.out.flush();
                 int exitCode = System.in.read();
@@ -69,15 +67,12 @@
             "-XX:+UsePerfData",
             Application.class.getName()
         );
-        AtomicInteger pid = new AtomicInteger(-1);
         AtomicBoolean error = new AtomicBoolean(false);
         Process app = ProcessTools.startProcess(
             "application",
             pb,
             line -> {
-                if (line.startsWith(PID)) {
-                    pid.set(Integer.parseInt(line.split("\\:")[1]));
-                } else if (line.equals(READY)) {
+                if (line.equals(READY)) {
                     return true;
                 } else if (line.equals(ERROR)) {
                     error.set(true);
@@ -92,7 +87,7 @@
             throw new Error("Unable to start the monitored application.");
         }
 
-        String pidStr = String.valueOf(pid.get());
+        String pidStr = String.valueOf(app.getPid());
         JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK("jstat");
         l.addToolArg("-compiler");
         l.addToolArg(pidStr);
--- a/test/sun/tools/jstatd/JstatdTest.java	Thu Jul 03 11:37:18 2014 -0700
+++ b/test/sun/tools/jstatd/JstatdTest.java	Wed Jul 09 10:42:37 2014 -0700
@@ -22,12 +22,12 @@
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.net.UnknownHostException;
 import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.util.Arrays;
-import java.util.regex.Pattern;
 
 import static jdk.testlibrary.Asserts.*;
 import jdk.testlibrary.JDKToolLauncher;
@@ -69,7 +69,7 @@
     private boolean useDefaultPort = true;
     private String port;
     private String serverName;
-    private String jstatdPid;
+    private Long jstatdPid;
     private boolean withExternalRegistry = false;
 
     public void setServerName(String serverName) {
@@ -84,67 +84,26 @@
         this.withExternalRegistry = withExternalRegistry;
     }
 
-    /**
-     * Parse pid from jps output
-     */
-    private String parsePid(String tool, OutputAnalyzer output) throws Exception {
-        String[] lines = output.getOutput().split(Utils.NEW_LINE);
-        String pid = null;
-        int count = 0;
-        String processName = tool;
-        if (tool == "rmiregistry") {
-            processName = "registryimpl";
-        }
+    private Long waitOnTool(ProcessThread thread) throws Throwable {
+        long pid = thread.getPid();
 
-        Pattern toolInJpsPattern =
-                Pattern.compile("^\\d+\\s{1}" + processName + "\\s{1}.*-dparent\\.pid\\." + ProcessTools.getProcessId() + ".*");
-        for (String line : lines) {
-            if (toolInJpsPattern.matcher(line.toLowerCase()).matches()) {
-                pid = line.split(" ")[0];
-                count++;
+        Throwable t = thread.getUncaught();
+        if (t != null) {
+            if (t.getMessage().contains(
+                    "java.rmi.server.ExportException: Port already in use")) {
+                System.out.println("Port already in use. Trying to restart with a new one...");
+                Thread.sleep(100);
+                return null;
+            } else {
+                // Something unexpected has happened
+                throw new Throwable(t);
             }
         }
-        if (count > 1) {
-            throw new Exception("Expected one " + tool
-                    + " process, got " + count + ". Test will be canceled.");
-        }
 
+        System.out.println(thread.getName() + " pid: " + pid);
         return pid;
     }
 
-    private String getToolPid(String tool)
-            throws Exception {
-        OutputAnalyzer output = runJps();
-        return parsePid(tool, output);
-    }
-
-    private String waitOnTool(String tool, TestThread thread) throws Throwable {
-        while (true) {
-            String pid = getToolPid(tool);
-
-            if (pid != null) {
-                System.out.println(tool + " pid: " + pid);
-                return pid;
-            }
-
-            Throwable t = thread.getUncaught();
-            if (t != null) {
-                if (t.getMessage().contains(
-                        "java.rmi.server.ExportException: Port already in use")) {
-                    System.out.println("Port already in use. Trying to restart with a new one...");
-                    Thread.sleep(100);
-                    return null;
-                } else {
-                    // Something unexpected has happened
-                    throw new Throwable(t);
-                }
-            }
-
-            System.out.println("Waiting until " + tool + " is running...");
-            Thread.sleep(100);
-        }
-    }
-
     private void log(String caption, String... cmd) {
         System.out.println(Utils.NEW_LINE + caption + ":");
         System.out.println(Arrays.toString(cmd).replace(",", ""));
@@ -180,12 +139,29 @@
         log("Start jps", cmd);
 
         ProcessBuilder processBuilder = new ProcessBuilder(cmd);
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = waitForJstatdRMI(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
     }
 
+    private OutputAnalyzer waitForJstatdRMI(ProcessBuilder pb) throws IOException, InterruptedException {
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+        while (output.getExitValue() != 0) {
+            String out = output.getOutput();
+
+            if (out.contains("RMI Registry not available") ||
+                out.contains("RMI Server JStatRemoteHost not available")) {
+                Thread.sleep(100);
+                output = new OutputAnalyzer(pb.start());
+            } else {
+                output.shouldHaveExitValue(0);
+            }
+        }
+        return output;
+    }
+
     /**
      * Verifies output form jps contains pids and programs' name information.
      * The function will discard any lines that come before the first line with pid.
@@ -235,7 +211,7 @@
         log("Start jstat", cmd);
 
         ProcessBuilder processBuilder = new ProcessBuilder(cmd);
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = waitForJstatdRMI(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
@@ -323,7 +299,7 @@
         try {
             jstatdThread.start();
             // Make sure jstatd is up and running
-            jstatdPid = waitOnTool("jstatd", jstatdThread);
+            jstatdPid = waitOnTool(jstatdThread);
             if (jstatdPid == null) {
                 // The port is already in use. Cancel and try with new one.
                 jstatdThread.stopProcess();
@@ -344,7 +320,7 @@
         try {
             while (jstatdThread == null) {
                 if (!useDefaultPort || withExternalRegistry) {
-                    port = Integer.toString(Utils.getFreePort());
+                    port = String.valueOf(Utils.getFreePort());
                 }
 
                 if (withExternalRegistry) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/pack200/PackChecksum.java	Wed Jul 09 10:42:37 2014 -0700
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+
+/*
+ * @test
+ * @bug 8000650
+ * @summary unpack200.exe should check gzip crc
+ * @compile -XDignore.symbol.file Utils.java PackChecksum.java
+ * @run main PackChecksum
+ * @author kizune
+ */
+public class PackChecksum {
+
+    public static void main(String... args) throws Exception {
+        testChecksum();
+    }
+
+    static void testChecksum() throws Exception {
+
+        // Create a fresh .jar file
+        File testFile = new File("src_tools.jar");
+        File testPack = new File("src_tools.pack.gz");
+        generateJar(testFile);
+        List<String> cmdsList = new ArrayList<>();
+
+        // Create .pack file
+        cmdsList.add(Utils.getPack200Cmd());
+        cmdsList.add(testPack.getName());
+        cmdsList.add(testFile.getName());
+        Utils.runExec(cmdsList);
+
+        // Mess up with the checksum of the packed file
+        RandomAccessFile raf = new RandomAccessFile(testPack, "rw");
+        raf.seek(raf.length() - 8);
+        int val = raf.readInt();
+        val = Integer.MAX_VALUE - val;
+        raf.seek(raf.length() - 8);
+        raf.writeInt(val);
+        raf.close();
+
+        File dstFile = new File("dst_tools.jar");
+        cmdsList.clear();
+        cmdsList.add(Utils.getUnpack200Cmd());
+        cmdsList.add(testPack.getName());
+        cmdsList.add(dstFile.getName());
+
+        boolean passed = false;
+        try {
+            Utils.runExec(cmdsList);
+        } catch (RuntimeException re) {
+            // unpack200 should exit with non-zero exit code
+            passed = true;
+        }
+
+        // tidy up
+        if (testFile.exists()) testFile.delete();
+        if (testPack.exists()) testPack.delete();
+        if (dstFile.exists()) dstFile.delete();
+        if (!passed) {
+            throw new Exception("File with incorrect CRC unpacked without the error.");
+        }
+    }
+
+    static void generateJar(File result) throws IOException {
+        if (result.exists()) {
+            result.delete();
+        }
+
+        try (JarOutputStream output = new JarOutputStream(new FileOutputStream(result)); ) {
+            for (int i = 0 ; i < 100 ; i++) {
+                JarEntry e = new JarEntry("F-" + i + ".txt");
+                output.putNextEntry(e);
+            }
+            output.flush();
+            output.close();
+        }
+    }
+
+}