changeset 2984:a423b6a55def

merge with jdk9-b60
author mcimadamore
date Wed, 22 Apr 2015 17:42:41 +0100
parents 447d5ec649da 35c897f16852
children d32645bf6e83
files make/CommonLangtools.gmk make/GensrcLangtools.gmk make/Makefile make/build.properties src/java.base/share/classes/jdk/Exported.java src/jdk.compiler/share/classes/com/sun/tools/classfile/Dependencies.java src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/SpecializeTypes.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java src/jdk.compiler/share/classes/com/sun/tools/javac/file/SymbolArchive.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/LVTRanges.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Pool.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java src/jdk.compiler/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileManager.java src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileObject.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacMessager.java src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties src/jdk.compiler/share/classes/com/sun/tools/javac/sym/CreateSymbols.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/BaseFileManager.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/List.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java src/jdk.compiler/share/classes/com/sun/tools/javap/AttributeWriter.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/AttrWithDeps.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/JavaCompilerWithDeps.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/ResolveWithDeps.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacErrorHandler.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java test/com/sun/javadoc/testJavaFX/C.java test/com/sun/javadoc/testJavaFX/D.java test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java test/com/sun/javadoc/testNonFrameWarning/pkg/C.java test/lib/annotations/annotations/classfile/ClassfileInspector.java test/lib/combo/tools/javac/combo/JavacTemplateTestBase.java test/tools/apt/Basics/CheckAptIsRemovedTest.java test/tools/javac/7129225/NegTest.ref test/tools/javac/7129225/TestImportStar.ref test/tools/javac/Paths/CompileClose.java test/tools/javac/Paths/SameJVM.java test/tools/javac/api/6411310/Test.java test/tools/javac/diags/examples/NonStaticCantBeRefFragment.java test/tools/javac/diags/examples/StaticBoundMref.java test/tools/javac/diags/examples/StaticMethodInUnboundLookup.java test/tools/javac/diags/examples/UnderscoreAsIdentifier.java test/tools/javac/failover/CheckAttributedTree.java test/tools/javac/generics/bridges/BridgeHarness.java test/tools/javac/lambda/IdentifierTest.out test/tools/javac/lambda/WarnUnderscoreAsIdent.java test/tools/javac/lambda/WarnUnderscoreAsIdent.out test/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java test/tools/javac/lib/DPrinter.java test/tools/javac/nio/compileTest/CompileTest.java test/tools/javac/nio/compileTest/HelloPathWorld.java test/tools/javac/parser/laxIdentifiers/LaxIdentifierTemplate.java test/tools/javac/resolve/tests/PrimitiveBinopOverload.java test/tools/javac/warnings/Deprecation.lintAll.out test/tools/javah/compareTest/CompareTest.java test/tools/javah/compareTest/CompareTest.sh test/tools/javah/compareTest/FindNativeFiles.java test/tools/javah/compareTest/README test/tools/jdeps/profiles.properties test/tools/sjavac/SJavac.java
diffstat 936 files changed, 37649 insertions(+), 18432 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Apr 01 15:13:45 2015 +0100
+++ b/.hgtags	Wed Apr 22 17:42:41 2015 +0100
@@ -277,3 +277,29 @@
 ad99965443d19a59e810ae67b0b742bb9722f5ed jdk9-b32
 e891e0c4edc5174a4da6d19dc2d59697b79f1916 jdk9-b33
 e18407fcede818b30709913784cb6b904030531d jdk9-b34
+b8e7bbdd806465a916e64413c283075ceb0a782c jdk9-b35
+c536541235e566701ff772700c15de14b75e2979 jdk9-b36
+478972d90f7bf5002615c5b2fb1ec3e0338fcadd jdk9-b37
+5ad591bc3ef6d1b30b215cb9c228bf94aac6dc7c jdk9-b38
+5ff1cd07bd9297e82cfea5ec01249d162260fe4e jdk9-b39
+c286272a81dd8f6005e22fed0238c4a3f75188c7 jdk9-b40
+f7ce2cfa4cdbec0ae0f46080484eace66be7987a jdk9-b41
+23a3a063a906a91ba696d792f0eeabf157cd2f86 jdk9-b42
+6a06008aec10d32898ca665685f531c681b28f5f jdk9-b43
+de2ce70d907c9f227b802cea29285bece5194cd5 jdk9-b44
+73bbdcf236b297a0c1b8875f2eeba65eaf7ade60 jdk9-b45
+e272d9be5f90edb6bb6b40f7816ec85eec0f5dc2 jdk9-b46
+230c139552501e612dd0d4423ac30f94c1201c0d jdk9-b47
+5b102fc29edf8b7eee7df208d8a8bba0e0a52f3a jdk9-b48
+15c79f28e30a1be561abe0d67674232ad5034d32 jdk9-b49
+1ccb6ef2f40bf9961b27adac390a6fc5181aa1fc jdk9-b50
+7c44d9a33bbea75f5d91625df9bbccea360aea2a jdk9-b51
+ee20efe0255d7ac6e06e88e06f7c72f6c6da7bf9 jdk9-b52
+99ff00581f3633c1787bec21f2a8f3a2ffe57665 jdk9-b53
+ed34864f3b43a7df394fce6c3f0bc86b70a5d686 jdk9-b54
+32a2e724988499e6f68611a65168c5f2fde0f6b9 jdk9-b55
+5ee7bba6ef41447f921184e8522da36734aec089 jdk9-b56
+ec977a00cecbf0007b0fa26c7af2852d57a79cad jdk9-b57
+07ce89fec30165a2f1212047bd23b30086ed1e74 jdk9-b58
+a598534d277e170a0bbf177bd54d9d179245532b jdk9-b59
+81bdc4545337c404bb87373838c983584a49afd6 jdk9-b60
--- a/make/CommonLangtools.gmk	Wed Apr 01 15:13:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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.  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 BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
-# and the interim javac, to be run by the boot jdk.
-$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
-    JAVAC := $(JAVAC), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
-    FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror))
-
-# javax.tools.JavaCompilerTool isn't really a suffix but this gets the file copied.
-RESOURCE_SUFFIXES := .gif .xml .css .js javax.tools.JavaCompilerTool
--- a/make/CompileInterim.gmk	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/CompileInterim.gmk	Wed Apr 22 17:42:41 2015 +0100
@@ -29,9 +29,9 @@
 include $(SPEC)
 include MakeBase.gmk
 include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
 
-include CommonLangtools.gmk
-
+################################################################################
 # Setup the rules to build the interim langtools jar, which is compiled by
 # the boot javac and can be run on the boot jdk. This will be used to compile
 # the rest of the product. Include the Genstubs build tool in this compilation
@@ -43,13 +43,12 @@
       $(LANGTOOLS_TOPDIR)/src/jdk.compiler/share/classes \
       $(LANGTOOLS_TOPDIR)/src/jdk.dev/share/classes \
       $(LANGTOOLS_TOPDIR)/src/jdk.javadoc/share/classes \
-      $(LANGTOOLS_TOPDIR)/src/java.base/share/classes \
-      $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler \
-      $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.dev \
-      $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.javadoc, \
-    EXCLUDES := com/sun/tools/javac/nio compileproperties anttasks crules, \
-    COPY := $(RESOURCE_SUFFIXES) jdeps.properties jdkinternals.properties version.properties, \
-    BIN := $(LANGTOOLS_OUTPUTDIR)/interim_classes, \
+      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.compiler \
+      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.dev \
+      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.javadoc, \
+    EXCLUDES := sun jdk, \
+    COPY := .gif .xml .css .js javax.tools.JavaCompilerTool, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_interim_classes, \
     JAR := $(INTERIM_LANGTOOLS_JAR)))
 
 all: $(BUILD_INTERIM_LANGTOOLS)
