changeset 3294:9adfb22ff08f jdk-9+111

8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: jjg, jlahoda, vromero, mcimadamore, bpatel, ksrini, darcy, anazarov, dfuchs Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, jan.lahoda@oracle.com, vicente.romero@oracle.com, andreas.lundblad@oracle.com, andrey.x.nazarov@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, kumar.x.srinivasan@oracle.com, sundararajan.athijegannathan@oracle.com
author alanb
date Thu, 17 Mar 2016 19:04:28 +0000
parents dbd1f626bd00
children 447f26d4b506 d52219fa3026
files make/CompileInterim.gmk make/build.properties make/build.xml make/gendata/Gendata-jdk.compiler.gmk make/intellij/ant.xml make/intellij/build.xml make/intellij/langtools.iml make/intellij/src/idea/LangtoolsIdeaAntLogger.java make/intellij/workspace.xml make/launcher.sh-template make/netbeans/langtools/build.xml make/netbeans/langtools/nbproject/project.xml make/tools/anttasks/SelectToolTask.java make/tools/crules/CodingRulesAnalyzerPlugin.java make/tools/propertiesparser/parser/MessageType.java src/java.compiler/share/classes/javax/lang/model/element/Element.java src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java src/java.compiler/share/classes/javax/lang/model/util/Elements.java src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java src/java.compiler/share/classes/javax/tools/JavaFileManager.java src/java.compiler/share/classes/javax/tools/StandardLocation.java src/java.compiler/share/classes/javax/tools/ToolProvider.java src/java.compiler/share/classes/module-info.java src/jdk.compiler/share/classes/com/sun/source/tree/DirectiveTree.java src/jdk.compiler/share/classes/com/sun/source/tree/ExportsTree.java src/jdk.compiler/share/classes/com/sun/source/tree/ModuleTree.java src/jdk.compiler/share/classes/com/sun/source/tree/ProvidesTree.java src/jdk.compiler/share/classes/com/sun/source/tree/RequiresTree.java src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java src/jdk.compiler/share/classes/com/sun/source/tree/UsesTree.java src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.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/TypeAnnotations.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeTag.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.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/Lower.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java src/jdk.compiler/share/classes/com/sun/tools/javac/file/ModuleNameReader.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.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/JNIWriter.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.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/sym/Profiles.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.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/tree/TreeScanner.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/ModuleHelper.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/ModuleWrappers.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/Name.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/ServiceLoader.java src/jdk.compiler/share/classes/com/sun/tools/javah/JavahTask.java src/jdk.compiler/share/classes/com/sun/tools/javah/resources/l10n.properties src/jdk.compiler/share/classes/com/sun/tools/sjavac/PubApiExtractor.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/Source.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SmartFileManager.java src/jdk.compiler/share/classes/module-info.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractProfileIndexWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ProfilePackageSummaryWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ProfileSummaryWriter.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfilePackageSummaryBuilder.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPaths.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/StandardDocFileFactory.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Utils.java src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/ClassDocImpl.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocletInvoker.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/JavadocTool.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/PackageDocImpl.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Start.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/ToolOption.java src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc.properties src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlConstants.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/ModuleSummaryWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/MetaKeywords.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/DocEnv.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocClassFinder.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties src/jdk.javadoc/share/classes/module-info.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/AccessFlags.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConcealedPackages_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Hashes_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/MainClass_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/TargetPlatform_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Version_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java src/jdk.jdeps/share/classes/com/sun/tools/javap/Options.java src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Analyzer.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Archive.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsFilter.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsWriter.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleInfoBuilder.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModulePaths.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModulesXmlReader.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/PlatformClassPath.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Profile.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties src/jdk.jdeps/share/classes/module-info.java src/jdk.jshell/share/classes/jdk/internal/jshell/remote/RemoteAgent.java src/jdk.jshell/share/classes/jdk/jshell/ExecutionControl.java src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java src/jdk.jshell/share/classes/module-info.java test/Makefile test/ProblemList.txt test/TEST.ROOT test/com/sun/javadoc/testCustomTag/TestCustomTag.java test/com/sun/javadoc/testCustomTag/taglets/CustomTag.java test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java test/com/sun/javadoc/testLinkOption/TestLinkOption.java test/com/sun/javadoc/testLinkOption/extra/StringBuilder.java test/com/sun/javadoc/testLinkOption/java/lang/StringBuilderChild.java test/com/sun/javadoc/testLinkOption/jdk/package-list test/com/sun/javadoc/testLinkOption/mylib/lang/StringBuilderChild.java test/com/sun/javadoc/testLinkOption/package-list test/com/sun/javadoc/testNavigation/TestNavigation.java test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java test/com/sun/javadoc/testNestedInlineTag/testtaglets/BoldTaglet.java test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java test/com/sun/javadoc/testProfiles/TestProfiles.java test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java test/com/sun/javadoc/testProfiles/pkg1/Class1Pkg1.java test/com/sun/javadoc/testProfiles/pkg1/Class2Pkg1.java test/com/sun/javadoc/testProfiles/pkg1/Class3Pkg1.java test/com/sun/javadoc/testProfiles/pkg1/Interface1Pkg1.java test/com/sun/javadoc/testProfiles/pkg2/Anno1Pkg2.java test/com/sun/javadoc/testProfiles/pkg2/Anno2Pkg2.java test/com/sun/javadoc/testProfiles/pkg2/Class1Pkg2.java test/com/sun/javadoc/testProfiles/pkg2/ClassError.java test/com/sun/javadoc/testProfiles/pkg2/ClassException.java test/com/sun/javadoc/testProfiles/pkg3/Class1Pkg3.java test/com/sun/javadoc/testProfiles/pkg3/Class2Pkg3.java test/com/sun/javadoc/testProfiles/pkg3/Interface1Pkg3.java test/com/sun/javadoc/testProfiles/pkg4/Anno1Pkg4.java test/com/sun/javadoc/testProfiles/pkg4/Class1Pkg4.java test/com/sun/javadoc/testProfiles/pkg5/Class1Pkg5.java test/com/sun/javadoc/testProfiles/pkg5/Interface1Pkg5.java test/com/sun/javadoc/testProfiles/pkgDeprecated/Class1PkgDeprecated.java test/com/sun/javadoc/testProfiles/pkgDeprecated/package-info.java test/com/sun/javadoc/testProfiles/profile-rtjar-includes-nopkgs.txt test/com/sun/javadoc/testProfiles/profile-rtjar-includes.txt test/com/sun/javadoc/testSubTitle/TestSubTitle.java test/com/sun/javadoc/testTaglets/TestTaglets.java test/com/sun/javadoc/testTaglets/taglets/Foo.java test/jdk/javadoc/doclet/5093723/T5093723.java test/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java test/jdk/javadoc/doclet/AccessFrameTitle/AccessFrameTitle.java test/jdk/javadoc/doclet/AccessH1/AccessH1.java test/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java test/jdk/javadoc/doclet/AccessSummary/AccessSummary.java test/jdk/javadoc/doclet/AuthorDD/AuthorDD.java test/jdk/javadoc/doclet/DocRootSlash/DocRootSlash.java test/jdk/javadoc/doclet/InheritDocForUserTags/DocTest.java test/jdk/javadoc/doclet/JavascriptWinTitle/JavascriptWinTitle.java test/jdk/javadoc/doclet/MetaTag/MetaTag.java test/jdk/javadoc/doclet/PackagesHeader/PackagesHeader.java test/jdk/javadoc/doclet/T6735320/T6735320.java test/jdk/javadoc/doclet/ValidHtml/ValidHtml.java test/jdk/javadoc/doclet/VersionNumber/VersionNumber.java test/jdk/javadoc/doclet/WindowTitles/WindowTitles.java test/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java test/jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java test/jdk/javadoc/doclet/testAbsLinkPath/TestAbsLinkPath.java test/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java test/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java test/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java test/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java test/jdk/javadoc/doclet/testBackSlashInLink/TestBackSlashInLink.java test/jdk/javadoc/doclet/testBadPackageFileInJar/TestBadPackageFileInJar.java test/jdk/javadoc/doclet/testBadSourceFile/TestBadSourceFile.java test/jdk/javadoc/doclet/testBaseClass/TestBaseClass.java test/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java test/jdk/javadoc/doclet/testCRLineSeparator/TestCRLineSeparator.java test/jdk/javadoc/doclet/testCharset/TestCharset.java test/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java test/jdk/javadoc/doclet/testClassTree/TestClassTree.java test/jdk/javadoc/doclet/testCmndLineClass/TestCmndLineClass.java test/jdk/javadoc/doclet/testCompletionFailure/TestCompletionFailure.java test/jdk/javadoc/doclet/testConstantValuesPage/TestConstantValuesPage.java test/jdk/javadoc/doclet/testConstructorIndent/TestConstructorIndent.java test/jdk/javadoc/doclet/testConstructors/TestConstructors.java test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java test/jdk/javadoc/doclet/testDocEncoding/TestDocEncoding.java test/jdk/javadoc/doclet/testDocErrorReporter/TestDocErrorReporter.java test/jdk/javadoc/doclet/testDocFileDir/TestDocFileDir.java test/jdk/javadoc/doclet/testDocFiles/TestDocFiles.java test/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java test/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java test/jdk/javadoc/doclet/testDupParamWarn/TestDupParamWarn.java test/jdk/javadoc/doclet/testEmptyClass/TestEmptyClass.java test/jdk/javadoc/doclet/testEnclosingClass/TestEnclosingClass.java test/jdk/javadoc/doclet/testEncoding/TestEncoding.java test/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java test/jdk/javadoc/doclet/testGeneratedBy/TestGeneratedBy.java test/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java test/jdk/javadoc/doclet/testHeadings/TestHeadings.java test/jdk/javadoc/doclet/testHelpFile/TestHelpFile.java test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java test/jdk/javadoc/doclet/testHiddenMembers/TestHiddenMembers.java test/jdk/javadoc/doclet/testHref/TestHref.java test/jdk/javadoc/doclet/testHrefInDocComment/TestHrefInDocComment.java test/jdk/javadoc/doclet/testHtmlComments/TestHtmlComments.java test/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java test/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java test/jdk/javadoc/doclet/testHtmlStrongTag/TestHtmlStrongTag.java test/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java test/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java test/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java test/jdk/javadoc/doclet/testIndentation/TestIndentation.java test/jdk/javadoc/doclet/testIndex/TestIndex.java test/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java test/jdk/javadoc/doclet/testInterface/TestInterface.java test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java test/jdk/javadoc/doclet/testJavascript/TestJavascript.java test/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java test/jdk/javadoc/doclet/testLeadingSpaces/LeadingSpaces.java test/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java test/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java test/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java test/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java test/jdk/javadoc/doclet/testLinkOption/extra/StringBuilder.java test/jdk/javadoc/doclet/testLinkOption/java/lang/StringBuilderChild.java test/jdk/javadoc/doclet/testLinkOption/jdk/package-list test/jdk/javadoc/doclet/testLinkOption/mylib/lang/StringBuilderChild.java test/jdk/javadoc/doclet/testLinkOption/package-list test/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java test/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java test/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java test/jdk/javadoc/doclet/testMemberInheritence/TestMemberInheritence.java test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java test/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java test/jdk/javadoc/doclet/testModifierEx/TestModifierEx.java test/jdk/javadoc/doclet/testNavigation/TestNavigation.java test/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java test/jdk/javadoc/doclet/testNoPackagesFile/TestNoPackagesFile.java test/jdk/javadoc/doclet/testNotifications/TestNotifications.java test/jdk/javadoc/doclet/testOptions/TestOptions.java test/jdk/javadoc/doclet/testOrdering/TestOrdering.java test/jdk/javadoc/doclet/testOverridenMethods/TestMultiInheritence.java test/jdk/javadoc/doclet/testOverridenMethods/TestOverridenMethodDocCopy.java test/jdk/javadoc/doclet/testOverridenMethods/TestOverridenPrivateMethods.java test/jdk/javadoc/doclet/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java test/jdk/javadoc/doclet/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java test/jdk/javadoc/doclet/testPackageDeprecation/TestPackageDeprecation.java test/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java test/jdk/javadoc/doclet/testParamTaglet/TestParamTaglet.java test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java test/jdk/javadoc/doclet/testRecurseSubPackages/TestRecurseSubPackages.java test/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java test/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java test/jdk/javadoc/doclet/testReturnTag/TestReturnTag.java test/jdk/javadoc/doclet/testSearch/TestSearch.java test/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java test/jdk/javadoc/doclet/testSerialVersionUID/TestSerialVersionUID.java test/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java test/jdk/javadoc/doclet/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java test/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java test/jdk/javadoc/doclet/testSimpleTagExclude/TestSimpleTagExclude.java test/jdk/javadoc/doclet/testSimpleTagInherit/TestSimpleTagInherit.java test/jdk/javadoc/doclet/testSinceTag/TestSinceTag.java test/jdk/javadoc/doclet/testSingleQuotedLink/TestSingleQuotedLink.java test/jdk/javadoc/doclet/testSourceTab/TestSourceTab.java test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java test/jdk/javadoc/doclet/testSummaryHeading/TestSummaryHeading.java test/jdk/javadoc/doclet/testSuperclassInSerialForm/TestSuperClassInSerialForm.java test/jdk/javadoc/doclet/testSupplementary/TestSupplementary.java test/jdk/javadoc/doclet/testTagInheritence/TestTagInheritence.java test/jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java test/jdk/javadoc/doclet/testTagOutput/TestTagOutput.java test/jdk/javadoc/doclet/testThrowsHead/TestThrowsHead.java test/jdk/javadoc/doclet/testThrowsInheritence/TestThrowsTagInheritence.java test/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java test/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java test/jdk/javadoc/doclet/testTopOption/TestTopOption.java test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java test/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java test/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java test/jdk/javadoc/doclet/testUseOption/TestUseOption.java test/jdk/javadoc/doclet/testValueTag/TestValueTag.java test/jdk/javadoc/doclet/testWarnBadParamNames/TestWarnBadParamNames.java test/jdk/javadoc/doclet/testWindowTitle/TestWindowTitle.java test/jdk/javadoc/doclet/testXOption/TestXOption.java test/jdk/javadoc/doclet/typeAnnotations/smoke/TestSmoke.java test/jdk/javadoc/tool/6227454/Test.java test/jdk/javadoc/tool/6942366/T6942366.java test/jdk/javadoc/tool/6958836/Test.java test/jdk/javadoc/tool/6964914/Test.java test/jdk/javadoc/tool/6964914/TestStdDoclet.java test/jdk/javadoc/tool/6964914/TestUserDoclet.java test/jdk/javadoc/tool/BreakIteratorWarning.java test/jdk/javadoc/tool/CheckResourceKeys.java test/jdk/javadoc/tool/EnsureNewOldDoclet.java test/jdk/javadoc/tool/FlagsTooEarly.java test/jdk/javadoc/tool/MaxWarns.java test/jdk/javadoc/tool/NoStar.java test/jdk/javadoc/tool/QuietOption.java test/jdk/javadoc/tool/ReleaseOption.java test/jdk/javadoc/tool/T4994049/T4994049.java test/jdk/javadoc/tool/T6551367.java test/jdk/javadoc/tool/T6968833.java test/jdk/javadoc/tool/VerifyLocale.java test/jdk/javadoc/tool/XWerror.java test/jdk/javadoc/tool/api/basic/JavadocTaskImplTest.java test/jdk/javadoc/tool/completionFailure/CompletionFailure.java test/jdk/javadoc/tool/doclint/DocLintTest.java test/jdk/javadoc/tool/doclint/ImplicitHeadersTest.java test/jdk/javadoc/tool/dupOk/DupOk.java test/jdk/javadoc/tool/nonConstExprs/Test.java test/jdk/javadoc/tool/outputRedirect/Test.java test/jdk/javadoc/tool/parser/7091528/T7091528.java test/jdk/jshell/ClassPathTest.java test/jdk/jshell/CommandCompletionTest.java test/jdk/jshell/CompletionSuggestionTest.java test/jdk/jshell/ComputeFQNsTest.java test/jdk/jshell/ErrorTranslationTest.java test/jdk/jshell/ImportTest.java test/jdk/jshell/InferTypeTest.java test/jdk/jshell/StartOptionTest.java test/jdk/jshell/T8146368/JShellToolTest8146368.java test/jdk/jshell/ToolFormatTest.java test/jdk/jshell/ToolReloadTest.java test/lib/annotations/annotations/classfile/ClassfileInspector.java test/tools/all/RunCodingRules.java test/tools/doclint/tool/PathsTest.java test/tools/javac/4846262/CheckEBCDICLocaleTest.java test/tools/javac/6302184/HiddenOptionsShouldUseGivenEncodingTest.java test/tools/javac/6330997/T6330997.java test/tools/javac/6403424/T6403424.java test/tools/javac/6508981/TestInferBinaryName.java test/tools/javac/6589361/T6589361.java test/tools/javac/6627362/T6627362.java test/tools/javac/6889255/T6889255.java test/tools/javac/AnonymousSubclassTest.java test/tools/javac/ClassPathTest/ClassPathTest.java test/tools/javac/ConstFoldTest.java test/tools/javac/Diagnostics/6769027/T6769027.java test/tools/javac/ExtDirs/ExtDirTest.java test/tools/javac/IncorrectInheritance/IncorrectInheritanceTest.java test/tools/javac/MethodParameters/AttributeVisitor.java test/tools/javac/MethodParametersTest.java test/tools/javac/MissingInclude/MissingIncludeTest.java test/tools/javac/Object1.java test/tools/javac/Object1.out test/tools/javac/Object2.java test/tools/javac/Object2.out test/tools/javac/Paths/AbsolutePathTest.java test/tools/javac/Paths/Diagnostics.sh test/tools/javac/ProtectedInnerClass/ProtectedInnerClassesTest.java test/tools/javac/T4093617/T4093617.java test/tools/javac/T4093617/T4093617.out test/tools/javac/T4093617/java.base/Object.java test/tools/javac/T4965689/ClassLiteralWastesByteTest.java test/tools/javac/T5053846/MethodRefDupInConstantPoolTest.java test/tools/javac/T5090006/AssertionFailureTest.java test/tools/javac/T6181889/EmptyFinallyTest.java test/tools/javac/T6358024.java test/tools/javac/T6358166.java test/tools/javac/T6403466.java test/tools/javac/T6405099.java test/tools/javac/T6406771.java test/tools/javac/T6435291/T6435291.java test/tools/javac/T6558476.java test/tools/javac/T6725036.java test/tools/javac/T6942649.java test/tools/javac/T6970173/DebugPointerAtBadPositionTest.java test/tools/javac/T6972327.java test/tools/javac/T6985181.java test/tools/javac/T6993301.java test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java test/tools/javac/T7040592/T7040592.java test/tools/javac/T8003967/DetectMutableStaticFields.java test/tools/javac/T8009640/CheckRejectProfileBCPOptionsIfUsedTogetherTest.java test/tools/javac/T8010659/CompilerCrashWhenMixingBinariesAndSourcesTest.java test/tools/javac/T8010737/ParameterNamesAreNotCopiedToAnonymousInitTest.java test/tools/javac/T8013394/CompileErrorWithIteratorTest.java test/tools/javac/T8019486/WrongLNTForLambdaTest.java test/tools/javac/T8022162/IncorrectSignatureDeterminationForInnerClassesTest.java test/tools/javac/T8024039/NoDeadCodeGenerationOnTrySmtTest.java test/tools/javac/T8024437/ExceptionInferenceFromClassFileTest.java test/tools/javac/TryWithResources/TwrForVariable3.out test/tools/javac/VersionOpt.java test/tools/javac/annotations/SyntheticParameters.java test/tools/javac/annotations/typeAnnotations/TypeProcOnly.java test/tools/javac/annotations/typeAnnotations/classfile/NestedLambdasCastedTest.java test/tools/javac/annotations/typeAnnotations/packageanno/PackageProcessor.java test/tools/javac/api/6400303/T6400303.java test/tools/javac/api/6412656/T6412656.java test/tools/javac/api/6418694/T6418694.java test/tools/javac/api/6440528/T6440528.java test/tools/javac/api/6557752/T6557752.java test/tools/javac/api/6852595/T6852595.java test/tools/javac/api/T6358786.java test/tools/javac/api/T6397104.java test/tools/javac/api/T6412669.java test/tools/javac/api/TestClientCodeWrapper.java test/tools/javac/api/TestGetElementReference.java test/tools/javac/api/TestJavacTask.java test/tools/javac/api/TestJavacTaskScanner.java test/tools/javac/api/TestResolveError.java test/tools/javac/api/TestResolveIdent.java test/tools/javac/api/TestSearchPaths.java test/tools/javac/api/TestTrees.java test/tools/javac/api/ToolProvider/HelloWorldTest.java test/tools/javac/api/ToolProvider/ToolProviderTest1.java test/tools/javac/api/ToolProvider/ToolProviderTest2.java test/tools/javac/api/mod/api/pkg/Api.java test/tools/javac/api/mod/module-info.java test/tools/javac/api/taskListeners/CompileEvent.java test/tools/javac/boxing/IncrementBoxedAndAccess.java test/tools/javac/cast/intersection/model/Model01.java test/tools/javac/cast/intersection/model/ModelChecker.java test/tools/javac/classfiles/InnerClasses/T8068517.java test/tools/javac/classfiles/attributes/AnnotationDefault/AnnotationDefaultTest.java test/tools/javac/classfiles/attributes/EnclosingMethod/EnclosingMethodTest.java test/tools/javac/classfiles/attributes/LineNumberTable/LineNumberTest.java test/tools/javac/classfiles/attributes/LocalVariableTable/LocalVariableTableTest.java test/tools/javac/classfiles/attributes/LocalVariableTable/LocalVariableTypeTableTest.java test/tools/javac/classfiles/attributes/Module/ModuleFlagTest.java test/tools/javac/classfiles/attributes/Module/ModuleTest.java test/tools/javac/classfiles/attributes/Module/ModuleTestBase.java test/tools/javac/classfiles/attributes/Signature/ConstructorTest.java test/tools/javac/classfiles/attributes/Signature/EnumTest.java test/tools/javac/classfiles/attributes/Signature/ExceptionTest.java test/tools/javac/classfiles/attributes/Signature/FieldTest.java test/tools/javac/classfiles/attributes/Signature/InnerClassTest.java test/tools/javac/classfiles/attributes/Signature/MethodParameterTest.java test/tools/javac/classfiles/attributes/Signature/MethodTypeBoundTest.java test/tools/javac/classfiles/attributes/Signature/ReturnTypeTest.java test/tools/javac/classfiles/attributes/SourceFile/AnonymousClassTest.java test/tools/javac/classfiles/attributes/SourceFile/InnerClassTest.java test/tools/javac/classfiles/attributes/SourceFile/LocalClassTest.java test/tools/javac/classfiles/attributes/SourceFile/MixTest.java test/tools/javac/classfiles/attributes/SourceFile/ModuleInfoTest.java test/tools/javac/classfiles/attributes/SourceFile/NoSourceFileAttribute.java test/tools/javac/classfiles/attributes/SourceFile/SourceFileTestBase.java test/tools/javac/classfiles/attributes/SourceFile/SyntheticClassTest.java test/tools/javac/classfiles/attributes/SourceFile/TopLevelClassesOneFileTest.java test/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassMembersTest.java test/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateSiblingsTest.java test/tools/javac/classfiles/attributes/Synthetic/AssertFieldTest.java test/tools/javac/classfiles/attributes/Synthetic/BridgeMethodForGenericMethodTest.java test/tools/javac/classfiles/attributes/Synthetic/BridgeMethodsForLambdaTest.java test/tools/javac/classfiles/attributes/Synthetic/EnumTest.java test/tools/javac/classfiles/attributes/Synthetic/PackageInfoTest.java test/tools/javac/classfiles/attributes/Synthetic/ThisFieldTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForGenericMethodTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerAnnotationTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerClassTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerEnumTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerInterfaceTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForTopLevelClassTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsForGenericMethodTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsForLambdaTest.java test/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsTest.java test/tools/javac/classfiles/attributes/deprecated/DeprecatedPackageTest.java test/tools/javac/classfiles/attributes/deprecated/DeprecatedTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerAnnotationsInInnerAnnotationTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerAnnotationsInInnerClassTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerAnnotationsInInnerEnumTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerAnnotationsInInnerInterfaceTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesHierarchyTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInAnonymousClassTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInInnerAnnotationTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInInnerClassTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInInnerEnumTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInInnerInterfaceTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInLocalClassTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesIndexTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerClassesTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerEnumInInnerAnnotationTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerEnumInInnerEnumTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerEnumInInnerInterfaceTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerEnumsInInnerClassTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerInterfacesInInnerAnnotationTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerInterfacesInInnerClassTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerInterfacesInInnerEnumTest.java test/tools/javac/classfiles/attributes/innerclasses/InnerInterfacesInInnerInterfaceTest.java test/tools/javac/classfiles/attributes/innerclasses/NoInnerClassesTest.java test/tools/javac/classfiles/attributes/lib/TestResult.java test/tools/javac/code/ArrayClone.java test/tools/javac/defaultMethods/AssertionsTest.java test/tools/javac/defaultMethods/BadClassfile.java test/tools/javac/defaultMethodsVisibility/DefaultMethodsNotVisibleForSourceLessThan8Test.java test/tools/javac/diags/CheckExamples.java test/tools/javac/diags/CheckResourceKeys.java test/tools/javac/diags/DocCommentProcessor.java test/tools/javac/diags/Example.java test/tools/javac/diags/FileManager.java test/tools/javac/diags/examples.not-yet.txt test/tools/javac/diags/examples/DirPathElementNotFound.java test/tools/javac/diags/examples/InvalidDefaultInterface/InvalidDefaultInterface.java test/tools/javac/diags/examples/InvalidDefaultInterface/processors/CreateBadClassFile.java test/tools/javac/diags/examples/InvalidStaticInterface/InvalidStaticInterface.java test/tools/javac/diags/examples/InvalidStaticInterface/processors/CreateBadClassFile.java test/tools/javac/diags/examples/NoJavaLang.java test/tools/javac/diags/examples/NoSuperclass.java test/tools/javac/doctree/ReferenceTest.java test/tools/javac/fatalErrors/NoJavaLangTest.java test/tools/javac/file/ExplodedImage.java test/tools/javac/file/T7018098.java test/tools/javac/generics/diamond/neg/T8078473_2.java test/tools/javac/importscope/CompletionFailureDuringImport.java test/tools/javac/importscope/ImportDependenciesTest.java test/tools/javac/importscope/ImportMembersTest.java test/tools/javac/importscope/NegativeCyclicDependencyTest.java test/tools/javac/innerClassFile/InnerClassFileTest.java test/tools/javac/javazip/JavaZipTest.java test/tools/javac/lambda/AvoidInfiniteReattribution.java test/tools/javac/lambda/LambdaInnerTypeVarReflect.java test/tools/javac/lambda/T8129740/SourceToSourceTranslationTest.java test/tools/javac/lambda/TestBootstrapMethodsCount.java test/tools/javac/lambda/bridge/TestMetafactoryBridges.java test/tools/javac/lambda/bridge/template_tests/TEST.properties test/tools/javac/lambda/lambdaNaming/TestNonSerializableLambdaNameStability.java test/tools/javac/lambda/lambdaNaming/TestSerializedLambdaNameStability.java test/tools/javac/lambdaShapes/TEST.properties test/tools/javac/lib/DPrinter.java test/tools/javac/lib/JavacTestingAbstractProcessor.java test/tools/javac/lib/combo/ReusableContext.java test/tools/javac/limits/NumArgsTest.java test/tools/javac/links/LinksTest.java test/tools/javac/modules/AbstractOrInnerClassServiceImplTest.java test/tools/javac/modules/AddLimitMods.java test/tools/javac/modules/AddReadsTest.java test/tools/javac/modules/AnnotationProcessing.java test/tools/javac/modules/AnnotationProcessorsInModulesTest.java test/tools/javac/modules/AutomaticModules.java test/tools/javac/modules/DoclintOtherModules.java test/tools/javac/modules/DuplicateClassTest.java test/tools/javac/modules/EdgeCases.java test/tools/javac/modules/GraphsTest.java test/tools/javac/modules/HelloWorldTest.java test/tools/javac/modules/MOptionTest.java test/tools/javac/modules/ModuleFinderTest.java test/tools/javac/modules/ModuleInfoTest.java test/tools/javac/modules/ModulePathTest.java test/tools/javac/modules/ModuleSourcePathTest.java test/tools/javac/modules/ModuleTestBase.java test/tools/javac/modules/ModulesAndClassPathTest.java test/tools/javac/modules/MultiModuleModeTest.java test/tools/javac/modules/NPEEmptyFileTest.java test/tools/javac/modules/OutputDirTest.java test/tools/javac/modules/PackageConflictTest.java test/tools/javac/modules/PackageMultipleModules.java test/tools/javac/modules/PluginsInModulesTest.java test/tools/javac/modules/ProvidesTest.java test/tools/javac/modules/QueryBeforeEnter.java test/tools/javac/modules/RepeatedUsesAndProvidesTest.java test/tools/javac/modules/ReportNonExistentPackageTest.java test/tools/javac/modules/RequiresPublicTest.java test/tools/javac/modules/ResolveTest.java test/tools/javac/modules/ServiceInStaticClassErrorTest.java test/tools/javac/modules/ServiceProvidedButNotExportedOrUsedTest.java test/tools/javac/modules/SingleModuleModeTest.java test/tools/javac/modules/SubpackageTest.java test/tools/javac/modules/UpgradeModulePathTest.java test/tools/javac/modules/UsesTest.java test/tools/javac/modules/XModuleTest.java test/tools/javac/newlines/NewLineTest.java test/tools/javac/options/modes/Tester.java test/tools/javac/options/xprefer/XPreferTest.java test/tools/javac/platform/PlatformProviderTest.java test/tools/javac/plugin/showtype/Test.java test/tools/javac/processing/T8142931.java test/tools/javac/processing/environment/ProcessingEnvAnnoDiscovery.java test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Processor.java test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Source.java test/tools/javac/processing/errors/EnsureMirroredTypeException/Processor.java test/tools/javac/processing/errors/EnsureMirroredTypeException/Source.java test/tools/javac/processing/errors/StopOnInapplicableAnnotations/GenerateFunctionalInterface.java test/tools/javac/processing/errors/StopOnInapplicableAnnotations/GenerateSuperInterfaceProcessor.java test/tools/javac/processing/errors/TestBadProcessor.java test/tools/javac/processing/loader/testClose/TestClose.java test/tools/javac/processing/loader/testClose/TestClose2.java test/tools/javac/processing/messager/MessagerDiags.java test/tools/javac/processing/model/TestSymtabItems.java test/tools/javac/processing/model/element/8009367/TestQualifiedNameUsed.java test/tools/javac/processing/model/element/TestEmptyContainer.java test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java test/tools/javac/processing/model/element/TestNonInherited.java test/tools/javac/processing/model/inheritedByType/EnsureOrder.java test/tools/javac/processing/model/testgetallmembers/Main.java test/tools/javac/processing/model/type/BasicAnnoTests.java test/tools/javac/processing/model/type/BoundsTest.java test/tools/javac/processing/model/type/NoTypes.java test/tools/javac/processing/rounds/BaseClassesNotReRead.java test/tools/javac/processing/rounds/CompleteOnClosed.java test/tools/javac/processing/rounds/OverwriteBetweenCompilations.java test/tools/javac/profiles/ProfileTest.java test/tools/javac/proprietary/WarnClass.java test/tools/javac/proprietary/WarnClass.out test/tools/javac/proprietary/WarnImport.java test/tools/javac/proprietary/WarnImport.out test/tools/javac/proprietary/WarnMethod.java test/tools/javac/proprietary/WarnMethod.out test/tools/javac/proprietary/WarnStaticImport.java test/tools/javac/proprietary/WarnStaticImport.out test/tools/javac/proprietary/WarnVariable.java test/tools/javac/proprietary/WarnVariable.out test/tools/javac/proprietary/WarnWildcard.java test/tools/javac/proprietary/WarnWildcard.out test/tools/javac/redefineObject/Object1-test.java test/tools/javac/redefineObject/Object1.out test/tools/javac/redefineObject/Object2-test.java test/tools/javac/redefineObject/Object2.out test/tools/javac/redefineObject/java.base/Object1.java test/tools/javac/redefineObject/java.base/Object2.java test/tools/javac/resolve/BitWiseOperators.java test/tools/javac/scope/DupUnsharedTest.java test/tools/javac/scope/HashCollisionTest.java test/tools/javac/scope/RemoveSymbolUnitTest.java test/tools/javac/scope/StarImportTest.java test/tools/javac/stackmap/StackMapTest.java test/tools/javac/sym/ElementStructureTest.java test/tools/javac/synthesize/Boolean.java test/tools/javac/synthesize/Byte.java test/tools/javac/synthesize/Character.java test/tools/javac/synthesize/Cloneable.java test/tools/javac/synthesize/Double.java test/tools/javac/synthesize/Float.java test/tools/javac/synthesize/Integer.java test/tools/javac/synthesize/Long.java test/tools/javac/synthesize/Main.java test/tools/javac/synthesize/Number.java test/tools/javac/synthesize/Object.java test/tools/javac/synthesize/Serializable.java test/tools/javac/synthesize/Short.java test/tools/javac/synthesize/Test.java test/tools/javac/synthesize/Void.java test/tools/javac/synthesize/src/Boolean.java test/tools/javac/synthesize/src/Byte.java test/tools/javac/synthesize/src/Character.java test/tools/javac/synthesize/src/Cloneable.java test/tools/javac/synthesize/src/Double.java test/tools/javac/synthesize/src/Float.java test/tools/javac/synthesize/src/Integer.java test/tools/javac/synthesize/src/Long.java test/tools/javac/synthesize/src/Number.java test/tools/javac/synthesize/src/Object.java test/tools/javac/synthesize/src/Serializable.java test/tools/javac/synthesize/src/Short.java test/tools/javac/synthesize/src/Test.java test/tools/javac/synthesize/src/Void.java test/tools/javac/synthesize/src/module-info.java test/tools/javac/tree/8067914/NukeExtraCast.java test/tools/javac/tree/ArrayTypeToString.java test/tools/javac/tree/MakeTypeTest.java test/tools/javac/tree/ScopeTest.java test/tools/javac/treeannotests/AnnoTreeTests.java test/tools/javac/treeannotests/TestProcessor.java test/tools/javac/types/ScopeListenerTest.java test/tools/javac/types/TestComparisons.java test/tools/javac/util/T6597678.java test/tools/javac/warnings/6594914/T6594914b.out test/tools/javac/warnings/VerifyLintDescriptions.java test/tools/javadoc/6227454/Test.java test/tools/javadoc/6964914/Test.java test/tools/javadoc/6964914/TestStdDoclet.java test/tools/javadoc/6964914/TestUserDoclet.java test/tools/javadoc/CheckResourceKeys.java test/tools/javadoc/CompletionError.java test/tools/javadoc/api/basic/TagletPathTest.java test/tools/javah/6257087/T6257087.java test/tools/javah/ModuleClass.java test/tools/javah/T4942232/MissingParamClassTest.java test/tools/javah/constMacroTest/ConstMacroTest.java test/tools/javap/4111861/T4111861.java test/tools/javap/4798312/JavapShouldLoadClassesFromRTJarTest.java test/tools/javap/4866831/PublicInterfaceTest.java test/tools/javap/4870651/T4870651.java test/tools/javap/6937244/T6937244.java test/tools/javap/6937244/T6937244A.java test/tools/javap/8006334/JavapTaskCtorFailWithNPE.java test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java test/tools/javap/AccessModifiers.java test/tools/javap/BadAttributeLength.java test/tools/javap/BoundsTypeVariableTest.java test/tools/javap/DescriptorTest.java test/tools/javap/ExtPath.java test/tools/javap/InvalidOptions.java test/tools/javap/MethodParameters.java test/tools/javap/StackMapTableTest.java test/tools/javap/T4075403.java test/tools/javap/T4459541.java test/tools/javap/T4501660.java test/tools/javap/T4501661.java test/tools/javap/T4777949.java test/tools/javap/T4876942.java test/tools/javap/T4880663.java test/tools/javap/T4880672.java test/tools/javap/T4884240.java test/tools/javap/T4975569.java test/tools/javap/T6271787.java test/tools/javap/T6474890.java test/tools/javap/T6587786.java test/tools/javap/T6622216.java test/tools/javap/T6622232.java test/tools/javap/T6622260.java test/tools/javap/T6715251.java test/tools/javap/T6715753.java test/tools/javap/T6715767.java test/tools/javap/T6729471.java test/tools/javap/T6824493.java test/tools/javap/T6863746.java test/tools/javap/T6866657.java test/tools/javap/T6868539.java test/tools/javap/T6879371.java test/tools/javap/T6980017.java test/tools/javap/T7004698.java test/tools/javap/T7186925.java test/tools/javap/T7190862.java test/tools/javap/T8032814.java test/tools/javap/T8032819.java test/tools/javap/T8033180.java test/tools/javap/T8033711.java test/tools/javap/T8035104.java test/tools/javap/T8038414.java test/tools/javap/TestSuperclass.java test/tools/javap/WhitespaceTest.java test/tools/javap/classfile/6888367/T6888367.java test/tools/javap/stackmap/StackmapTest.java test/tools/javap/typeAnnotations/T6855990.java test/tools/jdeps/APIDeps.java test/tools/jdeps/Basic.java test/tools/jdeps/CompilerUtils.java test/tools/jdeps/DotFileTest.java test/tools/jdeps/VerboseFormat/JdepsDependencyClosure.java test/tools/jdeps/VerboseFormat/use/indirect/DontUseJdkInternal2.java test/tools/jdeps/VerboseFormat/use/indirect/DontUseUnsafe2.java test/tools/jdeps/VerboseFormat/use/indirect/UseJdkInternalIndirectly.java test/tools/jdeps/VerboseFormat/use/indirect/UseUnsafeIndirectly.java test/tools/jdeps/VerboseFormat/use/indirect2/DontUseJdkInternal3.java test/tools/jdeps/VerboseFormat/use/indirect2/DontUseUnsafe3.java test/tools/jdeps/VerboseFormat/use/indirect2/UseJdkInternalIndirectly2.java test/tools/jdeps/VerboseFormat/use/indirect2/UseUnsafeIndirectly2.java test/tools/jdeps/VerboseFormat/use/internal/DontUseJdkInternal.java test/tools/jdeps/VerboseFormat/use/internal/UseClassWithJdkInternal.java test/tools/jdeps/VerboseFormat/use/internal/UseJdkInternalClass.java test/tools/jdeps/VerboseFormat/use/internal/UseJdkInternalClass2.java test/tools/jdeps/VerboseFormat/use/unsafe/DontUseUnsafe.java test/tools/jdeps/VerboseFormat/use/unsafe/UseClassWithUnsafe.java test/tools/jdeps/VerboseFormat/use/unsafe/UseUnsafeClass.java test/tools/jdeps/VerboseFormat/use/unsafe/UseUnsafeClass2.java test/tools/jdeps/f/F.java test/tools/jdeps/javax/activity/NotCompactProfile.java test/tools/jdeps/jdk.unsupported/Foo.java test/tools/jdeps/jdk.unsupported/JDKUnsupportedTest.java test/tools/jdeps/modules/GenModuleInfo.java test/tools/jdeps/modules/ModuleTest.java test/tools/jdeps/modules/src/m1/module-info.java test/tools/jdeps/modules/src/m1/p1/Goo.java test/tools/jdeps/modules/src/m1/p1/Lib.java test/tools/jdeps/modules/src/m1/p1/S.java test/tools/jdeps/modules/src/m1/p1/internal/Impl.java test/tools/jdeps/modules/src/m2/module-info.java test/tools/jdeps/modules/src/m2/p2/Bar.java test/tools/jdeps/modules/src/m2/p2/internal/T2.java test/tools/jdeps/modules/src/m3/module-info.java test/tools/jdeps/modules/src/m3/p3/Foo.java test/tools/jdeps/modules/src/m3/p3/Main.java test/tools/jdeps/modules/src/m4/module-info.java test/tools/jdeps/modules/src/m4/p4/Lib.java test/tools/jdeps/modules/src/m4/p4/internal/Impl.java test/tools/jdeps/modules/src/unsupported/module-info.java test/tools/jdeps/modules/src/unsupported/q/Counter.java test/tools/jdeps/p/Bar.java test/tools/lib/ToolBox.java test/tools/sjavac/ApiExtraction.java test/tools/sjavac/ClasspathDependencies.java test/tools/sjavac/CompileCircularSources.java test/tools/sjavac/CompileExcludingDependency.java test/tools/sjavac/CompileWithAtFile.java test/tools/sjavac/CompileWithInvisibleSources.java test/tools/sjavac/CompileWithOverrideSources.java test/tools/sjavac/HiddenFiles.java test/tools/sjavac/IncCompInheritance.java test/tools/sjavac/IncCompileChangeNative.java test/tools/sjavac/IncCompileDropClasses.java test/tools/sjavac/IncCompileFullyQualifiedRef.java test/tools/sjavac/IncCompileNoChanges.java test/tools/sjavac/IncCompileUpdateNative.java test/tools/sjavac/IncCompileWithChanges.java test/tools/sjavac/IncludeExcludePatterns.java test/tools/sjavac/NoState.java test/tools/sjavac/OverlappingSrcDst.java test/tools/sjavac/PackagePathMismatch.java test/tools/sjavac/ParallelCompilations.java test/tools/sjavac/PermittedArtifact.java test/tools/sjavac/StateDir.java
diffstat 921 files changed, 28044 insertions(+), 11557 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileInterim.gmk	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/CompileInterim.gmk	Thu Mar 17 19:04:28 2016 +0000
@@ -32,23 +32,35 @@
 include SetupJavaCompilers.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