--- a/make/GensrcLangtools.gmk	Wed Apr 01 15:13:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +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.  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 must be the first rule
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-include CommonLangtools.gmk
-
-################################################################################
-# Setup the compilation of the properties compilation tool. You can depend
-# upon $(BUILD_TOOLS_LANGTOOLS) to trigger a compilation of the tools. Note that 
-# we add src/share/classes to the sourcepath. This is necessary since the 
-# GenStubs program needs to be linked and run with the new javac sources.
-$(eval $(call SetupJavaCompilation,BUILD_TOOLS_LANGTOOLS, \
-    SETUP := BOOT_JAVAC, \
-    DISABLE_SJAVAC := true, \
-    ADD_JAVAC_FLAGS := -Xprefer:source, \
-    SRC := $(LANGTOOLS_TOPDIR)/make/tools, \
-    INCLUDES := compileproperties, \
-    BIN := $(LANGTOOLS_OUTPUTDIR)/buildtools_classes))
-
-################################################################################
-# The compileprops tools compiles a properties file into a resource bundle.
-TOOL_COMPILEPROPS_CMD := $(JAVA) -cp $(LANGTOOLS_OUTPUTDIR)/buildtools_classes \
-    compileproperties.CompileProperties -quiet
-
-# Lookup the properties that need to be compiled into resource bundles.
-PROPSOURCES := $(shell $(FIND) $(LANGTOOLS_TOPDIR)/src/*/share/classes -name "*.properties")
-
-# Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
-# to .../langtools/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
-# Strip away prefix and suffix, leaving for example only: 
-# "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
-PROPJAVAS := $(patsubst $(LANGTOOLS_TOPDIR)/src/%.properties, \
-    $(LANGTOOLS_OUTPUTDIR)/gensrc/%.java, \
-    $(subst /share/classes,,$(PROPSOURCES)))
-
-# Generate the package dirs for the tobe generated java files. Sort to remove
-# duplicates.
-PROPDIRS := $(sort $(dir $(PROPJAVAS)))
-
-# Now generate a sequence of:
-# "-compile ...javac_zh_CN.properties ...javac_zh_CN.java java.util.ListResourceBundle"
-# suitable to be fed into the CompileProperties command.
-PROPCMDLINE := $(subst _SPACE_, $(SPACE), \
-    $(join $(addprefix -compile_SPACE_, $(PROPSOURCES)), \
-    $(addsuffix _SPACE_java.util.ListResourceBundle, \
-    $(addprefix _SPACE_, $(PROPJAVAS)))))
-
-# Now setup the rule for the generation of the resource bundles.
-$(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props: $(PROPSOURCES) $(BUILD_TOOLS_LANGTOOLS)
-	$(RM) -r $(@D)/*
-	$(MKDIR) -p $(@D) $(PROPDIRS)
-	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" \
-	    > $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javah/resources/version.properties
-	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" \
-	    > $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javap/resources/version.properties
-	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" \
-	    > $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javac/resources/version.properties
-	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" \
-	    > $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.dev/com/sun/tools/jdeps/resources/version.properties
-	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" \
-	    > $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.javadoc/com/sun/tools/javadoc/resources/version.properties
-	$(ECHO) Compiling $(words $(PROPSOURCES) v1 v2 v3) properties into resource bundles
-	$(TOOL_COMPILEPROPS_CMD) $(PROPCMDLINE) \
-	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javah/resources/version.properties \
-	        $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javah/resources/version.java \
-	        java.util.ListResourceBundle \
-	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javap/resources/version.properties \
-	        $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javap/resources/version.java \
-	        java.util.ListResourceBundle \
-	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javac/resources/version.properties \
-	        $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.compiler/com/sun/tools/javac/resources/version.java \
-	        java.util.ListResourceBundle \
-	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.dev/com/sun/tools/jdeps/resources/version.properties \
-	        $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.dev/com/sun/tools/jdeps/resources/version.java \
-	        java.util.ListResourceBundle \
-	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.javadoc/com/sun/tools/javadoc/resources/version.properties \
-	        $(LANGTOOLS_OUTPUTDIR)/gensrc/jdk.javadoc/com/sun/tools/javadoc/resources/version.java \
-	        java.util.ListResourceBundle
-	$(TOUCH) $@
-
-all: $(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props
-
-################################################################################
--- a/make/Makefile	Wed Apr 01 15:13:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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.
-#
-
-# Locate this Makefile
-ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
-  makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST))
-else
-  makefile_path := $(lastword $(MAKEFILE_LIST))
-endif
-repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path))
-
-# What is the name of this subsystem (langtools, corba, etc)?
-subsystem_name := $(notdir $(repo_dir))
-
-# Try to locate top-level makefile
-top_level_makefile := $(repo_dir)/../Makefile
-ifneq ($(wildcard $(top_level_makefile)), )
-  $(info Will run $(subsystem_name) target on top-level Makefile)
-  $(info WARNING: This is a non-recommended way of building!)
-  $(info ===================================================)
-else
-  $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
-  $(error Build from top-level Makefile instead)
-endif
-
-all:
-	@$(MAKE) -f $(top_level_makefile) $(subsystem_name)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/Tools.gmk	Wed Apr 22 17:42:41 2015 +0100
@@ -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.
+#
+
+# This must be the first rule
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
+################################################################################
+# Setup the compilation of the properties compilation tool. You can depend
+# upon $(BUILD_TOOLS_LANGTOOLS) to trigger a compilation of the tools.
+$(eval $(call SetupJavaCompilation,BUILD_TOOLS_LANGTOOLS, \
+    SETUP := BOOT_JAVAC, \
+    DISABLE_SJAVAC := true, \
+    ADD_JAVAC_FLAGS := -Xprefer:source, \
+    SRC := $(LANGTOOLS_TOPDIR)/make/tools, \
+    INCLUDES := compileproperties propertiesparser, \
+    COPY := .properties, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes))
+
+all: $(BUILD_TOOLS_LANGTOOLS)
--- a/make/build.properties	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/build.properties	Wed Apr 22 17:42:41 2015 +0100
@@ -23,25 +23,48 @@
 # questions.
 #
 
-# This is the JDK used to build and run the bootstrap version of javac.
-# The bootstrap javac is used to compile both boostrap versions of the
-# other tools, and product versions of all the tools.
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
+#javac configuration for "normal build" (these will be passed to the bootstrap compiler):
+javac.debug = true
+javac.debuglevel = source,lines,vars
+javac.extra.opts=-XDignore.symbol.file=true
+javac.includes=
+javac.lint.opts = -Xlint:all,-deprecation -Werror
+javac.source = 8
+javac.target = 8
 
-# boot.java.home = /opt/jdk/1.7.0
-boot.java = ${boot.java.home}/bin/java
-boot.javac = ${boot.java.home}/bin/javac
+#javac configuration for bootstrap build (these will be passed to the compiler from the given boot JDK):
+boot.javac.extra.opts=-XDignore.symbol.file=true
+boot.javac.includes = \
+        javax/annotation/processing/ \
+        javax/lang/model/ \
+        javax/tools/ \
+        jdk/ \
+        com/sun/source/ \
+        com/sun/tools/javac/ \
+        com/sun/tools/doclint/
+boot.javac.lint.opts=
 boot.javac.source = 8
 boot.javac.target = 8
 
-# This is the JDK used to run the product version of the tools,
-# for example, for testing. If you're building a complete JDK, specify that.
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
+#configuration of submodules (share by both the bootstrap and normal compilation):
+langtools.modules=java.compiler:jdk.compiler:jdk.dev:jdk.javadoc
+java.compiler.dependencies=
+jdk.compiler.dependencies=java.compiler
+jdk.javadoc.dependencies=java.compiler:jdk.compiler
+jdk.dev.dependencies=java.compiler:jdk.compiler
 
-# target.java.home = /opt/jdk/1.8.0
-target.java = ${target.java.home}/bin/java
+javac.resource.includes = \
+        com/sun/tools/javac/resources/compiler.properties
+
+#test configuration:
+jtreg.tests=
+boot.javac.tests = tools/javac
+crules.tests = ../make/test/crules
+
+#javadoc configuration
+javadoc.jls.cite=The Java&trade; Language Specification
+javadoc.jls.option=-tag "jls:a:See &lt;cite&gt;${javadoc.jls.cite}&lt;/cite&gt;:" \
+    -tag "implNote:a:Implementation Note:"
 
 # Version info -- override as needed
 jdk.version = 1.9.0
@@ -55,147 +78,4 @@
 # timestamps
 # FIXME -- need to include openjdk as needed
 release = ${jdk.version}-${milestone}
-bootstrap.release = ${release}_bootstrap
 full.version = ${release}-${build.number}
-bootstrap.full.version = ${bootstrap.release}-${build.number}
-
-# options for the <javac> tasks used to compile the tools
-javac.source = 8
-javac.target = 8
-javac.debug = true
-javac.debuglevel = source,lines
-javac.no.jdk.warnings = -XDignore.symbol.file=true
-# set the following to -version to verify the versions of javac being used
-javac.version.opt =
-# in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all,-deprecation -Werror
-
-# options for the <javadoc> task for javac
-#javadoc.jls3.url=http://java.sun.com/docs/books/jls/
-#javadoc.jls3.cite=&lt;a href=&quot;${javadoc.jls3.url}&quot;&gt;The Java Language Specification, Third Edition&lt;/a&gt;
-#javadoc.jls3.option=-tag "jls3:a:See &lt;cite&gt;${javadoc.jls3.cite}&lt;/cite&gt;:"
-
-
-javadoc.jls.cite=The Java&trade; Language Specification
-
-javadoc.jls.option=-tag "jls:a:See &lt;cite&gt;${javadoc.jls.cite}&lt;/cite&gt;:"
-
-
-
-
-
-# jtreg, used to run the JDK regression tests
-# See http://openjdk.java.net/jtreg/
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-
-# jtreg.home = /opt/jtreg/4.1
-
-# findbugs
-# See http://findbugs.sourceforge.net/
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-
-# findbugs.home = /opt/findbugs/1.2.1
-
-# vizant (graph visualization tool for Ant)
-# See http://vizant.sourceforge.net/
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-
-# vizant.jar = /opt/vizant/0.1.2/vizant-0.1.2.jar
-# dot = dot
-
-#------------------------------------------------------------
-
-# The following properties define the packages for each of the tools.
-# Syntactically, they should be suitable as arguments for the "includes"
-# parameter of Ant filesets. In particular, note the trailing '/'.
-
-javac.includes = \
-        javax/annotation/processing/ \
-        javax/lang/model/ \
-        javax/lang/ \
-        javax/tools/ \
-        jdk/ \
-        com/sun/source/ \
-        com/sun/tools/javac/ \
-        com/sun/tools/doclint/
-
-javac.tests = \
-        tools/javac
-
-#
-
-javadoc.includes = \
-        com/sun/javadoc/ \
-        com/sun/tools/javadoc/ \
-        com/sun/tools/doclets/
-
-javadoc.tests = \
-        tools/javadoc/ \
-        com/sun/javadoc/
-
-#
-
-javah.includes = \
-        com/sun/tools/javah/
-
-javah.tests = \
-        tools/javah/
-
-#
-
-javap.includes = \
-        com/sun/tools/classfile/ \
-        com/sun/tools/javap/ \
-        com/sun/tools/jdeps/ \
-        sun/tools/javap/
-
-javap.tests = \
-        tools/javap/
-
-#
-
-sjavac.includes = \
-        com/sun/tools/sjavac/
-
-sjavac.tests = \
-        tools/sjavac
-
-crules.tests = ../make/test/crules
-
-#
-
-# The following files require the latest JDK to be available.
-# The API can be provided by using a suitable boot.java.home
-# or by setting import.jdk
-require.latest.jdk.files = \
-    com/sun/tools/javac/nio/*.java
-
-# The following files in the import jdk source directory are required
-# in order to compile the files defined in ${require.latest.jdk.files}
-#
-# For NIO, the list of stub files is defined by the contents of the primary
-# API packages, together with such types that may be required in order to
-# compile the stubs. Some of these dependencies would go away if the stub
-# generator were to be improved -- e.g. by removing unnecessary imports.
-#
-import.jdk.stub.files = \
-    java/io/File.java \
-    java/nio/file/**.java \
-    java/nio/file/attribute/**.java \
-    java/nio/file/spi/**.java \
-    java/nio/channels/AsynchronousChannel.java \
-    java/nio/channels/AsynchronousFileChannel.java \
-    java/nio/channels/CompletionHandler.java \
-    java/nio/channels/SeekableByteChannel.java
-
-# The following value is used by the main jtreg target.
-# An empty value means all tests
-# Override as desired to run a specific set of tests
-jtreg.tests =
-
-# Check style configuration
-# overridable name and version
-checkstyle.name.version = checkstyle-5.4
--- a/make/build.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/build.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -25,10 +25,10 @@
 -->
 
 <!--
- This is the main build file for the complete langtools repository.
- It is used when building JDK (in which case it is invoked from the
- Makefile), and it can be used when working on the tools themselves,
- in an IDE such as NetBeans.
+ This is a convenience build file supporting development in the langtools
+ repository. It can be run either standalone, or from IDEs. This build script
+ is for a developer use only, it is not used to build the production version
+ of javac or other langtools tools.
 
  External dependencies are specified via properties. These can be given
  on the command line, or by providing a local build.properties file.
@@ -39,58 +39,27 @@
  For example, to run any of the jtreg tests you must set jtreg.home,
  to run findbugs on the code you must set findbugs.home, and so on.
 
- For the most part, javac can be built using the previous version of JDK.
- However, a small number of javac files require access to the latest JDK,
- which may not yet have been compiled. To compile these files, you can do
- one of the following:
- - Set boot.java.home to a recent build of the latest version of JDK.
- - Set import.jdk to either a recent build (containing jre/lib/rt.jar)
-   or to jdk source repository.  In the latter case, stub files will
-   automatically be generated and used for the required API, to avoid
-   unnecessary compilation of the source repository.
- If you do neither, the relevant files will not be built.
-
  The main build happens in two phases:
- - First, javac and other tools as needed are built using ${boot.java.home}.
-   (This implies a constraint on the source code that they can be compiled
-   with the previous version of JDK.
+ - First, javac is built using ${boot.java.home}. (This implies a constraint
+   on the source code that they can be compiled with the previous version of JDK.
  - Second, all required classes are compiled with the latest javac, created
    in the previous step.
- The first phase is called the bootstrap phase. All targets, properties and
- tasks that are specific to that phase have "bootstrap" in their name.
+ The build generally builds one module at time.
 
- For more details on the JDK build, see
-    http://blogs.sun.com/kto/entry/anatomy_of_the_jdk_build
-    http://openjdk.java.net/groups/build/
  For more details on the stub generator, see
     http://blogs.sun.com/jjg/entry/building_javac_for_jdk7
 
  Internal details ...
 
- Interim build products are created in the build/ directory.
- Final build products are created in the dist/ directory.
- When building JDK, the dist/directory will contain:
- - A bootstrap compiler suitable for running with ${boot.java.home}
-   suitable for compiling downstream parts of JDK
- - Source files and class files for inclusion in the JDK being built
- When building standalone, the dist/directory will contain:
- - Separate jar files for each of the separate langtools components
- - Simple scripts to invoke the tools by executing the corresponding
-   jar files.
- These jar files and scripts are "for developer use only".
+ Bootstrap classes are built into the build/bootstrap/<module-name>/classes directory.
+ Final classes are built into the build/<module-name>/classes directory.
+ Final runnable javac is in dist/bin and dist/lib. Bootstrap javac (if requested by
+ using the build-bootstrap-javac target) is built into dist/bootstrap.
 
  This file is organized into sections as follows:
  - global property definitions
- - general top level targets
- - general diagnostic/debugging targets
- - groups of targets for each tool: javac, javadoc, javah, javap
-    Within each group, the following targets are provided, where applicable
-      build-bootstrap-TOOL      build the bootstrap version of the tool
-      build-classes-TOOL        build the classes for the tool
-      build-TOOL                build the jar file and script for the tool
-      jtreg-TOOL                build the tool and run the appropriate tests
-      findbugs-TOOL             run findbugs on the tool's source code
-      TOOL                      build the tool, run the tests, and run findbugs
+ - primary top level targets (cleaning, building, testing, producing javac)
+ - secondary top level targets (code analysis, diagnostics, extra documentation, etc.)
  - utility definitions
  -->
 
@@ -99,13 +68,6 @@
     **** Global property definitions.
     -->
 
-    <!-- Force full debuginfo for javac if the debug.classfiles
-    property is set.  This must be BEFORE the include of
-    build.properties because it sets javac.debuglevel.  -->
-    <condition property="javac.debuglevel" value="source,lines,vars">
-        <equals arg1="${debug.classfiles}" arg2="true"/>
-    </condition>
-
     <!-- The following locations can be used to override default property values. -->
 
     <!-- Use this location for customizations specific to this instance of this workspace -->
@@ -119,36 +81,24 @@
 
     <!-- Convenient shorthands for standard locations within the workspace. -->
     <property name="build.dir" location="build"/>
-    <property name="build.bootstrap.dir" location="${build.dir}/bootstrap"/>
-    <property name="build.coverage.dir" location="${build.dir}/coverage"/>
-    <property name="build.classes.dir" location="${build.dir}/classes"/>
-    <property name="build.gensrc.dir" location="${build.dir}/gensrc"/>
-    <property name="build.genstubs.dir" location="${build.dir}/genstubs"/>
-    <property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
+    <property name="build.crules.dir" location="${build.dir}/crules"/>
     <property name="build.jtreg.dir" location="${build.dir}/jtreg"/>
     <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
+    <property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
     <property name="dist.dir" location="dist"/>
     <property name="dist.bin.dir" location="${dist.dir}/bin"/>
-    <property name="dist.coverage.dir" location="${dist.dir}/coverage"/>
+    <property name="dist.lib.dir" location="${dist.dir}/lib"/>
     <property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/>
     <property name="dist.checkstyle.dir" location="${dist.dir}/checkstyle"/>
-    <property name="dist.lib.dir" location="${dist.dir}/lib"/>
     <property name="make.dir" location="make"/>
     <property name="make.conf.dir" location="${make.dir}/conf"/>
     <property name="make.tools.dir" location="${make.dir}/tools"/>
-    <property name="src.dir" location="src"/>
-    <property name="src.bin.dir" location="${src.dir}/share/bin"/>
     <property name="test.dir" location="test"/>
 
-    <path id="src.dirs">
-      <pathelement path="${src.dir}/java.base/share/classes"/>
-      <pathelement path="${src.dir}/java.compiler/share/classes"/>
-      <pathelement path="${src.dir}/jdk.compiler/share/classes"/>
-      <pathelement path="${src.dir}/jdk.dev/share/classes"/>
-      <pathelement path="${src.dir}/jdk.javadoc/share/classes"/>
-    </path>
-
-    <pathconvert pathsep="," property="src.dirs.property" refid="src.dirs" />
+    <property name="boot.build.dir" location="${build.dir}/bootstrap"/>
+    <property name="boot.dist.dir" location="${dist.dir}/bootstrap"/>
+    <property name="boot.dist.bin.dir" location="${boot.dist.dir}/bin"/>
+    <property name="boot.dist.lib.dir" location="${boot.dist.dir}/lib"/>
 
     <!-- java.marker is set to a marker file to check for within a Java install dir.
          The best file to check for across Solaris/Linux/Windows/MacOS is one of the
@@ -172,110 +122,89 @@
         <isset property="target.java.home"/>
     </condition>
 
-    <!-- Logic for handling access import jdk classes, if available.
-        import.jdk should be unset, or set to jdk home (to use rt.jar)
-        or to jdk repo (to use src/share/classes).
-        Based on the value, if any, set up default values for javac's sourcepath,
-        classpath and bootclasspath. Note: the default values are overridden
-        in the build-bootstrap-classes macro. -->
-
-    <available property="import.jdk.src.dir" value="${import.jdk}/src/share/classes"
-        filepath="${import.jdk}/src/share/classes" file="java/nio/file/Path.java"/>
-    <available property="import.jdk.jar" value="${import.jdk}/jre/lib/rt.jar"
-        ignoresystemclasses="true"
-        classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.Path"/>
-
-    <!-- Set the default bootclasspath option used for javac.
-        Note that different variants of the option are used, meaning we can't just
-        define the value for the option.
-        Note the explicit use of the standard property ${path.separator} in the following.
-        This is because Ant is not clever enough to handle direct use of : or ; -->
-    <condition property="javac.bootclasspath.opt"
-            value="-Xbootclasspath:${build.classes.dir}${path.separator}${import.jdk.jar}"
-            else="-Xbootclasspath/p:${build.classes.dir}">
-        <isset property="import.jdk.jar"/>
-    </condition>
-
-    <condition property="boot.java.provides.latest.jdk">
-        <available
-            ignoresystemclasses="true"
-            classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.Path"/>
-    </condition>
-
-    <condition property="bootstrap.exclude.files" value="" else="${require.latest.jdk.files}">
-        <isset property="boot.java.provides.latest.jdk"/>
-    </condition>
-
-    <condition property="exclude.files" value="" else="${require.latest.jdk.files}">
-        <or>
-            <isset property="boot.java.provides.latest.jdk"/>
-            <isset property="import.jdk"/>
-        </or>
-    </condition>
-
-    <condition property="require.import.jdk.stubs">
-        <and>
-            <not>
-                <isset property="boot.java.provides.latest.jdk"/>
-            </not>
-            <isset property="import.jdk.src.dir"/>
-        </and>
-    </condition>
-
-    <!-- Set the default value of the sourcepath used for javac. -->
-    <condition property="javac.sourcepath" value="${build.genstubs.dir}" else="">
-        <isset property="require.import.jdk.stubs"/>
-    </condition>
-
-    <!-- Set the default value of the classpath used for javac. -->
-    <property name="javac.classpath" value=""/>
-
+    <!-- setup basic properties holding paths to all sources, generated source and class directories
+         (both boot and non-boot) -->
+    <pathconvert property="langtools.sources">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${basedir}/src/" />
+        <mapper type="glob" from="*" to="*/share/classes"/>
+    </pathconvert>
+    <pathconvert property="langtools.gensrc">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${build.dir}/" />
+        <mapper type="glob" from="*" to="*/gensrc"/>
+    </pathconvert>
+    <pathconvert property="langtools.boot.classes">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${boot.build.dir}/" />
+        <mapper type="glob" from="*" to="*/classes"/>
+    </pathconvert>
+    <pathconvert property="langtools.classes">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${build.dir}/" />
+        <mapper type="glob" from="*" to="*/classes"/>
+    </pathconvert>
 
     <!--
-    **** General top level targets.
+        **** Primary targets
     -->
 
-    <!-- Standard target to build deliverables for JDK build. -->
-
-    <target name="build" depends="build-bootstrap-tools,build-all-classes">
-        <copy todir="${dist.dir}/bootstrap">
-            <fileset dir="${build.bootstrap.dir}" includes="bin/,lib/"/>
-        </copy>
-        <chmod dir="${dist.dir}/bootstrap/bin" perm="ugo+rx">
-            <include name="*"/>
-        </chmod>
-        <mkdir dir="${dist.lib.dir}"/>
-        <jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/>
-        <zip file="${dist.lib.dir}/src.zip">
-            <multirootfileset basedirs="${src.dirs.property}" />
-        </zip>
-    </target>
-
-    <target name="build-bootstrap-tools"
-        depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-javah,build-bootstrap-sjavac"
-    />
-
-    <target name="build-all-tools"
-        depends="build-javac,build-javadoc,build-javah,build-javap,build-sjavac"
-    />
-
-    <target name="build-all-classes" depends="build-bootstrap-javac,-create-import-jdk-stubs">
-        <build-classes includes="${javac.includes} ${javadoc.includes} ${javah.includes} ${javap.includes} ${sjavac.includes}"/>
-    </target>
-
-    <!-- clean -->
-
     <target name="clean" description="Delete all generated files">
         <delete dir="${build.dir}"/>
         <delete dir="${dist.dir}"/>
     </target>
 
-    <!-- Additional targets for running tools on the build -->
+    <target name="build" depends="build-all-tools">
+    </target>
+
+    <target name="build-all-tools" depends="build-all-classes,-def-build-all-module-jars,-def-build-tool">
+        <build-all-module-jars />
+        <build-tool name="javac"/>
+        <build-tool name="javadoc"/>
+        <build-tool name="javap"/>
+        <build-tool name="javah"/>
+        <build-tool name="sjavac"/>
+    </target>
+
+    <target name="build-all-classes" depends="-def-build-all-module-classes,build-bootstrap-javac-classes">
+        <build-all-module-classes />
+    </target>
 
     <target name="jtreg" depends="build-all-tools,-def-jtreg">
         <jtreg-tool name="all" tests="${jtreg.tests}"/>
     </target>
 
+    <target name="javadoc" depends="build-all-classes,-def-javadoc-tool">
+        <javadoc-tool options="${javadoc.jls.option}"/>
+    </target>
+
+    <target name="build-bootstrap-javac-classes" depends="-check-boot.java.home,-def-build-all-module-classes">
+        <build-all-module-classes compilation.kind="boot." />
+    </target>
+
+    <!--
+        **** Extra targets
+    -->
+
+    <target name="build-bootstrap-javac" depends="build-bootstrap-javac-classes,-def-build-all-module-jars,-def-build-tool">
+        <build-all-module-jars compilation.kind="boot." />
+        <build-tool name="javac" compilation.kind="boot." />
+    </target>
+
+    <target name="jtreg-bootstrap-javac" depends="build-bootstrap-javac,-def-jtreg">
+        <jtreg-tool name="bootstrap-javac"
+                    tests="${boot.javac.tests}"
+                    langtools.classes="${langtools.boot.classes}"/>
+    </target>
+
     <target name="checkstyle" depends="-def-checkstyle"
         description="Generates reports for code convention violations.">
         <mkdir dir="${dist.checkstyle.dir}"/>
@@ -325,9 +254,12 @@
             warningsProperty="findbugs.all.warnings"
             jvm="${target.java.home}/bin/java"
             jvmargs="-Xmx512M">
-            <class location="${build.classes.dir}"/>
+            <class location="${build.dir}/java.compiler/classes"/>
+            <class location="${build.dir}/jdk.compiler/classes"/>
+            <class location="${build.dir}/jdk.javadoc/classes"/>
+            <class location="${build.dir}/jdk.dev/classes"/>
             <sourcePath>
-                <path refid="src.dirs"/>
+                <pathelement path="${langtools.sources}"/>
             </sourcePath>
         </findbugs>
         <exec executable="sh">
@@ -339,49 +271,7 @@
         </exec>
     </target>
 
-    <target name="coverage" depends="-def-cobertura,build-all-classes,instrument-classes,jtreg,coverage-report"/>
-
-    <target name="instrument-classes" depends="-def-cobertura">
-        <!-- only define the following property when we want coverage info -->
-        <path id="coverage.classpath">
-            <pathelement location="${build.coverage.dir}/classes"/>
-            <path refid="cobertura.classpath"/>
-        </path>
-        <property name="coverage.options" value="-Dnet.sourceforge.cobertura.datafile=${build.coverage.dir}/cobertura.ser"/>
-        <property name="coverage.classpath" refid="coverage.classpath"/>
-        <mkdir dir="${build.coverage.dir}/classes"/>
-        <delete file="${build.coverage.dir}/cobertura.ser"/>
-        <cobertura-instrument todir="${build.coverage.dir}/classes"
-            datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${build.classes.dir}"
-               includes="**/*.class" excludes="**/resources/*.class"/>
-        </cobertura-instrument>
-    </target>
-
-    <target name="coverage-report" depends="-def-cobertura">
-        <mkdir dir="${dist.coverage.dir}"/>
-        <cobertura-report
-            destdir="${dist.coverage.dir}"
-            datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${src.dir}/java.base/share/classes"/>
-            <fileset dir="${src.dir}/java.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.dev/share/classes"/>
-            <fileset dir="${src.dir}/jdk.javadoc/share/classes"/>
-        </cobertura-report>
-        <cobertura-report
-            format="xml"
-            destdir="${dist.coverage.dir}"
-            datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${src.dir}/java.base/share/classes"/>
-            <fileset dir="${src.dir}/java.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.dev/share/classes"/>
-            <fileset dir="${src.dir}/jdk.javadoc/share/classes"/>
-        </cobertura-report>
-    </target>
-
-    <target name="diags-examples" depends="build-javac,build-javap">
+    <target name="diags-examples" depends="build-all-tools">
         <!-- can override the following on the command line if desired. -->
         <property name="diags.examples.out" location="${build.dir}/diag-examples/diags-examples.html"/>
         <mkdir dir="${build.dir}/diag-examples/classes"/>
@@ -391,7 +281,7 @@
             destdir="${build.dir}/diag-examples/classes"
             includes="ArgTypeCompilerFactory.java,Example.java,FileManager.java,HTMLWriter.java,RunExamples.java,DocCommentProcessor.java"
             sourcepath=""
-            classpath="${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar"
+            classpath="${langtools.classes}"
             includeAntRuntime="no"
             debug="${javac.debug}"
             debuglevel="${javac.debuglevel}">
@@ -400,7 +290,7 @@
         <java fork="true"
             jvm="${target.java.home}/bin/java"
             dir="test/tools/javac/diags"
-            classpath="${build.dir}/diag-examples/classes;${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar"
+            classpath="${build.dir}/diag-examples/classes;${langtools.classes}"
             classname="RunExamples">
             <jvmarg value="-Dtest.classes=${build.dir}/diag-examples/classes"/>
             <arg value="-examples"/>
@@ -413,56 +303,16 @@
         </java>
     </target>
 
-    <!-- a patching facility to speed up incorporating the langtools' classfiles
-         into a jdk of your choice. Either target.java.home or patch.jdk can be
-         set on the command line; setting target.java.home has the advantage of
-         patching the jdk used for jtreg and other tests.
-    -->
-    <target name="patch" depends="build-all-classes">
-        <condition property="patch.jdk" value="${target.java.home}">
-            <available file="${target.java.home}" type="dir"/>
-        </condition>
-        <fail message="patch.jdk or target.java.home is not set, please set target.java.home, or patch.jdk for an alternate jdk image to patch">
-            <condition>
-                <not>
-                    <isset property="patch.jdk"/>
-                </not>
-            </condition>
-        </fail>
-        <property name="patch.tools.jar" location="${patch.jdk}/lib/tools.jar"/>
-        <property name="patch.rt.jar" location="${patch.jdk}/jre/lib/rt.jar"/>
-        <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing tools.jar">
-            <condition>
-                <not>
-                    <available file="${patch.tools.jar}" type="file"/>
-                </not>
-            </condition>
-        </fail>
-        <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing rt.jar">
-            <condition>
-                <not>
-                    <available file="${patch.rt.jar}" type="file"/>
-                </not>
-            </condition>
-        </fail>
-        <zip zipfile="${patch.tools.jar}" update="true">
-            <zipfileset dir="${build.classes.dir}" includes="com/**"/>
-        </zip>
-        <zip zipfile="${patch.rt.jar}" update="true">
-            <zipfileset dir="${build.classes.dir}" includes="javax/**"/>
-        </zip>
-    </target>
-
     <target name="doclint-api" depends="build-all-classes">
         <delete dir="${build.dir}/doclint/classes"/>
         <mkdir dir="${build.dir}/doclint/classes"/>
         <javac fork="true"
-               executable="${boot.javac}"
+               executable="${boot.java.home}/bin/javac"
                destdir="${build.dir}/doclint/classes"
                includes="javax/lang/model/** com/sun/javadoc/** com/sun/source/**"
                excludes=""
-               sourcepath="${javac.sourcepath}"
-               classpath="${javac.classpath}"
+               sourcepath=""
+               classpath="${langtools.classes}"
                includeAntRuntime="no"
                source="${javac.source}"
                target="${javac.target}"
@@ -471,12 +321,11 @@
             <compilerarg value="-implicit:none"/>
             <compilerarg value="-Xprefer:source"/>
             <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-            <compilerarg line="${javac.no.jdk.warnings}"/>
-            <compilerarg line="${javac.version.opt}"/>
+            <compilerarg line="${javac.extra.opts}"/>
             <compilerarg line="-Xdoclint:all/protected,-missing"/>
             <src>
-                <path refid="src.dirs"/>
-                <path location="${build.gensrc.dir}"/>
+                <pathelement path="${langtools.sources}"/>
+                <pathelement path="${langtools.gensrc}"/>
             </src>
         </javac>
     </target>
@@ -515,17 +364,12 @@
             </classpath>
             <!-- platform classes used for documentation -->
             <bootclasspath>
-                <pathelement path="${build.dir}/classes"/>
+                <pathelement path="${langtools.classes}"/>
                 <pathelement path="${target.java.home}/jre/lib/rt.jar"/>
             </bootclasspath>
         </javadoc>
     </target>
 
-    <!--
-    **** Debugging/diagnostic targets.
-    -->
-
-    <!-- standard JDK target -->
     <target name="sanity"
         description="display settings of configuration values">
         <echo level="info">ant.home = ${ant.home}</echo>
@@ -536,257 +380,32 @@
         <echo level="info">checkstyle.home = ${checkstyle.home}</echo>
     </target>
 
-    <target name="post-sanity" depends="-def-jtreg,sanity,build"
-        description="perform basic validation after a standard build">
-        <jtreg
-            dir="make/test"
-            workDir="${build.jtreg.dir}/post-sanity/work"
-            reportDir="${build.jtreg.dir}/post-sanity/report"
-            jdk="${target.java.home}"
-            verbose="summary"
-            failonerror="false" resultproperty="jtreg.post-sanity.result">
-        </jtreg>
-    </target>
-
-    <!-- use vizant tool to generate graphical image of this Ant file.-->
-    <target name="vizant" depends="-def-vizant">
-        <mkdir dir="${build.dir}"/>
-        <echo message="Generating ${build.dir}/build.dot"/>
-        <vizant antfile="${make.dir}/build.xml" outfile="${build.dir}/build.dot"/>
-        <echo message="Generating ${build.dir}/build.png"/>
-        <exec executable="${dot}" >
-            <arg value="-Tpng"/>
-            <arg value="-o"/>
-            <arg file="${build.dir}/build.png"/>
-            <arg file="${build.dir}/build.dot"/>
-        </exec>
-    </target>
-
-    <target name="check-import.jdk">
-        <echo message="import.jdk: ${import.jdk}"/>
-        <echo message="import.jdk.jar: ${import.jdk.jar}"/>
-        <echo message="import.jdk.src.dir: ${import.jdk.src.dir}"/>
-    </target>
-
     <target name="diagnostics">
         <diagnostics/>
     </target>
 
-
-    <!--
-    **** javac targets.
-    -->
-
-    <target name="build-bootstrap-javac"
-            depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
-        <build-bootstrap-classes includes="${javac.includes}"/>
-        <build-bootstrap-jar     name="javac" includes="${javac.includes}"/>
-        <build-bootstrap-tool    name="javac"/>
-    </target>
-
-    <target name="build-classes-javac" depends="build-bootstrap-javac,-create-import-jdk-stubs">
-        <build-classes includes="${javac.includes}"/>
-    </target>
-
-    <target name="build-javac" depends="build-classes-javac">
-        <build-jar  name="javac" includes="${javac.includes}"/>
-        <build-tool name="javac"/>
-    </target>
-
-    <target name="javadoc-javac" depends="build-javac,-def-javadoc-tool">
-        <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls.option}"/>
-    </target>
-
-    <target name="jtreg-javac" depends="build-javac,build-javap,-def-jtreg">
-        <jtreg-tool name="javac" tests="${javac.tests}"/>
-    </target>
-
-    <target name="findbugs-javac" depends="build-javac,-def-findbugs">
-        <findbugs-tool name="javac"/>
-    </target>
-
-    <target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
-
-
-    <!--
-    **** javadoc targets.
-    -->
-
-    <target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
-        <build-bootstrap-classes includes="${javadoc.includes}"/>
-        <build-bootstrap-jar     name="javadoc" includes="${javadoc.includes}"
-                                 jarclasspath="javac.jar"/>
-        <build-bootstrap-tool    name="javadoc"/>
-    </target>
-
-    <target name="build-classes-javadoc" depends="build-classes-javac">
-        <build-classes includes="${javadoc.includes}"/>
-    </target>
-
-    <target name="build-javadoc" depends="build-javac,build-classes-javadoc">
-        <build-jar  name="javadoc" includes="${javadoc.includes}"
-                    jarclasspath="javac.jar"/>
-        <build-tool name="javadoc"/>
-    </target>
-
-    <target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool">
-        <javadoc-tool name="javadoc" includes="${javadoc.includes}"/>
-    </target>
-
-    <target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg">
-        <jtreg-tool name="javadoc" tests="${javadoc.tests}"/>
-    </target>
-
-    <target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs">
-        <findbugs-tool name="javadoc"/>
-    </target>
-
-    <target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
-
-    <!--
-    **** javah targets.
-    -->
-
-    <target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
-        <build-bootstrap-classes includes="${javah.includes}"/>
-        <build-bootstrap-jar     name="javah" includes="${javah.includes}"
-                                 jarclasspath="javadoc.jar javac.jar"/>
-        <build-bootstrap-tool    name="javah"/>
-    </target>
-
-    <target name="build-javah" depends="build-javac,build-classes-javah">
-        <build-jar  name="javah" includes="${javah.includes}" jarclasspath="javac.jar"/>
-        <build-tool name="javah"/>
-    </target>
-
-    <target name="build-classes-javah" depends="build-classes-javadoc">
-        <build-classes includes="${javah.includes}"/>
-    </target>
-
-    <!-- (no javadoc for javah) -->
-
-    <target name="jtreg-javah" depends="build-javah,-def-jtreg">
-        <jtreg-tool name="javah" tests="${javah.tests}"/>
-    </target>
-
-    <target name="findbugs-javah" depends="build-javah,-def-findbugs">
-        <findbugs-tool name="javah"/>
-    </target>
-
-    <target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
-
-
-    <!--
-    **** javap targets.
-    -->
-
-    <target name="build-bootstrap-javap"
-            depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
-        <build-bootstrap-classes includes="${javap.includes}"/>
-        <build-bootstrap-jar     name="javap" includes="${javap.includes}"
-                                 jarmainclass="sun.tools.javap.Main"/>
-        <build-bootstrap-tool    name="javap"/>
-    </target>
-
-    <target name="build-classes-javap" depends="build-classes-javac">
-        <build-classes includes="${javap.includes}"/>
-    </target>
-
-    <target name="build-javap" depends="build-javac,build-classes-javap">
-        <build-jar  name="javap" includes="${javap.includes}"
-                    jarmainclass="com.sun.tools.javap.Main"
-                    jarclasspath="javac.jar"/>
-        <build-tool name="javap"/>
-    </target>
-
-    <!-- (no javadoc for javap) -->
-
-    <target name="jtreg-javap" depends="build-javap,-def-jtreg">
-        <jtreg-tool name="javap" tests="${javap.tests}"/>
-    </target>
-
-    <target name="findbugs-javap" depends="build-javap,-def-findbugs">
-        <findbugs-tool name="javap"/>
-    </target>
-
-    <target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
-
-    <!--
-    **** sjavac targets.
-    -->
-
-    <target name="build-bootstrap-sjavac"
-            depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
-        <build-bootstrap-classes includes="${sjavac.includes}"/>
-        <build-bootstrap-jar     name="sjavac" includes="${sjavac.includes}"
-                                 jarmainclass="com.sun.tools.sjavac.Main"/>
-        <build-bootstrap-tool    name="sjavac"/>
-    </target>
-
-    <target name="build-classes-sjavac" depends="build-classes-javac">
-        <build-classes includes="${sjavac.includes}"/>
-    </target>
-
-    <target name="build-sjavac" depends="build-classes-sjavac">
-        <build-jar  name="sjavac" includes="${sjavac.includes}"
-                    jarmainclass="com.sun.tools.sjavac.Main"
-                    jarclasspath="sjavac.jar"/>
-        <build-tool name="sjavac"/>
-    </target>
-
-    <!-- (no javadoc for javap) -->
-
-    <target name="jtreg-sjavac" depends="build-sjavac,-def-jtreg">
-        <jtreg-tool name="sjavac" tests="${sjavac.tests}"/>
-    </target>
-
-    <target name="findbugs-sjavac" depends="build-sjavac,-def-findbugs">
-        <findbugs-tool name="sjavac"/>
-    </target>
-
-    <target name="sjavac" depends="build-sjavac,jtreg-sjavac,findbugs-sjavac"/>
-
-    <!--
-    **** crules targets.
-    -->
-
-    <target name="build-crules"
-            depends="-def-compilecrules,-def-build-jar-with-services,build-bootstrap-javac,-create-import-jdk-stubs">
-        <compilecrules/>
-        <build-jar-with-services
-                    name="crules"
-                    includes="crules/* crules/resources/*"
-                    classes.dir="${build.toolclasses.dir}"
-                    lib.dir="${build.toolclasses.dir}"
-                    jarmainclass=""
-                    jarclasspath="crules.jar"
-                    service.type="com.sun.source.util.Plugin"
-                    service.provider="crules.CodingRulesAnalyzerPlugin"/>
-        <build-tool name="crules"/>
-    </target>
-
-    <target name="jtreg-crules" depends="build-javac,build-crules,-def-jtreg">
+    <target name="jtreg-crules" depends="build-all-classes,-def-jtreg">
+        <mkdir dir="${build.crules.dir}/classes"/>
+        <javac fork="true"
+               source="${boot.javac.source}"
+               target="${boot.javac.target}"
+               executable="${boot.java.home}/bin/javac"
+               srcdir="${make.tools.dir}"
+               includes="crules/*"
+               destdir="${build.crules.dir}/classes"
+               includeantruntime="false">
+            <compilerarg value="-Xbootclasspath/p:${langtools.classes}"/>
+            <compilerarg line="${javac.lint.opts}"/>
+        </javac>
+        <copy todir="${build.crules.dir}/classes" includeemptydirs="false">
+            <fileset dir="${make.tools.dir}">
+                <include name="**/*.properties"/>
+            </fileset>
+        </copy>
+        <echo file="${build.crules.dir}/classes/META-INF/services/com.sun.source.util.Plugin">crules.CodingRulesAnalyzerPlugin</echo>
         <jtreg-tool name="crules"
                     tests="${crules.tests}"
-                    extra.jvmargs="-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar" />
-    </target>
-
-    <target name="check-coding-rules" depends="build-bootstrap-javac,-create-import-jdk-stubs,build-crules">
-        <build-classes includes="${javac.includes}"
-            plugin.options="-J-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar -Xplugin:coding_rules" />
-    </target>
-
-    <!--
-    **** Create import JDK stubs.
-    -->
-
-    <target name="-create-import-jdk-stubs" depends="-def-genstubs" if="require.import.jdk.stubs">
-        <mkdir dir="${build.genstubs.dir}"/>
-        <genstubs
-            srcdir="${import.jdk.src.dir}" destdir="${build.genstubs.dir}"
-            includes="${import.jdk.stub.files}"
-            fork="true" classpath="${build.toolclasses.dir}:${build.bootstrap.dir}/classes:${ant.core.lib}"
-        />
+                    extra.jvmargs="-Xbootclasspath/a:${build.crules.dir}/classes" />
     </target>
 
     <!--
@@ -802,6 +421,8 @@
             <isset property="jtreg.home"/>
         </condition>
         <replace file=".idea/ant.xml" token="@@@" value="${jtreg.idea.home}"/>
+        <replace file=".idea/workspace.xml" token="@FILE_SEP@" value="${file.separator}"/>
+        <replace file=".idea/workspace.xml" token="@PATH_SEP@" value="${path.separator}"/>
         <mkdir dir=".idea/classes"/>
         <javac srcdir="make/intellij/src"
                destdir=".idea/classes"/>
@@ -821,8 +442,8 @@
         <check name="target java" property="target.java.home" marker="${java.marker}"/>
     </target>
 
-    <target name="-check-cobertura.home" depends="-def-check">
-        <check name="cobertura" property="cobertura.home" marker="cobertura.jar"/>
+    <target name="-check-jtreg.home" depends="-def-check">
+        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
     </target>
 
     <target name="-check-findbugs.home" depends="-def-check">
@@ -830,27 +451,56 @@
     </target>
 
     <target name="-check-checkstyle.home" depends="-def-check">
-        <check name="checkstyle" property="checkstyle.home" marker="${checkstyle.name.version}.jar"/>
+        <check name="checkstyle" property="checkstyle.home" marker=""/> <!--TODO: better checkstyle verification-->
     </target>
 
-    <target name="-check-jtreg.home" depends="-def-check">
-        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
+    <!-- Definitions -->
+
+    <target name="-def-build-all-module-jars" depends="-def-build-module-jar">
+        <macrodef name="build-all-module-jars">
+            <attribute name="compilation.kind" default=""/>
+            <sequential>
+                <build-module-jar module.name="java.compiler" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="jdk.compiler" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="jdk.javadoc" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="jdk.dev" compilation.kind="@{compilation.kind}" />
+            </sequential>
+        </macrodef>
     </target>
 
-    <target name="-check-vizant" depends="-def-check">
-        <check name="vizant" property="vizant.jar"/>
-        <check name="dot" property="dot"/>
+    <target name="-def-build-module-jar">
+        <macrodef name="build-module-jar">
+            <attribute name="module.name"/>
+            <attribute name="compilation.kind"/>
+            <attribute name="dependencies" default="${@{compilation.kind}@{module.name}.dependencies}"/>
+            <attribute name="build.dir" default="${@{compilation.kind}build.dir}"/>
+            <attribute name="lib.dir" default="${@{compilation.kind}dist.lib.dir}"/>
+            <attribute name="classes.dir" default="@{build.dir}/@{module.name}/classes"/>
+            <sequential>
+                <mkdir dir="@{lib.dir}"/>
+                <local name="jarclasspath" />
+                <pathconvert property="jarclasspath">
+                    <path>
+                        <pathelement path="@{dependencies}" />
+                    </path>
+                    <map from="${basedir}/" to="" />
+                    <mapper type="glob" from="*" to="*.jar"/>
+                </pathconvert>
+                <jar destfile="@{lib.dir}/@{module.name}.jar"
+                     basedir="@{classes.dir}">
+                    <manifest>
+                        <attribute name="Class-Path" value="@{jarclasspath}"/>
+                    </manifest>
+                </jar>
+            </sequential>
+        </macrodef>
     </target>
 
-
-    <!--
-    **** Targets for Ant macro and task definitions.
-    -->
-
     <target name="-def-build-tool">
         <macrodef name="build-tool">
             <attribute name="name"/>
-            <attribute name="bin.dir" default="${dist.bin.dir}"/>
+            <attribute name="compilation.kind" default=""/>
+            <attribute name="bin.dir" default="${@{compilation.kind}dist.bin.dir}"/>
             <attribute name="java" default="${launcher.java}"/>
             <sequential>
                 <mkdir dir="@{bin.dir}"/>
@@ -866,84 +516,79 @@
         </macrodef>
     </target>
 
-    <target name="-def-build-jar">
-        <macrodef name="build-jar">
-            <attribute name="name"/>
-            <attribute name="includes"/>
-            <attribute name="classes.dir" default="${build.classes.dir}"/>
-            <attribute name="lib.dir" default="${dist.lib.dir}"/>
-            <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
-            <attribute name="jarclasspath" default=""/>
+    <target name="-def-build-all-module-classes" depends="-def-build-module-classes">
+        <macrodef name="build-all-module-classes">
+            <attribute name="compilation.kind" default=""/>
             <sequential>
-                <mkdir dir="@{lib.dir}"/>
-                <jar destfile="@{lib.dir}/@{name}.jar"
-                     basedir="@{classes.dir}"
-                     includes="@{includes}">
-                    <manifest>
-                        <attribute name="Main-Class" value="@{jarmainclass}"/>
-                        <attribute name="Class-Path" value="@{jarclasspath}"/>
-                    </manifest>
-                </jar>
+                <build-module-classes module.name="java.compiler"
+                                      compilation.kind="@{compilation.kind}" />
+                <build-module-classes module.name="jdk.compiler"
+                                      compilation.kind="@{compilation.kind}"
+                                      resource.includes="${javac.resource.includes}" />
+                <build-module-classes module.name="jdk.javadoc"
+                                      compilation.kind="@{compilation.kind}" />
+                <build-module-classes module.name="jdk.dev"
+                                      compilation.kind="@{compilation.kind}" />
             </sequential>
         </macrodef>
     </target>
 
-    <target name="-def-build-jar-with-services">
-        <macrodef name="build-jar-with-services">
-            <attribute name="name"/>
-            <attribute name="includes"/>
-            <attribute name="classes.dir" default="${build.classes.dir}"/>
-            <attribute name="lib.dir" default="${dist.lib.dir}"/>
-            <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
-            <attribute name="jarclasspath" default=""/>
-            <attribute name="service.type" default=""/>
-            <attribute name="service.provider" default=""/>
-            <sequential>
-                <mkdir dir="${build.toolclasses.dir}"/>
-                <jar destfile="@{lib.dir}/@{name}.jar"
-                     basedir="@{classes.dir}"
-                     includes="@{includes}">
-                    <service type="@{service.type}" provider="@{service.provider}"/>
-                    <manifest>
-                        <attribute name="Main-Class" value="@{jarmainclass}"/>
-                        <attribute name="Class-Path" value="@{jarclasspath}"/>
-                    </manifest>
-                </jar>
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-build-classes" depends="-def-pcompile">
-        <macrodef name="build-classes">
-            <attribute name="includes"/>
+    <target name="-def-build-module-classes" depends="-def-pcompile,-def-pparse">
+        <macrodef name="build-module-classes">
+            <attribute name="module.name"/>
+            <attribute name="compilation.kind" default=""/>
+            <attribute name="resource.includes" default="nonExistent" />
+            <attribute name="dependencies" default="${@{module.name}.dependencies}"/>
+            <attribute name="includes" default="${@{compilation.kind}javac.includes}"/>
+            <attribute name="javac.lint.opts" default="${@{compilation.kind}javac.lint.opts}"/>
+            <attribute name="javac.extra.opts" default="${@{compilation.kind}javac.extra.opts}"/>
+            <attribute name="build.dir" default="${@{compilation.kind}build.dir}"/>
             <attribute name="excludes" default="${exclude.files} **/package-info.java"/>
-            <attribute name="classes.dir" default="${build.classes.dir}"/>
-            <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
-            <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
-            <attribute name="bootclasspath.opt" default="${javac.bootclasspath.opt}"/>
-            <attribute name="classpath" default="${javac.classpath}"/>
-            <attribute name="sourcepath" default="${javac.sourcepath}"/>
+            <attribute name="classes.dir" default="@{build.dir}/@{module.name}/classes"/>
+            <attribute name="gensrc.dir" default="@{build.dir}/@{module.name}/gensrc"/>
+            <attribute name="depcache.dir" default="@{build.dir}/@{module.name}/depcache"/>
             <attribute name="java.home" default="${boot.java.home}"/>
-            <attribute name="source" default="${javac.source}"/>
-            <attribute name="target" default="${javac.target}"/>
+            <attribute name="source" default="${@{compilation.kind}javac.source}"/>
+            <attribute name="target" default="${@{compilation.kind}javac.target}"/>
             <attribute name="release" default="${release}"/>
             <attribute name="full.version" default="${full.version}"/>
             <attribute name="plugin.options" default=""/>
             <sequential>
                 <echo level="verbose" message="build-classes: excludes=@{excludes}"/>
-                <echo level="verbose" message="build-classes: bootclasspath.opt=@{bootclasspath.opt}"/>
                 <echo level="verbose" message="build-classes: classpath=@{classpath}"/>
                 <echo level="verbose" message="build-classes: sourcepath=@{sourcepath}"/>
+                <echo level="verbose" message="build-classes: dependencies=@{dependencies}"/>
+                <local name="src.dir" />
+                <property name="src.dir" location="${basedir}/src/@{module.name}/share/classes"/>
+                <local name="classpath" />
+                <pathconvert property="classpath">
+                    <path>
+                        <pathelement path="@{dependencies}" />
+                    </path>
+                    <map from="${basedir}/" to="@{build.dir}/" />
+                    <mapper type="glob" from="*" to="*/classes"/>
+                </pathconvert>
+                <local name="bootclasspath.prepend"/>
+                <condition property="bootclasspath.prepend" value="" else="${langtools.boot.classes}">
+                    <equals arg1="@{compilation.kind}" arg2="boot."/>
+                </condition>
+                <mkdir dir="@{classes.dir}"/>
                 <mkdir dir="@{gensrc.dir}"/>
-                <mkdir dir="@{classes.dir}"/>
+                <mkdir dir="@{depcache.dir}"/>
                 <pcompile destdir="@{gensrc.dir}"
                           includes="@{includes}">
                     <src>
-                        <path refid="src.dirs"/>
+                        <path location="${src.dir}"/>
                     </src>
                 </pcompile>
+                <pparse destdir="@{gensrc.dir}"
+                        includes="@{resource.includes}">
+                    <src>
+                        <path location="${src.dir}"/>
+                    </src>
+                </pparse>
                 <copy todir="@{gensrc.dir}">
-                    <multirootfileset basedirs="${src.dirs.property}" includes="@{includes}" />
+                    <fileset dir="${src.dir}" includes="@{includes}" />
                     <globmapper from="*.properties-template" to="*.properties"/>
                     <filterset begintoken="$(" endtoken=")">
                         <filter token="JDK_VERSION" value="${jdk.version}"/>
@@ -957,13 +602,20 @@
                         <pathelement location="@{gensrc.dir}"/>
                     </src>
                 </pcompile>
+                <antcall target="-do-depend">
+                    <param name="src.dir" value="${src.dir}" />
+                    <param name="classes.dir" value="@{classes.dir}" />
+                    <param name="gensrc.dir" value="@{gensrc.dir}" />
+                    <param name="depcache.dir" value="@{depcache.dir}" />
+                    <param name="classpath" value="${classpath}" />
+                </antcall>
                 <javac fork="true"
                        executable="@{java.home}/bin/javac"
                        destdir="@{classes.dir}"
                        includes="@{includes}"
                        excludes="@{excludes}"
-                       sourcepath="@{sourcepath}"
-                       classpath="@{classpath}"
+                       sourcepath="${src.dir}:@{gensrc.dir}"
+                       classpath="${classpath}"
                        includeAntRuntime="no"
                        source="@{source}"
                        target="@{target}"
@@ -971,19 +623,18 @@
                        debuglevel="${javac.debuglevel}">
                     <compilerarg value="-implicit:none"/>
                     <compilerarg value="-Xprefer:source"/>
-                    <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
-                    <compilerarg line="@{bootclasspath.opt}"/>
-                    <compilerarg line="${javac.no.jdk.warnings}"/>
-                    <compilerarg line="${javac.version.opt}"/>
-                    <compilerarg line="${javac.lint.opts}"/>
+                    <compilerarg value="-J-Xbootclasspath/p:${bootclasspath.prepend}"/>
+                    <compilerarg value="-Xbootclasspath/p:${classpath}"/>
+                    <compilerarg line="@{javac.extra.opts}"/>
+                    <compilerarg line="@{javac.lint.opts}"/>
                     <compilerarg line="@{plugin.options}"/>
                     <src>
-                        <path refid="src.dirs"/>
+                        <path location="${src.dir}"/>
                         <path location="@{gensrc.dir}"/>
                     </src>
                 </javac>
                 <copy todir="@{classes.dir}" includeemptydirs="false">
-                    <multirootfileset basedirs="${src.dirs.property}" includes="@{includes}" excludes="@{excludes}">
+                    <fileset dir="${src.dir}" includes="@{includes}" excludes="@{excludes}">
                         <exclude name="**/*.java"/>
                         <exclude name="**/*.properties"/>
                         <exclude name="**/*-template"/>
@@ -991,42 +642,37 @@
                         <exclude name="**/*.orig"/>
                         <exclude name="**/overview.html"/>
                         <exclude name="**/package.html"/>
-                    </multirootfileset>
+                    </fileset>
                 </copy>
             </sequential>
         </macrodef>
     </target>
 
-    <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
-        <presetdef name="build-bootstrap-tool">
-            <build-tool
-                bin.dir="${build.bootstrap.dir}/bin"
-                java="${boot.java}"/>
-        </presetdef>
+    <target name="-def-pparse">
+        <mkdir dir="${build.toolclasses.dir}"/>
+        <copy todir="${build.toolclasses.dir}/propertiesparser" >
+            <fileset dir="make/tools/propertiesparser" includes="**/resources/**"/>
+        </copy>
+        <javac fork="true"
+               source="${boot.javac.source}"
+               target="${boot.javac.target}"
+               executable="${boot.java.home}/bin/javac"
+               srcdir="${make.tools.dir}"
+               includes="propertiesparser/* anttasks/PropertiesParser* anttasks/PathFileSet*"
+               destdir="${build.toolclasses.dir}/"
+               classpath="${ant.core.lib}"
+               bootclasspath="${boot.java.home}/jre/lib/rt.jar"
+               includeantruntime="false">
+            <compilerarg line="${javac.lint.opts}"/>
+        </javac>
+        <taskdef name="pparse"
+                 classname="anttasks.PropertiesParserTask"
+                 classpath="${build.toolclasses.dir}/"/>
     </target>
 
-    <target name="-def-build-bootstrap-jar" depends="-def-build-jar">
-        <presetdef name="build-bootstrap-jar">
-            <build-jar
-                classes.dir="${build.bootstrap.dir}/classes"
-                lib.dir="${build.bootstrap.dir}/lib"/>
-        </presetdef>
-    </target>
-
-    <target name="-def-build-bootstrap-classes" depends="-def-build-classes">
-        <presetdef name="build-bootstrap-classes">
-            <build-classes
-                source="${boot.javac.source}"
-                target="${boot.javac.target}"
-                gensrc.dir="${build.bootstrap.dir}/gensrc"
-                classes.dir="${build.bootstrap.dir}/classes"
-                javac.bootclasspath=""
-                bootclasspath.opt="-Xbootclasspath/p:${build.bootstrap.dir}/classes"
-                sourcepath=""
-                release="${bootstrap.release}"
-                full.version="${bootstrap.full.version}"
-                excludes="${bootstrap.exclude.files} **/package-info.java"/>
-        </presetdef>
+    <target name="-do-depend" if="do.depend">
+        <depend srcdir="${src.dir}:${gensrc.dir}" destdir="${classes.dir}" classpath="${classpath}"
+                cache="${depcache.dir}"/>
     </target>
 
     <target name="-def-pcompile">
@@ -1048,55 +694,9 @@
                  classpath="${build.toolclasses.dir}/"/>
     </target>
 
-    <target name="-def-compilecrules">
-        <macrodef name="compilecrules">
-            <sequential>
-                <mkdir dir="${build.toolclasses.dir}"/>
-                <javac fork="true"
-                       source="${boot.javac.source}"
-                       target="${boot.javac.target}"
-                       executable="${boot.java.home}/bin/javac"
-                       srcdir="${make.tools.dir}"
-                       includes="crules/*"
-                       destdir="${build.toolclasses.dir}/"
-                       classpath="${ant.core.lib}"
-                       bootclasspath="${boot.java.home}/jre/lib/rt.jar"
-                       includeantruntime="false">
-                    <compilerarg value="-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-                    <compilerarg line="${javac.lint.opts}"/>
-                </javac>
-                <copy todir="${build.toolclasses.dir}/" includeemptydirs="false">
-                    <fileset dir="${make.tools.dir}">
-                        <include name="**/*.properties"/>
-                    </fileset>
-                </copy>
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-genstubs" depends="build-bootstrap-javac" if="require.import.jdk.stubs">
-        <mkdir dir="${build.toolclasses.dir}"/>
-        <javac fork="true"
-               source="${boot.javac.source}"
-               target="${boot.javac.target}"
-               executable="${boot.java.home}/bin/javac"
-               srcdir="${make.tools.dir}"
-               includes="genstubs/* anttasks/GenStubs*"
-               destdir="${build.toolclasses.dir}/"
-               classpath="${ant.core.lib}"
-               includeantruntime="false">
-            <compilerarg value="-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-            <compilerarg line="${javac.lint.opts}"/>
-        </javac>
-        <taskdef name="genstubs"
-                 classname="anttasks.GenStubsTask"
-                 classpath="${build.toolclasses.dir}/"/>
-    </target>
-
     <target name="-def-javadoc-tool" depends="-check-target.java.home">
         <macrodef name="javadoc-tool">
-            <attribute name="name"/>
-            <attribute name="includes"/>
+            <attribute name="includes" default="${javac.includes}"/>
             <attribute name="options" default=""/>
             <attribute name="source" default="${javac.source}"/>
             <sequential>
@@ -1106,7 +706,7 @@
                 <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
                 <javadoc
                     executable="${target.java.home}/bin/javadoc"
-                    destdir="${build.javadoc.dir}/@{name}"
+                    destdir="${build.javadoc.dir}"
                     source="@{source}"
                     windowtitle="UNOFFICIAL"
                     failonerror="true"
@@ -1116,57 +716,30 @@
                     packagenames="${javadoc.packagenames}" >
                     <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
                     <arg line="@{options}"/>
-                    <arg value="-tag" />
-                    <arg value="implNote:a:Implementation Note:"/>
                     <bootclasspath>
-                        <path location="${build.classes.dir}"/>
+                        <pathelement path="${langtools.classes}"/>
                         <path location="${target.java.home}/jre/lib/rt.jar"/>
                     </bootclasspath>
                     <sourcepath>
-                        <path refid="src.dirs"/>
+                        <pathelement path="${langtools.sources}"/>
                     </sourcepath>
                     <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
                     <!-- means that {@link some.package} will not work, which is no good. -->
                     <!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
                     <!-- which also causes duplicates in the class index for included files.) -->
-                    <packageset dir="${src.dir}/java.base/share/classes" includes="@{includes}">
+                    <packageset dir="${basedir}/src/java.compiler/share/classes" includes="@{includes}">
                         <or>
-                            <filename name="java/"/>
                             <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
+                        </or>
+                    </packageset>
+                    <packageset dir="${basedir}/src/jdk.compiler/share/classes" includes="@{includes}">
+                        <or>
                             <filename name="com/sun/source/"/>
                         </or>
                     </packageset>
-                    <packageset dir="${src.dir}/java.compiler/share/classes" includes="@{includes}">
+                    <packageset dir="${basedir}/src/jdk.javadoc/share/classes" includes="@{includes}">
                         <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
                             <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${src.dir}/jdk.compiler/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${src.dir}/jdk.dev/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${src.dir}/jdk.javadoc/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
                         </or>
                     </packageset>
                 </javadoc>
@@ -1184,6 +757,7 @@
         <macrodef name="jtreg-tool">
             <attribute name="name"/>
             <attribute name="tests"/>
+            <attribute name="langtools.classes" default="${langtools.classes}"/>
             <attribute name="jdk" default="${target.java.home}"/>
             <attribute name="samevm" default="true"/>
             <attribute name="verbose" default="${default.jtreg.verbose}"/>
@@ -1191,6 +765,7 @@
             <attribute name="keywords" default="-keywords:!ignore"/>
             <attribute name="jpda.jvmargs" default=""/>
             <attribute name="extra.jvmargs" default=""/>
+            <attribute name="build.dir" default="${build.dir}"/>
             <sequential>
                 <property name="coverage.options" value=""/>              <!-- default -->
                 <property name="coverage.classpath" value=""/>            <!-- default -->
@@ -1204,7 +779,7 @@
                     samevm="@{samevm}" verbose="@{verbose}"
                     failonerror="false" resultproperty="jtreg.@{name}.result"
                     javacoptions="-g"
-                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}${build.classes.dir} @{jpda.jvmargs} @{extra.jvmargs}">
+                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}@{langtools.classes} @{jpda.jvmargs} @{extra.jvmargs}">
                     <arg line="@{keywords}"/>
                     <arg line="@{options}"/>
                     <arg line="@{tests}"/>
@@ -1220,21 +795,12 @@
         <property name="jtreg.defined" value="true"/>
     </target>
 
-    <target name="-def-cobertura" depends="-check-cobertura.home">
-        <path id="cobertura.classpath">
-            <fileset dir="${cobertura.home}">
-                <include name="cobertura.jar"/>
-                <include name="lib/**/*.jar"/>
-            </fileset>
-        </path>
-        <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
-    </target>
-
-    <target name="-def-checkstyle" unless="checkstyle.defined"
-        depends="-check-checkstyle.home">
+    <target name="-def-checkstyle" unless="checkstyle.defined" depends="-check-checkstyle.home">
         <taskdef resource="checkstyletask.properties">
             <classpath>
-                <pathelement location="${checkstyle.home}/${checkstyle.name.version}-all.jar"/>
+              <fileset dir="${checkstyle.home}">
+                <include name="checkstyle-*-all.jar"/>
+              </fileset>
             </classpath>
         </taskdef>
         <property name="checkstyle.defined" value="true"/>
@@ -1265,7 +831,7 @@
                     jvmargs="-Xmx512M" >
                     <class location="${dist.dir}/lib/@{name}.jar"/>
                     <auxClasspath>
-                        <pathelement location="${build.classes.dir}"/>
+                        <pathelement location="${langtools.classes}"/>
                     </auxClasspath>
                     <sourcePath>
                         <path refid="src.dirs"/>
@@ -1276,11 +842,6 @@
         <property name="findbugs.defined" value="true"/>
     </target>
 
-    <target name="-def-vizant" unless="vizant.defined" depends="-check-vizant">
-        <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="${vizant.jar}"/>
-        <property name="vizant.defined" value="true"/>
-    </target>
-
     <target name="-def-check">
         <macrodef name="check">
             <attribute name="name"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/Gensrc-jdk.compiler.gmk	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  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 GensrcCommon.gmk