-# as it will be used together with the interim javac.
-$(eval $(call SetupJavaCompilation,BUILD_INTERIM_LANGTOOLS, \
-    SETUP := BOOT_JAVAC, \
-    DISABLE_SJAVAC := true, \
-    SRC := $(LANGTOOLS_TOPDIR)/src/java.compiler/share/classes \
-      $(LANGTOOLS_TOPDIR)/src/jdk.compiler/share/classes \
-      $(LANGTOOLS_TOPDIR)/src/jdk.javadoc/share/classes \
-      $(LANGTOOLS_TOPDIR)/src/jdk.jdeps/share/classes \
-      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.compiler \
-      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.javadoc \
-      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdeps, \
-    EXCLUDES := sun, \
-    COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
-    BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_interim_classes, \
-    JAR := $(INTERIM_LANGTOOLS_JAR)))
+# Setup the rules to build interim langtools, 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. Each module is compiled separately to allow a modular
+# boot jdk to override system classes using -Xoverride:.
 
-all: $(BUILD_INTERIM_LANGTOOLS)
+# Param 1 - Name of module to compile
+# Param 2 - Name of modules to depend on
+define SetupInterimModule
+  $$(eval $$(call SetupJavaCompilation,BUILD_INTERIM_$(strip $1), \
+      SETUP := BOOT_JAVAC, \
+      DISABLE_SJAVAC := true, \
+      SRC := $(LANGTOOLS_TOPDIR)/src/$(strip $1)/share/classes \
+          $$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)), \
+      EXCLUDES := sun com/sun/tools/jdeps com/sun/tools/javap, \
+      EXCLUDE_FILES := module-info.java, \
+      COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
+      BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/$(strip $1), \
+      ADD_JAVAC_FLAGS := -Xbootclasspath/p:$$(call PathList, \
+          $$(foreach m, $2, $(BUILDTOOLS_OUTPUTDIR)/override_modules/$$m)), \
+  ))
+
+  $$(BUILD_INTERIM_$(strip $1)): $$(foreach m, $2, $$(BUILD_INTERIM_$(strip $$m)))
+
+  TARGETS += $$(BUILD_INTERIM_$(strip $1))
+endef
+
+$(eval $(call SetupInterimModule, java.compiler))
+$(eval $(call SetupInterimModule, jdk.compiler, java.compiler))
+$(eval $(call SetupInterimModule, jdk.jdeps, jdk.compiler java.compiler))
+$(eval $(call SetupInterimModule, jdk.javadoc, java.compiler jdk.compiler))
+
+all: $(TARGETS)
--- a/make/build.properties	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/build.properties	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,58 +24,13 @@
 #
 
 #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
+javac.opts = -XDignore.symbol.file=true -Xlint:all,-deprecation,-options -Werror -g:source,lines,vars
+javac.source = 9
+javac.target = 9
 
-#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
-
-#configuration of submodules (share by both the bootstrap and normal compilation):
-langtools.modules=java.compiler:jdk.compiler:jdk.jdeps:jdk.javadoc:jdk.jshell:jdk.internal.le:jdk.jdi
-java.compiler.dependencies=
-jdk.compiler.dependencies=java.compiler
-jdk.javadoc.dependencies=java.compiler:jdk.compiler
-jdk.jdeps.dependencies=java.compiler:jdk.compiler
-jdk.internal.le.dependencies=
-jdk.jdi.dependencies=
-jdk.jshell.dependencies=java.compiler:jdk.internal.le:jdk.compiler:jdk.jdi
-
-tool.javac.main.class=com.sun.tools.javac.Main
-tool.javadoc.main.class=com.sun.tools.javadoc.Main
-tool.javap.main.class=com.sun.tools.javap.Main
-tool.javah.main.class=com.sun.tools.javah.Main
-tool.sjavac.main.class=com.sun.tools.sjavac.Main
-tool.jshell.main.class=jdk.internal.jshell.tool.JShellTool
-
-javac.resource.includes = \
+langtools.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™ Language Specification
-javadoc.jls.option=-tag "jls:a:See <cite>${javadoc.jls.cite}</cite>:" \
-    -tag "implNote:a:Implementation Note:"
-
 # Version info -- override as needed
 jdk.version = 9
 build.number = b00
@@ -89,3 +44,14 @@
 # FIXME -- need to include openjdk as needed
 release = ${jdk.version}-${milestone}
 full.version = ${release}+${build.number}
+
+#tools configuration:
+tool.javac.main.class=com.sun.tools.javac.Main
+tool.javadoc.main.class=jdk.javadoc.internal.tool.Main
+tool.javap.main.class=com.sun.tools.javap.Main
+tool.javah.main.class=com.sun.tools.javah.Main
+tool.sjavac.main.class=com.sun.tools.sjavac.Main
+tool.jshell.main.class=jdk.internal.jshell.tool.JShellTool
+
+#test configuration:
+jtreg.tests=
--- a/make/build.xml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/build.xml	Thu Mar 17 19:04:28 2016 +0000
@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2007, 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.
--->
+  ~ Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  ~
+  ~ This code is free software; you can redistribute 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 is a convenience build file supporting development in the langtools
@@ -33,33 +33,23 @@
  External dependencies are specified via properties. These can be given
  on the command line, or by providing a local build.properties file.
  (They can also be edited into make/build.properties, although that is not
- recommended.)  At a minimum, boot.java.home must be set to the installed
+ recommended.)  At a minimum, langtools.jdk.home must be set to the installed
  location of the version of JDK used to build this repository. Additional
  properties may be required, depending on the targets that are built.
- 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 example, to run any of the jtreg tests you must set jtreg.home.
 
- The main build happens in two phases:
- - 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 build generally builds one module at time.
+ The output of the build is as follows:
 
- For more details on the stub generator, see
-    http://blogs.sun.com/jjg/entry/building_javac_for_jdk7
-
- Internal details ...
-
- 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.
+ build
+   |-bin (scripts to invoke various tools, javac, javah etc.)
+   |-genrsc (generated sources - i.e. properties)
+   |-modules (compiled classes in a modular layout)
+   |-jtreg (test work/results)
+   |-toolclasses (tools used for building - like the property compiler)
 
  This file is organized into sections as follows:
  - global property definitions
- - primary top level targets (cleaning, building, testing, producing javac)
- - secondary top level targets (code analysis, diagnostics, extra documentation, etc.)
+ - primary top level targets (cleaning, building)
  - utility definitions
  -->
 
@@ -80,25 +70,19 @@
     <property file="${user.home}/.openjdk/build.properties"/>
 
     <!-- Convenient shorthands for standard locations within the workspace. -->
-    <property name="build.dir" location="build"/>
-    <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.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="src.dir" location="src"/>
+    <property name="test.dir" location="test"/>
     <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="test.dir" location="test"/>
+    <property name="build.dir" location="build"/>
+    <property name="build.modules" location="${build.dir}/modules"/>
+    <property name="build.gensrc" location="${build.dir}/gensrc"/>
+    <property name="build.tools" location="${build.dir}/toolclasses"/>
+    <property name="build.bin" location="${build.dir}/bin"/>
+    <property name="build.jtreg" location="${build.dir}/jtreg"/>
+    <property name="build.prevsrc" location="${build.dir}/prevsrc"/>
 
-    <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
@@ -113,786 +97,28 @@
     <!-- Standard property values, if not overriden by earlier settings. -->
     <property file="${make.dir}/build.properties"/>
 
+    <condition property="langtools.jdk.home" value="${jdk.home}">
+        <isset property="jdk.home" />
+    </condition>
+
     <!-- launcher.java is used in the launcher scripts provided to run
         the tools' jar files.  If it has not already been set, then
-        default it to use ${target.java.home}, if available, otherwise
+        default it to use ${langtools.jdk.home}, if available, otherwise
         quietly default to simply use "java". -->
     <condition property="launcher.java"
-        value="${target.java.home}/bin/java" else="java">
-        <isset property="target.java.home"/>
+        value="${langtools.jdk.home}/bin/java" else="java">
+        <isset property="langtools.jdk.home"/>
     </condition>
 
-    <!-- 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>
-
     <!--
-        **** Primary targets
+        **** Check targets
     -->
 
-    <target name="clean" description="Delete all generated files">
-        <delete dir="${build.dir}"/>
-        <delete dir="${dist.dir}"/>
-    </target>
-
-    <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"/>
-        <build-tool name="jshell"/>
-    </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}"/>
-        <checkstyle config="${make.conf.dir}/checkstyle-langtools.xml"
-              failureProperty="checkstyle.failure"
-              failOnViolation="false">
-            <formatter type="xml" tofile="${dist.checkstyle.dir}/checkstyle_report.xml"/>
-            <fileset dir="src" includes="**/*.java, **/*.properties"/>
-        </checkstyle>
-        <!-- transform the output to a simple html -->
-        <xslt  in="${dist.checkstyle.dir}/checkstyle_report.xml"
-               out="${dist.checkstyle.dir}/checkstyle_report.html"
-               style="${checkstyle.home}/contrib/checkstyle-simple.xsl"/>
-        <!-- transform the output to a very simple emacs friendly text file -->
-        <xslt  in="${dist.checkstyle.dir}/checkstyle_report.xml"
-               out="${dist.checkstyle.dir}/checkstyle_report.tmp"
-               style="${make.conf.dir}/checkstyle-emacs.xsl"/>
-        <!-- beautify remove extra lines -->
-        <move file="${dist.checkstyle.dir}/checkstyle_report.tmp"
-             toFile="${dist.checkstyle.dir}/checkstyle_report.emacs.txt">
-            <filterchain>
-                <ignoreblank/>
-                <replaceregex byline="true" pattern="^File:" replace="${line.separator}File:"/>
-            </filterchain>
-        </move>
-    </target>
-    <!-- target can be invoked from an ide, the output of which can be used
-         to access and fix the errors directly.
-     -->
-    <target name="checkstyle-ide" depends="checkstyle">
-        <concat>
-            <fileset file="${dist.checkstyle.dir}/checkstyle_report.emacs.txt"/>
-        </concat>
-    </target>
-
-    <target name="findbugs" depends="-def-findbugs,build-all-tools">
-        <property name="findbugs.reportLevel" value="medium"/>
-        <mkdir dir="${dist.findbugs.dir}"/>
-        <findbugs
-            home="${findbugs.home}"
-            projectName="JDK langtools ${full.version}"
-            output="xml"
-            outputFile="${dist.findbugs.dir}/findbugs.xml"
-            reportLevel="${findbugs.reportLevel}"
-            failOnError="false"
-            errorProperty="findbugs.all.errors"
-            warningsProperty="findbugs.all.warnings"
-            jvm="${target.java.home}/bin/java"
-            jvmargs="-Xmx512M">
-            <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.jdeps/classes"/>
-            <sourcePath>
-                <pathelement path="${langtools.sources}"/>
-            </sourcePath>
-        </findbugs>
-        <exec executable="sh">
-            <arg value="${findbugs.home}/bin/convertXmlToText"/>
-            <arg value="-longBugCodes"/>
-            <arg value="-html:${findbugs.home}/src/xsl/fancy.xsl"/>
-            <arg value="${dist.findbugs.dir}/findbugs.xml"/>
-            <redirector output="${dist.findbugs.dir}/findbugs.html"/>
-        </exec>
-    </target>
-
-    <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"/>
-        <javac fork="true"
-            executable="${dist.bin.dir}/javac"
-            srcdir="test/tools/javac/diags"
-            destdir="${build.dir}/diag-examples/classes"
-            includes="ArgTypeCompilerFactory.java,Example.java,FileManager.java,HTMLWriter.java,RunExamples.java,DocCommentProcessor.java"
-            sourcepath=""
-            classpath="${langtools.classes}"
-            includeAntRuntime="no"
-            debug="${javac.debug}"
-            debuglevel="${javac.debuglevel}">
-            <compilerarg line="${javac.lint.opts}"/>
-        </javac>
-        <java fork="true"
-            jvm="${target.java.home}/bin/java"
-            dir="test/tools/javac/diags"
-            classpath="${build.dir}/diag-examples/classes;${langtools.classes}"
-            classname="RunExamples">
-            <jvmarg value="-Dtest.classes=${build.dir}/diag-examples/classes"/>
-            <arg value="-examples"/>
-            <arg value="examples"/>
-            <arg value="-o"/>
-            <arg file="${diags.examples.out}"/>
-            <arg value="-showFiles"/>
-            <arg value="-title"/>
-            <arg value="Examples of javac diagnostics"/>
-        </java>
-    </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.java.home}/bin/javac"
-               destdir="${build.dir}/doclint/classes"
-               includes="javax/lang/model/** com/sun/javadoc/** com/sun/source/**"
-               excludes=""
-               sourcepath=""
-               classpath="${langtools.classes}"
-               includeAntRuntime="no"
-               source="${javac.source}"
-               target="${javac.target}"
-               debug="${javac.debug}"
-               debuglevel="${javac.debuglevel}">
-            <compilerarg value="-implicit:none"/>
-            <compilerarg value="-Xprefer:source"/>
-            <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-            <compilerarg line="${javac.extra.opts}"/>
-            <compilerarg line="-Xdoclint:all/protected,-missing"/>
-            <src>
-                <pathelement path="${langtools.sources}"/>
-                <pathelement path="${langtools.gensrc}"/>
-            </src>
-        </javac>
-    </target>
-
-    <!-- Generate API docs for "important" test classes that are used by
-         multiple tests.
-    -->
-    <target name="test-framework-docs" depends="build-all-classes">
-        <javadoc executable="${target.java.home}/bin/javadoc"
-                destdir="${build.dir}/testframeworkdocs">
-            <!-- disable doclint for now; it might be good to enable -Xdoclint:missing -->
-            <arg value="-Xdoclint:none"/>
-            <!-- source files to be documented -->
-            <sourcefiles>
-                <fileset dir="${test.dir}">
-                    <include name="**/ToolBox.java"/>
-                    <include name="**/*Tester.java"/>
-                    <include name="**/*TestBase.java"/>
-                    <include name="**/*Testing*.java"/>
-                </fileset>
-            </sourcefiles>
-            <!-- source path used for documentation -->
-            <sourcepath>
-                <pathelement path="${test.dir}/lib"/>
-                <pathelement path="${test.dir}/lib/combo"/>
-                <pathelement path="${test.dir}/tools/javac/lib"/>
-                <pathelement path="${test.dir}/tools/javac/classfiles/attributes/LocalVariableTable"/>
-            </sourcepath>
-            <!-- exclude the following "packages" found by <javadoc>
-                on the sourcepath -->
-            <excludepackage name="combo.tools.javac.combo"/>
-            <excludepackage name="tools.javac.combo"/>
-            <!-- library classes used for documentation -->
-            <classpath>
-                <pathelement path="${jtreg.home}/lib/testng.jar"/>
-            </classpath>
-            <!-- platform classes used for documentation -->
-            <bootclasspath>
-                <pathelement path="${langtools.classes}"/>
-                <pathelement path="${target.java.home}/jre/lib/rt.jar"/>
-            </bootclasspath>
-        </javadoc>
-    </target>
-
-    <target name="sanity"
-        description="display settings of configuration values">
-        <echo level="info">ant.home = ${ant.home}</echo>
-        <echo level="info">boot.java.home = ${boot.java.home}</echo>
-        <echo level="info">target.java.home = ${target.java.home}</echo>
-        <echo level="info">jtreg.home = ${jtreg.home}</echo>
-        <echo level="info">findbugs.home = ${findbugs.home}</echo>
-        <echo level="info">checkstyle.home = ${checkstyle.home}</echo>
-    </target>
-
-    <target name="diagnostics">
-        <diagnostics/>
-    </target>
-
-    <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.crules.dir}/classes" />
-    </target>
-
-    <!--
-    **** IDE support
-    -->
-
-    <target name="idea">
-        <mkdir dir=".idea"/>
-        <copy todir=".idea" >
-            <fileset dir="make/intellij" excludes="**/src/**"/>
-        </copy>
-        <condition property="idea.jtreg.home" value="${jtreg.home}" else = "[jtreg.home]">
-            <isset property="jtreg.home"/>
-        </condition>
-        <condition property="idea.target.jdk" value="${target.java.home}" else = "$JDKPath$">
-            <isset property="target.java.home"/>
-        </condition>
-        <replace file=".idea/ant.xml" token="@IDEA_JTREG_HOME@" value="${idea.jtreg.home}"/>
-        <replace file=".idea/ant.xml" token="@IDEA_TARGET_JDK@" value="${idea.target.jdk}"/>
-        <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"/>
-    </target>
-
-    <!--
-    **** Check targets.
-    **** "-check-*" targets check that a required property is set, and set to a reasonable value.
-    **** A user friendly message is generated if not, and the build exits.
-    -->
-
-    <target name="-check-boot.java.home" depends="-def-check">
-        <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
-    </target>
-
-    <target name="-check-target.java.home" depends="-def-check">
-        <check name="target java" property="target.java.home" marker="${java.marker}"/>
-    </target>
-
-    <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">
-        <check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/>
-    </target>
-
-    <target name="-check-checkstyle.home" depends="-def-check">
-        <check name="checkstyle" property="checkstyle.home" marker=""/> <!--TODO: better checkstyle verification-->
-    </target>
-
-    <!-- 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.jdeps" compilation.kind="@{compilation.kind}" />
-                <build-module-jar module.name="jdk.internal.le" compilation.kind="@{compilation.kind}" />
-                <build-module-jar module.name="jdk.jdi" compilation.kind="@{compilation.kind}" />
-                <build-module-jar module.name="jdk.jshell" compilation.kind="@{compilation.kind}" />
-            </sequential>
-        </macrodef>
-    </target>
-
-    <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>
-
-    <target name="-def-build-tool">
-        <macrodef name="build-tool">
-            <attribute name="name"/>
-            <attribute name="compilation.kind" default=""/>
-            <attribute name="bin.dir" default="${@{compilation.kind}dist.bin.dir}"/>
-            <attribute name="java" default="${launcher.java}"/>
-            <attribute name="main.class" default="${tool.@{name}.main.class}"/>
-            <sequential>
-                <mkdir dir="@{bin.dir}"/>
-                <copy file="${make.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
-                    <filterset begintoken="#" endtoken="#">
-                        <filter token="PROGRAM" value="@{main.class}"/>
-                        <filter token="TARGET_JAVA" value="@{java}"/>
-                        <filter token="PS" value="${path.separator}"/>
-                    </filterset>
-                </copy>
-                <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-build-all-module-classes" depends="-def-build-module-classes">
-        <macrodef name="build-all-module-classes">
-            <attribute name="compilation.kind" default=""/>
-            <sequential>
-                <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.jdeps"
-                                      compilation.kind="@{compilation.kind}" />
-                <copy-module-classes  module.name="jdk.internal.le"
-                                      compilation.kind="@{compilation.kind}" />
-                <copy-module-classes  module.name="jdk.jdi"
-                                      compilation.kind="@{compilation.kind}" />
-                <build-module-classes module.name="jdk.jshell"
-                                      compilation.kind="@{compilation.kind}" />
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-build-module-classes" depends="-def-pcompile,-def-pparse,-def-cdumper">
-        <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.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="${@{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: 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="@{depcache.dir}"/>
-                <pcompile destdir="@{gensrc.dir}"
-                          includes="@{includes}">
-                    <src>
-                        <path location="${src.dir}"/>
-                    </src>
-                </pcompile>
-                <pparse destdir="@{gensrc.dir}"
-                        includes="@{resource.includes}">
-                    <src>
-                        <path location="${src.dir}"/>
-                    </src>
-                </pparse>
-                <copy todir="@{gensrc.dir}">
-                    <fileset dir="${src.dir}" includes="@{includes}" />
-                    <globmapper from="*.properties-template" to="*.properties"/>
-                    <filterset begintoken="$(" endtoken=")">
-                        <filter token="JDK_VERSION" value="${jdk.version}"/>
-                        <filter token="RELEASE" value="@{release}"/>
-                        <filter token="FULL_VERSION" value="@{full.version}"/>
-                    </filterset>
-                </copy>
-                <pcompile destdir="@{gensrc.dir}"
-                          includes="**/*.properties">
-                    <src>
-                        <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="${src.dir}:@{gensrc.dir}"
-                       classpath="${classpath}"
-                       includeAntRuntime="no"
-                       source="@{source}"
-                       target="@{target}"
-                       debug="${javac.debug}"
-                       debuglevel="${javac.debuglevel}">
-                    <compilerarg value="-implicit:none"/>
-                    <compilerarg value="-Xprefer:source"/>
-                    <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 location="${src.dir}"/>
-                        <path location="@{gensrc.dir}"/>
-                    </src>
-                </javac>
-                <copy todir="@{classes.dir}" includeemptydirs="false">
-                    <fileset dir="${src.dir}" includes="@{includes}" excludes="@{excludes}">
-                        <exclude name="**/*.java"/>
-                        <exclude name="**/*.properties"/>
-                        <exclude name="**/*-template"/>
-                        <exclude name="**/*.rej"/>
-                        <exclude name="**/*.orig"/>
-                        <exclude name="**/overview.html"/>
-                        <exclude name="**/package.html"/>
-                    </fileset>
-                </copy>
-            </sequential>
-        </macrodef>
-        <macrodef name="copy-module-classes">
-            <attribute name="module.name"/>
-            <attribute name="compilation.kind" default=""/>
-            <attribute name="build.dir" default="${@{compilation.kind}build.dir}"/>
-            <attribute name="classes.dir" default="@{build.dir}/@{module.name}/classes"/>
-            <attribute name="java.home" default="${boot.java.home}"/>
-            <sequential>
-                <property name="classes.origin.dir" location="${target.java.home}/../../jdk/modules/@{module.name}"/>
-                <mkdir dir="@{classes.dir}"/>
-                <dumpclasses moduleName="@{module.name}" destDir="@{classes.dir}" />
-            </sequential>
-        </macrodef>
-    </target>
-
-    <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-cdumper">
-        <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="anttasks/DumpClass*"
-               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="dumpclasses"
-                 classname="anttasks.DumpClassesTask"
-                 classpath="${build.toolclasses.dir}/:${target.java.home}/jrt-fs.jar"/>
-    </target>
-
-    <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">
-        <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="compileproperties/* anttasks/CompileProperties* 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="pcompile"
-                 classname="anttasks.CompilePropertiesTask"
-                 classpath="${build.toolclasses.dir}/"/>
-    </target>
-
-    <target name="-def-javadoc-tool" depends="-check-target.java.home">
-        <macrodef name="javadoc-tool">
-            <attribute name="includes" default="${javac.includes}"/>
-            <attribute name="options" default=""/>
-            <attribute name="source" default="${javac.source}"/>
-            <sequential>
-                <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
-                <!-- Note: even with this default value, includes
-                from source directories get javadoc'd; see packageset below -->
-                <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}"
-                    source="@{source}"
-                    windowtitle="UNOFFICIAL"
-                    failonerror="true"
-                    use="true"
-                    author="false"
-                    version="false"
-                    packagenames="${javadoc.packagenames}" >
-                    <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
-                    <arg line="@{options}"/>
-                    <bootclasspath>
-                        <pathelement path="${langtools.classes}"/>
-                        <path location="${target.java.home}/jre/lib/rt.jar"/>
-                    </bootclasspath>
-                    <sourcepath>
-                        <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="${basedir}/src/java.compiler/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="javax/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${basedir}/src/jdk.compiler/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="com/sun/source/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${basedir}/src/jdk.javadoc/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="com/sun/javadoc/"/>
-                        </or>
-                    </packageset>
-                </javadoc>
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home,-check-target.java.home">
-        <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
-            <classpath>
-                <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
-                <pathelement location="${jtreg.home}/lib/javatest.jar"/>
-            </classpath>
-        </taskdef>
-        <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}"/>
-            <attribute name="options" default="${other.jtreg.options}"/>
-            <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 -->
-                <property name="default.jtreg.verbose" value="summary"/>  <!-- default -->
-                <property name="other.jtreg.options" value=""/>           <!-- default -->
-                <jtreg
-                    dir="${test.dir}"
-                    workDir="${build.jtreg.dir}/@{name}/work"
-                    reportDir="${build.jtreg.dir}/@{name}/report"
-                    jdk="@{jdk}"
-                    samevm="@{samevm}" verbose="@{verbose}"
-                    failonerror="false" resultproperty="jtreg.@{name}.result"
-                    javacoptions="-g"
-                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}@{langtools.classes} @{jpda.jvmargs} @{extra.jvmargs}">
-                    <arg line="@{keywords}"/>
-                    <arg line="@{options}"/>
-                    <arg line="@{tests}"/>
-                </jtreg>
-                <!-- the next two properties are for convenience, when only
-                     a single instance of jtreg will be invoked. -->
-                <condition property="jtreg.passed">
-                    <equals arg1="${jtreg.@{name}.result}" arg2="0"/>
-                </condition>
-                <property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/>
-            </sequential>
-        </macrodef>
-        <property name="jtreg.defined" value="true"/>
-    </target>
-
-    <target name="-def-checkstyle" unless="checkstyle.defined" depends="-check-checkstyle.home">
-        <taskdef resource="checkstyletask.properties">
-            <classpath>
-              <fileset dir="${checkstyle.home}">
-                <include name="checkstyle-*-all.jar"/>
-              </fileset>
-            </classpath>
-        </taskdef>
-        <property name="checkstyle.defined" value="true"/>
-    </target>
-
-    <target name="-def-findbugs" unless="findbugs.defined"
-        depends="-check-findbugs.home,-check-target.java.home">
-        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
-            <classpath>
-                <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
-            </classpath>
-        </taskdef>
-        <macrodef name="findbugs-tool">
-            <attribute name="name"/>
-            <attribute name="output" default="emacs"/>
-            <attribute name="outputFile" default=""/>
-            <attribute name="reportLevel" default="high"/>
-            <sequential>
-                <findbugs
-                    home="${findbugs.home}"
-                    output="@{output}"
-                    outputFile="@{outputFile}"
-                    reportLevel="@{reportLevel}"
-                    failOnError="false"
-                    errorProperty="findbugs.@{name}.errors"
-                    warningsProperty="findbugs.@{name}.warnings"
-                    jvm="${target.java.home}/bin/java"
-                    jvmargs="-Xmx512M" >
-                    <class location="${dist.dir}/lib/@{name}.jar"/>
-                    <auxClasspath>
-                        <pathelement location="${langtools.classes}"/>
-                    </auxClasspath>
-                    <sourcePath>
-                        <path refid="src.dirs"/>
-                    </sourcePath>
-                </findbugs>
-            </sequential>
-        </macrodef>
-        <property name="findbugs.defined" value="true"/>
-    </target>
-
     <target name="-def-check">