+
+$(eval $(call SetupVersionProperties,JAVAC_VERSION, \
+    com/sun/tools/javac/resources/version.properties))
+
+$(eval $(call SetupVersionProperties,JAVAH_VERSION, \
+    com/sun/tools/javah/resources/version.properties))
+
+$(eval $(call SetupVersionProperties,JAVAP_VERSION, \
+    com/sun/tools/javap/resources/version.properties))
+
+$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, \
+    $(JAVAC_VERSION) $(JAVAH_VERSION) $(JAVAP_VERSION)))
+
+$(eval $(call SetupParseProperties,PARSE_PROPERTIES, \
+	com/sun/tools/javac/resources/compiler.properties))
+
+all: $(COMPILE_PROPERTIES) $(PARSE_PROPERTIES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/Gensrc-jdk.dev.gmk	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+include GensrcCommon.gmk
+
+$(eval $(call SetupVersionProperties,JDEPS_VERSION,\
+    com/sun/tools/jdeps/resources/version.properties))
+
+$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, $(JDEPS_VERSION)))
+
+all: $(COMPILE_PROPERTIES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/Gensrc-jdk.javadoc.gmk	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+include GensrcCommon.gmk
+
+$(eval $(call SetupVersionProperties,JAVADOC_VERSION,\
+    com/sun/tools/javadoc/resources/version.properties))
+
+$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, $(JAVADOC_VERSION)))
+
+all: $(COMPILE_PROPERTIES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/GensrcCommon.gmk	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,130 @@
+#
+# 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.
+#
+
+# This must be the first rule
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+
+################################################################################
+# The compileprops tools compiles a properties file into a resource bundle.
+TOOL_COMPILEPROPS_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes \
+    compileproperties.CompileProperties -quiet
+
+################################################################################
+# The compileprops tools compiles a properties file into an enum-like class.
+TOOL_PARSEPROPS_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes \
+    propertiesparser.PropertiesParser
+
+
+################################################################################
+# Sets up a rule that creates a version.properties file in the gensrc output
+# directory.
+# Param 1 - Variable to add generated file name to
+# Param 2 - Name of version.properties file including packages from the src
+#           root.
+define SetupVersionProperties
+  $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2):
+	$(MKDIR) -p $$(@D)
+	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" \
+	    > $$@
+
+  $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2)
+endef
+
+################################################################################
+# Finds all properties files in the module source and creates a rule that runs
+# CompileProperties on them into the gensrc dir.
+# Param 1 - Variable to add targets to
+# Param 2 - Extra properties files to process
+define SetupCompileProperties
+  # Lookup the properties that need to be compiled into resource bundles.
+  PROPSOURCES := $2 \
+      $$(shell $(FIND) $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes -name "*.properties")
+
+  # Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
+  # to .../langtools/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
+  # Strip away prefix and suffix, leaving for example only: 
+  # "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
+  PROPJAVAS := $$(patsubst $(LANGTOOLS_TOPDIR)/src/%, \
+      $(SUPPORT_OUTPUTDIR)/gensrc/%, \
+      $$(patsubst %.properties, %.java, \
+      $$(subst /share/classes,, $$(PROPSOURCES))))
+
+  # Generate the package dirs for the to be generated java files. Sort to remove
+  # duplicates.
+  PROPDIRS := $$(sort $$(dir $$(PROPJAVAS)))
+
+  # Now generate a sequence of:
+  # "-compile ...javac_zh_CN.properties ...javac_zh_CN.java java.util.ListResourceBundle"
+  # suitable to be fed into the CompileProperties command.
+  PROPCMDLINE := $$(subst _SPACE_, $(SPACE), \
+      $$(join $$(addprefix -compile_SPACE_, $$(PROPSOURCES)), \
+      $$(addsuffix _SPACE_java.util.ListResourceBundle, \
+      $$(addprefix _SPACE_, $$(PROPJAVAS)))))
+
+  # Now setup the rule for the generation of the resource bundles.
+  $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_props: $$(PROPSOURCES)
+	$(MKDIR) -p $$(@D) $$(PROPDIRS)
+	$(FIND) $$(@D) -name "*.java" -a ! -name "*Properties.java" $(FIND_DELETE)
+	$(ECHO) Compiling $$(words $$(PROPSOURCES)) properties into resource bundles for $(MODULE)
+	$(TOOL_COMPILEPROPS_CMD) $$(PROPCMDLINE)
+	$(TOUCH) $$@
+
+  $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_props
+endef
+
+################################################################################
+# Parse property files in given location and generate a Java-like enum in the gensrc folder.
+# Param 1 - Variable to add targets to
+# Param 2 - Extra properties files to process
+define SetupParseProperties
+  # property files to process
+  PARSEPROPSOURCES := $$(addprefix $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes/, $2)
+
+  PARSEPROPALLDIRS := $$(patsubst $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes/%, \
+      $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/%, \
+      $$(dir $$(PARSEPROPSOURCES)))
+
+  PARSEPROPDIRS := $$(sort $$(PARSEPROPALLDIRS))
+
+  PARSEPROPCMDLINE := $$(subst _SPACE_, $$(SPACE), \
+    $$(join $$(foreach var,$$(PARSEPROPSOURCES),$$(addprefix -compile_SPACE_,$$(var))), \
+    $$(addprefix _SPACE_, $$(PARSEPROPALLDIRS))))
+
+  # Now setup the rule for the generation of the resource bundles.
+  $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props: $(PARSEPROPSOURCES)
+	$(MKDIR) -p $$(@D) $$(PARSEPROPDIRS)
+	$(FIND) $$(@D) -name "*Properties.java" $(FIND_DELETE)
+	$(ECHO) Parsing $$(words $$(PARSEPROPSOURCES)) properties into enum-like class for $(MODULE)
+	$(TOOL_PARSEPROPS_CMD) $$(PARSEPROPCMDLINE)
+	$(TOUCH) $$@
+
+  $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props
+endef
+
+################################################################################
--- a/make/intellij/build.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/build.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -2,10 +2,8 @@
 <project name="langtools" basedir="..">
 
     <script language="javascript" classpath=".idea/classes">
-        var ideaListener = project.getBuildListeners().firstElement();            
         var LangtoolsLogger = Java.type("idea.LangtoolsIdeaAntLogger");
-        project.removeBuildListener(ideaListener)
-        project.addBuildListener(new LangtoolsLogger(ideaListener))
+        new LangtoolsLogger(project)
     </script>
 
     <import file="../make/build.xml"/>
@@ -16,21 +14,25 @@
         <sequential>
             <java classname="org.apache.tools.ant.Main" fork="true" spawn="true">
                 <arg value="-f"/>
-                <arg value="@{antfile}"/>  
+                <arg value="@{antfile}"/>
                 <arg value="-Dboot.java.home=${boot.java.home}"/>
                 <arg value="-Dtarget.java.home=${target.java.home}"/>
                 <arg value="-Djtreg.home=${jtreg.home}"/>
                 <arg value="-Djtreg.tests=${jtreg.tests}"/>
                 <arg value="-Djtreg.jpda.jvmargs=${jtreg.jpda.jvmargs}"/>
                 <arg value="@{target}"/>
-                <classpath>           
+                <classpath>
                     <pathelement path="${java.class.path}"/>
                 </classpath>
             </java>
         </sequential>
     </macrodef>
 
-    <target name="post-make" depends="build-all-tools"/>
+    <target name="crules" depends="build-all-tools,-def-jtreg">
+        <jtreg-tool name="all" tests="tools/all/RunCodingRules.java"/>
+    </target>
+
+    <target name="post-make" depends="clean, build-all-tools"/>
 
     <target name="jtreg-debug" depends="build-all-tools,-def-jtreg">
         <exec-target target="jtreg-debug-internal"/>
--- a/make/intellij/compiler.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/compiler.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -5,6 +5,7 @@
     <excludeFromCompile>
       <directory url="file://$PROJECT_DIR$/src" includeSubdirectories="true" />
       <directory url="file://$PROJECT_DIR$/test" includeSubdirectories="true" />
+      <directory url="file://$PROJECT_DIR$/build" includeSubdirectories="true" />
     </excludeFromCompile>
     <resourceExtensions />
     <wildcardResourcePatterns />
@@ -13,6 +14,6 @@
         <processorPath useClasspath="true" />
       </profile>
     </annotationProcessing>
-  </component>  
+  </component>
 </project>
 
--- a/make/intellij/copyright/langtools.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/copyright/langtools.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -6,4 +6,4 @@
     <option name="myName" value="langtools" />
     <option name="myLocal" value="true" />
   </copyright>
-</component>
\ No newline at end of file
+</component>
--- a/make/intellij/langtools.iml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/langtools.iml	Wed Apr 22 17:42:41 2015 +0100
@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="false">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
     <output url="file://$MODULE_DIR$/build" />
     <output-test url="file://$MODULE_DIR$/build" />
     <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/gensrc" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/build/genstubs" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/java.base/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/java.compiler/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.compiler/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.dev/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.javadoc/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/java.compiler/gensrc" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/jdk.compiler/gensrc" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/jdk.dev/gensrc" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/jdk.javadoc/gensrc" isTestSource="false" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="inheritedJdk" />
   </component>
 </module>
-
--- a/make/intellij/misc.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/misc.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -3,8 +3,8 @@
   <component name="EntryPointsManager">
     <entry_points version="2.0" />
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true">
-    <output url="file://$PROJECT_DIR$/build" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/.idea/out" />
   </component>
 </project>
 
--- a/make/intellij/src/idea/LangtoolsIdeaAntLogger.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/src/idea/LangtoolsIdeaAntLogger.java	Wed Apr 22 17:42:41 2015 +0100
@@ -26,7 +26,9 @@
 package idea;
 
 import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildListener;
 import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
 
 import java.util.EnumSet;
 import java.util.Stack;
@@ -91,7 +93,9 @@
         /** jtreg test failure */
         JTREG_TEST_FAILED(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "FAILED: "),
         /** jtreg test error */
-        JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: ");
+        JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: "),
+        /** jtreg report */
+        JTREG_TEST_REPORT(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Report written");
 
         StringBinaryPredicate sbp;
         int priority;
@@ -124,7 +128,7 @@
         JAVAC("javac", MessageKind.JAVAC_ERROR, MessageKind.JAVAC_WARNING, MessageKind.JAVAC_NOTE,
                        MessageKind.JAVAC_NESTED_DIAG, MessageKind.JAVAC_CRASH),
         /** jtreg task - invoked during test execution */
-        JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR),
+        JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR, MessageKind.JTREG_TEST_REPORT),
         /** initial synthetic task when the logger is created */
         ROOT("") {
             @Override
@@ -166,21 +170,17 @@
             }
         },
         /** build bootstrap tool target - executed when bootstrapping javac */
-        BUILD_BOOTSTRAP_TOOL("build-bootstrap-.*") {
+        BUILD_BOOTSTRAP_JAVAC("build-bootstrap-javac-classes") {
             @Override
             String getDisplayMessage(BuildEvent e) {
-                String targetName = e.getTarget().getName();
-                String tool = targetName.split("-")[2];
-                return "Building bootstrap " + tool + "...";
+                return "Building bootstrap javac...";
             }
         },
         /** build classes target - executed when building classes of given tool */
-        BUILD_TOOL("build-classes-.*") {
+        BUILD_ALL_CLASSES("build-all-classes") {
             @Override
             String getDisplayMessage(BuildEvent e) {
-                String targetName = e.getTarget().getName();
-                String tool = targetName.split("-")[2];
-                return "Building " + tool + "...";
+                return "Building all classes...";
             }
         },
         /** synthetic target catching any other target not in this list */
@@ -195,14 +195,14 @@
             }
         };
 
-        String targetRegex;
+        String targetName;
 