-        <macrodef name="check">
-            <attribute name="name"/>
-            <attribute name="property"/>
-            <attribute name="marker" default=""/>
+      <macrodef name="check">
+          <attribute name="name"/>
+          <attribute name="property"/>
+          <attribute name="marker" default=""/>
             <sequential>
                 <fail message="Cannot locate @{name}: please set @{property} to its location">
                     <condition>
@@ -917,5 +143,207 @@
         </macrodef>
     </target>
 
+    <target name="-check-langtools.jdk.home" depends="-def-check">
+        <check name="target java" property="langtools.jdk.home" marker="${java.marker}"/>
+    </target>
+
+    <target name="-check-jtreg.home" depends="-def-check">
+        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
+    </target>
+
+    <!--
+        **** Primary targets
+    -->
+
+    <target name="clean" description="Delete all generated files">
+        <delete dir="${build.dir}"/>
+    </target>
+
+    <target name="build" depends="build-all-tools"/>
+
+    <target name="-prepare-build" depends="-check-langtools.jdk.home">
+        <mkdir dir="${build.modules}"/>
+        <mkdir dir="${build.tools}"/>
+        <mkdir dir="${build.gensrc}"/>
+        <mkdir dir="${build.bin}"/>
+        <mkdir dir="${build.prevsrc}"/>
+    </target>
+
+    <target name="generate-sources-internal">
+        <basename property="module.name" file="${basedir}"/>
+        <pparse destdir="${build.gensrc}/${module.name}" includes="${langtools.resource.includes}">
+            <src path="./share/classes"/>
+        </pparse>
+        <pcompile destdir="${build.gensrc}/${module.name}" includes="**/*.properties">
+            <src path="./share/classes"/>
+        </pcompile>
+    </target>
+
+    <target name="generate-sources"  depends="-prepare-build,-def-pparse,-def-pcompile">
+        <subant inheritall="true" target="generate-sources-internal" genericantfile="${make.dir}/build.xml">
+              <dirset dir="${src.dir}" includes="*.*"/>
+        </subant>
+    </target>
+
+    <target name="build-all-classes" depends="generate-sources">
+        <exec executable="${langtools.jdk.home}/bin/javac" failonerror="true">
+            <arg line="-source ${javac.source} -target ${javac.target}" />
+            <arg value="-d" />
+            <arg value="${build.modules}" />
+            <arg line="${javac.opts} -modulesourcepath ${src.dir}${file.separator}*${file.separator}share${file.separator}classes:${build.gensrc} -m java.compiler,jdk.compiler,jdk.javadoc,jdk.jdeps,jdk.jshell" />
+        </exec>
+        <delete>
+            <fileset dir="${build.modules}" includes="**/module-info.class"/>
+        </delete>
+    </target>
+
+    <target name="build-all-tools" depends="build-all-classes, -def-build-tool">
+        <build-tool name="javac"/>
+        <build-tool name="javadoc"/>
+        <build-tool name="javap"/>
+        <build-tool name="javah"/>
+        <build-tool name="jdeps"/>
+        <build-tool name="sjavac"/>
+        <build-tool name="jshell"/>
+    </target>
+
+    <target name="jtreg" depends="build-all-tools,-def-jtreg">
+        <jtreg-tool name="all" tests="${jtreg.tests}"/>
+    </target>
+
+    <!--
+    **** IDE support
+    -->
+
+    <target name="idea" depends="-check-langtools.jdk.home">
+        <mkdir dir=".idea"/>
+        <copy todir=".idea" >
+            <fileset dir="make/intellij" excludes="**/src/**"/>
+        </copy>
+        <condition property="idea.jtreg.home" value="${jtreg.home}" else = "[jtreg.home]">
+            <isset property="jtreg.home"/>
+        </condition>
+        <condition property="idea.target.jdk" value="${langtools.jdk.home}" else = "$JDKPath$">
+            <isset property="langtools.jdk.home"/>
+        </condition>
+        <replace file=".idea/ant.xml" token="@IDEA_JTREG_HOME@" value="${idea.jtreg.home}"/>
+        <replace file=".idea/ant.xml" token="@IDEA_TARGET_JDK@" value="${idea.target.jdk}"/>
+        <replace file=".idea/workspace.xml" token="@IDEA_TARGET_JDK@" value="${idea.target.jdk}"/>
+        <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"/>
+    </target>
+
+    <!--
+        **** Utility definitions
+    -->
+
+    <target name="-def-pparse">
+        <copy todir="${build.tools}/propertiesparser" >
+            <fileset dir="${make.tools.dir}/propertiesparser" includes="**/resources/**"/>
+        </copy>
+        <javac fork="true"
+               source="${javac.source}"
+               target="${javac.target}"
+               executable="${langtools.jdk.home}/bin/javac"
+               srcdir="${make.tools.dir}"
+               includes="propertiesparser/* anttasks/PropertiesParser* anttasks/PathFileSet*"
+               destdir="${build.tools}"
+               classpath="${ant.core.lib}"
+               bootclasspath="${langtools.jdk.home}/jre/lib/rt.jar"
+               includeantruntime="false">
+            <compilerarg line="${javac.opts} -XDstringConcat=inline"/>
+        </javac>
+        <taskdef name="pparse"
+                 classname="anttasks.PropertiesParserTask"
+                 classpath="${build.tools}"/>
+    </target>
+
+     <target name="-def-pcompile">
+        <javac fork="true"
+               source="${javac.source}"
+               target="${javac.target}"
+               executable="${langtools.jdk.home}/bin/javac"
+               srcdir="${make.tools.dir}"
+               includes="compileproperties/* anttasks/CompileProperties* anttasks/PathFileSet*"
+               destdir="${build.dir}/toolclasses/"
+               classpath="${ant.core.lib}"
+               includeantruntime="false">
+            <compilerarg line="${javac.opts} -XDstringConcat=inline"/>
+        </javac>
+        <taskdef name="pcompile"
+                 classname="anttasks.CompilePropertiesTask"
+                 classpath="${build.tools}"/>
+    </target>
+
+    <target name="-def-build-tool">
+        <macrodef name="build-tool">
+            <attribute name="name"/>
+            <attribute name="compilation.kind" default=""/>
+            <attribute name="bin.dir" default="${build.bin}"/>
+            <attribute name="java" default="${launcher.java}"/>
+            <attribute name="main.class" default="${tool.@{name}.main.class}"/>
+            <sequential>
+                <mkdir dir="@{bin.dir}"/>
+                <copy file="${make.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
+                    <filterset begintoken="#" endtoken="#">
+                        <filter token="PROGRAM" value="@{main.class}"/>
+                        <filter token="TARGET_JAVA" value="@{java}"/>
+                        <filter token="PS" value="${path.separator}"/>
+                    </filterset>
+                </copy>
+                <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
+            </sequential>
+        </macrodef>
+    </target>
+
+    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home,-check-langtools.jdk.home">
+        <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
+            <classpath>
+                <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
+                <pathelement location="${jtreg.home}/lib/javatest.jar"/>
+            </classpath>
+        </taskdef>
+        <macrodef name="jtreg-tool">
+            <attribute name="name"/>
+            <attribute name="tests"/>
+            <attribute name="jdk" default="${langtools.jdk.home}"/>
+            <attribute name="agentvm" default="true"/>
+            <attribute name="verbose" default="${default.jtreg.verbose}"/>
+            <attribute name="options" default="${other.jtreg.options}"/>
+            <attribute name="keywords" default="-keywords:!ignore"/>
+            <attribute name="jpda.jvmargs" default=""/>
+            <attribute name="extra.jvmargs" default=""/>
+            <attribute name="build.modules" default="${build.modules}"/>
+            <sequential>
+                <property name="coverage.options" value=""/>              <!-- default -->
+                <property name="coverage.classpath" value=""/>            <!-- default -->
+                <property name="default.jtreg.verbose" value="summary"/>  <!-- default -->
+                <property name="other.jtreg.options" value=""/>           <!-- default -->
+                <property name="jtreg.classfiles.to.modules" value="@{agentvm}"/>
+                <jtreg
+                    dir="${test.dir}"
+                    workDir="${build.jtreg}/@{name}/work"
+                    reportDir="${build.jtreg}/@{name}/report"
+                    jdk="@{jdk}"
+                    agentvm="@{agentvm}" verbose="@{verbose}"
+                    failonerror="false" resultproperty="jtreg.@{name}.result"
+                    vmoptions="${coverage.options} @{extra.jvmargs} -Xpatch:@{build.modules}">
+                    <arg value="-debug:@{jpda.jvmargs}"/>
+                    <arg line="@{keywords}"/>
+                    <arg line="@{options}"/>
+                    <arg line="@{tests}"/>
+                </jtreg>
+                <!-- the next two properties are for convenience, when only
+                     a single instance of jtreg will be invoked. -->
+                <condition property="jtreg.passed">
+                    <equals arg1="${jtreg.@{name}.result}" arg2="0"/>
+                </condition>
+                <property name="jtreg.report" value="${build.jtreg}/@{name}/report"/>
+            </sequential>
+        </macrodef>
+        <property name="jtreg.defined" value="true"/>
+    </target>
 </project>
-
--- a/make/gendata/Gendata-jdk.compiler.gmk	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/gendata/Gendata-jdk.compiler.gmk	Thu Mar 17 19:04:28 2016 +0000
@@ -39,6 +39,10 @@
     BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols, \
 ))
 
+ifeq ($(BOOT_JDK_MODULAR), true)
+  COMPILECREATESYMBOLS_ADD_EXPORTS := -XaddExports:jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED,jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
+endif
+
 $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \
     $(COMPILE_CREATE_SYMBOLS) \
     $(wildcard $(LANGTOOLS_TOPDIR)/make/data/symbols/*)
@@ -46,6 +50,7 @@
 	$(MKDIR) -p $(@D)
 	$(ECHO) Creating ct.sym classes
 	$(JAVA) $(INTERIM_LANGTOOLS_ARGS) \
+	    $(COMPILECREATESYMBOLS_ADD_EXPORTS) \
 	    -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \
 	    build.tools.symbolgenerator.CreateSymbols \
 	    build-ctsym \
--- a/make/intellij/ant.xml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/intellij/ant.xml	Thu Mar 17 19:04:28 2016 +0000
@@ -3,16 +3,12 @@
   <component name="AntConfiguration">
     <buildFile url="file://$PROJECT_DIR$/.idea/build.xml">
       <properties>
-        <property name="boot.java.home" value="$JDKPath$" />
         <property name="jtreg.tests" value="$FilePath$" />
-        <property name="target.java.home" value="@IDEA_TARGET_JDK@" />
+        <property name="langtools.jdk.home" value="@IDEA_TARGET_JDK@" />
         <property name="jtreg.home" value="@IDEA_JTREG_HOME@" />
-        <property name="javac.debuglevel" value="source,lines,vars" />
-        <property name="jtreg.jpda.jvmargs" value="-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5900,suspend=y" />
+        <property name="jtreg.jpda.jvmargs" value="-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=5900" />
       </properties>
       <executeOn event="afterCompilation" target="post-make" />
     </buildFile>
   </component>
 </project>
-
-
--- a/make/intellij/build.xml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/intellij/build.xml	Thu Mar 17 19:04:28 2016 +0000
@@ -15,8 +15,7 @@
             <java classname="org.apache.tools.ant.Main" fork="true" spawn="true">
                 <arg value="-f"/>
                 <arg value="@{antfile}"/>
-                <arg value="-Dboot.java.home=${boot.java.home}"/>
-                <arg value="-Dtarget.java.home=${target.java.home}"/>
+                <arg value="-Dlangtools.jdk.home=${langtools.jdk.home}"/>
                 <arg value="-Djtreg.home=${jtreg.home}"/>
                 <arg value="-Djtreg.tests=${jtreg.tests}"/>
                 <arg value="-Djtreg.jpda.jvmargs=${jtreg.jpda.jvmargs}"/>
@@ -28,18 +27,13 @@
         </sequential>
     </macrodef>
 
-    <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">
+    <target name="jtreg-debug" depends="build-all-tools, -def-jtreg">
         <exec-target target="jtreg-debug-internal"/>
     </target>
 
     <target name="jtreg-debug-internal" depends="-def-jtreg">
-        <jtreg-tool name="all" tests="${jtreg.tests}" jpda.jvmargs="${jtreg.jpda.jvmargs}"/>
+        <jtreg-tool name="all" tests="${jtreg.tests}" options="-conc:1" jpda.jvmargs="${jtreg.jpda.jvmargs}"/>
     </target>
 </project>
-
--- a/make/intellij/langtools.iml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/intellij/langtools.iml	Thu Mar 17 19:04:28 2016 +0000
@@ -8,12 +8,11 @@
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.compiler/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.javadoc/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.jdeps/share/classes" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/jdk.jshell/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.javadoc/gensrc" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/jdk.jdeps/gensrc" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/jdk.jshell/share/classes" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/build/gensrc/jdk.compiler" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/build/gensrc/jdk.javadoc" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/build/gensrc/jdk.jdeps" isTestSource="false" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="inheritedJdk" />
--- a/make/intellij/src/idea/LangtoolsIdeaAntLogger.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/intellij/src/idea/LangtoolsIdeaAntLogger.java	Thu Mar 17 19:04:28 2016 +0000
@@ -124,8 +124,8 @@
      * This enum is used to represent the list of tasks we need to keep track of during logging.
      */
     enum Task {
-        /** javac task - invoked during compilation */
-        JAVAC("javac", MessageKind.JAVAC_ERROR, MessageKind.JAVAC_WARNING, MessageKind.JAVAC_NOTE,
+        /** exec task - invoked during compilation */
+        JAVAC("exec", 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, MessageKind.JTREG_TEST_REPORT),
--- a/make/intellij/workspace.xml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/intellij/workspace.xml	Thu Mar 17 19:04:28 2016 +0000
@@ -7,14 +7,14 @@
     <option name="MAKE_PROJECT_ON_SAVE" value="true" />
   </component>
   <component name="RunManager" selected="Application.javac">
-    <!-- standard tools -->
+    <!-- javac -->
     <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@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.jdeps@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xpatch:build@FILE_SEP@modules" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="@IDEA_TARGET_JDK@" />
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <option name="ENV_VARIABLES" />
       <option name="PASS_PARENT_ENVS" value="true" />
@@ -27,13 +27,14 @@
         <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
+    <!-- javadoc -->
     <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@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.jdeps@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xpatch:build@FILE_SEP@modules" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="@IDEA_TARGET_JDK@" />
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <option name="ENV_VARIABLES" />
       <option name="PASS_PARENT_ENVS" value="true" />
@@ -46,13 +47,14 @@
         <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
+    <!-- javap -->
     <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@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.jdeps@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xpatch:build@FILE_SEP@modules" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="@IDEA_TARGET_JDK@" />
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <option name="ENV_VARIABLES" />
       <option name="PASS_PARENT_ENVS" value="true" />
@@ -65,13 +67,14 @@
         <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
+    <!-- javah -->
     <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@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.jdeps@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xpatch:build@FILE_SEP@modules" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="@IDEA_TARGET_JDK@" />
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <option name="ENV_VARIABLES" />
       <option name="PASS_PARENT_ENVS" value="true" />
@@ -84,13 +87,14 @@
         <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
+    <!-- sjavac -->
     <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@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.jdeps@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xpatch:build@FILE_SEP@modules" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="@IDEA_TARGET_JDK@" />
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <option name="ENV_VARIABLES" />
       <option name="PASS_PARENT_ENVS" value="true" />
@@ -103,13 +107,15 @@
         <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
+    <!-- jshell -->
     <configuration default="false" name="jshell" type="Application" factoryName="Application">
       <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
       <option name="MAIN_CLASS_NAME" value="jdk.internal.jshell.tool.JShellTool" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/jdk.internal.le/classes:build/jdk.jdi/classes:build/jdk.jshell/classes:build/java.compiler/classes:build/jdk.compiler/classes:build/jdk.javadoc/classes:build/jdk.jdeps/classes" />
+      <option name="VM_PARAMETERS" value="-Xpatch:build@FILE_SEP@modules -XaddExports:jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="@IDEA_TARGET_JDK@" />
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <option name="ENV_VARIABLES" />
       <option name="PASS_PARENT_ENVS" value="true" />
@@ -120,24 +126,11 @@
         <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@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.jdeps@FILE_SEP@classes" />
-      <option name="PROGRAM_PARAMETERS" value="" />
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
-      <option name="ENABLE_SWING_INSPECTOR" value="false" />
-      <option name="ENV_VARIABLES" />
-      <option name="PASS_PARENT_ENVS" value="true" />
-      <module name="langtools" />
-      <envs />
-      <RunnerSettings RunnerId="Run" />
-      <ConfigurationWrapper RunnerId="Run" />
+    <!-- jtreg run -->
+    <configuration default="false" name="jtreg (run)" type="AntRunConfiguration" factoryName="Ant Target">
+      <antsettings antfile="file://$PROJECT_DIR$/.idea/build.xml" target="jtreg" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-bootstrap-javac" />
       </method>
     </configuration>
     <!-- jtreg debug -->
@@ -181,4 +174,3 @@
     </buildFile>
   </component>
 </project>
-
--- a/make/launcher.sh-template	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/launcher.sh-template	Thu Mar 17 19:04:28 2016 +0000
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -31,22 +31,10 @@
       mydir=`cygpath -m $mydir`
       ;;
 esac
-mylib="$mydir/../lib"
+mylib="$mydir/../modules"
 
-# By default, put the jar file and its dependencies on the bootclasspath.
-# This is always required on a Mac, because the system langtools classes
-# are always on the main class path; in addition, it may be required on
-# standard versions of JDK (i.e. using rt.jar and tools.jar) because some
-# langtools interfaces are in rt.jar.
-# Assume that the jar file being invoked lists all the necessary langtools
-# jar files in its Class-Path manifest entry, so there is no need to search
-# dependent jar files for additional dependencies.
-
-if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
-   cp=`echo "$mylib"/*.jar |
-       sed -e 's|\([a-z.]*\.jar\) *|\1#PS#|g'`
-   bcp=$cp
-fi
+# patch langtools modules
+bcp=-Xpatch:"$mylib"
 
 # tools currently assumes that assertions are enabled in the launcher
 ea=-ea:com.sun.tools...
@@ -71,4 +59,4 @@
 unset DUALCASE
 
 IFS=$nl
-"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} #PROGRAM# ${toolOpts}
+"#TARGET_JAVA#" $bcp ${ea} ${javaOpts} #PROGRAM# ${toolOpts}
--- a/make/netbeans/langtools/build.xml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/netbeans/langtools/build.xml	Thu Mar 17 19:04:28 2016 +0000
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -48,20 +48,12 @@
 
     <!-- Build project. (action: build; F11) -->
 
-    <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.bootstrap">
-        <antcall target="build-all-tools"/>
-    </target>
-
     <!-- Compile a single file. (action: compile.single; F9) -->
 
-    <target name="compile-single" depends="-get-tool-if-set,build-bootstrap-javac-classes" unless="langtools.tool.bootstrap">
+    <target name="compile-single" depends="-get-tool-if-set,-check-langtools.jdk.home">
         <fail unless="includes">Must set property 'includes'</fail>
         <mkdir dir="${build.dir}/${module.name}/classes" />
-        <javac fork="true" executable="${boot.java.home}/bin/javac"
+        <javac fork="true" executable="${java.home}/bin/javac"
                srcdir="${basedir}/src/${module.name}/share/classes"
                destdir="${build.dir}/${module.name}/classes"
                includes="${includes}"
@@ -72,7 +64,6 @@
                target="${javac.target}"
                debug="${javac.debug}"
                debuglevel="${javac.debuglevel}">
-            <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
         </javac>
     </target>
 
@@ -81,12 +72,11 @@
         the user.
     -->
 
-    <target name="run" depends="-check-target.java.home,-build-classes,-def-run,-get-tool-and-args,-setup-bootclasspath,-def-resolve-main-class"
+    <target name="run" depends="-check-langtools.jdk.home,-build-classes,-def-run,-get-tool-and-args,-def-resolve-main-class"
             description="run tool">
-        <echo level="info" message="${with_bootclasspath}"/>
-        <echo level="info" message="Run ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
+        <echo level="info" message="Run ${langtools.tool.name} with args ${langtools.tool.args}"/>
         <resolve-main-class tool.name="${langtools.tool.name}" />
-        <run bcp="${with_bootclasspath}" mainclass="${langtools.main.class}" args="${langtools.tool.args}"/>
+        <run mainclass="${langtools.main.class}" args="${langtools.tool.args}"/>
     </target>
 
     <target name="-def-resolve-main-class">
@@ -102,17 +92,14 @@
         </macrodef>
     </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">
+    <target name="-build-classes" depends="-get-tool-if-set,-build-classes-all" />
+    <target name="-build-classes-all">
         <antcall target="build-all-classes"/>
     </target>
 
     <!-- Run a selected class. (action: run.single;  shift-F6) -->
 
-    <target name="run-single" depends="-check-target.java.home,-setup-bootclasspath,-def-run">
+    <target name="run-single" depends="-check-langtools.jdk.home,-def-run">
         <fail unless="run.classname">Must set property 'run.classname' </fail>
         <echo level="info" message="run ${run.classname}"/>
         <run mainclass="${run.classname}" args=""/>
@@ -123,22 +110,12 @@
         test all tools.
     -->
 
-    <target name="jtreg" depends="-get-tool-if-set,-jtreg-bootstrap-javac,-jtreg-all"
-        description="Test langtools tools or bootstrap javac"
+    <target name="jtreg" depends="-get-tool-if-set,-jtreg-all"
+        description="Test langtools 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-bootstrap-javac"/>
-            <target name="-show-jtreg"/>
-        </antcall>
-    </target>
-
-    <target name="-jtreg-all" unless="langtools.tool.bootstrap">
+    <target name="-jtreg-all">
         <echo level="info" message="Testing all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.bootstrap to test bootstrap javac)"/>
         <antcall>
             <target name="langtools.jtreg"/>
             <target name="-show-jtreg"/>
@@ -173,29 +150,27 @@
 
     <!-- Debug tool in NetBeans. -->
 
-    <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,-setup-bootclasspath,-build-classes,-def-resolve-main-class" if="netbeans.home">
-        <echo level="info" message="Debug ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
+    <target name="debug" depends="-check-langtools.jdk.home,-def-run,-def-start-debugger,-get-tool-and-args,-build-classes,-def-resolve-main-class" if="netbeans.home">
+        <echo level="info" message="Debug ${langtools.tool.name} with args ${langtools.tool.args}"/>
         <start-debugger/>
         <resolve-main-class tool.name="${langtools.tool.name}" />
-        <run bcp="${with_bootclasspath}" mainclass="${langtools.main.class}" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
+        <run mainclass="${langtools.main.class}" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
     </target>
 
     <!-- Debug a selected class . -->
-    <target name="debug-single" depends="-check-target.java.home,-def-start-debugger,-def-run">
+    <target name="debug-single" depends="-check-langtools.jdk.home,-def-start-debugger,-def-run">
         <fail unless="debug.classname">Must set property 'debug.classname'</fail>
         <start-debugger/>
         <run mainclass="${debug.classname}" args="" jpda.jvmargs="${jpda.jvmargs}"/>
     </target>
 
     <!-- Debug a jtreg test. -->
-    <target name="debug-jtreg" depends="-check-target.java.home,-def-start-debugger,-def-jtreg,-get-tool-if-set,-setup-bootclasspath">
+    <target name="debug-jtreg" depends="-check-langtools.jdk.home,-def-start-debugger,-def-jtreg,-get-tool-if-set">
         <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}"
-                    langtools.classes="${with_bootclasspath}"/>
+                    jpda.jvmargs="${jpda.jvmargs}"/>
     </target>
 
     <!-- Update a class being debugged. -->
@@ -206,11 +181,7 @@
         <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>
+        <property name="build.classes.dir" value="${build.dir}/${module.name}/classes" />
         <nbjpdareload>
             <fileset dir="${build.classes.dir}">
                 <include name="${class}.class"/>
@@ -218,23 +189,11 @@
         </nbjpdareload>
     </target>
 
-    <!-- Generate javadoc for one or all tools. (action: javadoc; Alt-F6)
-        If langtools.tool.name is set, then just test that tool; otherwise
-        test all tools.
-    -->
-
-    <target name="javadoc" depends="langtools.javadoc,-show-javadoc" />
-
-    <target name="-show-javadoc" if="netbeans.home">
-        <nbbrowse file="${build.javadoc.dir}/index.html"/>
-    </target>
-
     <!-- Prompt for values. -->
 
     <target name="-get-tool-if-set" depends="-def-select-tool">
         <select-tool
             toolproperty="langtools.tool.name"
-            bootstrapproperty="langtools.tool.bootstrap"
             propertyfile="${langtools.properties}"
             askIfUnset="false"
             />
@@ -244,32 +203,22 @@
         <select-tool
             toolproperty="langtools.tool.name"
             argsproperty="langtools.tool.args"
-            bootstrapproperty="langtools.tool.bootstrap"
             propertyfile="${langtools.properties}"
             askIfUnset="true"
             />
     </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">
             <attribute name="mainclass"/>
             <attribute name="args" default=""/>
-            <attribute name="bcp" default="${with_bootclasspath}"/>
+            <attribute name="build.modules" default="${build.modules}"/>
             <attribute name="jpda.jvmargs" default=""/>
 
             <sequential>
-                <java fork="true" jvm="${target.java.home}/bin/java" classname="@{mainclass}">
-                    <jvmarg line="-Xbootclasspath/p:@{bcp}"/>
+                <java fork="true" jvm="${langtools.jdk.home}/bin/java" classname="@{mainclass}">
+                    <jvmarg line="-Xpatch:@{build.modules}"/>
                     <jvmarg line="@{jpda.jvmargs}"/>
                     <arg line="@{args}"/>
                 </java>
@@ -285,11 +234,7 @@
                 <nbjpdastart name="${ant.project.name}" addressproperty="jpda.address" transport="dt_socket">
                     <bootclasspath>
                         <pathelement path="${langtools.classes}"/>
-                        <pathelement location="${target.java.home}/jre/lib/rt.jar"/>
                     </bootclasspath>
-                    <sourcepath>
-                        <pathelement path="${langtools.sources}"/>
-                    </sourcepath>
                 </nbjpdastart>
                 <property
                     name="@{jpda.jvmargs.property}"
@@ -300,6 +245,7 @@
     </target>
 
     <target name="-def-select-tool">
+        <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
         <mkdir dir="${build.toolclasses.dir}"/>
         <javac srcdir="${make.tools.dir}"
                includes="anttasks/SelectTool*"
--- a/make/netbeans/langtools/nbproject/project.xml	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/netbeans/langtools/nbproject/project.xml	Thu Mar 17 19:04:28 2016 +0000
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -408,9 +408,6 @@
                         </arity>
                     </context>
                 </action>
-                <action name="javadoc">
-                    <target>javadoc</target>
-                </action>
                 <action name="select-tool">
                     <target>select-tool</target>
                 </action>
@@ -477,7 +474,6 @@
                     <ide-action name="build"/>
                     <ide-action name="rebuild"/>
                     <ide-action name="clean"/>
-                    <ide-action name="javadoc"/>
                     <separator/>
                     <ide-action name="run"/>
                     <ide-action name="debug"/>
@@ -490,37 +486,35 @@
         <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
             <compilation-unit>
                 <package-root>${root}/src/java.compiler/share/classes</package-root>
-                <package-root>${root}/build/bootstrap/java.compiler/gensrc</package-root>
+                <package-root>${root}/build/gensrc/java.compiler</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>
+                <package-root>${root}/build/gensrc/jdk.compiler</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.jdeps/share/classes</package-root>
-                <package-root>${root}/build/bootstrap/jdk.jdeps/gensrc</package-root>
+                <package-root>${root}/build/gensrc/jdk.jdeps</package-root>
                 <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
                 <built-to>${root}/build/jdk.jdeps/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>${root}/src/jdk.javadoc/share/classes</package-root>
-                <package-root>${root}/build/bootstrap/jdk.javadoc/gensrc</package-root>
+                <package-root>${root}/build/gensrc/jdk.javadoc</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>
             <compilation-unit>
                 <package-root>${root}/src/jdk.jshell/share/classes</package-root>
-                <package-root>${root}/build/bootstrap/jdk.jshell/gensrc</package-root>
-                <package-root>${root}/../jdk/src/jdk.internal.le/share/classes</package-root>
-                <package-root>${root}/../jdk/src/jdk.jdi/share/classes</package-root>
-                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes</classpath>
+                <package-root>${root}/build/gensrc/jdk.jshell</package-root>
+                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
                 <built-to>${root}/build/jdk.jshell/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
--- a/make/tools/anttasks/SelectToolTask.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/tools/anttasks/SelectToolTask.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,18 +74,7 @@
 
     enum ToolChoices {
         NONE(""),
-        BOOSTRAP_JAVAC("bootstrap-javac", true) {
-            @Override
-            public ToolChoices baseTool() {
-                return JAVAC;
-            }
-        },
-        JAVAC("javac") {
-            @Override
-            public ToolChoices asBootstrap() {
-                return BOOSTRAP_JAVAC;
-            }
-        },
+        JAVAC("javac"),
         JAVADOC("javadoc"),
         JAVAH("javah"),
         JAVAP("javap"),
@@ -103,14 +92,6 @@
             this.bootstrap = bootstrap;
         }
 
-        public ToolChoices asBootstrap() {
-            return this;
-        }
-
-        public ToolChoices baseTool() {
-            return this;
-        }
-
         @Override
         public String toString() {
             return toolName;
@@ -146,15 +127,6 @@
     }
 
     /**
-     * Set the name of the property which will be used to bootstrap the
-     * selected tool, if any. The property will remain unset.
-     * @param bootstrapProperty
-     */
-    public void setBootstrapProperty(String bootstrapProperty) {
-        this.bootstrapProperty = bootstrapProperty;
-    }
-
-    /**
      * Specify whether or not to pop up a dialog if the user has not specified
      * a default value for a property.
      * @param askIfUnset a boolean flag indicating to prompt the user or not
@@ -169,7 +141,6 @@
 
         Properties props = readProperties(propertyFile);
         toolName = props.getProperty("tool.name");
-        toolBootstrap = props.getProperty("tool.bootstrap") != null;
         if (toolName != null) {
             toolArgs = props.getProperty(toolName + ".args", "");
         }
@@ -183,8 +154,6 @@
         // finally, return required values, if any
         if (toolProperty != null && !(toolName == null || toolName.equals(""))) {
             p.setProperty(toolProperty, toolName);
-            if (toolBootstrap)
-                p.setProperty(bootstrapProperty, "true");
 
             if (argsProperty != null && toolArgs != null)
                 p.setProperty(argsProperty, toolArgs);
@@ -198,20 +167,15 @@
 
         ToolChoices tool = (ToolChoices)toolChoice.getSelectedItem();
 
-        toolName = tool.baseTool().toolName;
-        toolBootstrap = tool.bootstrap;
+        toolName = tool.toolName;
         toolArgs = argsField.getText();
         if (defaultCheck.isSelected()) {
             if (toolName.equals("")) {
                 fileProps.remove("tool.name");
                 fileProps.remove("tool.bootstrap");
             } else {
+                fileProps.remove("tool.bootstrap");
                 fileProps.put("tool.name", toolName);
-                if (toolBootstrap) {
-                    fileProps.put("tool.bootstrap", "true");
-                } else {
-                    fileProps.remove("tool.bootstrap");
-                }
                 fileProps.put(toolName + ".args", toolArgs);
             }
             writeProperties(propertyFile, fileProps);
@@ -237,8 +201,6 @@
         toolChoice = new JComboBox<>(toolChoices.toArray());
         ToolChoices tool = toolName != null ? ToolChoices.valueOf(toolName.toUpperCase()) : null;
         if (toolName != null) {
-            if (toolBootstrap)
-                tool = tool.asBootstrap();
             toolChoice.setSelectedItem(tool);
         }
         toolChoice.addItemListener(new ItemListener() {
@@ -348,14 +310,13 @@
     String getDefaultArgsForTool(Properties props, ToolChoices tool) {
         if (tool == null)
             return "";
-        String toolName = tool.baseTool().toolName;
+        String toolName = tool.toolName;
         return toolName.equals("") ? "" : props.getProperty(toolName + ".args", "");
     }
 
     // Ant task parameters
     private boolean askIfUnset;
     private String toolProperty;
-    private String bootstrapProperty;
     private String argsProperty;
     private File propertyFile;
 
@@ -367,6 +328,5 @@
 
     // Result values for the client
     private String toolName;
-    private boolean toolBootstrap;
     private String toolArgs;
 }
--- a/make/tools/crules/CodingRulesAnalyzerPlugin.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/tools/crules/CodingRulesAnalyzerPlugin.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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,10 +23,13 @@
 
 package crules;
 
+import java.lang.reflect.Layer;
+import java.lang.reflect.Module;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 import javax.lang.model.element.TypeElement;
 import javax.tools.JavaFileObject;
@@ -52,6 +55,11 @@
 
     @DefinedBy(Api.COMPILER_TREE)
     public void init(JavacTask task, String... args) {
+        addExports("jdk.compiler",
+                "com.sun.tools.javac.api",
+                "com.sun.tools.javac.code",
+                "com.sun.tools.javac.tree",
+                "com.sun.tools.javac.util");
         BasicJavacTask impl = (BasicJavacTask)task;
         Context context = impl.getContext();
         log = Log.instance(context);
@@ -63,6 +71,20 @@
         ));
     }
 
+    private void addExports(String moduleName, String... packageNames) {
+        for (String packageName : packageNames) {
+            try {
+                Layer layer = Layer.boot();
+                Optional<Module> m = layer.findModule(moduleName);
+                if (!m.isPresent())
+                    throw new Error("module not found: " + moduleName);
+                m.get().addExports(packageName, getClass().getModule());
+            } catch (Exception e) {
+                throw new Error("failed to add exports for " + moduleName + "/" + packageName);
+            }
+        }
+    }
+
     public class PostAnalyzeTaskListener implements TaskListener {
         private final Map<Kind, List<AbstractCodingRulesAnalyzer>> analyzers = new HashMap<>();
 
--- a/make/tools/propertiesparser/parser/MessageType.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/make/tools/propertiesparser/parser/MessageType.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,6 +77,7 @@
         MODIFIER("modifier", "Modifier", "javax.lang.model.element"),
         FILE("file", "File", "java.io"),
         FILE_OBJECT("file object", "JavaFileObject", "javax.tools"),
+        PATH("path", "Path", "java.nio.file"),
         NAME("name", "Name", "com.sun.tools.javac.util"),
         NUMBER("number", "int", null),
         OPTION_NAME("option name", "Option", "com.sun.tools.javac.main"),
--- a/src/java.compiler/share/classes/javax/lang/model/element/Element.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/Element.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -105,8 +105,8 @@
      * java.util.Set<E>} is {@code "Set"}.
      *
      * If this element represents an unnamed {@linkplain
-     * PackageElement#getSimpleName package}, an empty name is
-     * returned.
+     * PackageElement#getSimpleName package} or unnamed {@linkplain
+     * ModuleElement#getSimpleName module}, an empty name is returned.
      *
      * If it represents a {@linkplain ExecutableElement#getSimpleName
      * constructor}, the name "{@code <init>}" is returned.  If it
@@ -122,6 +122,7 @@
      * @see ExecutableElement#getSimpleName
      * @see TypeElement#getSimpleName
      * @see VariableElement#getSimpleName
+     * @see ModuleElement#getSimpleName
      */
     Name getSimpleName();
 
@@ -137,7 +138,7 @@
      * top-level type}, its package is returned.
      *
      * <li> If this is a {@linkplain
-     * PackageElement#getEnclosingElement package}, {@code null} is
+     * PackageElement#getEnclosingElement package}, its module is
      * returned.
      *
      * <li> If this is a {@linkplain
@@ -150,6 +151,9 @@
      * parameter}, {@linkplain ExecutableElement the executable
      * element} which declares the parameter is returned.
      *
+     * <li> If this is a {@linkplain ModuleElement#getEnclosingElement
+     * module}, {@code null} is returned.
+     *
      * </ul>
      *
      * @return the enclosing element, or {@code null} if there is none
@@ -169,6 +173,9 @@
      * encloses the top-level classes and interfaces within it, but is
      * not considered to enclose subpackages.
      *
+     * A {@linkplain ModuleElement#getEnclosedElements module}
+     * encloses packages within it.
+     *
      * Other kinds of elements are not currently considered to enclose
      * any elements; however, that may change as this API or the
      * programming language evolves.
@@ -177,8 +184,9 @@
      * methods in {@link ElementFilter}.
      *
      * @return the enclosed elements, or an empty list if none
+     * @see TypeElement#getEnclosedElements
      * @see PackageElement#getEnclosedElements
-     * @see TypeElement#getEnclosedElements
+     * @see ModuleElement#getEnclosedElements
      * @see Elements#getAllMembers
      * @jls 8.8.9 Default Constructor
      * @jls 8.9 Enums
--- a/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, 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
@@ -94,7 +94,13 @@
      * A resource variable.
      * @since 1.7
      */
-    RESOURCE_VARIABLE;
+     RESOURCE_VARIABLE,
+
+    /**
+     * A module.
+     * @since 9
+     */
+     MODULE;
 
 
     /**
--- a/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -143,4 +143,13 @@
      *  a visitor implementation may optionally throw this exception
      */
     R visitUnknown(Element e, P p);
+
+    /**
+     * Visits a module element.
+     * @param e  the element to visit
+     * @param p  a visitor-specified parameter
+     * @return a visitor-specified result
+     * @since 9
+     */
+    R visitModule(ModuleElement e, P p);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.lang.model.element;
+
+import java.util.List;
+
+/**
+ * Represents a module program element.  Provides access to information
+ * about the module and its members.
+ *
+ * @see javax.lang.model.util.Elements#getModuleOf
+ * @since 9
+ */  // TODO: add @jls to module section
+public interface ModuleElement extends Element, QualifiedNameable {
+
+    /**
+     * Returns the fully qualified name of this module.
+     *
+     * @return the qualified name of this module, or an
+     * empty name if this is an unnamed module
+     */
+    @Override
+    Name getQualifiedName();
+
+    /**
+     * Returns the simple name of this module.  For an unnamed
+     * module, an empty name is returned.
+     *
+     * @return the simple name of this module or an empty name if
+     * this is an unnamed module
+     */
+    @Override
+    Name getSimpleName();
+
+    /**
+     * Returns the packages within this module.
+     * @return the packages within this module
+     */
+    @Override
+    List<? extends Element> getEnclosedElements();
+
+    /**
+     * Returns {@code true} if this is an unnamed module and {@code
+     * false} otherwise.
+     *
+     * @return {@code true} if this is an unnamed module and {@code
+     * false} otherwise
+     */ // TODO: add @jls to unnamed module section
+    boolean isUnnamed();
+
+    /**
+     * Returns {@code null} since a module is not enclosed by another
+     * element.
+     *
+     * @return {@code null}
+     */
+    @Override
+    Element getEnclosingElement();
+
+    /**
+     * Returns the directives contained in the declaration of this module.
+     * @return  the directives in the declaration of this module
+     */
+    List<? extends Directive> getDirectives();
+
+    /**
+     * The {@code kind} of a directive.
+     *
+     * <p>Note that it is possible additional directive kinds will be added
+     * to accommodate new, currently unknown, language structures added to
+     * future versions of the Java&trade; programming language.
+     *
+     * @since 9
+     */
+    enum DirectiveKind {
+        /** A "requires [public] module-name" directive. */
+        REQUIRES,
+        /** An "exports package-name [to module-name-list]" directive. */
+        EXPORTS,
+        /** A "uses service-name" directive. */
+        USES,
+        /** A "provides service-name with implementation-name" directive. */
+        PROVIDES
+    };
+
+    /**
+     * Represents a "module statement" within the declaration of this module.
+     *
+     * @since 9
+     *
+     */ // TODO: add jls to Module Statement
+    interface Directive {
+        /**
+         * Returns the {@code kind} of this directive.
+         *
+         * @return the kind of this directive
+         */
+        DirectiveKind getKind();
+    }
+
+    /**
+     * A dependency of a module.
+     * @since 9
+     */
+    interface RequiresDirective extends Directive {
+        /**
+         * Returns whether or not this is a public dependency.
+         * @return whether or not this is a public dependency
+         */
+        boolean isPublic();
+
+        /**
+         * Returns the module that is required
+         * @return the module that is required
+         */
+        ModuleElement getDependency();
+    }
+
+    /**
+     * An exported package of a module.
+     * @since 9
+     */
+    interface ExportsDirective extends Directive {
+        /**
+         * Returns the package being exported.
+         * @return the package being exported
+         */
+        PackageElement getPackage();
+
+        /**
+         * Returns the specific modules to which the package is being exported,
+         * or null, if the package is exported to all modules which
+         * have readability to this module.
+         * @return the specific modules to which the package is being exported
+         */
+        List<? extends ModuleElement> getTargetModules();
+    }
+
+    /**
+     * An implementation of a service provided by a module.
+     * @since 9
+     */
+    interface ProvidesDirective extends Directive {
+        /**
+         * Returns the service being provided.
+         * @return the service being provided
+         */
+        TypeElement getService();
+
+        /**
+         * Returns the implementation of the service being provided.
+         * @return the implementation of the service being provided
+         */
+        TypeElement getImplementation();
+    }
+
+    /**
+     * A reference to a service used by a module.
+     * @since 9
+     */
+    interface UsesDirective extends Directive {
+        /**
+         * Returns the service that is used.
+         * @return the service that is used
+         */
+        TypeElement getService();
+    }
+}
--- a/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, 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
@@ -72,20 +72,19 @@
     List<? extends Element> getEnclosedElements();
 
     /**
-     * Returns {@code true} is this is an unnamed package and {@code
+     * Returns {@code true} if this is an unnamed package and {@code
      * false} otherwise.
      *
-     * @return {@code true} is this is an unnamed package and {@code
+     * @return {@code true} if this is an unnamed package and {@code
      * false} otherwise
      * @jls 7.4.2 Unnamed Packages
      */
     boolean isUnnamed();
 
     /**
-     * Returns {@code null} since a package is not enclosed by another
-     * element.
+     * Returns the enclosing module.
      *
-     * @return {@code null}
+     * @return the enclosing module
      */
     @Override
     Element getEnclosingElement();
--- a/src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -151,7 +151,14 @@
       *
       * @since 1.8
       */
-    INTERSECTION;
+    INTERSECTION,
+
+    /**
+     * A pseudo-type corresponding to a module element.
+     * @see NoType
+     * @since 9
+     */
+    MODULE;
 
     /**
      * Returns {@code true} if this kind corresponds to a primitive
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -132,4 +132,19 @@
     public R visitUnknown(Element e, P p) {
         throw new UnknownElementException(e, p);
     }
+
+    /**
+     * Visits a {@code ModuleElement} by calling {@code
+     * visitUnknown}.
+
+     * @param e  {@inheritDoc}
+     * @param p  {@inheritDoc}
+     * @return the result of {@code visitUnknown}
+     *
+     * @since 9
+     */
+    @Override
+    public R visitModule(ModuleElement e, P p) {
+        return visitUnknown(e, p);
+    }
 }
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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,6 +27,7 @@
 
 import javax.annotation.processing.SupportedSourceVersion;
 import javax.lang.model.SourceVersion;
+import javax.lang.model.element.ModuleElement;
 import static javax.lang.model.SourceVersion.*;
 
 
@@ -71,4 +72,15 @@
     protected AbstractElementVisitor9(){
         super();
     }
+
+    /**
+     * Visits a {@code ModuleElement} in a manner defined by a
+     * subclass.
+     *
+     * @param t  {@inheritDoc}
+     * @param p  {@inheritDoc}
+     * @return the result of the visit as defined by a subclass
+     */
+    @Override
+    public abstract R visitModule(ModuleElement t, P p);
 }
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, 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
@@ -33,6 +33,12 @@
 import java.util.LinkedHashSet;
 
 import javax.lang.model.element.*;
+import javax.lang.model.element.ModuleElement.Directive;
+import javax.lang.model.element.ModuleElement.DirectiveKind;
+import javax.lang.model.element.ModuleElement.ExportsDirective;
+import javax.lang.model.element.ModuleElement.ProvidesDirective;
+import javax.lang.model.element.ModuleElement.RequiresDirective;
+import javax.lang.model.element.ModuleElement.UsesDirective;
 
 
 /**
@@ -78,6 +84,9 @@
     private static final Set<ElementKind> PACKAGE_KIND =
         Collections.unmodifiableSet(EnumSet.of(ElementKind.PACKAGE));
 
+    private static final Set<ElementKind> MODULE_KIND =
+        Collections.unmodifiableSet(EnumSet.of(ElementKind.MODULE));
+
     private static final Set<ElementKind> TYPE_KINDS =
         Collections.unmodifiableSet(EnumSet.of(ElementKind.CLASS,
                                                ElementKind.ENUM,
@@ -183,6 +192,28 @@
         return setFilter(elements, PACKAGE_KIND, PackageElement.class);
     }
 
+    /**
+     * Returns a list of modules in {@code elements}.
+     * @return a list of modules in {@code elements}
+     * @param elements the elements to filter
+     * @since 9
+     */
+    public static List<ModuleElement>
+            modulesIn(Iterable<? extends Element> elements) {
+        return listFilter(elements, MODULE_KIND, ModuleElement.class);
+    }
+
+    /**
+     * Returns a set of modules in {@code elements}.
+     * @return a set of modules in {@code elements}
+     * @param elements the elements to filter
+     * @since 9
+     */
+    public static Set<ModuleElement>
+            modulesIn(Set<? extends Element> elements) {
+        return setFilter(elements, MODULE_KIND, ModuleElement.class);
+    }
+
     // Assumes targetKinds and E are sensible.
     private static <E extends Element> List<E> listFilter(Iterable<? extends Element> elements,
                                                           Set<ElementKind> targetKinds,
@@ -207,4 +238,62 @@
         }
         return set;
     }