-        Target(String targetRegex) {
-            this.targetRegex = targetRegex;
+        Target(String targetName) {
+            this.targetName = targetName;
         }
 
         boolean matches(String msg) {
-            return msg.matches(targetRegex);
+            return msg.equals(targetName);
         }
 
         abstract String getDisplayMessage(BuildEvent e);
@@ -253,8 +253,14 @@
     /** stack of pending tasks */
     Stack<Task> tasks = new Stack<>();
 
-    public LangtoolsIdeaAntLogger(DefaultLogger logger) {
-        this.logger = logger;
+    public LangtoolsIdeaAntLogger(Project project) {
+        for (Object o : project.getBuildListeners()) {
+            if (o instanceof DefaultLogger) {
+                this.logger = (DefaultLogger)o;
+                project.removeBuildListener((BuildListener)o);
+                project.addBuildListener(this);
+            }
+        }
         tasks.push(Task.ROOT);
     }
 
--- a/make/intellij/workspace.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/intellij/workspace.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project version="4">  
+<project version="4">
   <component name="ChangeListManager">
     <ignored path=".idea/" />
   </component>
@@ -10,7 +10,7 @@
     <!-- standard tools -->
     <configuration default="false" name="javac" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -24,12 +24,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javac" />
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
     <configuration default="false" name="javadoc" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javadoc.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -43,12 +43,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javadoc" />
-      </method> 
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      </method>
     </configuration>
     <configuration default="false" name="javap" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javap.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -62,12 +62,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javap" />
-      </method> 
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      </method>
     </configuration>
     <configuration default="false" name="javah" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javah.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -81,12 +81,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javah" />
-      </method> 
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      </method>
     </configuration>
     <configuration default="false" name="sjavac" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.sjavac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -100,13 +100,13 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-sjavac" />
-      </method> 
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      </method>
     </configuration>
     <!-- bootstrap javac -->
     <configuration default="false" name="javac (bootstrap)" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/bootstrap/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@bootstrap@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -121,7 +121,7 @@
       <method>
         <option name="Make" enabled="false" />
         <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-bootstrap-javac" />
-      </method> 
+      </method>
     </configuration>
     <!-- jtreg debug -->
     <configuration default="false" name="jtreg (debug)" type="Remote" factoryName="Remote" singleton="true">
@@ -156,7 +156,7 @@
         <filter targetName="clean" isVisible="true" />
         <filter targetName="jtreg" isVisible="true" />
         <filter targetName="jtreg-debug" isVisible="true" />
-        <filter targetName="checkstyle" isVisible="true" />
+        <filter targetName="crules" isVisible="true" />
       </targetFilters>
       <viewClosedWhenNoErrors value="true" />
       <expanded value="false" />
--- a/make/launcher.sh-template	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/launcher.sh-template	Wed Apr 22 17:42:41 2015 +0100
@@ -43,10 +43,9 @@
 # dependent jar files for additional dependencies.
 
 if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
-   cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF |
-       grep "Class-Path:" |
-       sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1#PS#|g'`
-   bcp="$mylib/#PROGRAM#.jar#PS#$cp"
+   cp=`echo "$mylib"/*.jar |
+       sed -e 's|\([a-z.]*\.jar\) *|\1#PS#|g'`
+   bcp=$cp
 fi
 
 # tools currently assumes that assertions are enabled in the launcher
@@ -72,4 +71,4 @@
 unset DUALCASE
 
 IFS=$nl
-"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mylib}/#PROGRAM#.jar" ${toolOpts}
+"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} com.sun.tools.#PROGRAM#.Main ${toolOpts}
--- a/make/netbeans/langtools/build.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/netbeans/langtools/build.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -46,48 +46,34 @@
      -->
     <import file="../../build.xml"/>
 
-    <!-- Build project. (action: build; F11)
-        If langtools.tool.name is set, then just build that tool; otherwise
-        build all tools.
-    -->
+    <!-- Build project. (action: build; F11) -->
 
-    <target name="build" depends="-get-tool-if-set,-build-tool,-build-all"
-        description="Build one or all langtools tools"
-        />
-
-    <condition property="use_bootstrap" value="bootstrap-" else="">
-        <isset property="langtools.tool.bootstrap"/>
-    </condition>
-    <condition property="with_bootclasspath" value="${build.bootstrap.dir}/classes" else="${build.classes.dir}">
-        <isset property="langtools.tool.bootstrap"/>
-    </condition>
-
-    <target name="-build-tool" if="langtools.tool.name">
-        <echo level="info" message="Building ${use_bootstrap}${langtools.tool.name}"/>
-        <echo level="verbose" message="(Unset langtools.tool.name to build all tools)"/>
-        <antcall target="build-${use_bootstrap}${langtools.tool.name}"/>
+    <target name="build" depends="-get-tool-if-set,-build-bootstrap-javac,-build-all" />
+    <target name="-build-bootstrap-javac" if="langtools.tool.bootstrap">
+        <antcall target="build-bootstrap-javac"/>
     </target>
-
-    <target name="-build-all" unless="langtools.tool.name">
-        <echo level="info" message="Building all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.name to build a single tool)"/>
+    <target name="-build-all" unless="langtools.tool.bootstrap">
         <antcall target="build-all-tools"/>
     </target>
 
     <!-- Compile a single file. (action: compile.single; F9) -->
 
-    <target name="compile-single" depends="build-bootstrap-javac">
+    <target name="compile-single" depends="-get-tool-if-set,build-bootstrap-javac-classes" unless="langtools.tool.bootstrap">
         <fail unless="includes">Must set property 'includes'</fail>
-        <javac fork="true" executable="${build.bootstrap.dir}/bin/javac"
-               srcdir="${srcdir}"
-               destdir="${build.classes.dir}"
+        <mkdir dir="${build.dir}/${module.name}/classes" />
+        <javac fork="true" executable="${boot.java.home}/bin/javac"
+               srcdir="${basedir}/src/${module.name}/share/classes"
+               destdir="${build.dir}/${module.name}/classes"
                includes="${includes}"
                sourcepath=""
+               classpath="${langtools.classes}"
                includeAntRuntime="no"
                source="${javac.source}"
                target="${javac.target}"
                debug="${javac.debug}"
-               debuglevel="${javac.debuglevel}"/>
+               debuglevel="${javac.debuglevel}">
+            <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
+        </javac>
     </target>
 
     <!-- Run tool. (action: run; F6)
@@ -95,16 +81,24 @@
         the user.
     -->
 
-    <target name="run" depends="-check-target.java.home,build,-def-run,-get-tool-and-args"
+    <target name="run" depends="-check-target.java.home,-build-classes,-def-run,-get-tool-and-args,-setup-bootclasspath"
             description="run tool">
         <echo level="info" message="${with_bootclasspath}"/>
         <echo level="info" message="Run ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
         <run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}"/>
     </target>
 
+    <target name="-build-classes" depends="-get-tool-if-set,-build-classes-bootstrap-javac,-build-classes-all" />
+    <target name="-build-classes-bootstrap-javac" if="langtools.tool.bootstrap">
+        <antcall target="build-bootstrap-javac-classes"/>
+    </target>
+    <target name="-build-classes-all" unless="langtools.tool.bootstrap">
+        <antcall target="build-all-classes"/>
+    </target>
+
     <!-- Run a selected class. (action: run.single;  shift-F6) -->
 
-    <target name="run-single" depends="-check-target.java.home,-def-run">
+    <target name="run-single" depends="-check-target.java.home,-setup-bootclasspath,-def-run">
         <fail unless="run.classname">Must set property 'run.classname' </fail>
         <echo level="info" message="run ${run.classname}"/>
         <run mainclass="${run.classname}" args=""/>
@@ -115,22 +109,22 @@
         test all tools.
     -->
 
-    <target name="jtreg" depends="-get-tool-if-set,-jtreg-tool,-jtreg-all"
-        description="Test one or all langtools tools"
+    <target name="jtreg" depends="-get-tool-if-set,-jtreg-bootstrap-javac,-jtreg-all"
+        description="Test langtools tools or bootstrap javac"
         />
 
-    <target name="-jtreg-tool" if="langtools.tool.name">
-        <echo level="info" message="Testing ${langtools.tool.name}"/>
-        <echo level="verbose" message="(Unset langtools.tool.name to test all tools)"/>
+    <target name="-jtreg-bootstrap-javac" if="langtools.tool.bootstrap">
+        <echo level="info" message="Testing bootstrap javac"/>
+        <echo level="verbose" message="(Unset langtools.tool.bootstrap to test all tools)"/>
         <antcall>
-            <target name="jtreg-${langtools.tool.name}"/>
+            <target name="jtreg-bootstrap-javac"/>
             <target name="-show-jtreg"/>
         </antcall>
     </target>
 
-    <target name="-jtreg-all" unless="langtools.tool.name">
+    <target name="-jtreg-all" unless="langtools.tool.bootstrap">
         <echo level="info" message="Testing all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.name to test a single tool)"/>
+        <echo level="verbose" message="(Set langtools.tool.bootstrap to test bootstrap javac)"/>
         <antcall>
             <target name="langtools.jtreg"/>
             <target name="-show-jtreg"/>
@@ -165,7 +159,7 @@
 
     <!-- Debug tool in NetBeans. -->
 
-    <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,build" if="netbeans.home">
+    <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,-setup-bootclasspath,-build-classes" if="netbeans.home">
         <echo level="info" message="Debug ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
         <start-debugger/>
         <run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
@@ -179,20 +173,29 @@
     </target>
 
     <!-- Debug a jtreg test. -->
-    <target name="debug-jtreg" depends="-check-target.java.home,-def-start-debugger,-def-jtreg">
+    <target name="debug-jtreg" depends="-check-target.java.home,-def-start-debugger,-def-jtreg,-get-tool-if-set,-setup-bootclasspath">
         <fail unless="jtreg.tests">Must set property 'jtreg.tests'</fail>
         <start-debugger/>
-        <jtreg-tool name="debug" samevm="false" tests="${jtreg.tests}" jpda.jvmargs="${jpda.jvmargs}"/>
+        <jtreg-tool name="debug"
+                    samevm="false"
+                    tests="${jtreg.tests}"
+                    jpda.jvmargs="${jpda.jvmargs}"
+                    langtools.classes="${with_bootclasspath}"/>
     </target>
 
     <!-- Update a class being debugged. -->
 
-    <target name="debug-fix">
+    <target name="debug-fix" depends="-get-tool-if-set">
         <fail unless="class">Must set property 'class'
         </fail>
         <antcall target="compile-single">
             <param name="includes" value="${class}.java"/>
         </antcall>
+        <condition property="build.classes.dir"
+                   value="${build.dir}/${module.name}/classes"
+                   else="${boot.build.dir}/${module.name}/classes">
+            <isset property="use_bootstrap"/>
+        </condition>
         <nbjpdareload>
             <fileset dir="${build.classes.dir}">
                 <include name="${class}.class"/>
@@ -205,31 +208,10 @@
         test all tools.
     -->
 
-    <target name="javadoc" depends="-javadoc-tool,-javadoc-all"
-        description="Generate javadoc for one or all langtools tools"
-        />
-
-    <target name="-javadoc-tool" if="langtools.tool.name">
-        <echo level="info" message="Generate javadoc for ${langtools.tool.name}"/>
-        <echo level="verbose" message="(Unset langtools.tool.name to generate javadoc for all tools)"/>
-        <antcall>
-            <target name="javadoc-${langtools.tool.name}"/>
-            <target name="-show-javadoc"/>
-        </antcall>
-    </target>
-
-    <target name="-javadoc-all" unless="langtools.tool.name">
-        <echo level="info" message="Generate javadoc for all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.name to generate javadoc for a single tool)"/>
-        <antcall>
-            <target name="langtools.javadoc"/>
-            <target name="-show-javadoc"/>
-        </antcall>
-    </target>
+    <target name="javadoc" depends="langtools.javadoc,-show-javadoc" />
 
     <target name="-show-javadoc" if="netbeans.home">
-        <!-- what if doing javadoc for all? -->
-        <nbbrowse file="${build.javadoc.dir}/${langtools.tool.name}/index.html"/>
+        <nbbrowse file="${build.javadoc.dir}/index.html"/>
     </target>
 
     <!-- Prompt for values. -->
@@ -253,6 +235,15 @@
             />
     </target>
 
+    <target name="-setup-bootclasspath">
+        <condition property="use_bootstrap" value="bootstrap-" else="">
+            <isset property="langtools.tool.bootstrap"/>
+        </condition>
+        <condition property="with_bootclasspath" value="${langtools.boot.classes}" else="${langtools.classes}">
+            <isset property="langtools.tool.bootstrap"/>
+        </condition>
+    </target>
+
     <!-- Macro to run a tool or selected class - used by run* and debug* tasks -->
     <target name="-def-run">
         <macrodef name="run">
@@ -262,7 +253,7 @@
             <attribute name="jpda.jvmargs" default=""/>
 
             <sequential>
-                <java fork="true" jvm="${target.java}" classname="@{mainclass}">
+                <java fork="true" jvm="${target.java.home}/bin/java" classname="@{mainclass}">
                     <jvmarg line="-Xbootclasspath/p:@{bcp}"/>
                     <jvmarg line="@{jpda.jvmargs}"/>
                     <arg line="@{args}"/>
@@ -278,11 +269,11 @@
             <sequential>
                 <nbjpdastart name="${ant.project.name}" addressproperty="jpda.address" transport="dt_socket">
                     <bootclasspath>
-                        <pathelement location="${build.classes.dir}"/>
+                        <pathelement path="${langtools.classes}"/>
                         <pathelement location="${target.java.home}/jre/lib/rt.jar"/>
                     </bootclasspath>
                     <sourcepath>
-                        <path refid="src.dirs"/>
+                        <pathelement path="${langtools.sources}"/>
                     </sourcepath>
                 </nbjpdastart>
                 <property
--- a/make/netbeans/langtools/nbproject/project.xml	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/netbeans/langtools/nbproject/project.xml	Wed Apr 22 17:42:41 2015 +0100
@@ -57,11 +57,6 @@
                     <location>${root}/make</location>
                 </source-folder>
                 <source-folder>
-                    <label>Source files - java.base</label>
-                    <type>java</type>
-                    <location>${root}/src/java.base/share/classes</location>
-                </source-folder>
-                <source-folder>
                     <label>Source files - java.compiler</label>
                     <type>java</type>
                     <location>${root}/src/java.compiler/share/classes</location>
@@ -107,20 +102,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/java.base/share/classes</property>
-                    <context>
-                        <property>includes</property>
-                        <folder>${root}/src/java.base/share/classes</folder>
-                        <pattern>\.java$</pattern>
-                        <format>relative-path</format>
-                        <arity>
-                            <separated-files>,</separated-files>
-                        </arity>
-                    </context>
-                </action>
-                <action name="compile.single">
-                    <target>compile-single</target>
-                    <property name="srcdir">src/java.compiler/share/classes</property>
+                    <property name="module.name">java.compiler</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/java.compiler/share/classes</folder>
@@ -133,7 +115,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/jdk.compiler/share/classes</property>
+                    <property name="module.name">jdk.compiler</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/jdk.compiler/share/classes</folder>
@@ -146,7 +128,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/jdk.dev/share/classes</property>
+                    <property name="module.name">jdk.dev</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/jdk.dev/share/classes</folder>
@@ -159,7 +141,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/jdk.javadoc/share/classes</property>
+                    <property name="module.name">jdk.javadoc</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/jdk.javadoc/share/classes</folder>
@@ -259,18 +241,6 @@
                     <target>debug-single</target>
                     <context>
                         <property>debug.classname</property>
-                        <folder>${root}/src/java.base/share/classes</folder>
-                        <pattern>\.java$</pattern>
-                        <format>java-name</format>
-                        <arity>
-                            <one-file-only/>
-                        </arity>
-                    </context>
-                </action>
-                <action name="debug.single">
-                    <target>debug-single</target>
-                    <context>
-                        <property>debug.classname</property>
                         <folder>${root}/src/java.compiler/share/classes</folder>
                         <pattern>\.java$</pattern>
                         <format>java-name</format>
@@ -333,20 +303,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/java.base/share/classes</property>
-                    <context>
-                        <property>class</property>
-                        <folder>${root}/src/java.base/share/classes</folder>
-                        <pattern>\.java$</pattern>
-                        <format>relative-path-noext</format>
-                        <arity>
-                            <one-file-only/>
-                        </arity>
-                    </context>
-                </action>
-                <action name="debug.fix">
-                    <target>debug-fix</target>
-                    <property name="srcdir">src/java.compiler/share/classes</property>
+                    <property name="module.name">java.compiler</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/java.compiler/share/classes</folder>
@@ -359,7 +316,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/jdk.compiler/share/classes</property>
+                    <property name="module.name">jdk.compiler</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/jdk.compiler/share/classes</folder>
@@ -372,7 +329,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/jdk.dev/share/classes</property>
+                    <property name="module.name">jdk.dev</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/jdk.dev/share/classes</folder>
@@ -385,7 +342,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/jdk.dev/share/classes</property>
+                    <property name="module.name">jdk.javadoc</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/jdk.javadoc/share/classes</folder>
@@ -417,10 +374,6 @@
             <view>
                 <items>
                     <source-folder style="tree">
-                        <label>Source files - java.base</label>
-                        <location>${root}/src/java.base/share/classes</location>
-                    </source-folder>
-                    <source-folder style="tree">
                         <label>Source files - java.compiler</label>
                         <location>${root}/src/java.compiler/share/classes</location>
                     </source-folder>
@@ -477,12 +430,30 @@
         </general-data>
         <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
             <compilation-unit>
-                <package-root>${root}/src/java.base/share/classes</package-root>
                 <package-root>${root}/src/java.compiler/share/classes</package-root>
+                <package-root>${root}/build/bootstrap/java.compiler/gensrc</package-root>
+                <built-to>${root}/build/java.compiler/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/jdk.compiler/share/classes</package-root>
+                <package-root>${root}/build/bootstrap/jdk.compiler/gensrc</package-root>
+                <classpath mode="compile">${root}/build/java.compiler/classes</classpath>
+                <built-to>${root}/build/jdk.compiler/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/jdk.dev/share/classes</package-root>
+                <package-root>${root}/build/bootstrap/jdk.dev/gensrc</package-root>
+                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
+                <built-to>${root}/build/jdk.dev/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/jdk.javadoc/share/classes</package-root>
-                <built-to>${root}/build/classes</built-to>
+                <package-root>${root}/build/bootstrap/jdk.javadoc/gensrc</package-root>
+                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
+                <built-to>${root}/build/jdk.javadoc/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
         </java-data>
--- a/make/test/crules/CodingRulesAnalyzerPlugin/Test.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/test/crules/CodingRulesAnalyzerPlugin/Test.java	Wed Apr 22 17:42:41 2015 +0100
@@ -5,7 +5,31 @@
 import com.sun.tools.javac.util.Assert;
 
 public class Test {
-    public void check(String value) {
-        Assert.check(value.trim().length() > 0, "value=" + value);
+
+    String v;
+
+    public void check1(String value) {
+        Assert.check(value.trim().length() > 0, "value=" + value); //fail
+    }
+    public void check2(String value) {
+        Assert.check(value.trim().length() > 0, "value=" + "value"); //ok
+    }
+    public void check3(String value) {
+        Assert.check(value.trim().length() > 0, () -> "value=" + value); //ok
+    }
+    public void check4(String value) {
+        Assert.check(value.trim().length() > 0, value); //ok
+    }
+    public void check5(String value) {
+        Assert.check(value.trim().length() > 0, v); //ok
+    }
+    public void check6(String value) {
+        Assert.check(value.trim().length() > 0, () -> "value=" + "value"); //fail
+    }
+    public void check7(String value) {
+        Assert.check(value.trim().length() > 0, () -> value); //fail
+    }
+    public void check8(String value) {
+        Assert.check(value.trim().length() > 0, () -> v); //fail
     }
 }
--- a/make/test/crules/CodingRulesAnalyzerPlugin/Test.out	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/test/crules/CodingRulesAnalyzerPlugin/Test.out	Wed Apr 22 17:42:41 2015 +0100
@@ -1,2 +1,5 @@
-Test.java:9:21: compiler.err.proc.messager: compiler.misc.crules.should.not.use.string.concatenation
-1 error
+Test.java:12:58: compiler.err.proc.messager: compiler.misc.crules.should.not.use.eager.string.evaluation
+Test.java:27:49: compiler.err.proc.messager: compiler.misc.crules.should.not.use.lazy.string.evaluation
+Test.java:30:49: compiler.err.proc.messager: compiler.misc.crules.should.not.use.lazy.string.evaluation
+Test.java:33:49: compiler.err.proc.messager: compiler.misc.crules.should.not.use.lazy.string.evaluation
+4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/anttasks/PropertiesParserTask.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,92 @@
+/*
+ * 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 anttasks;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import propertiesparser.PropertiesParser;
+import propertiesparser.gen.ClassGenerator;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Resource;
+
+public class PropertiesParserTask extends MatchingTask {
+    public void addSrc(Path src) {
+        if (srcDirs == null)
+            srcDirs = new Path(getProject());
+        srcDirs.add(src);
+    }
+
+    public void setDestDir(File destDir) {
+        this.destDir = destDir;
+    }
+
+    @Override
+    public void execute() {
+        List<String> mainOpts = new ArrayList<String>();
+        int count = 0;
+        for (String dir : srcDirs.list()) {
+            File baseDir = getProject().resolveFile(dir);
+            DirectoryScanner s = getDirectoryScanner(baseDir);
+            for (String path : s.getIncludedFiles()) {
+                if (path.endsWith(".properties")) {
+                    File srcFile = new File(baseDir, path);
+                    String destPath =
+                            path.substring(0, path.lastIndexOf(File.separator) + 1) +
+                                    ClassGenerator.toplevelName(srcFile) + ".java";
+                    File destFile = new File(this.destDir, destPath);
+                    File destDir = destFile.getParentFile();
+                    // Arguably, the comparison in the next line should be ">", not ">="
+                    // but that assumes the resolution of the last modified time is fine
+                    // grained enough; in practice, it is better to use ">=".
+                    if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified())
+                        continue;
+                    destDir.mkdirs();
+                    mainOpts.add("-compile");
+                    mainOpts.add(srcFile.getPath());
+                    mainOpts.add(destDir.getPath());
+                    count++;
+                }
+            }
+        }
+        if (mainOpts.size() > 0) {
+            log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO);
+            PropertiesParser pp = new PropertiesParser(msg -> log(msg, Project.MSG_INFO));
+            boolean ok = pp.run(mainOpts.toArray(new String[mainOpts.size()]));
+            if (!ok)
+                throw new BuildException("PropertiesParser failed.");
+        }
+    }
+
+    private Path srcDirs;
+    private File destDir;
+}
--- a/make/tools/anttasks/SelectToolTask.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/tools/anttasks/SelectToolTask.java	Wed Apr 22 17:42:41 2015 +0100
@@ -74,7 +74,18 @@
 
     enum ToolChoices {
         NONE(""),
-        JAVAC("javac"),
+        BOOSTRAP_JAVAC("bootstrap-javac", true) {
+            @Override
+            public ToolChoices baseTool() {
+                return JAVAC;
+            }
+        },
+        JAVAC("javac") {
+            @Override
+            public ToolChoices asBootstrap() {
+                return BOOSTRAP_JAVAC;
+            }
+        },
         JAVADOC("javadoc"),
         JAVAH("javah"),
         JAVAP("javap");
@@ -91,6 +102,14 @@
             this.bootstrap = bootstrap;
         }
 
+        public ToolChoices asBootstrap() {
+            return this;
+        }
+
+        public ToolChoices baseTool() {
+            return this;
+        }
+
         @Override
         public String toString() {
             return toolName;
@@ -176,9 +195,11 @@
         JOptionPane p = createPane(guiProps);
         p.createDialog("Select Tool").setVisible(true);
 
-        toolName = ((ToolChoices)toolChoice.getSelectedItem()).toolName;
+        ToolChoices tool = (ToolChoices)toolChoice.getSelectedItem();
+
+        toolName = tool.baseTool().toolName;
+        toolBootstrap = tool.bootstrap;
         toolArgs = argsField.getText();
-        toolBootstrap = bootstrapCheckbox.isSelected();
         if (defaultCheck.isSelected()) {
             if (toolName.equals("")) {
                 fileProps.remove("tool.name");
@@ -213,30 +234,31 @@
         EnumSet<ToolChoices> toolChoices = toolProperty == null ?
                 EnumSet.allOf(ToolChoices.class) : EnumSet.range(ToolChoices.JAVAC, ToolChoices.JAVAP);
         toolChoice = new JComboBox<>(toolChoices.toArray());
-        if (toolName != null)
-            toolChoice.setSelectedItem(ToolChoices.valueOf(toolName.toUpperCase()));
+        ToolChoices tool = toolName != null ? ToolChoices.valueOf(toolName.toUpperCase()) : null;
+        if (toolName != null) {
+            if (toolBootstrap)
+                tool = tool.asBootstrap();
+            toolChoice.setSelectedItem(tool);
+        }
         toolChoice.addItemListener(new ItemListener() {
             @Override
             public void itemStateChanged(ItemEvent e) {
-                String tn = ((ToolChoices)e.getItem()).toolName;
-                argsField.setText(getDefaultArgsForTool(props, tn));
+                ToolChoices tool = (ToolChoices)e.getItem();
+                argsField.setText(getDefaultArgsForTool(props, tool));
                 if (toolProperty != null)
-                    okButton.setEnabled(!tn.equals(""));
+                    okButton.setEnabled(tool != ToolChoices.NONE);
             }
         });
-        GridBagConstraints checkConstraint = new GridBagConstraints();
         fc.anchor = GridBagConstraints.EAST;
 
         GridBagConstraints toolConstraint = new GridBagConstraints();
         fc.anchor = GridBagConstraints.WEST;
 
         toolPane.add(toolChoice, toolConstraint);
-        bootstrapCheckbox = new JCheckBox("bootstrap", toolBootstrap);
-        toolPane.add(bootstrapCheckbox, checkConstraint);
 
         body.add(toolPane, fc);
 
-        argsField = new JTextField(getDefaultArgsForTool(props, toolName), 40);
+        argsField = new JTextField(getDefaultArgsForTool(props, tool), 40);
         if (toolProperty == null || argsProperty != null) {
             JLabel argsLabel = new JLabel("Args:");
             body.add(argsLabel, lc);
@@ -322,8 +344,11 @@
         }
     }
 
-    String getDefaultArgsForTool(Properties props, String tn) {
-        return (tn == null || tn.equals("")) ? "" : props.getProperty(tn + ".args", "");
+    String getDefaultArgsForTool(Properties props, ToolChoices tool) {
+        if (tool == null)
+            return "";
+        String toolName = tool.baseTool().toolName;
+        return toolName.equals("") ? "" : props.getProperty(toolName + ".args", "");
     }
 
     // Ant task parameters
@@ -335,7 +360,6 @@
 
     // GUI components
     private JComboBox<?> toolChoice;
-    private JCheckBox bootstrapCheckbox;
     private JTextField argsField;
     private JCheckBox defaultCheck;
     private JButton okButton;
--- a/make/tools/crules/AssertCheckAnalyzer.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/tools/crules/AssertCheckAnalyzer.java	Wed Apr 22 17:42:41 2015 +0100
@@ -23,10 +23,14 @@
 
 package crules;
 
+import com.sun.source.tree.LambdaExpressionTree.BodyKind;
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TaskEvent.Kind;
+import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.tree.JCTree.JCExpression;
+import com.sun.tools.javac.tree.JCTree.JCLambda;
 import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
 import com.sun.tools.javac.tree.JCTree.Tag;
 import com.sun.tools.javac.tree.TreeInfo;
@@ -35,6 +39,22 @@
 
 public class AssertCheckAnalyzer extends AbstractCodingRulesAnalyzer {
 
+    enum AssertOverloadKind {
+        EAGER("crules.should.not.use.eager.string.evaluation"),
+        LAZY("crules.should.not.use.lazy.string.evaluation"),
+        NONE(null);
+
+        String errKey;
+
+        AssertOverloadKind(String errKey) {
+            this.errKey = errKey;
+        }
+
+        boolean simpleArgExpected() {
+            return this == AssertOverloadKind.EAGER;
+        }
+    }
+
     public AssertCheckAnalyzer(JavacTask task) {
         super(task);
         treeVisitor = new AssertCheckVisitor();
@@ -45,20 +65,46 @@
 
         @Override
         public void visitApply(JCMethodInvocation tree) {
-            Symbol method = TreeInfo.symbolFor(tree);
-            if (method != null &&
-                method.owner.getQualifiedName().contentEquals(Assert.class.getName()) &&
-                !method.name.contentEquals("error")) {
+            Symbol m = TreeInfo.symbolFor(tree);
+            AssertOverloadKind ak = assertOverloadKind(m);
+            if (ak != AssertOverloadKind.NONE &&
+                !m.name.contentEquals("error")) {
                 JCExpression lastParam = tree.args.last();
-                if (lastParam != null &&
-                    lastParam.type.tsym == syms.stringType.tsym &&
-                    lastParam.hasTag(Tag.PLUS)) {
-                    messages.error(tree, "crules.should.not.use.string.concatenation");
+                if (isSimpleStringArg(lastParam) != ak.simpleArgExpected()) {
+                    messages.error(lastParam, ak.errKey);
                 }
             }
 
             super.visitApply(tree);
         }
 
+        AssertOverloadKind assertOverloadKind(Symbol method) {
+            if (method == null ||
+                !method.owner.getQualifiedName().contentEquals(Assert.class.getName()) ||
+                method.type.getParameterTypes().tail == null) {
+                return AssertOverloadKind.NONE;
+            }
+            Type formal = method.type.getParameterTypes().last();
+            if (types.isSameType(formal, syms.stringType)) {
+                return AssertOverloadKind.EAGER;
+            } else if (types.isSameType(types.erasure(formal), types.erasure(syms.supplierType))) {
+                return AssertOverloadKind.LAZY;
+            } else {
+                return AssertOverloadKind.NONE;
+            }
+        }
+
+        boolean isSimpleStringArg(JCExpression e) {
+            switch (e.getTag()) {
+                case LAMBDA:
+                    JCLambda lambda = (JCLambda)e;
+                    return (lambda.getBodyKind() == BodyKind.EXPRESSION) &&
+                            isSimpleStringArg((JCExpression)lambda.body);
+                default:
+                    Symbol argSym = TreeInfo.symbolFor(e);
+                    return (e.type.constValue() != null ||
+                            (argSym != null && argSym.kind == Kinds.Kind.VAR));
+            }
+        }
     }
 }
--- a/make/tools/crules/MutableFieldsAnalyzer.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/tools/crules/MutableFieldsAnalyzer.java	Wed Apr 22 17:42:41 2015 +0100
@@ -30,7 +30,6 @@
 
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TaskEvent.Kind;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
 import com.sun.tools.javac.tree.TreeScanner;
 
@@ -38,6 +37,7 @@
 import static com.sun.tools.javac.code.Flags.FINAL;
 import static com.sun.tools.javac.code.Flags.STATIC;
 import static com.sun.tools.javac.code.Flags.SYNTHETIC;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 public class MutableFieldsAnalyzer extends AbstractCodingRulesAnalyzer {
 
@@ -68,7 +68,7 @@
                     .contains(packageToCheck);
             if (isJavacPack &&
                 (tree.sym.flags() & SYNTHETIC) == 0 &&
-                tree.sym.owner.kind == Kinds.TYP) {
+                tree.sym.owner.kind == TYP) {
                 if (!ignoreField(tree.sym.owner.flatName().toString(),
                         tree.getName().toString())) {
                     boolean enumClass = (tree.sym.owner.flags() & ENUM) != 0;
@@ -103,6 +103,9 @@
                 put("com.sun.tools.javac.file.ZipFileIndexCache",
                     Arrays.asList("sharedInstance"));
         classFieldsToIgnoreMap.
+                put("com.sun.tools.javac.file.JRTIndex",
+                    Arrays.asList("sharedInstance"));
+        classFieldsToIgnoreMap.
                 put("com.sun.tools.javac.main.JavaCompiler",
                     Arrays.asList("versionRB"));
         classFieldsToIgnoreMap.
--- a/make/tools/crules/resources/crules.properties	Wed Apr 01 15:13:45 2015 +0100
+++ b/make/tools/crules/resources/crules.properties	Wed Apr 22 17:42:41 2015 +0100
@@ -26,8 +26,10 @@
 # 0: symbol
 crules.err.var.must.be.final=\
     Static variable {0} must be final
-crules.should.not.use.string.concatenation=\
-    Should not use string concatenation.
+crules.should.not.use.eager.string.evaluation=\
+    Should not use eager string evaluation. Use lazy version instead.
+crules.should.not.use.lazy.string.evaluation=\
+    Should not use eager lazy evaluation. Use eager version instead.
 crules.no.defined.by=\
     This method implements a public API method, and should be marked with @DefinedBy.
 crules.wrong.defined.by=\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/PropertiesParser.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,127 @@
+/*
+ * 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 propertiesparser;
+
+import propertiesparser.parser.MessageFile;
+import propertiesparser.gen.ClassGenerator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.lang.RuntimeException;
+import java.lang.Throwable;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+/** Translates a .properties file into a .java file containing an enum-like Java class
+ *  which defines static factory methods for all resource keys in a given resource file. <P>
+ *
+ *  Usage: java PropertiesParser -compile [path to .properties file] [output folder where .java file will be written]
+ *
+ * @author mcimadamore
+ */
+
+public class PropertiesParser {
+
+    public Logger logger;
+
+    public PropertiesParser(Logger logger) {
+        this.logger = logger;
+    }
+
+    public static void main(String[] args) {
+        PropertiesParser pp = new PropertiesParser(msg -> System.out.println(msg));
+        boolean ok = pp.run(args);
+        if ( !ok ) {
+            System.exit(1);
+        }
+    }
+
+    public static interface Logger {
+        void info(String msg);
+    }
+
+    public void info(String msg) {
+        logger.info(msg);
+    }
+
+    public boolean run(String[] args) {
+        Map<String, String> optionsMap = parseOptions(args);
+        if (optionsMap.isEmpty()) {
+            usage();
+            return false;
+        }
+        try {
+            optionsMap.forEach((propfile, outfile) -> compilePropertyFile(propfile, outfile));
+            return true;
+        } catch (RuntimeException ex) {
+            ex.printStackTrace();
+            return false;
+        }
+    }
+
+    private void compilePropertyFile(String propertyPath, String outPath) {
+        try {
+            File propertyFile = new File(propertyPath);
+            String prefix = propertyFile.getName().split("\\.")[0];
+            MessageFile messageFile = new MessageFile(propertyFile, prefix);
+            new ClassGenerator().generateFactory(messageFile, new File(outPath));
+        } catch (Throwable ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    private Map<String, String> parseOptions(String args[]) {
+        Map<String, String> optionsMap = new HashMap<>(args.length);
+        for ( int i = 0; i < args.length ; i++ ) {
+            if ( "-compile".equals(args[i]) && i+2 < args.length ) {
+                optionsMap.put(args[++i], args[++i]);
+            } else {
+                return new HashMap<>();
+            }
+        }
+        return optionsMap;
+    }
+
+    private void usage() {
+        info("usage:");
+        info("    java PropertiesParser {-compile path_to_properties_file path_to_java_output_dir}");
+        info("");
+        info("Example:");
+        info("    java PropertiesParser -compile resources/test.properties resources");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/gen/ClassGenerator.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,442 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 propertiesparser.gen;
+
+import propertiesparser.parser.Message;
+import propertiesparser.parser.MessageFile;
+import propertiesparser.parser.MessageInfo;
+import propertiesparser.parser.MessageLine;
+import propertiesparser.parser.MessageType;
+import propertiesparser.parser.MessageType.CompoundType;
+import propertiesparser.parser.MessageType.CustomType;
+import propertiesparser.parser.MessageType.SimpleType;
+import propertiesparser.parser.MessageType.UnionType;
+import propertiesparser.parser.MessageType.Visitor;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.TreeSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Properties;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class ClassGenerator {
+
+    /** Empty string - used to generate indentation padding. */
+    private final static String INDENT_STRING = "                                                                   ";
+
+    /** Default indentation step. */
+    private final static int INDENT_WIDTH = 4;
+
+    /** File-backed property file containing basic code stubs. */
+    static Properties stubs;
+
+    static {
+        //init properties from file
+        stubs = new Properties();
+        String resourcePath = "/propertiesparser/resources/templates.properties";
+        try (InputStream in = ClassGenerator.class.getResourceAsStream(resourcePath)) {
+            stubs.load(in);
+        } catch (IOException ex) {
+            throw new AssertionError(ex);
+        }
+    }
+
+    /**
+     * Supported stubs in the property file.
+     */
+    enum StubKind {
+        TOPLEVEL("toplevel.decl"),
+        FACTORY_CLASS("nested.decl"),
+        IMPORT("import.decl"),
+        FACTORY_METHOD_DECL("factory.decl.method"),
+        FACTORY_METHOD_ARG("factory.decl.method.arg"),
+        FACTORY_METHOD_BODY("factory.decl.method.body"),
+        FACTORY_FIELD("factory.decl.field"),
+        WILDCARDS_EXTENDS("wildcards.extends"),
+        SUPPRESS_WARNINGS("suppress.warnings");
+
+        /** stub key (as it appears in the property file) */
+        String key;
+
+        StubKind(String key) {
+            this.key = key;
+        }
+
+        /**
+         * Subst a list of arguments into a given stub.
+         */
+        String format(Object... args) {
+            return MessageFormat.format((String)stubs.get(key), args);
+        }
+    }
+
+    /**
+     * Nested factory class kind. There are multiple sub-factories, one for each kind of commonly used
+     * diagnostics (i.e. error, warnings, note, fragment). An additional category is defined for
+     * those resource keys whose prefix doesn't match any predefined category.
+     */
+    enum FactoryKind {
+        ERR("err", "Error", "Errors"),
+        WARN("warn", "Warning", "Warnings"),
+        NOTE("note", "Note", "Notes"),
+        MISC("misc", "Fragment", "Fragments"),
+        OTHER(null, null, null);
+
+        /** The prefix for this factory kind (i.e. 'err'). */
+        String prefix;
+
+        /** The type of the factory method/fields in this class. */
+        String keyClazz;
+
+        /** The class name to be used for this factory. */
+        String factoryClazz;
+
+        FactoryKind(String prefix, String keyClazz, String factoryClazz) {
+            this.prefix = prefix;
+            this.keyClazz = keyClazz;
+            this.factoryClazz = factoryClazz;
+        }
+
+        /**
+         * Utility method for parsing a factory kind from a resource key prefix.
+         */
+        static FactoryKind parseFrom(String prefix) {
+            for (FactoryKind k : FactoryKind.values()) {
+                if (k.prefix == null || k.prefix.equals(prefix)) {
+                    return k;
+                }
+            }
+            return null;
+        }
+    }
+
+    /**
+     * Main entry-point: generate a Java enum-like set of nested factory classes into given output
+     * folder. The factories are populated as mandated by the comments in the input resource file.
+     */
+    public void generateFactory(MessageFile messageFile, File outDir) {
+        Map<FactoryKind, List<Map.Entry<String, Message>>> groupedEntries =
+                messageFile.messages.entrySet().stream()
+                        .collect(Collectors.groupingBy(e -> FactoryKind.parseFrom(e.getKey().split("\\.")[1])));
+        //generate nested classes
+        List<String> nestedDecls = new ArrayList<>();
+        Set<String> importedTypes = new TreeSet<>();
+        for (Map.Entry<FactoryKind, List<Map.Entry<String, Message>>> entry : groupedEntries.entrySet()) {
+            if (entry.getKey() == FactoryKind.OTHER) continue;
+            //emit members
+            String members = entry.getValue().stream()
+                    .flatMap(e -> generateFactoryMethodsAndFields(e.getKey(), e.getValue()).stream())
+                    .collect(Collectors.joining("\n\n"));
+            //emit nested class
+            String factoryDecl =
+                    StubKind.FACTORY_CLASS.format(entry.getKey().factoryClazz, indent(members, 1));
+            nestedDecls.add(indent(factoryDecl, 1));
+            //add imports
+            entry.getValue().stream().forEach(e ->
+                    importedTypes.addAll(importedTypes(e.getValue().getMessageInfo().getTypes())));
+        }
+        String clazz = StubKind.TOPLEVEL.format(
+                packageName(messageFile.file),
+                String.join("\n", generateImports(importedTypes)),
+                toplevelName(messageFile.file),
+                String.join("\n", nestedDecls));
+        try (FileWriter fw = new FileWriter(new File(outDir, toplevelName(messageFile.file) + ".java"))) {
+            fw.append(clazz);
+        } catch (Throwable ex) {
+            throw new AssertionError(ex);
+        }
+    }
+
+    /**
+     * Indent a string to a given level.
+     */
+    String indent(String s, int level) {
+        return Stream.of(s.split("\n"))
+                .map(sub -> INDENT_STRING.substring(0, level * INDENT_WIDTH) + sub)
+                .collect(Collectors.joining("\n"));
+    }
+
+    /**
+     * Retrieve package part of given file object.
+     */
+    String packageName(File file) {
+        String path = file.getAbsolutePath();
+        int begin = path.lastIndexOf(File.separatorChar + "com" + File.separatorChar);
+        String packagePath = path.substring(begin + 1, path.lastIndexOf(File.separatorChar));
+        String packageName =  packagePath.replace(File.separatorChar, '.');
+        return packageName;
+    }
+
+    /**
+     * Form the name of the toplevel factory class.
+     */
+    public static String toplevelName(File file) {
+        return Stream.of(file.getName().split("\\."))
+                .map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1))
+                .collect(Collectors.joining(""));
+    }
+
+    /**
+     * Generate a list of import declarations given a set of imported types.
+     */
+    List<String> generateImports(Set<String> importedTypes) {
+        List<String> importDecls = new ArrayList<>();
+        for (String it : importedTypes) {
+            importDecls.add(StubKind.IMPORT.format(it));
+        }
+        return importDecls;
+    }
+
+    /**
+     * Generate a list of factory methods/fields to be added to a given factory nested class.
+     */
+    List<String> generateFactoryMethodsAndFields(String key, Message msg) {
+        MessageInfo msgInfo = msg.getMessageInfo();
+        List<MessageLine> lines = msg.getLines(false);
+        String javadoc = lines.stream()
+                .filter(ml -> !ml.isInfo() && !ml.isEmptyOrComment())
+                .map(ml -> ml.text)
+                .collect(Collectors.joining("\n *"));
+        String[] keyParts = key.split("\\.");
+        FactoryKind k = FactoryKind.parseFrom(keyParts[1]);
+        String factoryName = factoryName(key);
+        if (msgInfo.getTypes().isEmpty()) {
+            //generate field
+            String factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
+                    "\"" + keyParts[0] + "\"",
+                    "\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
+                    javadoc);
+            return Collections.singletonList(factoryField);
+        } else {
+            //generate method
+            List<String> factoryMethods = new ArrayList<>();
+            for (List<MessageType> msgTypes : normalizeTypes(0, msgInfo.getTypes())) {
+                List<String> types = generateTypes(msgTypes);
+                List<String> argNames = argNames(types.size());
+                String suppressionString = needsSuppressWarnings(msgTypes) ?
+                        StubKind.SUPPRESS_WARNINGS.format() : "";
+                String factoryMethod = StubKind.FACTORY_METHOD_DECL.format(suppressionString, k.keyClazz,
+                        factoryName, argDecls(types, argNames).stream().collect(Collectors.joining(", ")),
+                        indent(StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
+                                "\"" + keyParts[0] + "\"",
+                                "\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
+                                argNames.stream().collect(Collectors.joining(", "))), 1),
+                        javadoc);
+                factoryMethods.add(factoryMethod);
+            }
+            return factoryMethods;
+        }
+    }
+
+    /**
+     * Form the name of a factory method/field given a resource key.
+     */
+    String factoryName(String key) {
+        return Stream.of(key.split("[\\.-]"))
+                .skip(2)
+                .map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1))
+                .collect(Collectors.joining(""));
+    }
+
+    /**
+     * Generate a formal parameter list given a list of types and names.
+     */
+    List<String> argDecls(List<String> types, List<String> args) {
+        List<String> argNames = new ArrayList<>();
+        for (int i = 0 ; i < types.size() ; i++) {
+            argNames.add(types.get(i) + " " + args.get(i));
+        }
+        return argNames;
+    }
+
+    /**
+     * Generate a list of formal parameter names given a size.
+     */
+    List<String> argNames(int size) {
+        List<String> argNames = new ArrayList<>();
+        for (int i = 0 ; i < size ; i++) {
+            argNames.add(StubKind.FACTORY_METHOD_ARG.format(i));
+        }
+        return argNames;
+    }
+
+    /**
+     * Convert a (normalized) parsed type into a string-based representation of some Java type.
+     */
+    List<String> generateTypes(List<MessageType> msgTypes) {
+        return msgTypes.stream().map(t -> t.accept(stringVisitor, null)).collect(Collectors.toList());
+    }
+    //where
+        Visitor<String, Void> stringVisitor = new Visitor<String, Void>() {
+            @Override
+            public String visitCustomType(CustomType t, Void aVoid) {
+                String customType = t.typeString;
+                return customType.substring(customType.lastIndexOf('.') + 1);
+            }
+
+            @Override
+            public String visitSimpleType(SimpleType t, Void aVoid) {
+                return t.clazz;
+            }
+
+            @Override
+            public String visitCompoundType(CompoundType t, Void aVoid) {
+                return StubKind.WILDCARDS_EXTENDS.format(t.kind.clazz.clazz,
+                        t.elemtype.accept(this, null));
+            }
+
+            @Override
+            public String visitUnionType(UnionType t, Void aVoid) {
+                throw new AssertionError("Union types should have been denormalized!");
+            }
+        };
+
+    /**
+     * See if any of the parsed types in the given list needs warning suppression.
+     */
+    boolean needsSuppressWarnings(List<MessageType> msgTypes) {
+        return msgTypes.stream().anyMatch(t -> t.accept(suppressWarningsVisitor, null));
+    }
+    //where
+    Visitor<Boolean, Void> suppressWarningsVisitor = new Visitor<Boolean, Void>() {
+        @Override
+        public Boolean visitCustomType(CustomType t, Void aVoid) {
+            //play safe
+            return true;
+        }
+        @Override
+        public Boolean visitSimpleType(SimpleType t, Void aVoid) {
+            switch (t) {
+                case LIST:
+                case SET:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        @Override
+        public Boolean visitCompoundType(CompoundType t, Void aVoid) {
+            return t.elemtype.accept(this, null);
+        }
+
+        @Override
+        public Boolean visitUnionType(UnionType t, Void aVoid) {
+            return needsSuppressWarnings(Arrays.asList(t.choices));
+        }
+    };
+
+    /**
+     * Retrieve a list of types that need to be imported, so that the factory body can refer
+     * to the types in the given list using simple names.
+     */
+    Set<String> importedTypes(List<MessageType> msgTypes) {
+        Set<String> imports = new TreeSet<>();
+        msgTypes.forEach(t -> t.accept(importVisitor, imports));
+        return imports;
+    }
+    //where
+    Visitor<Void, Set<String>> importVisitor = new Visitor<Void, Set<String>>() {
+        @Override
+        public Void visitCustomType(CustomType t, Set<String> imports) {
+            imports.add(t.typeString);
+            return null;
+        }
+
+        @Override
+        public Void visitSimpleType(SimpleType t, Set<String> imports) {
+            if (t.qualifier != null) {
+                imports.add(t.qualifier + "." + t.clazz);
+            }
+            return null;
+        }
+
+        @Override
+        public Void visitCompoundType(CompoundType t, Set<String> imports) {
+            visitSimpleType(t.kind.clazz, imports);
+            t.elemtype.accept(this, imports);
+            return null;
+        }
+
+        @Override
+        public Void visitUnionType(UnionType t, Set<String> imports) {
+            Stream.of(t.choices).forEach(c -> c.accept(this, imports));
+            return null;
+        }
+    };
+
+    /**
+     * Normalize parsed types in a comment line. If one or more types in the line contains alternatives,
+     * this routine generate a list of 'overloaded' normalized signatures.
+     */
+    List<List<MessageType>> normalizeTypes(int idx, List<MessageType> msgTypes) {
+        if (msgTypes.size() == idx) return Collections.singletonList(Collections.emptyList());
+        MessageType head = msgTypes.get(idx);
+        List<List<MessageType>> buf = new ArrayList<>();
+        for (MessageType alternative : head.accept(normalizeVisitor, null)) {
+            for (List<MessageType> rest : normalizeTypes(idx + 1, msgTypes)) {
+                List<MessageType> temp = new ArrayList<>(rest);
+                temp.add(0, alternative);
+                buf.add(temp);
+            }
+        }
+        return buf;
+    }
+    //where
+    Visitor<List<MessageType>, Void> normalizeVisitor = new Visitor<List<MessageType>, Void>() {
+        @Override
+        public List<MessageType> visitCustomType(CustomType t, Void aVoid) {
+            return Collections.singletonList(t);
+        }
+
+        @Override
+        public List<MessageType> visitSimpleType(SimpleType t, Void aVoid) {
+            return Collections.singletonList(t);
+        }
+
+        @Override
+        public List<MessageType> visitCompoundType(CompoundType t, Void aVoid) {
+            return t.elemtype.accept(this, null).stream()
+                    .map(nt -> new CompoundType(t.kind, nt))
+                    .collect(Collectors.toList());
+        }
+
+        @Override
+        public List<MessageType> visitUnionType(UnionType t, Void aVoid) {
+            return Stream.of(t.choices)
+                    .flatMap(t2 -> t2.accept(this, null).stream())
+                    .collect(Collectors.toList());
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/parser/Message.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,91 @@
+/*
+ * 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 propertiesparser.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A message within the message file.
+ * A message is a series of lines containing a "name=value" property,
+ * optionally preceded by a comment describing the use of placeholders
+ * such as {0}, {1}, etc within the property value.
+ */
+public final class Message {
+    final MessageLine firstLine;
+    private MessageInfo messageInfo;
+
+    Message(MessageLine l) {
+        firstLine = l;
+    }
+
+    /**
+     * Get the Info object for this message. It may be empty if there
+     * if no comment preceding the property specification.
+     */
+    public MessageInfo getMessageInfo() {
+        if (messageInfo == null) {
+            MessageLine l = firstLine.prev;
+            if (l != null && l.isInfo())
+                messageInfo = new MessageInfo(l.text);
+            else
+                messageInfo = MessageInfo.dummyInfo;
+        }
+        return messageInfo;
+    }
+
+    /**
+     * Get all the lines pertaining to this message.
+     */
+    public List<MessageLine> getLines(boolean includeAllPrecedingComments) {
+        List<MessageLine> lines = new ArrayList<>();
+        MessageLine l = firstLine;
+        if (includeAllPrecedingComments) {
+            // scan back to find end of prev message
+            while (l.prev != null && l.prev.isEmptyOrComment())
+                l = l.prev;
+            // skip leading blank lines
+            while (l.text.isEmpty())
+                l = l.next;
+        } else {
+            if (l.prev != null && l.prev.isInfo())
+                l = l.prev;
+        }
+
+        // include any preceding lines
+        for ( ; l != firstLine; l = l.next)
+            lines.add(l);
+
+        // include message lines
+        for (l = firstLine; l != null && l.hasContinuation(); l = l.next)
+            lines.add(l);
+        lines.add(l);
+
+        // include trailing blank line if present
+        l = l.next;
+        if (l != null && l.text.isEmpty())
+            lines.add(l);
+
+        return lines;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/parser/MessageFile.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+package propertiesparser.parser;
+
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.*;
+
+/**
+ * Class to facilitate manipulating compiler.properties.
+ */
+public class MessageFile {
+
+    MessageLine firstLine;
+    public Map<String, Message> messages = new TreeMap<>();
+    public File file;
+    public String keyPrefix;
+
+    public MessageFile(File file, String keyPrefix) throws IOException {
+        this.file = file;
+        this.keyPrefix = keyPrefix;
+        read(file);
+    }
+
+    final void read(File in) throws IOException {
+        MessageLine currLine = null;
+        for (String line : Files.readAllLines(in.toPath())) {
+            if (currLine == null)
+                firstLine = currLine = new MessageLine(line);
+            else
+                currLine = currLine.append(line);
+            if (line.startsWith(keyPrefix + ".")) {
+                int eq = line.indexOf("=");
+                if (eq > 0)
+                    messages.put(line.substring(0, eq), new Message(currLine));
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/parser/MessageInfo.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,125 @@
+/*
+ * 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 propertiesparser.parser;
+
+import propertiesparser.parser.MessageType.CompoundType;
+import propertiesparser.parser.MessageType.OrType;
+import propertiesparser.parser.MessageType.SimpleType;
+import propertiesparser.parser.MessageType.UnionType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * An object to represent the comment that may precede the property
+ * specification in a Message.
+ * The comment is modelled as a list of fields, where the fields correspond
+ * to the placeholder values (e.g. {0}, {1}, etc) within the message value.
+ */
+public final class MessageInfo {
+
+    /** The fields of the Info object. */
+    List<MessageType> types = new ArrayList<>();
+
+    MessageInfo(String text) throws IllegalArgumentException {
+        if (text != null) {
+            if (!text.startsWith("# "))
+                throw new IllegalArgumentException();
+            String[] segs = text.substring(2).split(", ");
+            types = new ArrayList<>();
+            for (String seg : segs) {
+                types.add(parseType(seg));
+            }
+        }
+    }
+
+    public List<MessageType> getTypes() {
+        return types;
+    }
+
+    boolean isEmpty() {
+        return types.isEmpty();
+    }
+
+    @Override
+    public String toString() {
+        return types.toString();
+    }
+
+    /**
+     * Split the type comment into multiple alternatives (separated by 'or') - then parse each of them
+     * individually and form an 'or' type.
+     */
+    MessageType parseType(String text) {
+        int commentStart = text.indexOf("(");
+        if (commentStart != -1) {
+            //remove optional comment
+            text = text.substring(0, commentStart);
+        }
+        text = text.substring(text.indexOf(": ") + 2);
+        String[] alternatives = text.split(" " + OrType.OR_NAME + " ");
+        MessageType[] types = new MessageType[alternatives.length];
+        for (int i = 0 ; i < alternatives.length ; i++) {
+            types[i] = parseAlternative(alternatives[i].trim());
+        }
+        return types.length > 1 ?
+                new OrType(types) : types[0];
+    }
+
+    /**
+     * Parse a subset of the type comment; valid matches are simple types, compound types,
+     * union types and custom types.
+     */
+    MessageType parseAlternative(String text) {
+        //try with custom types
+        if (text.charAt(0) == '\'') {
+            int end = text.indexOf('\'', 1);
+            return new MessageType.CustomType(text.substring(1, end));
+        }
+        //try with simple types
+        for (SimpleType st : SimpleType.values()) {
+            if (text.equals(st.kindName())) {
+                return st;
+            }
+        }
+        //try with compound types
+        for (CompoundType.Kind ck : CompoundType.Kind.values()) {
+            if (text.startsWith(ck.kindName)) {
+                MessageType elemtype = parseAlternative(text.substring(ck.kindName.length() + 1).trim());
+                return new CompoundType(ck, elemtype);
+            }
+        }
+        //try with union types
+        for (UnionType.Kind uk : UnionType.Kind.values()) {
+            if (text.startsWith(uk.kindName)) {
+                return new UnionType(uk);
+            }
+        }
+        //no match - report a warning
+        System.err.println("WARNING - unrecognized type: " + text);
+        return SimpleType.UNKNOWN;
+    }
+
+    /** Dummy message info to be used when no resource key comment is available. */
+    static final MessageInfo dummyInfo = new MessageInfo(null);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/parser/MessageLine.java	Wed Apr 22 17:42:41 2015 +0100
@@ -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.
+ */
+package propertiesparser.parser;
+
+import java.util.regex.Pattern;
+
+/**
+ * A line of text within the message file.
+ * The lines form a doubly linked list for simple navigation.
+ */
+public class MessageLine {
+
+    static final Pattern emptyOrCommentPattern = Pattern.compile("( *#.*)?");
+    static final Pattern typePattern = Pattern.compile("[-\\\\'A-Z\\.a-z ]+( \\([A-Za-z 0-9]+\\))?");
+    static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
+            typePattern.pattern(), typePattern.pattern()));
+
+    public String text;
+    MessageLine prev;
+    MessageLine next;
+
+    MessageLine(String text) {
+        this.text = text;
+    }
+
+    public boolean isEmptyOrComment() {
+        return emptyOrCommentPattern.matcher(text).matches();
+    }
+
+    public boolean isInfo() {
+        return infoPattern.matcher(text).matches();
+    }
+
+    boolean hasContinuation() {
+        return (next != null) && text.endsWith("\\");
+    }
+
+    MessageLine append(String text) {
+        MessageLine l = new MessageLine(text);
+        append(l);
+        return l;
+    }
+
+    void append(MessageLine l) {
+        assert l.prev == null && l.next == null;
+        l.prev = this;
+        l.next = next;
+        if (next != null) {
+            next.prev = l;
+        }
+        next = l;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/parser/MessageType.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,250 @@
+/*
+ * 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 propertiesparser.parser;
+
+/**
+ * Common interface to all kinds of diagnostic argument types.
+ */
+public interface MessageType {
+
+    /**
+     * Visitor method.
+     */
+    <R, A> R accept(Visitor<R, A> v, A a);
+
+    /**
+     * The type as mentioned in the resource file.
+     */
+    String kindName();
+
+    /**
+     * A custom type is a type for which a predefined alternative does not exist. As such, it is an
+     * handy option when prototyping - but usages of custom types should be avoided in product-quality
+     * resource file comments.
+     *
+     * Example: 'com.sun.tools.javac.code.Flags.Flag'
+     */
+    public static class CustomType implements MessageType {
+
+        /** The string-based representation of this type. */
+        public String typeString;
+
+        public CustomType(String typeString) {
+            this.typeString = typeString;
+        }
+
+        @Override
+        public String kindName() {
+            return typeString;
+        }
+
+        @Override
+        public <R, A> R accept(Visitor<R, A> v, A a) {
+            return v.visitCustomType(this, a);
+        }
+    }
+
+    /**
+     * A predefined type. All common types mentioned in the resource file comments are meant to
+     * be included here.
+     */
+    public enum SimpleType implements MessageType {
+
+        BOOLEAN("boolean", "boolean", null),
+        FRAGMENT("fragment", "Fragment", null),
+        DIAGNOSTIC("diagnostic", "JCDiagnostic", "com.sun.tools.javac.util"),
+        MODIFIER("modifier", "Modifier", "javax.lang.model.element"),
+        FILE("file", "File", "java.io"),
+        FILE_OBJECT("file object", "JavaFileObject", "javax.tools"),
+        NAME("name", "Name", "com.sun.tools.javac.util"),
+        NUMBER("number", "int", null),
+        OPTION_NAME("option name", "Option", "com.sun.tools.javac.main"),
+        SOURCE_VERSION("source version", "Source", "com.sun.tools.javac.code"),
+        STRING("string", "String", null),
+        SYMBOL("symbol", "Symbol", "com.sun.tools.javac.code"),
+        SYMBOL_KIND("symbol kind", "Kind", "com.sun.tools.javac.code.Kinds"),
+        KIND_NAME("kind name", "KindName", "com.sun.tools.javac.code.Kinds"),
+        TOKEN("token", "TokenKind", "com.sun.tools.javac.parser.Tokens"),
+        TYPE("type", "Type", "com.sun.tools.javac.code"),
+        SET("set", "Set", "java.util"),
+        LIST("list", "List", "java.util"),
+        OBJECT("object", "Object", null),
+        UNUSED("unused", "Void", null),
+        UNKNOWN("<unknown>", "UnknownType", null);
+
+        /** name of the predefined type as mentioned in the resource file. */
+        public final String kindName;
+
+        /** string-based representation of the type */
+        public final String clazz;
+
+        /** type qualifier (might be null) */
+        public final String qualifier;
+
+        SimpleType(String kindName, String clazz, String qualifier) {
+            this.kindName = kindName;
+            this.clazz = clazz;
+            this.qualifier = qualifier;
+        }
+
+        @Override
+        public String kindName() {
+            return kindName;
+        }
+
+        @Override
+        public <R, A> R accept(Visitor<R, A> v, A a) {
+            return v.visitSimpleType(this, a);
+        }
+    }
+
+    /**
+     * A compound type is a collection of some element type.
+     *
+     * Example: list of string
+     */
+    public static class CompoundType implements MessageType {
+
+        /**
+         * Compound type kind.
+         */
+        public enum Kind {
+            LIST("list of", SimpleType.LIST),
+            SET("set of", SimpleType.SET);
+
+            public final String kindName;
+            public final SimpleType clazz;
+
+            Kind(String kindName, SimpleType clazz) {
+                this.kindName = kindName;
+                this.clazz = clazz;
+            }
+        }
+
+        /** The compound type kind. */
+        public final Kind kind;
+
+        /** The element type. */
+        public final MessageType elemtype;
+
+        public CompoundType(Kind kind, MessageType elemtype) {
+            this.kind = kind;
+            this.elemtype = elemtype;
+        }
+
+        @Override
+        public String kindName() {
+            return kind.kindName;
+        }
+
+        @Override
+        public <R, A> R accept(Visitor<R, A> v, A a) {
+            return v.visitCompoundType(this, a);
+        }
+    }
+
+    /**
+     * A union type represents an alternative between two (or more) types. It can be useful to
+     * define the type of an argument which can assume multiple (unrelated) values; union types
+     * are only meant to be used in cases where the alternative comes up frequently enough in the
+     * resource file comments - in order to avoid cluttered comments.
+     *
+     * Example: message segment
+     */
+    public static class UnionType implements MessageType {
+
+        /**
+         * Union type kind.
+         */
+        public enum Kind {
+            MESSAGE_SEGMENT("message segment", SimpleType.DIAGNOSTIC, SimpleType.FRAGMENT),
+            FILE_NAME("file name", SimpleType.FILE, SimpleType.FILE_OBJECT);
+
+            final String kindName;
+            final SimpleType[] choices;
+
+            Kind(String kindName, SimpleType... choices) {
+                this.kindName = kindName;
+                this.choices = choices;
+            }
+        }
+
+        /** The union type kind. */
+        public final Kind kind;
+
+        /** The union type alternatives. */
+        public final MessageType[] choices;
+
+        UnionType(Kind kind) {
+            this(kind, kind.choices);
+        }
+
+        protected UnionType(Kind kind, MessageType[] choices) {
+            this.choices = choices;
+            this.kind = kind;
+        }
+
+        @Override
+        public String kindName() {
+            return kind.kindName;
+        }
+
+        @Override
+        public <R, A> R accept(Visitor<R, A> v, A a) {
+            return v.visitUnionType(this, a);
+        }
+    }
+
+    /**
+     * A subclass of union type representing 'explicit' alternatives in the resource file comments.
+     * Note: as the token 'or' is parsed with lowest priority, it is not possible, for instance,
+     * to form a compound type out of an 'or' type. In such cases a plain union type should be used
+     * instead.
+     *
+     * Examples: symbol or type
+     */
+    public static class OrType extends UnionType {
+
+        public static final String OR_NAME = "or";
+
+        @Override
+        public String kindName() {
+            return OR_NAME;
+        }
+
+        public OrType(MessageType... choices) {
+            super(null, choices);
+        }
+    }
+
+    /**
+     * Visitor class.
+     */
+    public static abstract class Visitor<R, A> {
+        public abstract R visitCustomType(CustomType t, A a);
+        public abstract R visitSimpleType(SimpleType t, A a);
+        public abstract R visitCompoundType(CompoundType t, A a);
+        public abstract R visitUnionType(UnionType t, A a);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/tools/propertiesparser/resources/templates.properties	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,48 @@
+toplevel.decl=\
+    package {0};\n\
+    \n\
+    {1}\n\
+    import com.sun.tools.javac.util.JCDiagnostic.Error;\n\
+    import com.sun.tools.javac.util.JCDiagnostic.Warning;\n\
+    import com.sun.tools.javac.util.JCDiagnostic.Note;\n\
+    import com.sun.tools.javac.util.JCDiagnostic.Fragment;\n\
+    \n\
+    public class {2} '{'\n\
+    {3}\n\
+    '}'\n
+
+import.decl=\
+    import {0};
+
+nested.decl =\
+    public static class {0} '{'\n\
+    {1}\n\
+    '}'
+
+factory.decl.method=\
+    /**\n\
+    ' '* {5}\n\
+    ' '*/\n\
+    {0}public static {1} {2}({3}) '{'\n\
+    {4}\n\
+    '}'
+
+factory.decl.method.arg=\
+    arg{0}
+
+factory.decl.method.body=\
+    return new {0}({1}, {2}, {3});
+
+factory.decl.field=\
+    /**\n\
+    ' '* {4}\n\
+    ' '*/\n\
+    public static final {0} {1} = new {0}({2}, {3});
+
+wildcards.extends=\
+    {0}<? extends {1}>
+
+suppress.warnings=\
+  @SuppressWarnings("rawtypes")\n
+
+
--- a/src/java.base/share/classes/jdk/Exported.java	Wed Apr 01 15:13:45 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk;
-
-import java.lang.annotation.*;
-
-/**
-  * Indicates whether or not a JDK specific type or package is an
-  * exported part of the JDK suitable for use outside of the JDK
-  * implementation itself.
-  *
-  * This annotation should only be applied to types and packages
-  * <em>outside</em> of the Java SE namespaces of {@code java.*} and
-  * {@code javax.*} packages.  For example, certain portions of {@code
-  * com.sun.*} are official parts of the JDK meant to be generally
-  * usable while other portions of {@code com.sun.*} are not.  This
-  * annotation type allows those portions to be easily and
-  * programmatically distinguished.
-  *
-  * <p>If in one release a type or package is
-  * <code>@Exported(true)</code>, in a subsequent major release such a
-  * type or package can transition to <code>@Exported(false)</code>.
-  *
-  * <p>If a type or package is <code>@Exported(false)</code> in a
-  * release, it may be removed in a subsequent major release.
-  *
-  * <p>If a top-level type has an <code>@Exported</code> annotation,
-  * any nested member types with the top-level type should have an
-  * <code>@Exported</code> annotation with the same value.
-  *
-  * (In exceptional cases, if a nested type is going to be removed
-  * before its enclosing type, the nested type's could be
-  * <code>@Exported(false)</code> while its enclosing type was
-  * <code>@Exported(true)</code>.)
-  *
-  * Likewise, if a package has an <code>@Exported</code> annotation,
-  * top-level types within that package should also have an
-  * <code>@Exported</code> annotation.
-  *
-  * Sometimes a top-level type may have a different
-  * <code>@Exported</code> value than its package.
-  *
-  * @since 1.8
-  */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.PACKAGE})
-@Exported
-public @interface Exported {
-    /**
-     * Whether or not the annotated type or package is an exported
-     * part of the JDK.
-     * @return whether or not the annotated type or package is an exported
-     * part of the JDK
-     */
-    boolean value() default true;
-}
--- a/src/java.compiler/share/classes/javax/tools/DiagnosticCollector.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/DiagnosticCollector.java	Wed Apr 22 17:42:41 2015 +0100
@@ -28,6 +28,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * Provides an easy way to collect diagnostics in a list.
@@ -43,7 +44,7 @@
             Collections.synchronizedList(new ArrayList<Diagnostic<? extends S>>());
 
     public void report(Diagnostic<? extends S> diagnostic) {
-        diagnostic.getClass(); // null check
+        Objects.requireNonNull(diagnostic);
         diagnostics.add(diagnostic);
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java	Wed Apr 22 17:42:41 2015 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.tools;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.util.Iterator;
+
+/**
+ * Package-private utility methods to convert between files and paths.
+ *
+ * @since 1.9
+ */
+class FileManagerUtils {
+    private FileManagerUtils() { }
+
+    static Iterable<Path> asPaths(final Iterable<? extends File> files) {
+        return () -> new Iterator<Path>() {
+            Iterator<? extends File> iter = files.iterator();
+
+            @Override
+            public boolean hasNext() {
+                return iter.hasNext();
+            }
+
+            @Override
+            public Path next() {
+                return iter.next().toPath();
+            }
+        };
+    }
+
+    static Iterable<File> asFiles(final Iterable<? extends Path> paths) {
+        return () -> new Iterator<File>() {
+            Iterator<? extends Path> iter = paths.iterator();
+
+            @Override
+            public boolean hasNext() {
+                return iter.hasNext();
+            }
+
+            @Override
+            public File next() {
+                Path p = iter.next();
+                try {
+                    return p.toFile();
+                } catch (UnsupportedOperationException e) {
+                    throw new IllegalArgumentException(p.toString(), e);
+                }
+            }
+        };
+    }
+}
--- a/src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java	Wed Apr 22 17:42:41 2015 +0100
@@ -31,6 +31,7 @@
 import java.io.Reader;
 import java.io.Writer;
 import java.net.URI;
+import java.util.Objects;
 
 /**
  * Forwards calls to a given file object.  Subclasses of this class
@@ -53,8 +54,7 @@
      * @param fileObject delegate to this file object
      */
     protected ForwardingFileObject(F fileObject) {
-        fileObject.getClass(); // null check
-        this.fileObject = fileObject;
+        this.fileObject = Objects.requireNonNull(fileObject);
     }
 
     public URI toUri() {
--- a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java	Wed Apr 22 17:42:41 2015 +0100
@@ -27,6 +27,7 @@
 
 import java.io.IOException;
 import java.util.Iterator;
+import java.util.Objects;
 import java.util.Set;
 import javax.tools.JavaFileObject.Kind;
 
@@ -51,8 +52,7 @@
      * @param fileManager delegate to this file manager
      */
     protected ForwardingJavaFileManager(M fileManager) {
-        fileManager.getClass(); // null check
-        this.fileManager = fileManager;
+        this.fileManager = Objects.requireNonNull(fileManager);
     }
 
     /**
--- a/src/java.compiler/share/classes/javax/tools/JavaFileObject.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/JavaFileObject.java	Wed Apr 22 17:42:41 2015 +0100
@@ -27,6 +27,7 @@
 
 import javax.lang.model.element.NestingKind;
 import javax.lang.model.element.Modifier;
+import java.util.Objects;
 
 /**
  * File abstraction for tools operating on Java&trade; programming language
@@ -78,8 +79,7 @@
          */
         public final String extension;
         private Kind(String extension) {
-            extension.getClass(); // null check
-            this.extension = extension;
+            this.extension = Objects.requireNonNull(extension);
         }
     }
 
--- a/src/java.compiler/share/classes/javax/tools/SimpleJavaFileObject.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/SimpleJavaFileObject.java	Wed Apr 22 17:42:41 2015 +0100
@@ -28,6 +28,7 @@
 import java.io.*;
 import java.net.URI;
 import java.nio.CharBuffer;
+import java.util.Objects;
 import javax.lang.model.element.Modifier;
 import javax.lang.model.element.NestingKind;
 import javax.tools.JavaFileObject.Kind;
@@ -61,9 +62,8 @@
      * @param kind the kind of this file object
      */
     protected SimpleJavaFileObject(URI uri, Kind kind) {
-        // null checks
-        uri.getClass();
-        kind.getClass();
+        Objects.requireNonNull(uri);
+        Objects.requireNonNull(kind);
         if (uri.getPath() == null)
             throw new IllegalArgumentException("URI must have a path: " + uri);
         this.uri = uri;
--- a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,13 +27,16 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
+import java.nio.file.Path;
+import java.util.Arrays;
+
+import static javax.tools.FileManagerUtils.*;
 
 /**
- * File manager based on {@linkplain File java.io.File}.  A common way
- * to obtain an instance of this class is using {@linkplain
- * JavaCompiler#getStandardFileManager
- * getStandardFileManager}, for example:
+ * File manager based on {@linkplain File java.io.File} and {@linkplain Path java.nio.file.Path}.
+ *
+ * A common way to obtain an instance of this class is using
+ * {@linkplain JavaCompiler#getStandardFileManager getStandardFileManager}, for example:
  *
  * <pre>
  *   JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
@@ -110,7 +113,7 @@
  *     <code>file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java</code>
  *   </li>
  *   <li>
- *     <code>jar:///C:/Documents%20and%20Settings/UncleBob/lib/vendorA.jar!com/vendora/LibraryClass.class</code>
+ *     <code>jar:///C:/Documents%20and%20Settings/UncleBob/lib/vendorA.jar!/com/vendora/LibraryClass.class</code>
  *   </li>
  * </ul>
  * Whereas these are not (reason in parentheses):
@@ -120,7 +123,7 @@
  *     and depend on the current directory)
  *   </li>
  *   <li>
- *     <code>jar:lib/vendorA.jar!com/vendora/LibraryClass.class</code>
+ *     <code>jar:lib/vendorA.jar!/com/vendora/LibraryClass.class</code>
  *     (the first half of the path depends on the current directory,
  *     whereas the component after ! is legal)
  *   </li>
@@ -134,6 +137,10 @@
  *   </li>
  * </ul>
  *
+ * <p>All implementations of this interface must support Path objects representing
+ * files in the {@linkplain java.nio.file.FileSystems#getDefault() default file system.}
+ * It is recommended that implementations should support Path objects from any filesystem.</p>
+ *
  * @author Peter von der Ah&eacute;
  * @since 1.6
  */
@@ -147,11 +154,12 @@
      * @param a a file object
      * @param b a file object
      * @return true if the given file objects represent the same
-     * canonical file or zip file entry; false otherwise
+     * canonical file, zip file entry or path; false otherwise
      *
      * @throws IllegalArgumentException if either of the arguments
      * were created with another file manager implementation
      */
+    @Override
     boolean isSameFile(FileObject a, FileObject b);
 
     /**
@@ -166,6 +174,27 @@
         Iterable<? extends File> files);
 
     /**
+     * Returns file objects representing the given paths.
+     *
+     * <p>The default implementation converts each path to a file and calls
+     * {@link #getJavaFileObjectsFromFiles getJavaObjectsFromFiles}.
+     * IllegalArgumentException will be thrown if any of the paths
+     * cannot be converted to a file.
+     *
+     * @param paths a list of paths
+     * @return a list of file objects
+     * @throws IllegalArgumentException if the list of paths includes
+     * a directory or if this file manager does not support any of the
+     * given paths.
+     *
+     * @since 1.9
+     */
+    default Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(
+            Iterable<? extends Path> paths) {
+        return getJavaFileObjectsFromFiles(asFiles(paths));
+    }
+
+    /**
      * Returns file objects representing the given files.
      * Convenience method equivalent to:
      *
@@ -183,6 +212,27 @@
     Iterable<? extends JavaFileObject> getJavaFileObjects(File... files);
 
     /**
+     * Returns file objects representing the given paths.
+     * Convenience method equivalent to:
+     *
+     * <pre>
+     *     getJavaFileObjectsFromPaths({@linkplain java.util.Arrays#asList Arrays.asList}(paths))
+     * </pre>
+     *
+     * @param paths an array of paths
+     * @return a list of file objects
+     * @throws IllegalArgumentException if the array of files includes
+     * a directory
+     * @throws NullPointerException if the given array contains null
+     * elements
+     *
+     * @since 1.9
+     */
+    default Iterable<? extends JavaFileObject> getJavaFileObjects(Path... paths) {
+        return getJavaFileObjectsFromPaths(Arrays.asList(paths));
+    }
+
+    /**
      * Returns file objects representing the given file names.
      *
      * @param names a list of file names
@@ -211,29 +261,94 @@
     Iterable<? extends JavaFileObject> getJavaFileObjects(String... names);
 
     /**
-     * Associates the given path with the given location.  Any
+     * Associates the given search path with the given location.  Any
      * previous value will be discarded.
      *
      * @param location a location
-     * @param path a list of files, if {@code null} use the default
-     * path for this location
+     * @param files a list of files, if {@code null} use the default
+     * search path for this location
      * @see #getLocation
-     * @throws IllegalArgumentException if location is an output
-     * location and path does not contain exactly one element
-     * @throws IOException if location is an output location and path
+     * @throws IllegalArgumentException if {@code location} is an output
+     * location and {@code files} does not contain exactly one element
+     * @throws IOException if {@code location} is an output location and
      * does not represent an existing directory
      */
-    void setLocation(Location location, Iterable<? extends File> path)
+    void setLocation(Location location, Iterable<? extends File> files)
         throws IOException;
 
     /**
-     * Returns the path associated with the given location.
+     * Associates the given search path with the given location.  Any
+     * previous value will be discarded.
+     *
+     * <p>The default implementation converts each path to a file and calls
+     * {@link #getJavaFileObjectsFromFiles getJavaObjectsFromFiles}.
+     * IllegalArgumentException will be thrown if any of the paths
+     * cannot be converted to a file.</p>
+     *
+     * @param location a location
+     * @param paths a list of paths, if {@code null} use the default
+     * search path for this location
+     * @see #getLocation
+     * @throws IllegalArgumentException if {@code location} is an output
+     * location and {@code paths} does not contain exactly one element
+     * or if this file manager does not support any of the given paths
+     * @throws IOException if {@code location} is an output location and
+     * {@code paths} does not represent an existing directory
+     *
+     * @since 1.9
+     */
+    default void setLocationFromPaths(Location location, Iterable<? extends Path> paths)
+        throws IOException {
+        setLocation(location, asFiles(paths));
+    }
+
+    /**
+     * Returns the search path associated with the given location.
      *
      * @param location a location
      * @return a list of files or {@code null} if this location has no
-     * associated path
+     * associated search path
+     * @throws IllegalStateException if any element of the search path
+     * cannot be converted to a {@linkplain File}.
+     *
      * @see #setLocation
+     * @see Path#toFile
      */
     Iterable<? extends File> getLocation(Location location);
 
+    /**
+     * Returns the search path associated with the given location.
+     *
+     * @param location a location
+     * @return a list of paths or {@code null} if this location has no
+     * associated search path
+     *
+     * @see #setLocationFromPaths
+     * @since 1.9
+     */
+    default Iterable<? extends Path> getLocationAsPaths(Location location) {
+        return asPaths(getLocation(location));
+    }
+
+    /**
+     * Returns the path, if any, underlying this file object (optional operation).
+     * File objects derived from a {@link java.nio.file.FileSystem FileSystem},
+     * including the default file system, typically have a corresponding underlying
+     * {@link java.nio.file.Path Path} object. In such cases, this method may be
+     * used to access that object.
+     *
+     * <p>The default implementation throws {@link UnsupportedOperationException}
+     * for all files.</p>
+     *
+     * @param file a file object
+     * @return a path representing the same underlying file system artifact
+     * @throws IllegalArgumentException if the file object does not have an underlying path
+     * @throws UnsupportedOperationException if the operation is not supported by this file manager
+     *
+     * @since 1.9
+     */
+    default Path asPath(FileObject file) {
+        throw new UnsupportedOperationException();
+    }
+
 }
--- a/src/java.compiler/share/classes/javax/tools/ToolProvider.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/java.compiler/share/classes/javax/tools/ToolProvider.java	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,14 @@
 
 package javax.tools;
 
-import java.io.File;
 import java.lang.ref.Reference;
 import java.lang.ref.WeakReference;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.MalformedURLException;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 import java.util.logging.Logger;
 import java.util.logging.Level;
+
 import static java.util.logging.Level.*;
 
 /**
@@ -89,30 +86,38 @@
         return null;
     }
 
-    private static final String defaultJavaCompilerName
+    private static final String systemJavaCompilerName
         = "com.sun.tools.javac.api.JavacTool";
 
     /**
      * Returns the Java&trade; programming language compiler provided
      * with this platform.
+     * <p>The file manager returned by calling
+     * {@link JavaCompiler#getStandardFileManager getStandardFileManager}
+     * on this compiler supports paths provided by any
+     * {@linkplain java.nio.file.FileSystem filesystem}.</p>
      * @return the compiler provided with this platform or
      * {@code null} if no compiler is provided
      */
     public static JavaCompiler getSystemJavaCompiler() {
-        return instance().getSystemTool(JavaCompiler.class, defaultJavaCompilerName);
+        return instance().getSystemTool(JavaCompiler.class, systemJavaCompilerName);
     }
 
-    private static final String defaultDocumentationToolName
+    private static final String systemDocumentationToolName
         = "com.sun.tools.javadoc.api.JavadocTool";
 
     /**
      * Returns the Java&trade; programming language documentation tool provided
      * with this platform.
+     * <p>The file manager returned by calling
+     * {@link DocumentationTool#getStandardFileManager getStandardFileManager}
+     * on this tool supports paths provided by any
+     * {@linkplain java.nio.file.FileSystem filesystem}.</p>
      * @return the documentation tool provided with this platform or
      * {@code null} if no documentation tool is provided
      */
     public static DocumentationTool getSystemDocumentationTool() {
-        return instance().getSystemTool(DocumentationTool.class, defaultDocumentationToolName);
+        return instance().getSystemTool(DocumentationTool.class, systemDocumentationToolName);
     }
 
     /**
@@ -125,13 +130,7 @@
      * or {@code null} if no tools are provided
      */
     public static ClassLoader getSystemToolClassLoader() {
-        try {
-            Class<? extends JavaCompiler> c =
-                    instance().getSystemToolClass(JavaCompiler.class, defaultJavaCompilerName);
-            return c.getClassLoader();
-        } catch (Throwable e) {
-            return trace(WARNING, e);
-        }
+        return ClassLoader.getSystemClassLoader();
     }
 
 
@@ -145,12 +144,7 @@
 
     // Cache for tool classes.
     // Use weak references to avoid keeping classes around unnecessarily
-    private Map<String, Reference<Class<?>>> toolClasses = new HashMap<>();
-
-    // Cache for tool classloader.
-    // Use a weak reference to avoid keeping it around unnecessarily
-    private Reference<ClassLoader> refToolClassLoader = null;
-
+    private final Map<String, Reference<Class<?>>> toolClasses = new HashMap<>();
 
     private ToolProvider() { }
 
@@ -158,9 +152,8 @@
         Class<? extends T> c = getSystemToolClass(clazz, name);
         try {
             return c.asSubclass(clazz).newInstance();
-        } catch (Throwable e) {
-            trace(WARNING, e);
-            return null;
+        } catch (InstantiationException | IllegalAccessException | RuntimeException | Error e) {
+            return trace(WARNING, e);
         }
     }
 
@@ -169,48 +162,12 @@
         Class<?> c = (refClass == null ? null : refClass.get());
         if (c == null) {
             try {
-                c = findSystemToolClass(name);
-            } catch (Throwable e) {
+                c = Class.forName(name, false, ClassLoader.getSystemClassLoader());
+            } catch (ClassNotFoundException | RuntimeException | Error e) {
                 return trace(WARNING, e);
             }
-            toolClasses.put(name, new WeakReference<Class<?>>(c));
+            toolClasses.put(name, new WeakReference<>(c));
         }
         return c.asSubclass(clazz);
     }
-
-    private static final String[] defaultToolsLocation = { "lib", "tools.jar" };
-
-    private Class<?> findSystemToolClass(String toolClassName)
-        throws MalformedURLException, ClassNotFoundException
-    {
-        // try loading class directly, in case tool is on the bootclasspath
-        try {
-            return Class.forName(toolClassName, false, null);
-        } catch (ClassNotFoundException e) {
-            trace(FINE, e);
-
-            // if tool not on bootclasspath, look in default tools location (tools.jar)
-            ClassLoader cl = (refToolClassLoader == null ? null : refToolClassLoader.get());
-            if (cl == null) {
-                File file = new File(System.getProperty("java.home"));
-                if (file.getName().equalsIgnoreCase("jre"))
-                    file = file.getParentFile();
-                for (String name : defaultToolsLocation)
-                    file = new File(file, name);
-
-                // if tools not found, no point in trying a URLClassLoader
-                // so rethrow the original exception.
-                if (!file.exists())
-                    throw e;
-
-                URL[] urls = { file.toURI().toURL() };
-                trace(FINE, urls[0].toString());
-
-                cl = URLClassLoader.newInstance(urls);
-                refToolClassLoader = new WeakReference<>(cl);
-            }
-
-            return Class.forName(toolClassName, false, cl);
-        }
-    }
 }
--- a/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java	Wed Apr 22 17:42:41 2015 +0100
@@ -27,7 +27,9 @@
 
 import com.sun.source.doctree.DocCommentTree;
 import com.sun.source.doctree.DocTree;
+
 import java.util.Iterator;
+import java.util.Objects;
 
 /**
  * A path of tree nodes, typically used to represent the sequence of ancestor
@@ -57,8 +59,8 @@
      * @return a path identifying the target node
      */
     public static DocTreePath getPath(DocTreePath path, DocTree target) {
-        path.getClass();
-        target.getClass();
+        Objects.requireNonNull(path); //null check
+        Objects.requireNonNull(target); //null check
 
         class Result extends Error {
             static final long serialVersionUID = -5942088234594905625L;
@@ -96,11 +98,8 @@
      * @param t the DocCommentTree to create the path for.
      */
     public DocTreePath(TreePath treePath, DocCommentTree t) {
-        treePath.getClass();
-        t.getClass();
-
-        this.treePath = treePath;
-        this.docComment = t;
+        this.treePath = Objects.requireNonNull(treePath);
+        this.docComment = Objects.requireNonNull(t);
         this.parent = null;
         this.leaf = t;
     }
--- a/src/jdk.compiler/share/classes/com/sun/source/util/TaskListener.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/TaskListener.java	Wed Apr 22 17:42:41 2015 +0100
@@ -37,13 +37,19 @@
 {
     /**
      * Invoked when an event has begun.
+     *
+     * @implSpec The default implementation of this method does nothing.
+     *
      * @param e the event
      */
-    public void started(TaskEvent e);
+    default void started(TaskEvent e) { }
 
     /**
      * Invoked when an event has been completed.
+     *
+     * @implSpec The default implementation of this method does nothing.
+     *
      * @param e the event
      */
-    public void finished(TaskEvent e);
+    default void finished(TaskEvent e) { }
 }
--- a/src/jdk.compiler/share/classes/com/sun/source/util/TreePath.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/TreePath.java	Wed Apr 22 17:42:41 2015 +0100
@@ -26,6 +26,7 @@
 package com.sun.source.util;
 
 import java.util.Iterator;
+import java.util.Objects;
 
 import com.sun.source.tree.*;
 
@@ -57,8 +58,8 @@
      * @return the tree path of the target node
      */
     public static TreePath getPath(TreePath path, Tree target) {
-        path.getClass();
-        target.getClass();
+        Objects.requireNonNull(path);
+        Objects.requireNonNull(target);
 
         class Result extends Error {
             static final long serialVersionUID = -5942088234594905625L;
--- a/src/jdk.compiler/share/classes/com/sun/tools/classfile/ClassReader.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/classfile/ClassReader.java	Wed Apr 22 17:42:41 2015 +0100
@@ -30,6 +30,7 @@
 import java.io.DataInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Objects;
 
 /**
  *  <p><b>This is NOT part of any supported API.
@@ -39,13 +40,9 @@
  */
 public class ClassReader {
     ClassReader(ClassFile classFile, InputStream in, Attribute.Factory attributeFactory) throws IOException {
-        // null checks
-        classFile.getClass();
-        attributeFactory.getClass();
-
-        this.classFile = classFile;
+        this.classFile = Objects.requireNonNull(classFile);
+        this.attributeFactory = Objects.requireNonNull(attributeFactory);
         this.in = new DataInputStream(new BufferedInputStream(in));
-        this.attributeFactory = attributeFactory;
     }
 
     ClassFile getClassFile() {
--- a/src/jdk.compiler/share/classes/com/sun/tools/classfile/Dependencies.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/classfile/Dependencies.java	Wed Apr 22 17:42:41 2015 +0100
@@ -30,6 +30,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.regex.Pattern;
 
@@ -43,6 +44,7 @@
 import com.sun.tools.classfile.Type.SimpleType;
 import com.sun.tools.classfile.Type.TypeParamType;
 import com.sun.tools.classfile.Type.WildcardType;
+
 import static com.sun.tools.classfile.ConstantPool.*;
 
 /**
@@ -165,8 +167,7 @@
      * @param f the finder
      */
     public void setFinder(Finder f) {
-        f.getClass(); // null check
-        finder = f;
+        finder = Objects.requireNonNull(f);
     }
 
     /**
@@ -220,8 +221,7 @@
      * @param f the filter
      */
     public void setFilter(Filter f) {
-        f.getClass(); // null check
-        filter = f;
+        filter = Objects.requireNonNull(f);
     }
 
     /**
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java	Wed Apr 22 17:42:41 2015 +0100
@@ -81,6 +81,7 @@
 import com.sun.source.util.TreePath;
 import com.sun.tools.doclint.HtmlTag.AttrKind;
 import com.sun.tools.javac.tree.DocPretty;
+import com.sun.tools.javac.util.Assert;
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.StringUtils;
@@ -137,13 +138,13 @@
     // <editor-fold defaultstate="collapsed" desc="Top level">
 
     Checker(Env env) {
-        env.getClass();
-        this.env = env;
+        this.env = Assert.checkNonNull(env);
         tagStack = new LinkedList<>();
         implicitHeaderLevel = env.implicitHeaderLevel;
     }
 
     public Void scan(DocCommentTree tree, TreePath p) {
+        env.initTypes();
         env.setCurrent(p, tree);
 
         boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Wed Apr 22 17:42:41 2015 +0100
@@ -32,6 +32,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Queue;
+import java.util.regex.Pattern;
 
 import javax.lang.model.element.Name;
 import javax.tools.StandardLocation;
@@ -79,7 +80,8 @@
     private static final String STATS = "-stats";
     public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
     public static final String XCUSTOM_TAGS_PREFIX = "-XcustomTags:";
-    public static final String TAGS_SEPARATOR = ",";
+    public static final String XCHECK_PACKAGE = "-XcheckPackage:";
+    public static final String SEPARATOR = ",";
 
     // <editor-fold defaultstate="collapsed" desc="Command-line entry point">
     public static void main(String... args) {
@@ -156,7 +158,7 @@
         env.init(task);
         checker = new Checker(env);
 
-        DeclScanner ds = new DeclScanner() {
+        DeclScanner ds = new DeclScanner(env) {
             @Override
             void visitDecl(Tree tree, Name name) {
                 TreePath p = getCurrentPath();
@@ -272,6 +274,8 @@
                 env.setImplicitHeaders(Character.digit(ch, 10));
             } else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
                 env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
+            } else if (arg.startsWith(XCHECK_PACKAGE)) {
+                env.setCheckPackages(arg.substring(arg.indexOf(":") + 1));
             } else
                 throw new IllegalArgumentException(arg);
         }
@@ -280,7 +284,7 @@
         checker = new Checker(env);
 
         if (addTaskListener) {
-            final DeclScanner ds = new DeclScanner() {
+            final DeclScanner ds = new DeclScanner(env) {
                 @Override
                 void visitDecl(Tree tree, Name name) {
                     TreePath p = getCurrentPath();
@@ -337,6 +341,9 @@
            return true;
         if (opt.startsWith(XMSGS_CUSTOM_PREFIX))
            return Messages.Options.isValidOptions(opt.substring(XMSGS_CUSTOM_PREFIX.length()));
+        if (opt.startsWith(XCHECK_PACKAGE)) {
+            return Env.validatePackages(opt.substring(opt.indexOf(":") + 1));
+        }
         return false;
     }
 
@@ -348,6 +355,12 @@
     // <editor-fold defaultstate="collapsed" desc="DeclScanner">
 
     static abstract class DeclScanner extends TreePathScanner<Void, Void> {
+        final Env env;
+
+        public DeclScanner(Env env) {
+            this.env = env;
+        }
+
         abstract void visitDecl(Tree tree, Name name);
 
         @Override @DefinedBy(Api.COMPILER_TREE)
@@ -373,6 +386,33 @@
             visitDecl(tree, tree.getName());
             return super.visitVariable(tree, ignore);
         }
+
+        @Override @DefinedBy(Api.COMPILER_TREE)
+        public Void visitCompilationUnit(CompilationUnitTree node, Void p) {
+            if (env.includePackages != null) {
+                String packageName =   node.getPackageName() != null
+                                     ? node.getPackageName().toString()
+                                     : "";
+                if (!env.includePackages.isEmpty()) {
+                    boolean included = false;
+                    for (Pattern pack : env.includePackages) {
+                        if (pack.matcher(packageName).matches()) {
+                            included = true;
+                            break;
+                        }
+                    }
+                    if (!included)
+                        return null;
+                }
+                for (Pattern pack : env.excludePackages) {
+                    if (pack.matcher(packageName).matches()) {
+                        return null;
+                    }
+                }
+            }
+            return super.visitCompilationUnit(node, p);
+        }
+
     }
 
     // </editor-fold>
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java	Wed Apr 22 17:42:41 2015 +0100
@@ -26,8 +26,12 @@
 package com.sun.tools.doclint;
 
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Set;
-import java.util.LinkedHashSet;
+import java.util.regex.Pattern;
 
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
@@ -36,6 +40,7 @@
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.util.Elements;
 import javax.lang.model.util.Types;
+import javax.tools.Diagnostic.Kind;
 
 import com.sun.source.doctree.DocCommentTree;
 import com.sun.source.util.DocTrees;
@@ -44,6 +49,7 @@
 import com.sun.source.util.TreePath;
 import com.sun.tools.javac.model.JavacTypes;
 import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.util.MatchingUtils;
 import com.sun.tools.javac.util.StringUtils;
 
 /**
@@ -90,6 +96,9 @@
 
     Set<String> customTags;
 
+    Set<Pattern> includePackages;
+    Set<Pattern> excludePackages;
+
     // Utility classes
     DocTrees trees;
     Elements elements;
@@ -129,6 +138,12 @@
         this.trees = trees;
         this.elements = elements;
         this.types = types;
+    }
+
+    void initTypes() {
+        if (java_lang_Error != null)
+            return ;
+
         java_lang_Error = elements.getTypeElement("java.lang.Error").asType();
         java_lang_RuntimeException = elements.getTypeElement("java.lang.RuntimeException").asType();
         java_lang_Throwable = elements.getTypeElement("java.lang.Throwable").asType();
@@ -141,12 +156,43 @@
 
     void setCustomTags(String cTags) {
         customTags = new LinkedHashSet<>();
-        for (String s : cTags.split(DocLint.TAGS_SEPARATOR)) {
+        for (String s : cTags.split(DocLint.SEPARATOR)) {
             if (!s.isEmpty())
                 customTags.add(s);
         }
     }
 
+    void setCheckPackages(String packages) {
+        includePackages = new HashSet<>();
+        excludePackages = new HashSet<>();
+        for (String pack : packages.split(DocLint.SEPARATOR)) {
+            boolean excluded = false;
+            if (pack.startsWith("-")) {
+                pack = pack.substring(1);
+                excluded = true;
+            }
+            if (pack.isEmpty())
+                continue;
+            Pattern pattern = MatchingUtils.validImportStringToPattern(pack);
+            if (excluded) {
+                excludePackages.add(pattern);
+            } else {
+                includePackages.add(pattern);
+            }
+        }
+    }
+
+    static boolean validatePackages(String packages) {
+        for (String pack : packages.split(DocLint.SEPARATOR)) {
+            if (pack.startsWith("-")) {
+                pack = pack.substring(1);
+            }
+            if (!pack.isEmpty() && !MatchingUtils.isValidImportString(pack))
+                return false;
+        }
+        return true;
+    }
+
     /** Set the current declaration and its doc comment. */
     void setCurrent(TreePath path, DocCommentTree comment) {
         currPath = path;
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-dc.anchor.already.defined = anchor already defined: {0}
+dc.anchor.already.defined = anchor already defined: "{0}"
 dc.anchor.value.missing = no value given for anchor
 dc.attr.lacks.value = attribute lacks value
 dc.attr.not.number = attribute value is not a number
@@ -107,6 +107,13 @@
 \    equivalent to -Xmsgs:all/protected, meaning that\n\
 \    all messages are reported for protected and public\n\
 \    declarations only. \n\
+\  -XcheckPackage:<packages>\n\
+\    Enable or disable checks in specific packages.\n\
+\    <packages> is a comma separated list of package specifiers.\n\
+\    Package specifier is either a qualified name of a package\n\
+\    or a package name prefix followed by ''.*'', which expands to\n\
+\    all sub-packages of the given package. Prefix the package specifier\n\
+\    with ''-'' to disable checks for the specified packages.\n\
 \  -stats\n\
 \    Report statistics on the reported issues.\n\
 \  -h -help --help -usage -?\n\
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java	Wed Apr 22 17:42:41 2015 +0100
@@ -191,7 +191,7 @@
             }
         }
         for (List<String> p: pluginsToCall) {
-            Log.instance(context).error("msg.plugin.not.found", p.head);
+            Log.instance(context).error("plugin.not.found", p.head);
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java	Wed Apr 22 17:42:41 2015 +0100
@@ -26,6 +26,7 @@
 
 package com.sun.tools.javac.api;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -44,6 +45,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
 import javax.lang.model.element.Modifier;
@@ -55,6 +57,7 @@
 import javax.tools.JavaFileManager.Location;
 import javax.tools.JavaFileObject;
 import javax.tools.JavaFileObject.Kind;
+import javax.tools.StandardJavaFileManager;
 
 import com.sun.source.util.TaskEvent;
 import com.sun.source.util.TaskListener;
@@ -115,11 +118,13 @@
     public JavaFileManager wrap(JavaFileManager fm) {
         if (isTrusted(fm))
             return fm;
+        if (fm instanceof StandardJavaFileManager)
+            return new WrappedStandardJavaFileManager((StandardJavaFileManager) fm);
         return new WrappedJavaFileManager(fm);
     }
 
     public FileObject wrap(FileObject fo) {
-        if (isTrusted(fo))
+        if (fo == null || isTrusted(fo))
             return fo;
         return new WrappedFileObject(fo);
     }
@@ -132,7 +137,7 @@
     }
 
     public JavaFileObject wrap(JavaFileObject fo) {
-        if (isTrusted(fo))
+        if (fo == null || isTrusted(fo))
             return fo;
         return new WrappedJavaFileObject(fo);
     }
@@ -207,8 +212,7 @@
     protected class WrappedJavaFileManager implements JavaFileManager {
         protected JavaFileManager clientJavaFileManager;
         WrappedJavaFileManager(JavaFileManager clientJavaFileManager) {
-            clientJavaFileManager.getClass(); // null check
-            this.clientJavaFileManager = clientJavaFileManager;
+            this.clientJavaFileManager = Objects.requireNonNull(clientJavaFileManager);
         }
 
         @Override @DefinedBy(Api.COMPILER)
@@ -360,11 +364,83 @@
         }
     }
 
+    protected class WrappedStandardJavaFileManager extends WrappedJavaFileManager
+            implements StandardJavaFileManager {
+        WrappedStandardJavaFileManager(StandardJavaFileManager clientJavaFileManager) {
+            super(clientJavaFileManager);
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends JavaFileObject> getJavaFileObjectsFromFiles(Iterable<? extends File> files) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getJavaFileObjectsFromFiles(files);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends JavaFileObject> getJavaFileObjects(File... files) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getJavaFileObjects(files);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable<String> names) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getJavaFileObjectsFromStrings(names);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends JavaFileObject> getJavaFileObjects(String... names) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getJavaFileObjects(names);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public void setLocation(Location location, Iterable<? extends File> path) throws IOException {
+            try {
+                ((StandardJavaFileManager)clientJavaFileManager).setLocation(location, path);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends File> getLocation(Location location) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getLocation(location);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+    }
+
     protected class WrappedFileObject implements FileObject {
         protected FileObject clientFileObject;
         WrappedFileObject(FileObject clientFileObject) {
-            clientFileObject.getClass(); // null check
-            this.clientFileObject = clientFileObject;
+            this.clientFileObject = Objects.requireNonNull(clientFileObject);
         }
 
         @Override @DefinedBy(Api.COMPILER)
@@ -530,8 +606,7 @@
     protected class WrappedDiagnosticListener<T /*super JavaFileObject*/> implements DiagnosticListener<T> {
         protected DiagnosticListener<T> clientDiagnosticListener;
         WrappedDiagnosticListener(DiagnosticListener<T> clientDiagnosticListener) {
-            clientDiagnosticListener.getClass(); // null check
-            this.clientDiagnosticListener = clientDiagnosticListener;
+            this.clientDiagnosticListener = Objects.requireNonNull(clientDiagnosticListener);
         }
 
         @Override @DefinedBy(Api.COMPILER)
@@ -558,47 +633,47 @@
             this.d = d;
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public Diagnostic.Kind getKind() {
             return d.getKind();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public JavaFileObject getSource() {
             return unwrap(d.getSource());
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public long getPosition() {
             return d.getPosition();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public long getStartPosition() {
             return d.getStartPosition();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public long getEndPosition() {
             return d.getEndPosition();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public long getLineNumber() {
             return d.getLineNumber();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public long getColumnNumber() {
             return d.getColumnNumber();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public String getCode() {
             return d.getCode();
         }
 
-        @DefinedBy(Api.COMPILER)
+        @Override @DefinedBy(Api.COMPILER)
         public String getMessage(Locale locale) {
             return d.getMessage(locale);
         }
@@ -612,8 +687,7 @@
     protected class WrappedTaskListener implements TaskListener {
         protected TaskListener clientTaskListener;
         WrappedTaskListener(TaskListener clientTaskListener) {
-            clientTaskListener.getClass(); // null check
-            this.clientTaskListener = clientTaskListener;
+            this.clientTaskListener = Objects.requireNonNull(clientTaskListener);
         }
 
         @Override @DefinedBy(Api.COMPILER_TREE)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacScope.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacScope.java	Wed Apr 22 17:42:41 2015 +0100
@@ -34,8 +34,7 @@
 import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
-
-
+import com.sun.tools.javac.util.Assert;
 
 /**
  * Provides an implementation of Scope.
@@ -67,8 +66,7 @@
     protected final Env<AttrContext> env;
 
     private JavacScope(Env<AttrContext> env) {
-        env.getClass(); // null-check
-        this.env = env;
+        this.env = Assert.checkNonNull(env);
     }
 
     @DefinedBy(Api.COMPILER_TREE)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Wed Apr 22 17:42:41 2015 +0100
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.api;
 
+import java.io.IOException;
 import java.nio.CharBuffer;
 import java.util.*;
 import java.util.concurrent.Callable;
@@ -39,6 +40,7 @@
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.comp.*;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.main.*;
 import com.sun.tools.javac.main.JavaCompiler;
 import com.sun.tools.javac.parser.Parser;
@@ -67,6 +69,7 @@
 public class JavacTaskImpl extends BasicJavacTask {
     private final Arguments args;
     private JavaCompiler compiler;
+    private JavaFileManager fileManager;
     private Locale locale;
     private Map<JavaFileObject, JCCompilationUnit> notYetEntered;
     private ListBuffer<Env<AttrContext>> genList;
@@ -76,6 +79,7 @@
     JavacTaskImpl(Context context) {
         super(context, true);
         args = Arguments.instance(context);
+        fileManager = context.get(JavaFileManager.class);
     }
 
     @Override @DefinedBy(Api.COMPILER)
@@ -105,7 +109,7 @@
 
     @Override @DefinedBy(Api.COMPILER)
     public void setProcessors(Iterable<? extends Processor> processors) {
-        processors.getClass(); // null check
+        Objects.requireNonNull(processors);
         // not mt-safe
         if (used.get())
             throw new IllegalStateException();
@@ -202,6 +206,12 @@
     void cleanup() {
         if (compiler != null)
             compiler.close();
+        if (fileManager instanceof BaseFileManager && ((BaseFileManager) fileManager).autoClose) {
+            try {
+                fileManager.close();
+            } catch (IOException ignore) {
+            }
+        }
         compiler = null;
         context = null;
         notYetEntered = null;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java	Wed Apr 22 17:42:41 2015 +0100
@@ -34,6 +34,7 @@
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.Set;
 
 import javax.lang.model.SourceVersion;
@@ -43,6 +44,7 @@
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.main.Arguments;
 import com.sun.tools.javac.main.Option;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.util.ClientCodeException;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.DefinedBy;
@@ -123,7 +125,7 @@
 
             if (options != null) {
                 for (String option : options)
-                    option.getClass(); // null check
+                    Objects.requireNonNull(option);
             }
 
             if (classes != null) {
@@ -151,8 +153,12 @@
             else
                 context.put(Log.outKey, new PrintWriter(out, true));
 
-            if (fileManager == null)
+            if (fileManager == null) {
                 fileManager = getStandardFileManager(diagnosticListener, null, null);
+                if (fileManager instanceof BaseFileManager) {
+                    ((BaseFileManager) fileManager).autoClose = true;
+                }
+            }
             fileManager = ccw.wrap(fileManager);
 
             context.put(JavaFileManager.class, fileManager);
@@ -172,7 +178,7 @@
         if (err == null)
             err = System.err;
         for (String argument : arguments)
-            argument.getClass(); // null check
+            Objects.requireNonNull(argument);
         return com.sun.tools.javac.Main.compile(arguments, new PrintWriter(err, true));
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,6 @@
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TreePath;
 import com.sun.tools.javac.code.Flags;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.MethodSymbol;
@@ -99,6 +98,7 @@
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.JCDiagnostic;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.util.ListBuffer;
 import com.sun.tools.javac.util.Log;
@@ -107,6 +107,7 @@
 import com.sun.tools.javac.util.Position;
 import com.sun.tools.javac.util.Tuple.Tuple2;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 
 /**
@@ -475,7 +476,7 @@
         searched.add(tsym);
 
         for (Symbol sym : tsym.members().getSymbolsByName(fieldName)) {
-            if (sym.kind == Kinds.VAR) {
+            if (sym.kind == VAR) {
                 return (VarSymbol)sym;
             }
         }
@@ -517,7 +518,7 @@
     /** @see com.sun.tools.javadoc.ClassDocImpl#findConstructor */
     MethodSymbol findConstructor(ClassSymbol tsym, List<Type> paramTypes) {
         for (Symbol sym : tsym.members().getSymbolsByName(names.init)) {
-            if (sym.kind == Kinds.MTH) {
+            if (sym.kind == MTH) {
                 if (hasParameterTypes((MethodSymbol) sym, paramTypes)) {
                     return (MethodSymbol) sym;
                 }
@@ -558,7 +559,7 @@
             // attempt to emulate the old behavior.
             MethodSymbol lastFound = null;
             for (Symbol sym : tsym.members().getSymbolsByName(methodName)) {
-                if (sym.kind == Kinds.MTH) {
+                if (sym.kind == MTH) {
                     if (sym.name == methodName) {
                         lastFound = (MethodSymbol)sym;
                     }
@@ -570,7 +571,7 @@
         } else {
             for (Symbol sym : tsym.members().getSymbolsByName(methodName)) {
                 if (sym != null &&
-                    sym.kind == Kinds.MTH) {
+                    sym.kind == MTH) {
                     if (hasParameterTypes((MethodSymbol) sym, paramTypes)) {
                         return (MethodSymbol) sym;
                     }
@@ -696,7 +697,8 @@
     @DefinedBy(Api.COMPILER_TREE)
     public TypeMirror getTypeMirror(TreePath path) {
         Tree t = path.getLeaf();
-        return ((JCTree)t).type;
+        Type ty = ((JCTree)t).type;
+        return ty == null ? null : ty.stripMetadataIfNeeded();
     }
 
     @DefinedBy(Api.COMPILER_TREE)
@@ -925,12 +927,7 @@
         try {
             switch (kind) {
             case ERROR:
-                boolean prev = log.multipleErrors;
-                try {
-                    log.error(pos, "proc.messager", msg.toString());
-                } finally {
-                    log.multipleErrors = prev;
-                }
+                log.error(DiagnosticFlag.MULTIPLE, pos, "proc.messager", msg.toString());
                 break;
 
             case WARNING:
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.Inherited;
+import java.lang.annotation.Repeatable;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
@@ -183,65 +184,12 @@
         return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
     }
 
-    // Needed to unpack the runtime view of containing annotations
-    private static final Class<? extends Annotation> REPEATABLE_CLASS = initRepeatable();
-    private static final Method VALUE_ELEMENT_METHOD = initValueElementMethod();
-
-    private static Class<? extends Annotation> initRepeatable() {
-        try {
-            // Repeatable will not be available when bootstrapping on
-            // JDK 7 so use a reflective lookup instead of a class
-            // literal for Repeatable.class.
-            return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
-        } catch (ClassNotFoundException | SecurityException e) {
-            return null;
-        }
-    }
-
-    private static Method initValueElementMethod() {
-        if (REPEATABLE_CLASS == null)
-            return null;
-
-        Method m = null;
-        try {
-            m = REPEATABLE_CLASS.getMethod("value");
-            if (m != null)
-                m.setAccessible(true);
-            return m;
-        } catch (NoSuchMethodException e) {
-            return null;
-        }
-    }
-
-
     // Helper to getAnnotationsByType
     private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType) {
-        // Since we can not refer to java.lang.annotation.Repeatable until we are
-        // bootstrapping with java 8 we need to get the Repeatable annotation using
-        // reflective invocations instead of just using its type and element method.
-        if (REPEATABLE_CLASS != null &&
-            VALUE_ELEMENT_METHOD != null) {
-            // Get the Repeatable instance on the annotations declaration
-            Annotation repeatable = (Annotation)annoType.getAnnotation(REPEATABLE_CLASS);
-            if (repeatable != null) {
-                try {
-                    // Get the value element, it should be a class
-                    // indicating the containing annotation type
-                    @SuppressWarnings("unchecked")
-                    Class<? extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(repeatable);
-                    if (containerType == null)
-                        return null;
-
-                    return containerType;
-                } catch (ClassCastException | IllegalAccessException | InvocationTargetException e) {
-                    return null;
-                }
-            }
-        }
-        return null;
+        Repeatable repeatable = annoType.getAnnotation(Repeatable.class);
+        return (repeatable == null) ? null : repeatable.value();
     }
 
-
     // Helper to getAnnotationsByType
     private static Attribute[] unpackAttributes(Attribute.Compound container) {
         // We now have an instance of the container,
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Wed Apr 01 15:13:45 2015 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Wed Apr 22 17:42:41 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,27 +25,40 @@
 
 package com.sun.tools.javac.code;
 
-import java.io.*;
+import java.io.IOException;
+import java.io.File;
 import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
+
 import javax.lang.model.SourceVersion;
-import javax.tools.JavaFileObject;
 import javax.tools.JavaFileManager;
 import javax.tools.JavaFileManager.Location;
+import javax.tools.JavaFileObject;
 import javax.tools.StandardJavaFileManager;
 
+import com.sun.tools.javac.code.Scope.WriteableScope;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.Completer;
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
+import com.sun.tools.javac.code.Symbol.PackageSymbol;
+import com.sun.tools.javac.code.Symbol.TypeSymbol;
+import com.sun.tools.javac.comp.Annotate;
+import com.sun.tools.javac.comp.Enter;
+import com.sun.tools.javac.file.JRTIndex;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.jvm.ClassReader;
+import com.sun.tools.javac.jvm.Profile;
+import com.sun.tools.javac.util.*;
+
 import static javax.tools.StandardLocation.*;
 
-import com.sun.tools.javac.comp.Annotate;
-import com.sun.tools.javac.code.Scope.WriteableScope;
-import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.jvm.ClassReader;
-import com.sun.tools.javac.util.*;
-
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 import static com.sun.tools.javac.main.Option.*;
+import com.sun.tools.javac.util.Dependencies.CompletionCause;
 
 /**
  *  This class provides operations to locate class definitions
@@ -62,7 +75,7 @@
 
     ClassReader reader;
 
-    Annotate annotate;
+    private final Annotate annotate;
 
     /** Switch: verbose output.
      */
@@ -126,6 +139,18 @@
     protected Symbol currentOwner = null;
 
     /**
+     * The currently selected profile.
+     */
+    private final Profile profile;
+
+    /**
+     * Use direct access to the JRTIndex to access the temporary
+     * replacement for the info that used to be in ct.sym.
+     * In time, this will go away and be replaced by the module system.
+     */
+    private final JRTIndex jrtIndex;
+
+    /**
      * Completer that delegates to the complete-method of this class.
      */
     private final Completer thisCompleter = new Completer() {
@@ -168,13 +193,73 @@
         preferSource = "source".equals(options.get("-Xprefer"));
         userPathsFirst = options.isSet(XXUSERPATHSFIRST);
 
-
         completionFailureName =
             options.isSet("failcomplete")
             ? names.fromString(options.get("failcomplete"))
             : null;
+
+        // Temporary, until more info is available from the module system.
+        boolean useCtProps;
+        JavaFileManager fm = context.get(JavaFileManager.class);
+        if (fm instanceof JavacFileManager) {
+            JavacFileManager jfm = (JavacFileManager) fm;
+            useCtProps = jfm.isDefaultBootClassPath() && jfm.isSymbolFileEnabled();
+        } else if (fm.getClass().getName().equals("com.sun.tools.sjavac.comp.SmartFileManager")) {
+            useCtProps = !options.isSet("ignore.symbol.file");
+        } else {
+            useCtProps = false;
+        }
+        jrtIndex = useCtProps && JRTIndex.isAvailable() ? JRTIndex.getSharedInstance() : null;
+
+        profile = Profile.instance(context);
     }
 
+
+/************************************************************************
+ * Temporary ct.sym replacement
+ *
+ * The following code is a temporary substitute for the ct.sym mechanism
+ * used in JDK 6 thru JDK 8.
+ * This mechanism will eventually be superseded by the Jigsaw module system.
+ ***********************************************************************/
+
+    /**
+     * Returns any extra flags for a class symbol.
+     * This information used to be provided using private annotations
+     * in the class file in ct.sym; in time, this information will be
+     * available from the module system.
+     */
+    long getSupplementaryFlags(ClassSymbol c) {
+        if (jrtIndex == null || !jrtIndex.isInJRT(c.classfile)) {
+            return 0;
+        }
+
+        if (supplementaryFlags == null) {
+            supplementaryFlags = new HashMap<>();
+        }
+
+        Long flags = supplementaryFlags.get(c.packge());
+        if (flags == null) {
+            long newFlags = 0;
+            try {
+                JRTIndex.CtSym ctSym = jrtIndex.getCtSym(c.packge().flatName());
+                Profile minProfile = Profile.DEFAULT;
+                if (ctSym.proprietary)
+                    newFlags |= PROPRIETARY;
+                if (ctSym.minProfile != null)
+                    minProfile = Profile.lookup(ctSym.minProfile);
+                if (profile != Profile.DEFAULT && minProfile.value > profile.value) {
+                    newFlags |= NOT_IN_PROFILE;
+                }
+            } catch (IOException ignore) {
+            }
+            supplementaryFlags.put(c.packge(), flags = newFlags);
+        }
+        return flags;
+    }
+
+    private Map<PackageSymbol, Long> supplementaryFlags;
+
 /************************************************************************
  * Loading Classes
  ***********************************************************************/
@@ -186,19 +271,14 @@
         if (sym.kind == TYP) {
             try {
                 ClassSymbol c = (ClassSymbol) sym;
-                dependencies.push(c);
+                dependencies.push(c, CompletionCause.CLASS_READER);
+                annotate.blockAnnotations();
                 c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
-                annotate.enterStart();
-                try {
-                    completeOwners(c.owner);
-                    completeEnclosing(c);
-                } finally {
-                    // The flush needs to happen only after annotations
-                    // are filled in.
-                    annotate.enterDoneWithoutFlush();
-                }
+                completeOwners(c.owner);
+                completeEnclosing(c);
                 fillIn(c);
             } finally {
+                annotate.unblockAnnotationsNoFlush();
                 dependencies.pop();
             }
         } else if (sym.kind == PCK) {
@@ -259,6 +339,7 @@
                 }
                 if (classfile.getKind() == JavaFileObject.Kind.CLASS) {
                     reader.readClassFile(c);
+                    c.flags_field |= getSupplementaryFlags(c);
                 } else {
                     if (sourceCompleter != null) {
                         sourceCompleter.complete(c);
@@ -271,13 +352,15 @@
                 currentClassFile = previousClassFile;
             }
         } else {
-            JCDiagnostic diag =
-                diagFactory.fragment("class.file.not.found", c.flatname);
-            throw
-                newCompletionFailure(c, diag);
+            throw classFileNotFound(c);
         }
     }
     // where
+        private CompletionFailure classFileNotFound(ClassSymbol c) {
+            JCDiagnostic diag =
+                diagFactory.fragment("class.file.not.found", c.flatname);
+            return newCompletionFailure(c, diag);
+        }
         /** Static factory for CompletionFailure objects.
          *  In practice, only one can be used at a time, so we share one
          *  to reduce the expense of allocating