+
+
+
+    /**
+     * Returns a list of export directives in {@code directives}.
+     * @return a list of export directives in {@code directives}
+     * @param directives the directives to filter
+     * @since 9
+     */
+    public static List<ExportsDirective>
+            exportsIn(Iterable<? extends Directive> directives) {
+        return listFilter(directives, DirectiveKind.EXPORTS, ExportsDirective.class);
+    }
+
+    /**
+     * Returns a list of provides directives in {@code directives}.
+     * @return a list of provides directives in {@code directives}
+     * @param directives the directives to filter
+     * @since 9
+     */
+    public static List<ProvidesDirective>
+            providesIn(Iterable<? extends Directive> directives) {
+        return listFilter(directives, DirectiveKind.PROVIDES, ProvidesDirective.class);
+    }
+
+    /**
+     * Returns a list of requires directives in {@code directives}.
+     * @return a list of requires directives in {@code directives}
+     * @param directives the directives to filter
+     * @since 9
+     */
+    public static List<RequiresDirective>
+            requiresIn(Iterable<? extends Directive> directives) {
+        return listFilter(directives, DirectiveKind.REQUIRES, RequiresDirective.class);
+    }
+
+    /**
+     * Returns a list of uses directives in {@code directives}.
+     * @return a list of uses directives in {@code directives}
+     * @param directives the directives to filter
+     * @since 9
+     */
+    public static List<UsesDirective>
+            usesIn(Iterable<? extends Directive> directives) {
+        return listFilter(directives, DirectiveKind.USES, UsesDirective.class);
+    }
+
+    // Assumes directiveKind and D are sensible.
+    private static <D extends Directive> List<D> listFilter(Iterable<? extends Directive> directives,
+                                                          DirectiveKind directiveKind,
+                                                          Class<D> clazz) {
+        List<D> list = new ArrayList<>();
+        for (Directive d : directives) {
+            if (d.getKind() == directiveKind)
+                list.add(clazz.cast(d));
+        }
+        return list;
+    }
 }
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -95,4 +95,17 @@
     protected ElementKindVisitor9(R defaultValue) {
         super(defaultValue);
     }
+
+    /**
+     * Visits a {@code ModuleElement} by calling {@code
+     * defaultAction}.
+     *
+     * @param e the element to visit
+     * @param p a visitor-specified parameter
+     * @return  the result of {@code defaultAction}
+     */
+    @Override
+    public R visitModule(ModuleElement e, P p) {
+        return defaultAction(e, p);
+    }
 }
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -108,4 +108,17 @@
     protected ElementScanner9(R defaultValue){
         super(defaultValue);
     }
+
+    /**
+     * Visits a {@code ModuleElement} by scanning the enclosed
+     * elements.
+     *
+     * @param e the element to visit
+     * @param p a visitor-specified parameter
+     * @return  the result of the scan
+     */
+    @Override
+    public R visitModule(ModuleElement e, P p) {
+        return scan(e.getEnclosedElements(), p); // TODO: Hmmm, this might not be right
+    }
 }
--- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -30,7 +30,6 @@
 import java.util.Map;
 
 import javax.lang.model.element.*;
-import javax.lang.model.type.*;
 
 
 /**
@@ -64,6 +63,15 @@
     TypeElement getTypeElement(CharSequence name);
 
     /**
+     * Returns a module element given its fully qualified name.
+     *
+     * @param name  the name
+     * @return the named module element, or {@code null} if it cannot be found
+     * @since 9
+     */
+    ModuleElement getModuleElement(CharSequence name);
+
+    /**
      * Returns the values of an annotation's elements, including defaults.
      *
      * @see AnnotationMirror#getElementValues()
@@ -129,6 +137,16 @@
     PackageElement getPackageOf(Element type);
 
     /**
+     * Returns the module of an element.  The module of a module is
+     * itself.
+     *
+     * @param type the element being examined
+     * @return the module of an element
+     * @since 9
+     */
+    ModuleElement getModuleOf(Element type);
+
+    /**
      * Returns all members of a type element, whether inherited or
      * declared directly.  For a class the result also includes its
      * constructors, but not local or anonymous classes.
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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,6 +27,7 @@
 
 import javax.annotation.processing.SupportedSourceVersion;
 import javax.lang.model.SourceVersion;
+import javax.lang.model.element.ModuleElement;
 import static javax.lang.model.SourceVersion.*;
 
 /**
@@ -90,4 +91,17 @@
     protected SimpleElementVisitor9(R defaultValue){
         super(defaultValue);
     }
+
+    /**
+     * Visits a {@code ModuleElement} by calling {@code
+     * defaultAction}.
+     *
+     * @param e the element to visit
+     * @param p a visitor-specified parameter
+     * @return  the result of {@code defaultAction}
+     */
+    @Override
+    public R visitModule(ModuleElement e, P p) {
+        return defaultAction(e, p);
+    }
 }
--- a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, 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
@@ -28,6 +28,7 @@
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.Objects;
+import java.util.ServiceLoader;
 import java.util.Set;
 import javax.tools.JavaFileObject.Kind;
 
@@ -163,4 +164,24 @@
     public void close() throws IOException {
         fileManager.close();
     }
+
+    public Location getModuleLocation(Location location, String moduleName) throws IOException {
+        return fileManager.getModuleLocation(location, moduleName);
+    }
+
+    public Location getModuleLocation(Location location, JavaFileObject fo, String pkgName) throws IOException {
+        return fileManager.getModuleLocation(location, fo, pkgName);
+    }
+
+    public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws  IOException {
+        return fileManager.getServiceLoader(location, service);
+    }
+
+    public String inferModuleName(Location location) throws IOException {
+        return fileManager.inferModuleName(location);
+    }
+
+    public Iterable<Set<Location>> listModuleLocations(Location location) throws IOException {
+        return fileManager.listModuleLocations(location);
+    }
 }
--- a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,9 @@
 import java.io.Flushable;
 import java.io.IOException;
 import java.util.Iterator;
+import java.util.ServiceLoader;
 import java.util.Set;
+
 import static javax.tools.JavaFileObject.Kind;
 
 /**
@@ -124,6 +126,17 @@
          * @return true if this is an output location, false otherwise
          */
         boolean isOutputLocation();
+
+        /**
+         * Indicates if this location is expected to contain modules,
+         * as compared to a location which contains packages and classes.
+         *
+         * @return true if this location is expected to contain modules
+         * @since 9
+         */
+        default boolean isModuleLocation() {
+            return false;
+        }
     }
 
     /**
@@ -385,6 +398,7 @@
      * @throws IOException if an I/O error occurred
      * @see #close
      */
+    @Override
     void flush() throws IOException;
 
     /**
@@ -398,5 +412,84 @@
      * @throws IOException if an I/O error occurred
      * @see #flush
      */
+    @Override
     void close() throws IOException;
+
+    /**
+     * Gets a location for a named module within a module-oriented location.
+     *
+     * @param location the module-oriented location
+     * @param moduleName the name of the module to be found
+     * @return the location for the named module
+     *
+     * @throws IOException if an I/O error occurred
+     * @throws UnsupportedOperationException if this operation if not supported by this file manager
+     * @since 9
+     */ // TODO: describe failure modes
+    default Location getModuleLocation(Location location, String moduleName) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Gets a location for the module containing a specific file representing a Java
+     * source or class.
+     *
+     * @param location a module-oriented location
+     * @param fo the file
+     * @param pkgName the package name for the class(es) defined in this file
+     * @return the module containing the file
+     *
+     * @throws IOException if an I/O error occurred
+     * @throws UnsupportedOperationException if this operation if not supported by this file manager
+     * @since 9
+     */ // TODO: describe failure modes
+    default Location getModuleLocation(Location location, JavaFileObject fo, String pkgName) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Get a service loader for a specific service class from a given location.
+     *
+     * @param location the location
+     * @param service  the {@code Class} object of the service class
+     * @param <S> the service class
+     * @return a service loader for the given service class
+     *
+     * @throws IOException if an I/O error occurred
+     * @throws UnsupportedOperationException if this operation if not supported by this file manager
+     * @since 9
+     */ // TODO: describe failure modes
+    default <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws  IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Infer the name of the module from its location, as returned by
+     * getModuleLocation or listModuleLocations.
+     *
+     * @param location a location representing a module
+     * @return the name of the module
+     *
+     * @throws IOException if an I/O error occurred
+     * @throws UnsupportedOperationException if this operation if not supported by this file manager
+     * @since 9
+     */ // TODO: describe failure modes
+    default String inferModuleName(Location location) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Lists the modules in a module-oriented location.
+     *
+     * @param location  the location for which to list the modules
+     * @return  a series of sets of locations containing modules
+     *
+     * @throws IOException if an I/O error occurred
+     * @throws UnsupportedOperationException if this operation if not supported by this file manager
+     * @since 9
+     */ // TODO: describe failure modes
+    default Iterable<Set<Location>> listModuleLocations(Location location) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
 }
--- a/src/java.compiler/share/classes/javax/tools/StandardLocation.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/tools/StandardLocation.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,12 @@
     ANNOTATION_PROCESSOR_PATH,
 
     /**
+     * Location to search for modules containing annotation processors.
+     * @since 9
+     */
+    ANNOTATION_PROCESSOR_MODULE_PATH,
+
+    /**
      * Location to search for platform classes.  Sometimes called
      * the boot class path.
      */
@@ -72,7 +78,31 @@
      * Location of new native header files.
      * @since 1.8
      */
-    NATIVE_HEADER_OUTPUT;
+    NATIVE_HEADER_OUTPUT,
+
+    /**
+     * Location to search for the source code of modules.
+     * @since 9
+     */
+    MODULE_SOURCE_PATH,
+
+    /**
+     * Location to search for upgradeable system modules.
+     * @since 9
+     */
+    UPGRADE_MODULE_PATH,
+
+    /**
+     * Location to search for system modules.
+     * @since 9
+     */
+    SYSTEM_MODULES,
+
+    /**
+     * Location to search for precompiled user modules.
+     * @since 9
+     */
+    MODULE_PATH;
 
     /**
      * Returns a location object with the given name.  The following
@@ -90,8 +120,11 @@
             for (Location location : values())
                 locations.putIfAbsent(location.getName(), location);
         }
-        locations.putIfAbsent(name.toString(/* null-check */), new Location() {
+        name.getClass(); /* null-check */
+        locations.putIfAbsent(name, new Location() {
+                @Override
                 public String getName() { return name; }
+                @Override
                 public boolean isOutputLocation() { return name.endsWith("_OUTPUT"); }
             });
         return locations.get(name);
@@ -100,8 +133,10 @@
         private static final ConcurrentMap<String,Location> locations
             = new ConcurrentHashMap<>();
 
+    @Override
     public String getName() { return name(); }
 
+    @Override
     public boolean isOutputLocation() {
         switch (this) {
             case CLASS_OUTPUT:
@@ -112,4 +147,18 @@
                 return false;
         }
     }
+
+    @Override
+    public boolean isModuleLocation() {
+        switch (this) {
+            case MODULE_SOURCE_PATH:
+            case ANNOTATION_PROCESSOR_MODULE_PATH:
+            case UPGRADE_MODULE_PATH:
+            case SYSTEM_MODULES:
+            case MODULE_PATH:
+                return true;
+            default:
+                return false;
+        }
+    }
 }
--- a/src/java.compiler/share/classes/javax/tools/ToolProvider.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/java.compiler/share/classes/javax/tools/ToolProvider.java	Thu Mar 17 19:04:28 2016 +0000
@@ -25,10 +25,11 @@
 
 package javax.tools;
 
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.util.HashMap;
-import java.util.Map;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
 
 /**
  * Provides methods for locating tool providers, for example,
@@ -40,8 +41,8 @@
  */
 public class ToolProvider {
 
-    private static final String systemJavaCompilerName
-        = "com.sun.tools.javac.api.JavacTool";
+    private static final String systemJavaCompilerModule = "jdk.compiler";
+    private static final String systemJavaCompilerName   = "com.sun.tools.javac.api.JavacTool";
 
     /**
      * Returns the Java&trade; programming language compiler provided
@@ -52,13 +53,17 @@
      * {@linkplain java.nio.file.FileSystem filesystem}.</p>
      * @return the compiler provided with this platform or
      * {@code null} if no compiler is provided
+     * @implNote This implementation returns the compiler provided
+     * by the {@code jdk.compiler} module if that module is available,
+     * and null otherwise.
      */
     public static JavaCompiler getSystemJavaCompiler() {
-        return instance().getSystemTool(JavaCompiler.class, systemJavaCompilerName);
+        return getSystemTool(JavaCompiler.class,
+                systemJavaCompilerModule, systemJavaCompilerName);
     }
 
-    private static final String systemDocumentationToolName
-        = "jdk.javadoc.internal.api.JavadocTool";
+    private static final String systemDocumentationToolModule = "jdk.javadoc";
+    private static final String systemDocumentationToolName = "jdk.javadoc.internal.api.JavadocTool";
 
     /**
      * Returns the Java&trade; programming language documentation tool provided
@@ -69,9 +74,13 @@
      * {@linkplain java.nio.file.FileSystem filesystem}.</p>
      * @return the documentation tool provided with this platform or
      * {@code null} if no documentation tool is provided
+     * @implNote This implementation returns the tool provided
+     * by the {@code jdk.javadoc} module if that module is available,
+     * and null otherwise.
      */
     public static DocumentationTool getSystemDocumentationTool() {
-        return instance().getSystemTool(DocumentationTool.class, systemDocumentationToolName);
+        return getSystemTool(DocumentationTool.class,
+                systemDocumentationToolModule, systemDocumentationToolName);
     }
 
     /**
@@ -87,41 +96,70 @@
         return ClassLoader.getSystemClassLoader();
     }
 
+    private static final boolean useLegacy;
 
-    private static ToolProvider instance;
-
-    private static synchronized ToolProvider instance() {
-        if (instance == null)
-            instance = new ToolProvider();
-        return instance;
+    static {
+        Class<?> c = null;
+        try {
+            c = Class.forName("java.lang.reflect.Module");
+        } catch (Throwable t) {
+        }
+        useLegacy = (c == null);
     }
 
-    // Cache for tool classes.
-    // Use weak references to avoid keeping classes around unnecessarily
-    private final Map<String, Reference<Class<?>>> toolClasses = new HashMap<>();
+    /**
+     * Get an instance of a system tool using the service loader.
+     * @implNote         By default, this returns the implementation in the specified module.
+     *                   For limited backward compatibility, if this code is run on an older version
+     *                   of the Java platform that does not support modules, this method will
+     *                   try and create an instance of the named class. Note that implies the
+     *                   class must be available on the system class path.
+     * @param <T>        the interface of the tool
+     * @param clazz      the interface of the tool
+     * @param moduleName the name of the module containing the desired implementation
+     * @param className  the class name of the desired implementation
+     * @return the specified implementation of the tool
+     */
+    private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) {
+        if (useLegacy) {
+            try {
+                return Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance();
+            } catch (ReflectiveOperationException e) {
+                throw new Error(e);
+            }
+        }
 
-    private ToolProvider() { }
-
-    private <T> T getSystemTool(Class<T> clazz, String name) {
-        Class<? extends T> c = getSystemToolClass(clazz, name);
         try {
-            return c.asSubclass(clazz).newInstance();
-        } catch (InstantiationException | IllegalAccessException | RuntimeException | Error e) {
+            ServiceLoader<T> sl = ServiceLoader.load(clazz, ClassLoader.getSystemClassLoader());
+            for (Iterator<T> iter = sl.iterator(); iter.hasNext(); ) {
+                T tool = iter.next();
+                if (matches(tool, moduleName))
+                    return tool;
+            }
+        } catch (ServiceConfigurationError e) {
             throw new Error(e);
         }
+        return null;
     }
 
-    private <T> Class<? extends T> getSystemToolClass(Class<T> clazz, String name) {
-        Reference<Class<?>> refClass = toolClasses.get(name);
-        Class<?> c = (refClass == null ? null : refClass.get());
-        if (c == null) {
-            try {
-                c = Class.forName(name, false, ClassLoader.getSystemClassLoader());
-            } catch (ClassNotFoundException | RuntimeException | Error e) {
-                throw new Error(e);
-            }
-            toolClasses.put(name, new WeakReference<>(c));
+    /**
+     * Determine if this is tho desired tool instance.
+     * @param <T>        the interface of the tool
+     * @param tool       the instance of the tool
+     * @param moduleName the name of the module containing the desired implementation
+     * @return true if and only if the tool matches the specified criteria
+     */
+    private static <T> boolean matches(T tool, String moduleName) {
+        // for now, use reflection to implement
+        //      return moduleName.equals(tool.getClass().getModule().getName());
+        try {
+            Method getModuleMethod = Class.class.getDeclaredMethod("getModule");
+            Object toolModule = getModuleMethod.invoke(tool.getClass());
+            Method getNameMethod = toolModule.getClass().getDeclaredMethod("getName");
+            String toolModuleName = (String) getNameMethod.invoke(toolModule);
+            return moduleName.equals(toolModuleName);
+        } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
+            return false;
         }
-        return c.asSubclass(clazz);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.compiler/share/classes/module-info.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+module java.compiler {
+    exports javax.annotation.processing;
+    exports javax.lang.model;
+    exports javax.lang.model.element;
+    exports javax.lang.model.type;
+    exports javax.lang.model.util;
+    exports javax.tools;
+
+    uses javax.tools.DocumentationTool;
+    uses javax.tools.JavaCompiler;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/DirectiveTree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+/**
+ * A super-type for all the directives in a ModuleTree.
+ */
+public interface DirectiveTree extends Tree { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/ExportsTree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+import java.util.List;
+
+/**
+ * A tree node for an 'exports' directive in a module declaration.
+ *
+ * For example:
+ * <pre>
+ *    exports <em>package-name</em>;
+ *    exports <em>package-name</em> to <em>module-name</em>;
+ * </pre>
+ *
+ * @since 9
+ */
+public interface ExportsTree extends DirectiveTree {
+    /**
+     * Returns the name of the package to be exported.
+     * @return  the name of the package to be exported
+     */
+    ExpressionTree getExportName();
+
+    /**
+     * Returns the names of the modules to which the package is exported,
+     * or null, if the package is exported to all modules.
+     *
+     * @return the names of the modules to which the package is exported, or null
+     */
+    List<? extends ExpressionTree> getModuleNames();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/ModuleTree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+import java.util.List;
+
+
+/**
+ * A tree node for a module declaration.
+ *
+ * For example:
+ * <pre>
+ *    module <em>module-name</em> {
+ *        <em>directives</em>
+ *    }
+ * </pre>
+ *
+ * @since 9
+ */
+public interface ModuleTree extends Tree {
+    /**
+     * Returns the name of the module.
+     * @return the name of the module
+     */
+    ExpressionTree getName();
+
+    /**
+     * Returns the directives in the module declaration.
+     * @return the directives in the module declaration
+     */
+    List<? extends DirectiveTree> getDirectives();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/ProvidesTree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+/**
+ * A tree node for a 'provides' directive in a module declaration.
+ *
+ * For example:
+ * <pre>
+ *    provides <em>service-name</em> with <em>implementation-name</em>;
+ * </pre>
+
+ * @since 9
+ */
+public interface ProvidesTree extends DirectiveTree {
+    /**
+     * Returns the name of the service type being provided.
+     * @return the name of the service type being provided
+     */
+    ExpressionTree getServiceName();
+
+    /**
+     * Returns the name of the implementation type being provided.
+     * @return the name of the implementation type being provided
+     */
+    ExpressionTree getImplementationName();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/RequiresTree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+/**
+ * A tree node for a 'requires' directive in a module declaration.
+ *
+ * For example:
+ * <pre>
+ *    requires <em>module-name</em>;
+ *    requires public <em>module-name</em>;
+ * </pre>
+ *
+ * @since 9
+ */
+public interface RequiresTree extends DirectiveTree {
+    /**
+     * Returns true if this is a "requires public" directive.
+     * @return true if this is a "requires public" directive
+     */
+    boolean isPublic();
+
+    /**
+     * Returns the name of the module that is required.
+     * @return the name of the module that is required
+     */
+    ExpressionTree getModuleName();
+}
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -604,6 +604,35 @@
         ANNOTATION_TYPE(ClassTree.class),
 
         /**
+         * Used for instances of {@link ModuleTree} representing module declarations.
+         */
+        MODULE(ModuleTree.class),
+
+        /**
+         * Used for instances of {@link ExportsTree} representing
+         * export directives in a module declaration.
+         */
+        EXPORTS(ExportsTree.class),
+
+        /**
+         * Used for instances of {@link ProvidesTree} representing
+         * export directives in a module declaration.
+         */
+        PROVIDES(ProvidesTree.class),
+
+        /**
+         * Used for instances of {@link RequiresTree} representing
+         * export directives in a module declaration.
+         */
+        REQUIRES(RequiresTree.class),
+
+        /**
+         * Used for instances of {@link UsesTree} representing
+         * export directives in a module declaration.
+         */
+        USES(UsesTree.class),
+
+        /**
          * An implementation-reserved node. This is the not the node
          * you are looking for.
          */
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -482,6 +482,46 @@
     R visitWildcard(WildcardTree node, P p);
 
     /**
+     * Visits a ModuleTree node.
+     * @param node the node being visited
+     * @param p a parameter value
+     * @return a result value
+     */
+    R visitModule(ModuleTree node, P p);
+
+    /**
+     * Visits an ExportsTree node.
+     * @param node the node being visited
+     * @param p a parameter value
+     * @return a result value
+     */
+    R visitExports(ExportsTree node, P p);
+
+    /**
+     * Visits a ProvidesTree node.
+     * @param node the node being visited
+     * @param p a parameter value
+     * @return a result value
+     */
+    R visitProvides(ProvidesTree node, P p);
+
+    /**
+     * Visits a RequiresTree node.
+     * @param node the node being visited
+     * @param p a parameter value
+     * @return a result value
+     */
+    R visitRequires(RequiresTree node, P p);
+
+    /**
+     * Visits a UsesTree node.
+     * @param node the node being visited
+     * @param p a parameter value
+     * @return a result value
+     */
+    R visitUses(UsesTree node, P p);
+
+    /**
      * Visits an unknown type of Tree node.
      * This can occur if the language evolves and new kinds
      * of nodes are added to the {@code Tree} hierarchy.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/UsesTree.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,45 @@
+
+/*
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+/**
+ * A tree node for a 'uses' directive in a module declaration.
+ *
+ * For example:
+ * <pre>
+ *    uses <em>service-name</em>;
+ * </pre>
+ *
+ * @since 9
+ */
+public interface UsesTree extends DirectiveTree {
+    /**
+     * Returns the name of the service type.
+     * @return  the name of the service type
+     */
+    ExpressionTree getServiceName();
+}
--- a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -719,14 +719,30 @@
         return defaultAction(node, p);
     }
 
-    /**
-     * {@inheritDoc} This implementation calls {@code defaultAction}.
-     *
-     * @param node {@inheritDoc}
-     * @param p {@inheritDoc}
-     * @return  the result of {@code defaultAction}
-     */
+    public R visitModule(ModuleTree node, P p) {
+        return defaultAction(node, p);
+    }
+
     @Override
+    public R visitExports(ExportsTree node, P p) {
+        return defaultAction(node, p);
+    }
+
+    @Override
+    public R visitProvides(ProvidesTree node, P p) {
+        return defaultAction(node, p);
+    }
+
+    @Override
+    public R visitRequires(RequiresTree node, P p) {
+        return defaultAction(node, p);
+    }
+
+    @Override
+    public R visitUses(UsesTree node, P p) {
+        return defaultAction(node, p);
+    }
+
     public R visitErroneous(ErroneousTree node, P p) {
         return defaultAction(node, p);
     }
--- a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -846,6 +846,32 @@
         return r;
     }
 
+    public R visitModule(ModuleTree node, P p) {
+        R r = scan(node.getName(), p);
+        r = scanAndReduce(node.getDirectives(), p, r);
+        return r;
+    }
+
+    public R visitExports(ExportsTree node, P p) {
+        R r = scan(node.getExportName(), p);
+        r = scanAndReduce(node.getModuleNames(), p, r);
+        return r;
+    }
+
+    public R visitProvides(ProvidesTree node, P p) {
+        R r = scan(node.getServiceName(), p);
+        r = scanAndReduce(node.getImplementationName(), p, r);
+        return r;
+    }
+
+    public R visitRequires(RequiresTree node, P p) {
+        return scan(node.getModuleName(), p);
+    }
+
+    public R visitUses(UsesTree node, P p) {
+        return scan(node.getServiceName(), p);
+    }
+
     /**
      * {@inheritDoc} This implementation returns {@code null}.
      *
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Thu Mar 17 19:04:28 2016 +0000
@@ -195,6 +195,9 @@
                 } else {
                     throw new BadArgs("dc.bad.value.for.option", arg, args[i]);
                 }
+            } else if ((arg.equals("-target") || arg.equals("-source")) && i + 1 < args.length) {
+                javacOpts.add(arg);
+                javacOpts.add(args[++i]);
             } else if (arg.equals(STATS)) {
                 env.messages.setStatsEnabled(true);
             } else if (arg.equals("-bootclasspath") && i + 1 < args.length) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -28,6 +28,7 @@
 import java.util.Collection;
 import java.util.LinkedHashSet;
 import java.util.Locale;
+import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -57,7 +58,6 @@
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.util.Log;
 import com.sun.tools.javac.util.PropagatedException;
-import com.sun.tools.javac.util.ServiceLoader;
 
 /**
  * Provides basic functionality for implementations of JavacTask.
@@ -195,8 +195,7 @@
 
         Set<List<String>> pluginsToCall = new LinkedHashSet<>(pluginOpts);
         JavacProcessingEnvironment pEnv = JavacProcessingEnvironment.instance(context);
-        ClassLoader cl = pEnv.getProcessorClassLoader();
-        ServiceLoader<Plugin> sl = ServiceLoader.load(Plugin.class, cl);
+        ServiceLoader<Plugin> sl = pEnv.getServiceLoader(Plugin.class);
         for (Plugin plugin : sl) {
             for (List<String> p : pluginsToCall) {
                 if (plugin.getName().equals(p.head)) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -36,6 +36,7 @@
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import java.net.URI;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -347,6 +348,50 @@
         }
 
         @Override @DefinedBy(Api.COMPILER)
+        public Location getModuleLocation(Location location, String moduleName) throws IOException {
+            try {
+                return clientJavaFileManager.getModuleLocation(location, moduleName);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Location getModuleLocation(Location location, JavaFileObject fo, String pkgName) throws IOException {
+            try {
+                return clientJavaFileManager.getModuleLocation(location, fo, pkgName);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public String inferModuleName(Location location) throws IOException {
+            try {
+                return clientJavaFileManager.inferModuleName(location);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<Set<Location>> listModuleLocations(Location location) throws IOException {
+            try {
+                return clientJavaFileManager.listModuleLocations(location);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
         public int isSupportedOption(String option) {
             try {
                 return clientJavaFileManager.isSupportedOption(option);
@@ -381,6 +426,17 @@
         }
 
         @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(Iterable<? extends Path> paths) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getJavaFileObjectsFromPaths(paths);
+            } 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);
@@ -392,6 +448,17 @@
         }
 
         @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends JavaFileObject> getJavaFileObjects(Path... paths) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getJavaFileObjects(paths);
+            } 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);
@@ -414,9 +481,20 @@
         }
 
         @Override @DefinedBy(Api.COMPILER)
-        public void setLocation(Location location, Iterable<? extends File> path) throws IOException {
+        public void setLocation(Location location, Iterable<? extends File> files) throws IOException {
             try {
-                ((StandardJavaFileManager)clientJavaFileManager).setLocation(location, path);
+                ((StandardJavaFileManager)clientJavaFileManager).setLocation(location, files);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public void setLocationFromPaths(Location location, Iterable<? extends Path> paths) throws IOException {
+            try {
+                ((StandardJavaFileManager)clientJavaFileManager).setLocationFromPaths(location, paths);
             } catch (ClientCodeException e) {
                 throw e;
             } catch (RuntimeException | Error e) {
@@ -434,6 +512,28 @@
                 throw new ClientCodeException(e);
             }
         }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Iterable<? extends Path> getLocationAsPaths(Location location) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).getLocationAsPaths(location);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
+
+        @Override @DefinedBy(Api.COMPILER)
+        public Path asPath(FileObject file) {
+            try {
+                return ((StandardJavaFileManager)clientJavaFileManager).asPath(file);
+            } catch (ClientCodeException e) {
+                throw e;
+            } catch (RuntimeException | Error e) {
+                throw new ClientCodeException(e);
+            }
+        }
     }
 
     protected class WrappedFileObject implements FileObject {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Thu Mar 17 19:04:28 2016 +0000
@@ -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
@@ -33,12 +33,17 @@
 
 import javax.annotation.processing.Processor;
 import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.TypeElement;
+import javax.lang.model.util.ElementFilter;
 import javax.tools.*;
+import javax.tools.JavaFileObject.Kind;
 
 import com.sun.source.tree.*;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.ModuleSymbol;
+import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.comp.*;
 import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.main.*;
@@ -49,6 +54,8 @@
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.JCClassDecl;
 import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
+import com.sun.tools.javac.tree.JCTree.JCModuleDecl;
+import com.sun.tools.javac.tree.JCTree.Tag;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.List;
@@ -253,7 +260,7 @@
      * @return a list of elements corresponding to the top level
      * classes in the abstract syntax trees
      */
-    public Iterable<? extends TypeElement> enter() {
+    public Iterable<? extends Element> enter() {
         return enter(null);
     }
 
@@ -264,11 +271,13 @@
      * @return a list of elements corresponding to the top level
      * classes in the abstract syntax trees
      */
-    public Iterable<? extends TypeElement> enter(Iterable<? extends CompilationUnitTree> trees)
+    public Iterable<? extends Element> enter(Iterable<? extends CompilationUnitTree> trees)
     {
         if (trees == null && notYetEntered != null && notYetEntered.isEmpty())
             return List.nil();
 
+        boolean wasInitialized = compiler != null;
+
         prepareCompiler(true);
 
         ListBuffer<JCCompilationUnit> roots = null;
@@ -305,22 +314,38 @@
             }
         }
 
-        if (roots == null)
+        if (roots == null) {
+            if (trees == null && !wasInitialized) {
+                compiler.initModules(List.nil());
+            }
             return List.nil();
+        }
+
+        List<JCCompilationUnit> units = compiler.initModules(roots.toList());
 
         try {
-            List<JCCompilationUnit> units = compiler.enterTrees(roots.toList());
+            units = compiler.enterTrees(units);
 
             if (notYetEntered.isEmpty())
                 compiler.processAnnotations(units);
 
-            ListBuffer<TypeElement> elements = new ListBuffer<>();
+            ListBuffer<Element> elements = new ListBuffer<>();
             for (JCCompilationUnit unit : units) {
-                for (JCTree node : unit.defs) {
-                    if (node.hasTag(JCTree.Tag.CLASSDEF)) {
-                        JCClassDecl cdef = (JCClassDecl) node;
-                        if (cdef.sym != null) // maybe null if errors in anno processing
-                            elements.append(cdef.sym);
+                boolean isPkgInfo = unit.sourcefile.isNameCompatible("package-info",
+                                                                     JavaFileObject.Kind.SOURCE);
+                if (isPkgInfo) {
+                    elements.append(unit.packge);
+                } else {
+                    for (JCTree node : unit.defs) {
+                        if (node.hasTag(JCTree.Tag.CLASSDEF)) {
+                            JCClassDecl cdef = (JCClassDecl) node;
+                            if (cdef.sym != null) // maybe null if errors in anno processing
+                                elements.append(cdef.sym);
+                        } else if (node.hasTag(JCTree.Tag.MODULEDEF)) {
+                            JCModuleDecl mdef = (JCModuleDecl) node;
+                            if (mdef.sym != null)
+                                elements.append(mdef.sym);
+                        }
                     }
                 }
             }
@@ -353,7 +378,7 @@
     // This implementation requires that we open up privileges on JavaCompiler.
     // An alternative implementation would be to move this code to JavaCompiler and
     // wrap it here
-    public Iterable<? extends Element> analyze(Iterable<? extends TypeElement> classes) {
+    public Iterable<? extends Element> analyze(Iterable<? extends Element> classes) {
         enter(null);  // ensure all classes have been entered
 
         final ListBuffer<Element> results = new ListBuffer<>();
@@ -383,8 +408,13 @@
                         if (cdef.sym != null)
                             elems.append(cdef.sym);
                         break;
-                    case TOPLEVEL:
-                        JCCompilationUnit unit = (JCCompilationUnit) env.tree;
+                    case MODULEDEF:
+                        JCModuleDecl mod = (JCModuleDecl) env.tree;
+                        if (mod.sym != null)
+                            elems.append(mod.sym);
+                        break;
+                    case PACKAGEDEF:
+                        JCCompilationUnit unit = env.toplevel;
                         if (unit.packge != null)
                             elems.append(unit.packge);
                         break;
@@ -413,7 +443,7 @@
      * @param classes a list of class elements
      * @return the files that were generated
      */
-    public Iterable<? extends JavaFileObject> generate(Iterable<? extends TypeElement> classes) {
+    public Iterable<? extends JavaFileObject> generate(Iterable<? extends Element> classes) {
         final ListBuffer<JavaFileObject> results = new ListBuffer<>();
         try {
             analyze(null);  // ensure all classes have been parsed, entered, and analyzed
@@ -447,17 +477,33 @@
         return TreeInfo.pathFor((JCTree) node, (JCTree.JCCompilationUnit) unit).reverse();
     }
 
+    public void ensureEntered() {
+        args.allowEmpty();
+        enter(null);
+    }
+
     abstract class Filter {
-        void run(Queue<Env<AttrContext>> list, Iterable<? extends TypeElement> classes) {
-            Set<TypeElement> set = new HashSet<>();
-            for (TypeElement item: classes)
+        void run(Queue<Env<AttrContext>> list, Iterable<? extends Element> elements) {
+            Set<Element> set = new HashSet<>();
+            for (Element item: elements) {
                 set.add(item);
+            }
 
             ListBuffer<Env<AttrContext>> defer = new ListBuffer<>();
             while (list.peek() != null) {
                 Env<AttrContext> env = list.remove();
-                ClassSymbol csym = env.enclClass.sym;
-                if (csym != null && set.contains(csym.outermostClass()))
+                Symbol test = null;
+
+                if (env.tree.hasTag(Tag.MODULEDEF)) {
+                    test = ((JCModuleDecl) env.tree).sym;
+                } else if (env.tree.hasTag(Tag.PACKAGEDEF)) {
+                    test = env.toplevel.packge;
+                } else {
+                    ClassSymbol csym = env.enclClass.sym;
+                    if (csym != null)
+                        test = csym.outermostClass();
+                }
+                if (test != null && set.contains(test))
                     process(env);
                 else
                     defer = defer.append(env);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java	Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -129,9 +129,17 @@
             }
 
             if (classes != null) {
-                for (String cls : classes)
-                    if (!SourceVersion.isName(cls)) // implicit null check
+                for (String cls : classes) {
+                    int sep = cls.indexOf('/'); // implicit null check
+                    if (sep > 0) {
+                        String mod = cls.substring(0, sep);
+                        if (!SourceVersion.isName(mod))
+                            throw new IllegalArgumentException("Not a valid module name: " + mod);
+                        cls = cls.substring(sep + 1);
+                    }
+                    if (!SourceVersion.isName(cls))
                         throw new IllegalArgumentException("Not a valid class name: " + cls);
+                }
             }
 
             if (compilationUnits != null) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Mar 17 19:04:28 2016 +0000
@@ -76,6 +76,7 @@
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.MethodSymbol;
+import com.sun.tools.javac.code.Symbol.ModuleSymbol;
 import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.code.Symbol.TypeSymbol;
 import com.sun.tools.javac.code.Symbol.VarSymbol;
@@ -92,6 +93,7 @@
 import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.comp.MemberEnter;
+import com.sun.tools.javac.comp.Modules;
 import com.sun.tools.javac.comp.Resolve;
 import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.model.JavacElements;
@@ -156,6 +158,7 @@
 public class JavacTrees extends DocTrees {
 
     // in a world of a single context per compilation, these would all be final
+    private Modules modules;
     private Resolve resolve;
     private Enter enter;
     private Log log;
@@ -206,6 +209,7 @@
     }
 
     private void init(Context context) {
+        modules = Modules.instance(context);
         attr = Attr.instance(context);
         enter = Enter.instance(context);
         elements = JavacElements.instance(context);
@@ -434,21 +438,31 @@
                 // and if not, then we check to see if it identifies a package.
                 Type t = attr.attribType(ref.qualifierExpression, env);
                 if (t.isErroneous()) {
-                    if (ref.memberName == null) {
-                        // Attr/Resolve assume packages exist and create symbols as needed
-                        // so use getPackageElement to restrict search to existing packages
-                        PackageSymbol pck = elements.getPackageElement(ref.qualifierExpression.toString());
-                        if (pck != null) {
-                            return pck;
-                        } else if (ref.qualifierExpression.hasTag(JCTree.Tag.IDENT)) {
+                    JCCompilationUnit toplevel =
+                        treeMaker.TopLevel(List.<JCTree>nil());
+                    final ModuleSymbol msym = modules.getDefaultModule();
+                    toplevel.modle = msym;
+                    toplevel.packge = msym.unnamedPackage;
+                    Symbol sym = attr.attribIdent(ref.qualifierExpression, toplevel);
+
+                    sym.complete();
+
+                    if ((sym.kind == PCK || sym.kind == TYP) && sym.exists()) {
+                        tsym = (TypeSymbol) sym;
+                        memberName = (Name) ref.memberName;
+                        if (sym.kind == PCK && memberName != null) {
+                            //cannot refer to a package "member"
+                            return null;
+                        }
+                    } else {
+                        if (ref.qualifierExpression.hasTag(JCTree.Tag.IDENT)) {
                             // fixup:  allow "identifier" instead of "#identifier"
                             // for compatibility with javadoc
                             tsym = env.enclClass.sym;
                             memberName = ((JCIdent) ref.qualifierExpression).name;
-                        } else
+                        } else {
                             return null;
-                    } else {
-                        return null;
+                        }
                     }
                 } else {
                     tsym = t.tsym;
@@ -1179,7 +1193,8 @@
             }
         };
 
-        PackageSymbol psym = javaFileObjectToPackageMap.getOrDefault(jfo, syms.unnamedPackage);
+        PackageSymbol psym = javaFileObjectToPackageMap.getOrDefault(jfo,
+                syms.unnamedModule.unnamedPackage);
 
         jcCompilationUnit.docComments = new DocCommentTable() {
             @Override
@@ -1209,13 +1224,12 @@
 
         };
         jcCompilationUnit.lineMap = jcCompilationUnit.getLineMap();
+        jcCompilationUnit.modle = psym.modle;
+        jcCompilationUnit.sourcefile = jfo;
         jcCompilationUnit.namedImportScope = new NamedImportScope(psym, jcCompilationUnit.toplevelScope);
         jcCompilationUnit.packge = psym;
-        jcCompilationUnit.starImportScope = null;
-        jcCompilationUnit.sourcefile = jfo;
         jcCompilationUnit.starImportScope = new StarImportScope(psym);
         jcCompilationUnit.toplevelScope = WriteableScope.create(psym);
-
         return new TreePath(jcCompilationUnit);
     }
 }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Thu Mar 17 19:04:28 2016 +0000
@@ -37,11 +37,13 @@
 import javax.tools.JavaFileManager.Location;
 import javax.tools.JavaFileObject;
 import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
 
 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.ModuleSymbol;
 import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.code.Symbol.TypeSymbol;
 import com.sun.tools.javac.comp.Annotate;
@@ -118,6 +120,10 @@
      */
     final Name completionFailureName;
 
+    /** Module specified with -Xmodule:
+     */
+    final Name moduleOverride;
+
     /** Access to files
      */
     private final JavaFileManager fileManager;
@@ -178,7 +184,7 @@
         return instance;
     }
 
-    /** Construct a new class reader. */
+    /** Construct a new class finder. */
     protected ClassFinder(Context context) {
         context.put(classFinderKey, this);
         reader = ClassReader.instance(context);
@@ -205,6 +211,9 @@
             ? names.fromString(options.get("failcomplete"))
             : null;
 
+        moduleOverride = options.isSet(XMODULE) ? names.fromString(options.get(XMODULE))
+                                                : null;
+
         // Temporary, until more info is available from the module system.
         boolean useCtProps;
         JavaFileManager fm = context.get(JavaFileManager.class);
@@ -237,7 +246,7 @@
      * available from the module system.
      */
     long getSupplementaryFlags(ClassSymbol c) {
-        if (jrtIndex == null || !jrtIndex.isInJRT(c.classfile)) {
+        if (jrtIndex == null || !jrtIndex.isInJRT(c.classfile) || c.name == names.module_info) {
             return 0;
         }
 
@@ -318,7 +327,7 @@
             for (Name name : Convert.enclosingCandidates(Convert.shortName(c.name))) {
                 Symbol encl = owner.members().findFirst(name);
                 if (encl == null)
-                    encl = syms.classes.get(TypeSymbol.formFlatName(name, owner));
+                    encl = syms.getClass(c.packge().modle, TypeSymbol.formFlatName(name, owner));
                 if (encl != null)
                     encl.complete();
             }
@@ -328,7 +337,7 @@
     /** Fill in definition of class `c' from corresponding class or
      *  source file.
      */
-    private void fillIn(ClassSymbol c) {
+    void fillIn(ClassSymbol c) {
         if (completionFailureName == c.fullname) {
             throw new CompletionFailure(c, "user-selected completion failure by class name");
         }
@@ -397,14 +406,21 @@
     /** Load a toplevel class with given fully qualified name
      *  The class is entered into `classes' only if load was successful.
      */
-    public ClassSymbol loadClass(Name flatname) throws CompletionFailure {
-        boolean absent = syms.classes.get(flatname) == null;
-        ClassSymbol c = syms.enterClass(flatname);
+    public ClassSymbol loadClass(ModuleSymbol msym, Name flatname) throws CompletionFailure {
+        Assert.checkNonNull(msym);
+        Name packageName = Convert.packagePart(flatname);
+        PackageSymbol ps = syms.lookupPackage(msym, packageName);
+
+        Assert.checkNonNull(ps.modle, () -> "msym=" + msym + "; flatName=" + flatname);
+
+        boolean absent = syms.getClass(ps.modle, flatname) == null;
+        ClassSymbol c = syms.enterClass(ps.modle, flatname);
+
         if (c.members_field == null) {
             try {
                 c.complete();
             } catch (CompletionFailure ex) {
-                if (absent) syms.classes.remove(flatname);
+                if (absent) syms.removeClass(ps.modle, flatname);
                 throw ex;
             }
         }
@@ -438,7 +454,7 @@
             ? p.package_info
             : (ClassSymbol) p.members_field.findFirst(classname);
         if (c == null) {
-            c = syms.enterClass(classname, p);
+            c = syms.enterClass(p.modle, classname, p);
             if (c.classfile == null) // only update the file if's it's newly created
                 c.classfile = file;
             if (isPkgInfo) {
@@ -479,6 +495,7 @@
     /**
      * specifies types of files to be read when filling in a package symbol
      */
+    // Note: overridden by JavadocClassFinder
     protected EnumSet<JavaFileObject.Kind> getPackageFileKinds() {
         return EnumSet.of(JavaFileObject.Kind.CLASS, JavaFileObject.Kind.SOURCE);
     }
@@ -502,16 +519,83 @@
         if (p.members_field == null)
             p.members_field = WriteableScope.create(p);
 
-        preferCurrent = false;
-        if (userPathsFirst) {
+        ModuleSymbol msym = p.modle;
+
+        Assert.checkNonNull(msym, () -> p.toString());
+
+        msym.complete();
+
+        if (msym == syms.noModule) {
+            preferCurrent = false;
+            if (userPathsFirst) {
+                scanUserPaths(p);
+                preferCurrent = true;
+                scanPlatformPath(p);
+            } else {
+                scanPlatformPath(p);
+                scanUserPaths(p);
+            }
+        } else if (msym.classLocation == StandardLocation.CLASS_PATH) {
+            // assert p.modle.sourceLocation == StandardLocation.SOURCE_PATH);
             scanUserPaths(p);
-            preferCurrent = true;
-            scanPlatformPath(p);
         } else {
-            scanPlatformPath(p);
-            scanUserPaths(p);
+            scanModulePaths(p, msym);
         }
-        verbosePath = false;
+    }
+
+    // TODO: for now, this is a much simplified form of scanUserPaths
+    // and (deliberately) does not default sourcepath to classpath.
+    // But, we need to think about retaining existing behavior for
+    // -classpath and -sourcepath for single module mode.
+    // One plausible solution is to detect if the module's sourceLocation
+    // is the same as the module's classLocation.
+    private void scanModulePaths(PackageSymbol p, ModuleSymbol msym) throws IOException {
+        Set<JavaFileObject.Kind> kinds = getPackageFileKinds();
+
+        Set<JavaFileObject.Kind> classKinds = EnumSet.copyOf(kinds);
+        classKinds.remove(JavaFileObject.Kind.SOURCE);
+        boolean wantClassFiles = !classKinds.isEmpty();
+
+        Set<JavaFileObject.Kind> sourceKinds = EnumSet.copyOf(kinds);
+        sourceKinds.remove(JavaFileObject.Kind.CLASS);
+        boolean wantSourceFiles = !sourceKinds.isEmpty();
+
+        String packageName = p.fullname.toString();
+
+        if (msym.name == moduleOverride) {
+            if (wantClassFiles) {
+                fillIn(p, CLASS_PATH,
+                       fileManager.list(CLASS_PATH,
+                                        packageName,
+                                        classKinds,
+                                        false));
+            }
+            if (wantSourceFiles && fileManager.hasLocation(SOURCE_PATH)) {
+                fillIn(p, SOURCE_PATH,
+                        fileManager.list(SOURCE_PATH,
+                                        packageName,
+                                        sourceKinds,
+                                        false));
+            }
+        }
+
+        Location classLocn = msym.classLocation;
+        Location sourceLocn = msym.sourceLocation;
+
+        if (wantClassFiles && (classLocn != null)) {
+            fillIn(p, classLocn,
+                   fileManager.list(classLocn,
+                                    packageName,
+                                    classKinds,
+                                    false));
+        }
+        if (wantSourceFiles && (sourceLocn != null)) {
+            fillIn(p, sourceLocn,
+                   fileManager.list(sourceLocn,
+                                    packageName,
+                                    sourceKinds,
+                                    false));
+        }
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2009, 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 com.sun.tools.javac.code;
+
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.Set;
+
+import javax.lang.model.element.ModuleElement;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
+
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.ModuleSymbol;
+import com.sun.tools.javac.code.Symbol.PackageSymbol;
+import com.sun.tools.javac.util.DefinedBy;
+import com.sun.tools.javac.util.DefinedBy.Api;
+import com.sun.tools.javac.util.List;
+
+
+/**
+ *  Root class for the directives that may appear in module compilation units.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public abstract class Directive implements ModuleElement.Directive {
+
+    /** Flags for RequiresDirective. */
+    public enum RequiresFlag {
+        PUBLIC(0x0020),
+        SYNTHETIC(0x1000),
+        MANDATED(0x8000),
+        EXTRA(0x10000);
+
+        // overkill? move to ClassWriter?
+        public static int value(Set<RequiresFlag> s) {
+            int v = 0;
+            for (RequiresFlag f: s)
+                v |= f.value;
+            return v;
+        }
+
+        RequiresFlag(int value) {
+            this.value = value;
+        }
+
+        public final int value;
+    }
+
+    /**
+     * 'exports' Package ';'
+     */
+    public static class ExportsDirective extends Directive
+            implements ModuleElement.ExportsDirective {
+        public final PackageSymbol packge;
+        public final List<ModuleSymbol> modules;
+
+        public ExportsDirective(PackageSymbol packge, List<ModuleSymbol> modules) {
+            this.packge = packge;
+            this.modules = modules;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public ModuleElement.DirectiveKind getKind() {
+            return ModuleElement.DirectiveKind.EXPORTS;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public PackageElement getPackage() {
+            return packge;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public java.util.List<? extends ModuleElement> getTargetModules() {
+            return Collections.unmodifiableList(modules);
+        }
+
+        @Override
+        public String toString() {
+            if (modules == null)
+                return "Exports[" + packge + "]";
+            else
+                return "Exports[" + packge + ":" + modules + "]";
+        }
+    }
+
+    /**
+     * 'provides' ServiceName 'with' QualifiedIdentifer ';'
+     */
+    public static class ProvidesDirective extends Directive
+            implements ModuleElement.ProvidesDirective {
+        public final ClassSymbol service;
+        public final ClassSymbol impl;
+
+        public ProvidesDirective(ClassSymbol service, ClassSymbol impl) {
+            this.service = service;
+            this.impl = impl;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public ModuleElement.DirectiveKind getKind() {
+            return ModuleElement.DirectiveKind.PROVIDES;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public TypeElement getService() {
+            return service;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public TypeElement getImplementation() {
+            return impl;
+        }
+
+        @Override
+        public String toString() {
+            return "Provides[" + service + "," + impl + "]";
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (!(obj instanceof ProvidesDirective)) {
+                return false;
+            }
+            ProvidesDirective other = (ProvidesDirective)obj;
+            return service == other.service && impl == other.impl;
+        }
+
+        @Override
+        public int hashCode() {
+            return service.hashCode() * 31 + impl.hashCode() * 37;
+        }
+    }
+
+    /**
+     * 'requires' ['public'] ModuleName ';'
+     */
+    public static class RequiresDirective extends Directive
+            implements ModuleElement.RequiresDirective {
+        public final ModuleSymbol module;
+        public final Set<RequiresFlag> flags;
+
+        public RequiresDirective(ModuleSymbol module) {
+            this(module, EnumSet.noneOf(RequiresFlag.class));
+        }
+
+        public RequiresDirective(ModuleSymbol module, Set<RequiresFlag> flags) {
+            this.module = module;
+            this.flags = flags;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public ModuleElement.DirectiveKind getKind() {
+            return ModuleElement.DirectiveKind.REQUIRES;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public boolean isPublic() {
+            return flags.contains(RequiresFlag.PUBLIC);
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public ModuleElement getDependency() {
+            return module;
+        }
+
+        @Override
+        public String toString() {
+            return "Requires[" + flags + "," + module + "]";
+        }
+    }
+
+    /**
+     * 'uses' ServiceName ';'
+     */
+    public static class UsesDirective extends Directive
+            implements ModuleElement.UsesDirective {
+        public final ClassSymbol service;
+
+        public UsesDirective(ClassSymbol service) {
+            this.service = service;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public ModuleElement.DirectiveKind getKind() {
+            return ModuleElement.DirectiveKind.USES;
+        }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public TypeElement getService() {
+            return service;
+        }
+
+        @Override
+        public String toString() {
+            return "Uses[" + service + "]";
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (!(obj instanceof UsesDirective)) {
+                return false;
+            }
+            UsesDirective other = (UsesDirective)obj;
+            return service == other.service;
+        }
+
+        @Override
+        public int hashCode() {
+            return service.hashCode() * 31;
+        }
+    }
+}
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java	Thu Mar 17 19:04:28 2016 +0000
@@ -107,6 +107,7 @@
     public static final int ACC_SUPER    = 0x0020;
     public static final int ACC_BRIDGE   = 0x0040;
     public static final int ACC_VARARGS  = 0x0080;
+    public static final int ACC_MODULE   = 0x8000;
 
     /*****************************************
      * Internal compiler flags (no bits in the lower 16).
@@ -277,6 +278,21 @@
      */
     public static final long TYPE_TRANSLATED = 1L<<50;
 
+    /**
+     * Flag to indicate class symbol is for module-info
+     */
+    public static final long MODULE = 1L<<51;
+
+    /**
+     * Flag to indicate the given ModuleSymbol is an automatic module.
+     */
+    public static final long AUTOMATIC_MODULE = 1L<<52;
+
+    /**
+     * Flag to indicate the given ModuleSymbol is a system module.
+     */
+    public static final long SYSTEM_MODULE = 1L<<53;
+
     /** Modifier masks.
      */
     public static final int
@@ -385,7 +401,8 @@
         SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
         THROWS(Flags.THROWS),
         LAMBDA_METHOD(Flags.LAMBDA_METHOD),
-        TYPE_TRANSLATED(Flags.TYPE_TRANSLATED);
+        TYPE_TRANSLATED(Flags.TYPE_TRANSLATED),
+        MODULE(Flags.MODULE);
 
         Flag(long flag) {
             this.value = flag;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java	Thu Mar 17 19:04:28 2016 +0000
@@ -65,6 +65,7 @@
         VAR(Category.BASIC, KindName.VAR, KindSelector.VAR),
         MTH(Category.BASIC, KindName.METHOD, KindSelector.MTH),
         POLY(Category.BASIC, KindSelector.POLY),
+        MDL(Category.BASIC, KindSelector.MDL),
         ERR(Category.ERROR, KindSelector.ERR),
         AMBIGUOUS(Category.RESOLUTION_TARGET),                         // overloaded       target
         HIDDEN(Category.RESOLUTION_TARGET),                            // not overloaded   non-target
@@ -169,9 +170,10 @@
         public static final KindSelector VAR = new KindSelector(0x04);
         public static final KindSelector VAL = new KindSelector(0x0c);
         public static final KindSelector MTH = new KindSelector(0x10);
-        public static final KindSelector ERR = new KindSelector(0x3f);
         public static final KindSelector POLY = new KindSelector(0x20);
-        public static final KindSelector ASG = new KindSelector(0x44);
+        public static final KindSelector MDL = new KindSelector(0x40);
+        public static final KindSelector ERR = new KindSelector(0x7f);
+        public static final KindSelector ASG = new KindSelector(0x84);
 
         //common derived selectors
         public static final KindSelector TYP_PCK = of(TYP, PCK);
@@ -212,6 +214,7 @@
             if ((data & MTH.data) != 0) kinds.add(KindName.METHOD);
             if ((data & TYP.data) != 0) kinds.add(KindName.CLASS);
             if ((data & PCK.data) != 0) kinds.add(KindName.PACKAGE);
+            if ((data & MDL.data) != 0) kinds.add(KindName.MODULE);
             return kinds;
         }
     }
@@ -230,7 +233,8 @@
         CLASS("kindname.class"),
         STATIC_INIT("kindname.static.init"),
         INSTANCE_INIT("kindname.instance.init"),
-        PACKAGE("kindname.package");
+        PACKAGE("kindname.package"),
+        MODULE("kindname.module");
 
         private final String name;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java	Thu Mar 17 19:04:28 2016 +0000
@@ -0,0 +1,335 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.tools.javac.code;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileManager.Location;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.StandardLocation;
+
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
+import com.sun.tools.javac.code.Symbol.ModuleSymbol;
+import com.sun.tools.javac.resources.CompilerProperties.Errors;
+import com.sun.tools.javac.resources.CompilerProperties.Fragments;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.JCDiagnostic;
+import com.sun.tools.javac.util.JCDiagnostic.Fragment;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.ListBuffer;
+import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.Name;
+import com.sun.tools.javac.util.Names;
+import com.sun.tools.javac.util.StringUtils;
+
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
+/**
+ *  This class provides operations to locate module definitions
+ *  from the source and class files on the paths provided to javac.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class ModuleFinder {
+    /** The context key for the module finder. */
+    protected static final Context.Key<ModuleFinder> moduleFinderKey = new Context.Key<>();
+
+    /** The log to use for verbose output. */
+    private final Log log;
+
+    /** The symbol table. */
+    private final Symtab syms;
+
+    /** The name table. */
+    private final Names names;
+
+    private final ClassFinder classFinder;
+
+    /** Access to files
+     */
+    private final JavaFileManager fileManager;
+
+    private final JCDiagnostic.Factory diags;
+
+    /** Get the ModuleFinder instance for this invocation. */
+    public static ModuleFinder instance(Context context) {
+        ModuleFinder instance = context.get(moduleFinderKey);
+        if (instance == null)
+            instance = new ModuleFinder(context);
+        return instance;
+    }
+
+    /** Construct a new module finder. */
+    protected ModuleFinder(Context context) {
+        context.put(moduleFinderKey, this);
+        names = Names.instance(context);
+        syms = Symtab.instance(context);
+        fileManager = context.get(JavaFileManager.class);
+        log = Log.instance(context);
+        classFinder = ClassFinder.instance(context);
+
+        diags = JCDiagnostic.Factory.instance(context);
+    }
+
+    class ModuleLocationIterator implements Iterator<Set<Location>> {
+        StandardLocation outer;
+        Set<Location> next = null;
+
+        Iterator<StandardLocation> outerIter = Arrays.asList(
+                StandardLocation.MODULE_SOURCE_PATH,
+                StandardLocation.UPGRADE_MODULE_PATH,
+                StandardLocation.SYSTEM_MODULES,
+                StandardLocation.MODULE_PATH
+        ).iterator();
+        Iterator<Set<Location>> innerIter = null;
+
+        @Override
+        public boolean hasNext() {
+            while (next == null) {
+                while (innerIter == null || !innerIter.hasNext()) {
+                    if (outerIter.hasNext()) {
+                        outer = outerIter.next();
+                        try {
+                            innerIter = fileManager.listModuleLocations(outer).iterator();
+                        } catch (IOException e) {
+                            System.err.println("error listing module locations for " + outer + ": " + e);  // FIXME
+                        }
+                    } else
+                        return false;
+                }
+
+                if (innerIter.hasNext())
+                    next = innerIter.next();
+            }
+            return true;
+        }
+
+        @Override
+        public Set<Location> next() {
+            hasNext();
+            if (next != null) {
+                Set<Location> result = next;
+                next = null;
+                return result;
+            }
+            throw new NoSuchElementException();
+        }
+
+    }
+
+    ModuleLocationIterator moduleLocationIterator = new ModuleLocationIterator();
+
+    public ModuleSymbol findModule(Name name) {
+        return findModule(syms.enterModule(name));
+    }
+
+    public ModuleSymbol findModule(ModuleSymbol msym) {
+        if (msym.kind != ERR && msym.sourceLocation == null && msym.classLocation == null) {
+            // fill in location
+            List<ModuleSymbol> list = scanModulePath(msym);
+            if (list.isEmpty()) {
+                msym.kind = ERR;
+            }
+        }
+        if (msym.kind != ERR && msym.module_info.sourcefile == null && msym.module_info.classfile == null) {
+            // fill in module-info
+            findModuleInfo(msym);
+        }
+        return msym;
+    }
+
+    public List<ModuleSymbol> findAllModules() {
+        List<ModuleSymbol> list = scanModulePath(null);
+        for (ModuleSymbol