changeset 14495:5aadb299a052

Merge
author mchung
date Tue, 17 Nov 2015 15:13:05 -0800
parents e5fcea3aa679 2376cb553336
children fa885780a428
files
diffstat 48 files changed, 321 insertions(+), 306 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileInterimRmic.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/CompileInterimRmic.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -44,6 +44,7 @@
 $(eval $(call SetupJavaCompilation,BUILD_INTERIM_RMIC, \
     SETUP := GENERATE_OLDBYTECODE, \
     SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes, \
+    EXCLUDE_FILES := module-info.java, \
     INCLUDES := $(RMIC_PKGS), \
     BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.rmic, \
     COPY := .properties))
--- a/make/copy/Copy-java.base.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/copy/Copy-java.base.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -215,4 +215,4 @@
   TARGETS += $(CONF_DST_DIR)/sdp/sdp.conf.template
 endif
 
-##########################################################################################
+################################################################################
--- a/make/copy/CopyCommon.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/copy/CopyCommon.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -23,7 +23,7 @@
 # questions.
 #
 
-INCLUDE_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE)
+INCLUDE_DST_DIR := $(MODULES_INCLUDE_OUTPUTDIR)/$(MODULE)
 LIB_DST_DIR := $(MODULES_LIBS_OUTPUTDIR)/$(MODULE)
 CONF_DST_DIR := $(MODULES_CONF_OUTPUTDIR)/$(MODULE)
 
--- a/make/gensrc/Gensrc-java.management.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/gensrc/Gensrc-java.management.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -28,8 +28,6 @@
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, jdk, gensrc/Gensrc-java.management.gmk))
 
-TARGETS += $(GENSRC_JAVA_MANAGEMENT)
-
 ################################################################################
 
 include GensrcProperties.gmk
--- a/make/launcher/Launcher-java.base.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-java.base.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -68,8 +68,7 @@
 endif
 
 $(eval $(call SetupBuildLauncher, keytool, \
-    MAIN_MODULE := java.base, \
-    MAIN_CLASS  := sun.security.tools.keytool.Main, \
+    MAIN_CLASS := sun.security.tools.keytool.Main, \
 ))
 
 ################################################################################
--- a/make/launcher/Launcher-java.corba.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-java.corba.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,13 +26,11 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, idlj, \
-    MAIN_MODULE := java.corba, \
-    MAIN_CLASS  := com.sun.tools.corba.se.idl.toJavaPortable.Compile, \
+    MAIN_CLASS := com.sun.tools.corba.se.idl.toJavaPortable.Compile, \
 ))
 
 $(eval $(call SetupBuildLauncher, orbd, \
-    MAIN_MODULE := java.corba, \
-    MAIN_CLASS  := com.sun.corba.se.impl.activation.ORBD, \
+    MAIN_CLASS := com.sun.corba.se.impl.activation.ORBD, \
     JAVA_ARGS := \
         -Dcom.sun.CORBA.activation.DbDir=./orb.db \
         -Dcom.sun.CORBA.activation.Port=1049 \
@@ -40,13 +38,11 @@
 ))
 
 $(eval $(call SetupBuildLauncher, servertool, \
-    MAIN_MODULE := java.corba, \
-    MAIN_CLASS  := com.sun.corba.se.impl.activation.ServerTool, \
+    MAIN_CLASS := com.sun.corba.se.impl.activation.ServerTool, \
 ))
 
 $(eval $(call SetupBuildLauncher, tnameserv, \
-    MAIN_MODULE := java.corba, \
-    MAIN_CLASS  := com.sun.corba.se.impl.naming.cosnaming.TransientNameServer, \
+    MAIN_CLASS := com.sun.corba.se.impl.naming.cosnaming.TransientNameServer, \
     JAVA_ARGS := \
         -Dcom.sun.CORBA.activation.DbDir=./orb.db \
         -Djava.util.logging.LoggingPermission=contol \
--- a/make/launcher/Launcher-java.desktop.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-java.desktop.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -30,8 +30,7 @@
 
 ifndef BUILD_HEADLESS_ONLY
   $(eval $(call SetupBuildLauncher, appletviewer, \
-      MAIN_MODULE := java.desktop, \
-      MAIN_CLASS  := sun.applet.Main, \
+      MAIN_CLASS := sun.applet.Main, \
       JAVA_ARGS := -addmods ALL-SYSTEM, \
       LIBS_unix := $(X_LIBS), \
   ))
--- a/make/launcher/Launcher-java.rmi.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-java.rmi.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,11 +26,9 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, rmid, \
-    MAIN_MODULE := java.rmi, \
-    MAIN_CLASS  := sun.rmi.server.Activation, \
+    MAIN_CLASS := sun.rmi.server.Activation, \
 ))
 
 $(eval $(call SetupBuildLauncher, rmiregistry, \
-    MAIN_MODULE := java.rmi, \
-    MAIN_CLASS  := sun.rmi.registry.RegistryImpl, \
+    MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
 ))
--- a/make/launcher/Launcher-java.scripting.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-java.scripting.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,6 +26,5 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jrunscript, \
-    MAIN_MODULE := java.scripting, \
-    MAIN_CLASS  := com.sun.tools.script.shell.Main, \
+    MAIN_CLASS := com.sun.tools.script.shell.Main, \
 ))
--- a/make/launcher/Launcher-java.security.jgss.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-java.security.jgss.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -27,17 +27,14 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   $(eval $(call SetupBuildLauncher, kinit, \
-      MAIN_MODULE := java.security.jgss, \
-      MAIN_CLASS  := sun.security.krb5.internal.tools.Kinit, \
+      MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \
   ))
 
   $(eval $(call SetupBuildLauncher, klist, \
-      MAIN_MODULE := java.security.jgss, \
-      MAIN_CLASS  := sun.security.krb5.internal.tools.Klist, \
+      MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \
   ))
 
   $(eval $(call SetupBuildLauncher, ktab, \
-      MAIN_MODULE := java.security.jgss, \
-      MAIN_CLASS  := sun.security.krb5.internal.tools.Ktab, \
+      MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \
   ))
 endif
--- a/make/launcher/Launcher-jdk.compiler.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.compiler.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,22 +26,19 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, javac, \
-    MAIN_MODULE := jdk.compiler, \
-    MAIN_CLASS  := com.sun.tools.javac.Main, \
+   MAIN_CLASS := com.sun.tools.javac.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
 
 $(eval $(call SetupBuildLauncher, javah, \
-    MAIN_MODULE := jdk.compiler, \
-    MAIN_CLASS  := com.sun.tools.javah.Main, \
+    MAIN_CLASS := com.sun.tools.javah.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
 
 $(eval $(call SetupBuildLauncher, serialver, \
-    MAIN_MODULE := jdk.compiler, \
-    MAIN_CLASS  := sun.tools.serialver.SerialVer, \
+    MAIN_CLASS := sun.tools.serialver.SerialVer, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
 
@@ -49,8 +46,7 @@
   # Build sjavac directly to the exploded image so that it does not get included
   # into any real images
   $(eval $(call SetupBuildLauncher, sjavac, \
-      MAIN_MODULE := jdk.compiler, \
-      MAIN_CLASS  := com.sun.tools.sjavac.Main, \
+      MAIN_CLASS := com.sun.tools.sjavac.Main, \
       CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
           -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
       OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
--- a/make/launcher/Launcher-jdk.hotspot.agent.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.hotspot.agent.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,14 +26,12 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jsadebugd, \
-    MAIN_MODULE := jdk.hotspot.agent, \
-    MAIN_CLASS  := sun.jvm.hotspot.jdi.SADebugServer, \
+    MAIN_CLASS := sun.jvm.hotspot.jdi.SADebugServer, \
     MACOSX_SIGNED := true, \
 ))
 
 
 $(eval $(call SetupBuildLauncher, jhsdb, \
-    MAIN_MODULE := jdk.hotspot.agent, \
-    MAIN_CLASS  := sun.jvm.hotspot.SALauncher, \
+    MAIN_CLASS := sun.jvm.hotspot.SALauncher, \
     MACOSX_SIGNED := true, \
 ))
--- a/make/launcher/Launcher-jdk.jartool.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jartool.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,11 +26,9 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jar, \
-    MAIN_MODULE := jdk.jartool, \
-    MAIN_CLASS  := sun.tools.jar.Main, \
+    MAIN_CLASS := sun.tools.jar.Main, \
 ))
 
 $(eval $(call SetupBuildLauncher, jarsigner, \
-    MAIN_MODULE := jdk.jartool, \
-    MAIN_CLASS  := sun.security.tools.jarsigner.Main, \
+    MAIN_CLASS := sun.security.tools.jarsigner.Main, \
 ))
--- a/make/launcher/Launcher-jdk.javadoc.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.javadoc.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,8 +26,7 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, javadoc, \
-    MAIN_MODULE := jdk.javadoc, \
-    MAIN_CLASS  := com.sun.tools.javadoc.Main, \
+    MAIN_CLASS := com.sun.tools.javadoc.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
--- a/make/launcher/Launcher-jdk.jcmd.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jcmd.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,8 +26,7 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jinfo, \
-    MAIN_MODULE := jdk.jcmd, \
-    MAIN_CLASS  := sun.tools.jinfo.JInfo, \
+    MAIN_CLASS := sun.tools.jinfo.JInfo, \
     JAVA_ARGS := \
         -Dsun.jvm.hotspot.debugger.useProcDebugger \
         -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
@@ -36,8 +35,7 @@
 ))
 
 $(eval $(call SetupBuildLauncher, jmap, \
-    MAIN_MODULE := jdk.jcmd, \
-    MAIN_CLASS  := sun.tools.jmap.JMap, \
+    MAIN_CLASS := sun.tools.jmap.JMap, \
     JAVA_ARGS := \
         -Dsun.jvm.hotspot.debugger.useProcDebugger \
         -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
@@ -46,13 +44,11 @@
 ))
 
 $(eval $(call SetupBuildLauncher, jps, \
-    MAIN_MODULE := jdk.jcmd, \
-    MAIN_CLASS  := sun.tools.jps.Jps, \
+    MAIN_CLASS := sun.tools.jps.Jps, \
 ))
 
 $(eval $(call SetupBuildLauncher, jstack, \
-    MAIN_MODULE := jdk.jcmd, \
-    MAIN_CLASS  := sun.tools.jstack.JStack, \
+    MAIN_CLASS := sun.tools.jstack.JStack, \
     JAVA_ARGS := \
         -Dsun.jvm.hotspot.debugger.useProcDebugger \
         -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
@@ -61,11 +57,9 @@
 ))
 
 $(eval $(call SetupBuildLauncher, jstat, \
-    MAIN_MODULE := jdk.jcmd, \
-    MAIN_CLASS  := sun.tools.jstat.Jstat, \
+    MAIN_CLASS := sun.tools.jstat.Jstat, \
 ))
 
 $(eval $(call SetupBuildLauncher, jcmd, \
-    MAIN_MODULE := jdk.jcmd, \
-    MAIN_CLASS  := sun.tools.jcmd.JCmd, \
+    MAIN_CLASS := sun.tools.jcmd.JCmd, \
 ))
--- a/make/launcher/Launcher-jdk.jconsole.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jconsole.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,8 +26,7 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jconsole, \
-    MAIN_MODULE := jdk.jconsole, \
-    MAIN_CLASS  := sun.tools.jconsole.JConsole, \
+    MAIN_CLASS := sun.tools.jconsole.JConsole, \
     JAVA_ARGS := -Djconsole.showOutputViewer, \
     CFLAGS_windows := -DJAVAW, \
     LIBS_windows := user32.lib, \
--- a/make/launcher/Launcher-jdk.jdeps.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jdeps.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,15 +26,13 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, javap, \
-    MAIN_MODULE := jdk.jdeps, \
-    MAIN_CLASS  := com.sun.tools.javap.Main, \
+    MAIN_CLASS := com.sun.tools.javap.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
 
 $(eval $(call SetupBuildLauncher, jdeps, \
-    MAIN_MODULE := jdk.jdeps, \
-    MAIN_CLASS  := com.sun.tools.jdeps.Main, \
+    MAIN_CLASS := com.sun.tools.jdeps.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
--- a/make/launcher/Launcher-jdk.jdi.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jdi.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,6 +26,5 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jdb, \
-    MAIN_MODULE := jdk.jdi, \
-    MAIN_CLASS  := com.sun.tools.example.debug.tty.TTY, \
+    MAIN_CLASS := com.sun.tools.example.debug.tty.TTY, \
 ))
--- a/make/launcher/Launcher-jdk.jlink.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jlink.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,22 +26,19 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jimage,\
-    MAIN_MODULE := jdk.jlink, \
-    MAIN_CLASS  := jdk.tools.jimage.Main, \
+    MAIN_CLASS := jdk.tools.jimage.Main, \
     CFLAGS := -DENABLE_ARG_FILES, \
 ))
 
 $(eval $(call SetupBuildLauncher, jlink,\
-    MAIN_MODULE := jdk.jlink, \
-    MAIN_CLASS  := jdk.tools.jlink.Main, \
+    MAIN_CLASS := jdk.tools.jlink.Main, \
     CFLAGS := -DENABLE_ARG_FILES \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
 
 $(eval $(call SetupBuildLauncher, jmod,\
-    MAIN_MODULE := jdk.jlink, \
-    MAIN_CLASS  := jdk.tools.jmod.Main, \
+    MAIN_CLASS := jdk.tools.jmod.Main, \
     CFLAGS := -DENABLE_ARG_FILES \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
--- a/make/launcher/Launcher-jdk.jshell.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jshell.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,8 +26,7 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jshell, \
-    MAIN_MODULE := jdk.jshell, \
-    MAIN_CLASS  := jdk.internal.jshell.tool.JShellTool, \
+    MAIN_CLASS := jdk.internal.jshell.tool.JShellTool, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
 ))
--- a/make/launcher/Launcher-jdk.jvmstat.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.jvmstat.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,6 +26,5 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jstatd, \
-    MAIN_MODULE := jdk.jvmstat, \
-    MAIN_CLASS  := sun.tools.jstatd.Jstatd, \
+    MAIN_CLASS := sun.tools.jstatd.Jstatd, \
 ))
--- a/make/launcher/Launcher-jdk.pack200.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.pack200.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -27,7 +27,7 @@
 
 $(eval $(call SetupBuildLauncher, pack200, \
     MAIN_MODULE := java.base, \
-    MAIN_CLASS  := com.sun.java.util.jar.pack.Driver, \
+    MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \
 ))
 
 ################################################################################
--- a/make/launcher/Launcher-jdk.policytool.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.policytool.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -27,8 +27,7 @@
 
 ifndef BUILD_HEADLESS_ONLY
   $(eval $(call SetupBuildLauncher, policytool, \
-      MAIN_MODULE := jdk.policytool, \
-      MAIN_CLASS  := sun.security.tools.policytool.PolicyTool, \
+      MAIN_CLASS := sun.security.tools.policytool.PolicyTool, \
       LIBS_unix := $(X_LIBS), \
   ))
 endif
--- a/make/launcher/Launcher-jdk.rmic.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.rmic.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,7 +26,6 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, rmic, \
-    MAIN_MODULE := jdk.rmic, \
-    MAIN_CLASS  := sun.rmi.rmic.Main, \
+    MAIN_CLASS := sun.rmi.rmic.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
--- a/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,7 +26,6 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, jjs, \
-    MAIN_MODULE := jdk.scripting.nashorn.shell, \
-    MAIN_CLASS  := jdk.nashorn.tools.jjs.Main, \
+    MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \
     CFLAGS := -DENABLE_ARG_FILES, \
 ))
--- a/make/launcher/Launcher-jdk.xml.bind.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.xml.bind.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,11 +26,9 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, schemagen, \
-    MAIN_MODULE := jdk.xml.bind, \
-    MAIN_CLASS  := com.sun.tools.internal.jxc.SchemaGenerator, \
+    MAIN_CLASS := com.sun.tools.internal.jxc.SchemaGenerator, \
 ))
 
 $(eval $(call SetupBuildLauncher, xjc, \
-    MAIN_MODULE := jdk.xml.bind, \
-    MAIN_CLASS  := com.sun.tools.internal.xjc.Driver, \
+    MAIN_CLASS := com.sun.tools.internal.xjc.Driver, \
 ))
--- a/make/launcher/Launcher-jdk.xml.ws.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/Launcher-jdk.xml.ws.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -26,11 +26,9 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, wsgen, \
-    MAIN_MODULE := jdk.xml.ws, \
-    MAIN_CLASS  := com.sun.tools.internal.ws.WsGen, \
+    MAIN_CLASS := com.sun.tools.internal.ws.WsGen, \
 ))
 
 $(eval $(call SetupBuildLauncher, wsimport, \
-    MAIN_MODULE := jdk.xml.ws, \
-    MAIN_CLASS  := com.sun.tools.internal.ws.WsImport, \
+    MAIN_CLASS := com.sun.tools.internal.ws.WsImport, \
 ))
--- a/make/launcher/LauncherCommon.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/launcher/LauncherCommon.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -62,7 +62,8 @@
 # used as the name of the executable.
 #
 # Remaining parameters are named arguments. These include:
-# MAIN_MODULE  The module of the main class to launch
+# MAIN_MODULE  The module of the main class to launch if different from the 
+#     current module
 # MAIN_CLASS   The Java main class to launch
 # JAVA_ARGS   Processed into a -DJAVA_ARGS C flag
 # APP_CLASSPATH   Processed into a -DAPP_CLASSPATH C flag
@@ -98,15 +99,13 @@
     $1_JAVA_ARGS += -ms8m
   endif
 
-  ifneq ($$($1_MAIN_MODULE), )
-    $1_MODULE_MAIN_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS)
-  else
-    $1_MODULE_MAIN_CLASS := $$($1_MAIN_CLASS)
+  ifeq ($$($1_MAIN_MODULE), )
+    $1_MAIN_MODULE := $(MODULE)
   endif
 
   ifneq ($$($1_JAVA_ARGS), )
     $1_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \
-        $$(addprefix -J, $$($1_JAVA_ARGS)) $$($1_MODULE_MAIN_CLASS), "$$a"$(COMMA) )) }'
+        $$(addprefix -J, $$($1_JAVA_ARGS)) -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS), "$$a"$(COMMA) )) }'
     $1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR)
   endif
 
@@ -136,7 +135,7 @@
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), aix)
-    $1_LDFLAGS_SUFFIX += -L$(NATIVE_OUTPUTDIR)/java.base -ljli_static
+    $1_LDFLAGS += -L$(NATIVE_OUTPUTDIR)/java.base
     $1_LIBS += -ljli_static
   endif
 
--- a/make/lib/CoreLibraries.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/lib/CoreLibraries.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -261,7 +261,7 @@
         -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
         -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
         -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
+        -I$(HEADERS_OUTPUTDIR)/java.base, \
     CFLAGS_unix := -UDEBUG, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/make/lib/Lib-java.instrument.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/lib/Lib-java.instrument.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -76,7 +76,7 @@
     LIBS_macosx := -liconv -framework Cocoa -framework Security \
         -framework ApplicationServices, \
     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \
-        $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib, \
+        $(NATIVE_OUTPUTDIR)/java.base/jli_static.lib, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
     RC_FLAGS := $(RC_FLAGS) \
         -D "JDK_FNAME=instrument.dll" \
--- a/make/lib/Lib-jdk.crypto.ucrypto.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/lib/Lib-jdk.crypto.ucrypto.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -43,7 +43,7 @@
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LIBS := $(LIBDL), \
       LIBS_solaris := -lc, \
-      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \
+      OBJECT_DIR := $(NATIVE_OUTPUTDIR)/$(MODULE)/libj2ucrypto, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
   $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA)
--- a/make/lib/Lib-jdk.internal.le.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/lib/Lib-jdk.internal.le.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -33,7 +33,7 @@
       #
   LIBLE_CPPFLAGS := \
       $(addprefix -I, $(LIBLE_SRC)) \
-      -I$(SUPPORT_OUTPUTDIR)/headers/jdk.internal.le \
+      -I$(HEADERS_OUTPUTDIR)/jdk.internal.le \
       #
 
   $(eval $(call SetupNativeCompilation,BUILD_LIBLE, \
--- a/make/lib/SecurityLibraries.gmk	Tue Nov 17 15:12:29 2015 -0800
+++ b/make/lib/SecurityLibraries.gmk	Tue Nov 17 15:13:05 2015 -0800
@@ -32,7 +32,7 @@
   LIBOSXSECURITY_DIRS := $(JDK_TOPDIR)/src/java.base/macosx/native/libosxsecurity
   LIBOSXSECURITY_CFLAGS := -I$(LIBOSXSECURITY_DIRS) \
       $(LIBJAVA_HEADER_FLAGS) \
-      -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
+      -I$(HEADERS_OUTPUTDIR)/java.base \
 
   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXSECURITY, \
       LIBRARY := osxsecurity, \
@@ -43,7 +43,7 @@
           $(LIBOSXSECURITY_CFLAGS), \
       DISABLED_WARNINGS_clang := deprecated-declarations, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
-          -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
+          -L$(MODULES_LIBS_OUTPUTDIR)/java.base \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -fobjc-link-runtime, \
       LIBS := \
--- a/src/java.base/share/classes/jdk/internal/jimage/UTF8String.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jimage/UTF8String.java	Tue Nov 17 15:13:05 2015 -0800
@@ -258,10 +258,10 @@
 
     @Override
     public String toString() {
-        ByteBuffer buffer = ByteBuffer.allocate(bytes.length+2);
+        ByteBuffer buffer = ByteBuffer.allocate(count+2);
         buffer.order(ByteOrder.BIG_ENDIAN);
-        buffer.putShort((short)bytes.length);
-        buffer.put(bytes);
+        buffer.putShort((short)count);
+        buffer.put(bytes, offset, count);
         ByteArrayInputStream stream = new ByteArrayInputStream(buffer.array());
         DataInputStream in = new DataInputStream(stream);
         try {
--- a/src/java.base/share/classes/jdk/internal/jimage/decompressor/CompressedResourceHeader.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jimage/decompressor/CompressedResourceHeader.java	Tue Nov 17 15:13:05 2015 -0800
@@ -37,16 +37,16 @@
  */
 public final class CompressedResourceHeader {
 
-    private static final int SIZE = 21;
+    private static final int SIZE = 29;
     public static final int MAGIC = 0xCAFEFAFA;
-    private final int uncompressedSize;
-    private final int compressedSize;
+    private final long uncompressedSize;
+    private final long compressedSize;
     private final int decompressorNameOffset;
     private final int contentOffset;
     private final boolean isTerminal;
 
-    public CompressedResourceHeader(int compressedSize,
-            int uncompressedSize, int decompressorNameOffset, int contentOffset,
+    public CompressedResourceHeader(long compressedSize,
+            long uncompressedSize, int decompressorNameOffset, int contentOffset,
             boolean isTerminal) {
         this.compressedSize = compressedSize;
         this.uncompressedSize = uncompressedSize;
@@ -75,11 +75,11 @@
         return provider.getString(contentOffset);
     }
 
-    public int getUncompressedSize() {
+    public long getUncompressedSize() {
         return uncompressedSize;
     }
 
-    public int getResourceSize() {
+    public long getResourceSize() {
         return compressedSize;
     }
 
@@ -88,8 +88,8 @@
         ByteBuffer buffer = ByteBuffer.allocate(SIZE);
         buffer.order(order);
         buffer.putInt(MAGIC);
-        buffer.putInt(compressedSize);
-        buffer.putInt(uncompressedSize);
+        buffer.putLong(compressedSize);
+        buffer.putLong(uncompressedSize);
         buffer.putInt(decompressorNameOffset);
         buffer.putInt(contentOffset);
         buffer.put(isTerminal ? (byte)1 : (byte)0);
@@ -113,8 +113,8 @@
         if(magic != MAGIC) {
             return null;
         }
-        int size = buffer.getInt();
-        int uncompressedSize = buffer.getInt();
+        long size = buffer.getLong();
+        long uncompressedSize = buffer.getLong();
         int decompressorNameOffset = buffer.getInt();
         int contentIndex = buffer.getInt();
         byte isTerminal = buffer.get();
--- a/src/java.base/share/classes/jdk/internal/jimage/decompressor/ResourceDecompressor.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jimage/decompressor/ResourceDecompressor.java	Tue Nov 17 15:13:05 2015 -0800
@@ -49,5 +49,5 @@
      * @throws Exception
      */
     public byte[] decompress(StringsProvider strings, byte[] content, int offset,
-            int originalSize) throws Exception;
+            long originalSize) throws Exception;
 }
--- a/src/java.base/share/classes/jdk/internal/jimage/decompressor/StringSharingDecompressor.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jimage/decompressor/StringSharingDecompressor.java	Tue Nov 17 15:13:05 2015 -0800
@@ -224,7 +224,7 @@
 
     @Override
     public byte[] decompress(StringsProvider reader, byte[] content,
-            int offset, int originalSize) throws Exception {
+            int offset, long originalSize) throws Exception {
         return normalize(reader, content, offset);
     }
 }
--- a/src/java.base/share/classes/jdk/internal/jimage/decompressor/ZipDecompressor.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jimage/decompressor/ZipDecompressor.java	Tue Nov 17 15:13:05 2015 -0800
@@ -25,8 +25,6 @@
 package jdk.internal.jimage.decompressor;
 
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.zip.DataFormatException;
 import java.util.zip.Inflater;
 
 /**
@@ -61,7 +59,7 @@
 
     @Override
     public byte[] decompress(StringsProvider reader, byte[] content, int offset,
-            int originalSize) throws Exception {
+            long originalSize) throws Exception {
         byte[] decompressed = decompress(content, offset);
         return decompressed;
     }
--- a/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtFileSystem.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtFileSystem.java	Tue Nov 17 15:13:05 2015 -0800
@@ -232,48 +232,48 @@
     }
 
     // These methods throw read only file system exception
-    final void setTimes(byte[] path, FileTime mtime, FileTime atime, FileTime ctime)
+    final void setTimes(AbstractJrtPath jrtPath, FileTime mtime, FileTime atime, FileTime ctime)
             throws IOException {
         throw readOnly();
     }
 
-    final void createDirectory(byte[] path, FileAttribute<?>... attrs) throws IOException {
+    final void createDirectory(AbstractJrtPath jrtPath, FileAttribute<?>... attrs) throws IOException {
         throw readOnly();
     }
 
-    final void deleteFile(byte[] path, boolean failIfNotExists)
+    final void deleteFile(AbstractJrtPath jrtPath, boolean failIfNotExists)
             throws IOException {
         throw readOnly();
     }
 
-    final OutputStream newOutputStream(byte[] path, OpenOption... options)
+    final OutputStream newOutputStream(AbstractJrtPath jrtPath, OpenOption... options)
             throws IOException {
         throw readOnly();
     }
 
-    final void copyFile(boolean deletesrc, byte[] src, byte[] dst, CopyOption... options)
+    final void copyFile(boolean deletesrc, AbstractJrtPath srcPath, AbstractJrtPath dstPath, CopyOption... options)
             throws IOException {
         throw readOnly();
     }
 
-    final FileChannel newFileChannel(byte[] path,
+    final FileChannel newFileChannel(AbstractJrtPath jrtPath,
             Set<? extends OpenOption> options,
             FileAttribute<?>... attrs)
             throws IOException {
         throw new UnsupportedOperationException("newFileChannel");
     }
 
-    final InputStream newInputStream(byte[] path) throws IOException {
-        return new ByteArrayInputStream(getFileContent(path));
+    final InputStream newInputStream(AbstractJrtPath jrtPath) throws IOException {
+        return new ByteArrayInputStream(getFileContent(jrtPath));
     }
 
-    final SeekableByteChannel newByteChannel(byte[] path,
+    final SeekableByteChannel newByteChannel(AbstractJrtPath jrtPath,
             Set<? extends OpenOption> options,
             FileAttribute<?>... attrs)
             throws IOException {
         checkOptions(options);
 
-        byte[] buf = getFileContent(path);
+        byte[] buf = getFileContent(jrtPath);
         final ReadableByteChannel rbc
                 = Channels.newChannel(new ByteArrayInputStream(buf));
         final long size = buf.length;
@@ -328,8 +328,8 @@
         };
     }
 
-    final JrtFileStore getFileStore(AbstractJrtPath path) {
-        return new JrtFileStore(path);
+    final JrtFileStore getFileStore(AbstractJrtPath jrtPath) {
+        return new JrtFileStore(jrtPath);
     }
 
     final void ensureOpen() throws IOException {
@@ -341,29 +341,26 @@
     // abstract methods to be implemented by a particular jrt file system
     abstract AbstractJrtPath getRootPath();
 
-    abstract boolean isSameFile(AbstractJrtPath p1, AbstractJrtPath p2) throws IOException;
+    abstract boolean isSameFile(AbstractJrtPath jrtPath1, AbstractJrtPath jrtPath2) throws IOException;
 
     abstract boolean isLink(AbstractJrtPath jrtPath) throws IOException;
 
     abstract AbstractJrtPath resolveLink(AbstractJrtPath jrtPath) throws IOException;
 
-    abstract AbstractJrtFileAttributes getFileAttributes(byte[] path, LinkOption... options) throws IOException;
+    abstract AbstractJrtFileAttributes getFileAttributes(AbstractJrtPath jrtPath, LinkOption... options) throws IOException;
 
-    abstract boolean exists(byte[] path) throws IOException;
+    abstract boolean exists(AbstractJrtPath jrtPath) throws IOException;
 
-    abstract boolean isDirectory(byte[] path, boolean resolveLinks) throws IOException;
+    abstract boolean isDirectory(AbstractJrtPath jrtPath, boolean resolveLinks) throws IOException;
 
     /**
      * returns the list of child paths of the given directory "path"
      *
      * @param path name of the directory whose content is listed
-     * @param childPrefix prefix added to returned children names - may be null
-     * in which case absolute child paths are returned
      * @return iterator for child paths of the given directory path
      */
-    abstract Iterator<Path> iteratorOf(byte[] path, String childPrefix)
-            throws IOException;
+    abstract Iterator<Path> iteratorOf(AbstractJrtPath jrtPath) throws IOException;
 
     // returns the content of the file resource specified by the path
-    abstract byte[] getFileContent(byte[] path) throws IOException;
+    abstract byte[] getFileContent(AbstractJrtPath jrtPath) throws IOException;
 }
--- a/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtPath.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/AbstractJrtPath.java	Tue Nov 17 15:13:05 2015 -0800
@@ -685,7 +685,7 @@
 
     final void createDirectory(FileAttribute<?>... attrs)
             throws IOException {
-        jrtfs.createDirectory(getResolvedPath(), attrs);
+        jrtfs.createDirectory(this, attrs);
     }
 
     final InputStream newInputStream(OpenOption... options) throws IOException {
@@ -696,7 +696,7 @@
                 }
             }
         }
-        return jrtfs.newInputStream(getResolvedPath());
+        return jrtfs.newInputStream(this);
     }
 
     final DirectoryStream<Path> newDirectoryStream(Filter<? super Path> filter)
@@ -705,15 +705,15 @@
     }
 
     final void delete() throws IOException {
-        jrtfs.deleteFile(getResolvedPath(), true);
+        jrtfs.deleteFile(this, true);
     }
 
     final void deleteIfExists() throws IOException {
-        jrtfs.deleteFile(getResolvedPath(), false);
+        jrtfs.deleteFile(this, false);
     }
 
     final AbstractJrtFileAttributes getAttributes(LinkOption... options) throws IOException {
-        AbstractJrtFileAttributes zfas = jrtfs.getFileAttributes(getResolvedPath(), options);
+        AbstractJrtFileAttributes zfas = jrtfs.getFileAttributes(this, options);
         if (zfas == null) {
             throw new NoSuchFileException(toString());
         }
@@ -741,7 +741,7 @@
 
     final void setTimes(FileTime mtime, FileTime atime, FileTime ctime)
             throws IOException {
-        jrtfs.setTimes(getResolvedPath(), mtime, atime, ctime);
+        jrtfs.setTimes(this, mtime, atime, ctime);
     }
 
     final Map<String, Object> readAttributes(String attributes, LinkOption... options)
@@ -789,13 +789,13 @@
     final SeekableByteChannel newByteChannel(Set<? extends OpenOption> options,
             FileAttribute<?>... attrs)
             throws IOException {
-        return jrtfs.newByteChannel(getResolvedPath(), options, attrs);
+        return jrtfs.newByteChannel(this, options, attrs);
     }
 
     final FileChannel newFileChannel(Set<? extends OpenOption> options,
             FileAttribute<?>... attrs)
             throws IOException {
-        return jrtfs.newFileChannel(getResolvedPath(), options, attrs);
+        return jrtfs.newFileChannel(this, options, attrs);
     }
 
     final void checkAccess(AccessMode... modes) throws IOException {
@@ -816,7 +816,7 @@
             }
         }
 
-        BasicFileAttributes attrs = jrtfs.getFileAttributes(getResolvedPath());
+        BasicFileAttributes attrs = jrtfs.getFileAttributes(this);
         if (attrs == null && (path.length != 1 || path[0] != '/')) {
             throw new NoSuchFileException(toString());
         }
@@ -831,7 +831,7 @@
 
     final boolean exists() {
         try {
-            return jrtfs.exists(getResolvedPath());
+            return jrtfs.exists(this);
         } catch (IOException x) {
         }
         return false;
@@ -839,17 +839,17 @@
 
     final OutputStream newOutputStream(OpenOption... options) throws IOException {
         if (options.length == 0) {
-            return jrtfs.newOutputStream(getResolvedPath(),
+            return jrtfs.newOutputStream(this,
                     CREATE_NEW, WRITE);
         }
-        return jrtfs.newOutputStream(getResolvedPath(), options);
+        return jrtfs.newOutputStream(this, options);
     }
 
     final void move(AbstractJrtPath target, CopyOption... options)
             throws IOException {
         if (this.jrtfs == target.jrtfs) {
             jrtfs.copyFile(true,
-                    getResolvedPath(), target.getResolvedPath(),
+                    this, target,
                     options);
         } else {
             copyToTarget(target, options);
@@ -861,7 +861,7 @@
             throws IOException {
         if (this.jrtfs == target.jrtfs) {
             jrtfs.copyFile(false,
-                    getResolvedPath(), target.getResolvedPath(),
+                    this, target,
                     options);
         } else {
             copyToTarget(target, options);
@@ -901,7 +901,7 @@
             // create directory or file
             target.createDirectory();
         } else {
-            try (InputStream is = jrtfs.newInputStream(getResolvedPath()); OutputStream os = target.newOutputStream()) {
+            try (InputStream is = jrtfs.newInputStream(this); OutputStream os = target.newOutputStream()) {
                 byte[] buf = new byte[8192];
                 int n;
                 while ((n = is.read(buf)) != -1) {
--- a/src/java.base/share/classes/jdk/internal/jrtfs/JrtDirectoryStream.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/JrtDirectoryStream.java	Tue Nov 17 15:13:05 2015 -0800
@@ -39,10 +39,7 @@
 final class JrtDirectoryStream implements DirectoryStream<Path> {
 
     private final AbstractJrtFileSystem jrtfs;
-    private final byte[] path;
-    // prefix to be used for children of this directory
-    // so that child path are reported relatively (if needed)
-    private final String childPrefix;
+    private final AbstractJrtPath dir;
     private final DirectoryStream.Filter<? super Path> filter;
     private volatile boolean isClosed;
     private volatile Iterator<Path> itr;
@@ -51,22 +48,12 @@
             DirectoryStream.Filter<? super java.nio.file.Path> filter)
             throws IOException {
         this.jrtfs = jrtPath.getFileSystem();
-        this.path = jrtPath.getResolvedPath();
+        this.dir = jrtPath;
         // sanity check
-        if (!jrtfs.isDirectory(path, true)) {
+        if (!jrtfs.isDirectory(dir, true)) {
             throw new NotDirectoryException(jrtPath.toString());
         }
 
-        // absolute path and does not have funky chars in front like /./java.base
-        if (jrtPath.isAbsolute() && (path.length == jrtPath.getPathLength())) {
-            childPrefix = null;
-        } else {
-            // cases where directory content needs to modified with prefix
-            // like ./java.base, /./java.base, java.base and so on.
-            String dirName = jrtPath.toString();
-            int idx = dirName.indexOf(JrtFileSystem.getString(path).substring(1));
-            childPrefix = dirName.substring(0, idx);
-        }
         this.filter = filter;
     }
 
@@ -80,7 +67,7 @@
         }
 
         try {
-            itr = jrtfs.iteratorOf(path, childPrefix);
+            itr = jrtfs.iteratorOf(dir);
         } catch (IOException e) {
             throw new IllegalStateException(e);
         }
--- a/src/java.base/share/classes/jdk/internal/jrtfs/JrtExplodedFileSystem.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/JrtExplodedFileSystem.java	Tue Nov 17 15:13:05 2015 -0800
@@ -293,26 +293,26 @@
     }
 
     @Override
-    boolean isSameFile(AbstractJrtPath p1, AbstractJrtPath p2) throws IOException {
-        Node n1 = checkNode(p1.getName());
-        Node n2 = checkNode(p2.getName());
+    boolean isSameFile(AbstractJrtPath jrtPath1, AbstractJrtPath jrtPath2) throws IOException {
+        Node n1 = checkNode(jrtPath1);
+        Node n2 = checkNode(jrtPath2);
         return n1 == n2;
     }
 
     @Override
     boolean isLink(AbstractJrtPath jrtPath) throws IOException {
-        return checkNode(jrtPath.getName()).isLink();
+        return checkNode(jrtPath).isLink();
     }
 
     @Override
     AbstractJrtPath resolveLink(AbstractJrtPath jrtPath) throws IOException {
-        String name = checkNode(jrtPath.getName()).resolveLink().getName();
+        String name = checkNode(jrtPath).resolveLink().getName();
         return toJrtExplodedPath(name);
     }
 
     @Override
-    AbstractJrtFileAttributes getFileAttributes(byte[] path, LinkOption... options) throws IOException {
-        Node node = checkNode(path);
+    AbstractJrtFileAttributes getFileAttributes(AbstractJrtPath jrtPath, LinkOption... options) throws IOException {
+        Node node = checkNode(jrtPath);
         if (node.isLink() && followLinks(options)) {
             node = node.resolveLink(true);
         }
@@ -320,9 +320,9 @@
     }
 
     @Override
-    boolean exists(byte[] path) throws IOException {
+    boolean exists(AbstractJrtPath jrtPath) throws IOException {
         try {
-            checkNode(path);
+            checkNode(jrtPath);
             return true;
         } catch (NoSuchFileException nsfe) {
             return false;
@@ -330,29 +330,37 @@
     }
 
     @Override
-    boolean isDirectory(byte[] path, boolean resolveLinks) throws IOException {
-        Node node = checkNode(path);
+    boolean isDirectory(AbstractJrtPath jrtPath, boolean resolveLinks) throws IOException {
+        Node node = checkNode(jrtPath);
         return resolveLinks && node.isLink()
                 ? node.resolveLink(true).isDirectory()
                 : node.isDirectory();
     }
 
     @Override
-    Iterator<Path> iteratorOf(byte[] path, String childPrefix) throws IOException {
-        Node node = checkNode(path).resolveLink(true);
+    Iterator<Path> iteratorOf(AbstractJrtPath dir) throws IOException {
+        Node node = checkNode(dir).resolveLink(true);
         if (!node.isDirectory()) {
-            throw new NotDirectoryException(getString(path));
+            throw new NotDirectoryException(getString(dir.getName()));
         }
 
-        Function<Node, Path> f = childPrefix == null
-                ? child -> toJrtExplodedPath(child.getName())
-                : child -> toJrtExplodedPath(childPrefix + child.getName().substring(1));
-        return node.getChildren().stream().map(f).collect(toList()).iterator();
+        Function<Node, Path> nodeToPath =
+            child -> dir.resolve(
+                toJrtExplodedPath(child.getName()).
+                getFileName());
+
+        return node.getChildren().stream().
+                   map(nodeToPath).collect(toList()).
+                   iterator();
     }
 
     @Override
-    byte[] getFileContent(byte[] path) throws IOException {
-        return checkNode(path).getContent();
+    byte[] getFileContent(AbstractJrtPath jrtPath) throws IOException {
+        return checkNode(jrtPath).getContent();
+    }
+
+    private Node checkNode(AbstractJrtPath jrtPath) throws IOException {
+        return checkNode(jrtPath.getResolvedPath());
     }
 
     private Node checkNode(byte[] path) throws IOException {
--- a/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java	Tue Nov 17 15:13:05 2015 -0800
@@ -36,6 +36,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.function.Function;
 import static java.util.stream.Collectors.toList;
 import jdk.internal.jimage.ImageReader;
@@ -103,21 +104,21 @@
     @Override
     boolean isSameFile(AbstractJrtPath p1, AbstractJrtPath p2) throws IOException {
         ensureOpen();
-        NodeAndImage n1 = findNode(p1.getName());
-        NodeAndImage n2 = findNode(p2.getName());
-        return n1.node.equals(n2.node);
+        Node node1 = findNode(p1);
+        Node node2 = findNode(p2);
+        return node1.equals(node2);
     }
 
     @Override
     boolean isLink(AbstractJrtPath jrtPath) throws IOException {
-        return checkNode(jrtPath.getName()).node.isLink();
+        return checkNode(jrtPath).isLink();
     }
 
     @Override
     AbstractJrtPath resolveLink(AbstractJrtPath jrtPath) throws IOException {
-        NodeAndImage ni = checkNode(jrtPath.getName());
-        if (ni.node.isLink()) {
-            Node node = ni.node.resolveLink();
+        Node node = checkNode(jrtPath);
+        if (node.isLink()) {
+            node = node.resolveLink();
             return toJrtPath(node.getName().getBytesCopy());
         }
 
@@ -125,19 +126,19 @@
     }
 
     @Override
-    JrtFileAttributes getFileAttributes(byte[] path, LinkOption... options)
+    JrtFileAttributes getFileAttributes(AbstractJrtPath jrtPath, LinkOption... options)
             throws IOException {
-        NodeAndImage ni = checkNode(path);
-        if (ni.node.isLink() && followLinks(options)) {
-            return new JrtFileAttributes(ni.node.resolveLink(true));
+        Node node = checkNode(jrtPath);
+        if (node.isLink() && followLinks(options)) {
+            return new JrtFileAttributes(node.resolveLink(true));
         }
-        return new JrtFileAttributes(ni.node);
+        return new JrtFileAttributes(node);
     }
 
     @Override
-    boolean exists(byte[] path) throws IOException {
+    boolean exists(AbstractJrtPath jrtPath) throws IOException {
         try {
-            checkNode(path);
+            checkNode(jrtPath);
         } catch (NoSuchFileException exp) {
             return false;
         }
@@ -145,39 +146,36 @@
     }
 
     @Override
-    boolean isDirectory(byte[] path, boolean resolveLinks)
+    boolean isDirectory(AbstractJrtPath jrtPath, boolean resolveLinks)
             throws IOException {
-        NodeAndImage ni = checkNode(path);
-        return resolveLinks && ni.node.isLink()
-                ? ni.node.resolveLink(true).isDirectory()
-                : ni.node.isDirectory();
+        Node node = checkNode(jrtPath);
+        return resolveLinks && node.isLink()
+                ? node.resolveLink(true).isDirectory()
+                : node.isDirectory();
     }
 
     @Override
-    Iterator<Path> iteratorOf(byte[] path, String childPrefix)
-            throws IOException {
-        NodeAndImage ni = checkNode(path);
-        Node node = ni.node.resolveLink(true);
-
+    Iterator<Path> iteratorOf(AbstractJrtPath jrtPath) throws IOException {
+        Node node = checkNode(jrtPath).resolveLink(true);
         if (!node.isDirectory()) {
-            throw new NotDirectoryException(getString(path));
+            throw new NotDirectoryException(getString(jrtPath.getName()));
         }
 
         if (node.isRootDir()) {
-            return rootDirIterator(path, childPrefix);
+            return rootDirIterator(jrtPath);
         } else if (node.isModulesDir()) {
-            return modulesDirIterator(path, childPrefix);
+            return modulesDirIterator(jrtPath);
         } else if (node.isPackagesDir()) {
-            return packagesDirIterator(path, childPrefix);
+            return packagesDirIterator(jrtPath);
         }
 
-        return nodesToIterator(toJrtPath(path), childPrefix, node.getChildren());
+        return nodesToIterator(jrtPath, node.getChildren());
     }
 
     @Override
-    byte[] getFileContent(byte[] path) throws IOException {
-        final NodeAndImage ni = checkResource(path);
-        return ni.getResource();
+    byte[] getFileContent(AbstractJrtPath jrtPath) throws IOException {
+        final Node node = checkResource(jrtPath);
+        return bootImage.getResource(node);
     }
 
     // Implementation details below this point
@@ -196,48 +194,32 @@
         }
     }
 
-    private static class NodeAndImage {
-
-        final Node node;
-        final ImageReader image;
-
-        NodeAndImage(Node node, ImageReader image) {
-            this.node = node;
-            this.image = image;
-        }
-
-        byte[] getResource() throws IOException {
-            return image.getResource(node);
-        }
-    }
-
-    private NodeAndImage lookup(byte[] path) {
-        ImageReader image = bootImage;
-        Node node;
+    private Node lookup(byte[] path) {
+        Node node = null;
         try {
             node = bootImage.findNode(path);
         } catch (RuntimeException re) {
             throw new InvalidPathException(getString(path), re.toString());
         }
-        return node != null ? new NodeAndImage(node, image) : null;
+        return node;
     }
 
-    private NodeAndImage lookupSymbolic(byte[] path) {
+    private Node lookupSymbolic(byte[] path) {
         for (int i = 1; i < path.length; i++) {
             if (path[i] == (byte) '/') {
                 byte[] prefix = Arrays.copyOfRange(path, 0, i);
-                NodeAndImage ni = lookup(prefix);
-                if (ni == null) {
+                Node node = lookup(prefix);
+                if (node == null) {
                     break;
                 }
 
-                if (ni.node.isLink()) {
-                    Node link = ni.node.resolveLink(true);
+                if (node.isLink()) {
+                    Node link = node.resolveLink(true);
                     // resolved symbolic path concatenated to the rest of the path
                     UTF8String resPath = link.getName().concat(new UTF8String(path, i));
                     byte[] resPathBytes = resPath.getBytesCopy();
-                    ni = lookup(resPathBytes);
-                    return ni != null ? ni : lookupSymbolic(resPathBytes);
+                    node = lookup(resPathBytes);
+                    return node != null ? node : lookupSymbolic(resPathBytes);
                 }
             }
         }
@@ -245,30 +227,42 @@
         return null;
     }
 
-    private NodeAndImage findNode(byte[] path) throws IOException {
-        NodeAndImage ni = lookup(path);
-        if (ni == null) {
-            ni = lookupSymbolic(path);
-            if (ni == null) {
+    private Node findNode(AbstractJrtPath jrtPath) throws IOException {
+        return findNode(jrtPath.getResolvedPath());
+    }
+
+    private Node findNode(byte[] path) throws IOException {
+        Node node = lookup(path);
+        if (node == null) {
+            node = lookupSymbolic(path);
+            if (node == null) {
                 throw new NoSuchFileException(getString(path));
             }
         }
-        return ni;
+        return node;
     }
 
-    private NodeAndImage checkNode(byte[] path) throws IOException {
+    private Node checkNode(AbstractJrtPath jrtPath) throws IOException {
+        return checkNode(jrtPath.getResolvedPath());
+    }
+
+    private Node checkNode(byte[] path) throws IOException {
         ensureOpen();
         return findNode(path);
     }
 
-    private NodeAndImage checkResource(byte[] path) throws IOException {
-        NodeAndImage ni = checkNode(path);
-        if (ni.node.isDirectory()) {
+    private Node checkResource(AbstractJrtPath jrtPath) throws IOException {
+        return checkResource(jrtPath.getResolvedPath());
+    }
+
+    private Node checkResource(byte[] path) throws IOException {
+        Node node = checkNode(path);
+        if (node.isDirectory()) {
             throw new FileSystemException(getString(path) + " is a directory");
         }
 
-        assert ni.node.isResource() : "resource node expected here";
-        return ni;
+        assert node.isResource() : "resource node expected here";
+        return node;
     }
 
     private JrtPath toJrtPath(String path) {
@@ -279,52 +273,54 @@
         return new JrtPath(this, path);
     }
 
-    private Iterator<Path> nodesToIterator(Path path, String childPrefix, List<Node> childNodes) {
-        Function<Node, Path> f = childPrefix == null
-                ? child -> toJrtPath(child.getNameString())
-                : child -> toJrtPath(childPrefix + child.getNameString().substring(1));
-        return childNodes.stream().map(f).collect(toList()).iterator();
+    private Iterator<Path> nodesToIterator(AbstractJrtPath dir, List<Node> childNodes) {
+        Function<Node, Path> nodeToPath =
+            child -> dir.resolve(
+                toJrtPath(child.getNameString()).getFileName());
+        return childNodes.stream().
+                map(nodeToPath).collect(toList()).
+                iterator();
     }
 
     private List<Node> rootChildren;
 
-    private synchronized void initRootChildren(byte[] path) {
+    private synchronized void initRootChildren(AbstractJrtPath jrtPath) throws IOException {
         if (rootChildren == null) {
             rootChildren = new ArrayList<>();
-            rootChildren.addAll(bootImage.findNode(path).getChildren());
+            rootChildren.addAll(findNode(jrtPath).getChildren());
         }
     }
 
-    private Iterator<Path> rootDirIterator(byte[] path, String childPrefix) throws IOException {
-        initRootChildren(path);
-        return nodesToIterator(rootPath, childPrefix, rootChildren);
+    private Iterator<Path> rootDirIterator(AbstractJrtPath jrtPath) throws IOException {
+        initRootChildren(jrtPath);
+        return nodesToIterator(jrtPath, rootChildren);
     }
 
     private List<Node> modulesChildren;
 
-    private synchronized void initModulesChildren(byte[] path) {
+    private synchronized void initModulesChildren(AbstractJrtPath jrtPath) throws IOException {
         if (modulesChildren == null) {
             modulesChildren = new ArrayList<>();
-            modulesChildren.addAll(bootImage.findNode(path).getChildren());
+            modulesChildren.addAll(findNode(jrtPath).getChildren());
         }
     }
 
-    private Iterator<Path> modulesDirIterator(byte[] path, String childPrefix) throws IOException {
-        initModulesChildren(path);
-        return nodesToIterator(new JrtPath(this, path), childPrefix, modulesChildren);
+    private Iterator<Path> modulesDirIterator(AbstractJrtPath jrtPath) throws IOException {
+        initModulesChildren(jrtPath);
+        return nodesToIterator(jrtPath, modulesChildren);
     }
 
     private List<Node> packagesChildren;
 
-    private synchronized void initPackagesChildren(byte[] path) {
+    private synchronized void initPackagesChildren(AbstractJrtPath jrtPath) throws IOException {
         if (packagesChildren == null) {
             packagesChildren = new ArrayList<>();
-            packagesChildren.addAll(bootImage.findNode(path).getChildren());
+            packagesChildren.addAll(findNode(jrtPath).getChildren());
         }
     }
 
-    private Iterator<Path> packagesDirIterator(byte[] path, String childPrefix) throws IOException {
-        initPackagesChildren(path);
-        return nodesToIterator(new JrtPath(this, path), childPrefix, packagesChildren);
+    private Iterator<Path> packagesDirIterator(AbstractJrtPath jrtPath) throws IOException {
+        initPackagesChildren(jrtPath);
+        return nodesToIterator(jrtPath, packagesChildren);
     }
 }
--- a/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp	Tue Nov 17 15:13:05 2015 -0800
@@ -137,7 +137,7 @@
     if (is_read) {
         const ImageStrings strings = reader->get_strings();
         ImageDecompressor::decompress_resource(compressedAddress, uncompressedAddress,
-                (u4) uncompressed_size, &strings);
+                uncompressed_size, &strings, reader->endian());
     }
     return (jboolean) is_read;
 }
--- a/src/java.base/share/native/libjimage/imageDecompressor.cpp	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/native/libjimage/imageDecompressor.cpp	Tue Nov 17 15:13:05 2015 -0800
@@ -105,32 +105,66 @@
     return NULL;
 }
 
+// Sparc to read unaligned content
+// u8 l = (*(u8*) ptr);
+// If ptr is not aligned, sparc will fail.
+u8 ImageDecompressor::getU8(u1* ptr, Endian *endian) {
+    u8 ret;
+    if (endian->is_big_endian()) {
+        ret = (u8)ptr[0] << 56 | (u8)ptr[1] << 48 | (u8)ptr[2]<<40 | (u8)ptr[3]<<32 |
+                ptr[4]<<24 | ptr[5]<<16 | ptr[6]<<8 | ptr[7];
+    } else {
+        ret = ptr[0] | ptr[1]<<8 | ptr[2]<<16 | ptr[3]<<24 | (u8)ptr[4]<<32 |
+                (u8)ptr[5]<<40 | (u8)ptr[6]<<48 | (u8)ptr[7]<<56;
+    }
+    return ret;
+}
+
+u4 ImageDecompressor::getU4(u1* ptr, Endian *endian) {
+    u4 ret;
+    if (endian->is_big_endian()) {
+        ret = ptr[0] << 24 | ptr[1]<<16 | (ptr[2]<<8) | ptr[3];
+    } else {
+        ret = ptr[0] | ptr[1]<<8 | (ptr[2]<<16) | ptr[3]<<24;
+    }
+    return ret;
+}
+
 /*
  * Decompression entry point. Called from ImageFileReader::get_resource.
  */
 void ImageDecompressor::decompress_resource(u1* compressed, u1* uncompressed,
-                u4 uncompressed_size, const ImageStrings* strings) {
+                u8 uncompressed_size, const ImageStrings* strings, Endian *endian) {
     bool has_header = false;
     u1* decompressed_resource = compressed;
     u1* compressed_resource = compressed;
-
     // Resource could have been transformed by a stack of decompressors.
     // Iterate and decompress resources until there is no more header.
     do {
         ResourceHeader _header;
-        memcpy(&_header, compressed_resource, sizeof (ResourceHeader));
+        u1* compressed_resource_base = compressed_resource;
+        _header._magic = getU4(compressed_resource, endian);
+        compressed_resource += 4;
+        _header._size = getU8(compressed_resource, endian);
+        compressed_resource += 8;
+        _header._uncompressed_size = getU8(compressed_resource, endian);
+        compressed_resource += 8;
+        _header._decompressor_name_offset = getU4(compressed_resource, endian);
+        compressed_resource += 4;
+        _header._decompressor_config_offset = getU4(compressed_resource, endian);
+        compressed_resource += 4;
+        _header._is_terminal = *compressed_resource;
+        compressed_resource += 1;
         has_header = _header._magic == ResourceHeader::resource_header_magic;
         if (has_header) {
             // decompressed_resource array contains the result of decompression
-            decompressed_resource = new u1[_header._uncompressed_size];
+            decompressed_resource = new u1[(size_t) _header._uncompressed_size];
             // Retrieve the decompressor name
             const char* decompressor_name = strings->get(_header._decompressor_name_offset);
             assert(decompressor_name && "image decompressor not found");
             // Retrieve the decompressor instance
             ImageDecompressor* decompressor = get_decompressor(decompressor_name);
             assert(decompressor && "image decompressor not found");
-            u1* compressed_resource_base = compressed_resource;
-            compressed_resource += ResourceHeader::resource_header_length;
             // Ask the decompressor to decompress the compressed content
             decompressor->decompress_resource(compressed_resource, decompressed_resource,
                 &_header, strings);
@@ -140,7 +174,7 @@
             compressed_resource = decompressed_resource;
         }
     } while (has_header);
-    memcpy(uncompressed, decompressed_resource, uncompressed_size);
+    memcpy(uncompressed, decompressed_resource, (size_t) uncompressed_size);
     delete decompressed_resource;
 }
 
@@ -293,14 +327,14 @@
             }
         }
     }
-    u4 remain = header->_size - (int)(data - data_base);
-    u4 computed = (u4)(uncompressed_resource - uncompressed_base) + remain;
+    u8 remain = header->_size - (int)(data - data_base);
+    u8 computed = (u8)(uncompressed_resource - uncompressed_base) + remain;
     if (header->_uncompressed_size != computed)
-        printf("Failure, expecting %d but getting %d\n", header->_uncompressed_size,
+        printf("Failure, expecting %llu but getting %llu\n", header->_uncompressed_size,
                 computed);
     assert(header->_uncompressed_size == computed &&
                 "Constant Pool reconstruction failed");
-    memcpy(uncompressed_resource, data, remain);
+    memcpy(uncompressed_resource, data, (size_t) remain);
 }
 
 /*
--- a/src/java.base/share/native/libjimage/imageDecompressor.hpp	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/native/libjimage/imageDecompressor.hpp	Tue Nov 17 15:13:05 2015 -0800
@@ -48,13 +48,11 @@
  *   have been used to compress the resource.
  */
 struct ResourceHeader {
-    /* Length of header, needed to retrieve content offset */
-    static const u1 resource_header_length = 21;
     /* magic bytes that identifies a compressed resource header*/
     static const u4 resource_header_magic = 0xCAFEFAFA;
     u4 _magic; // Resource header
-    u4 _size;    // Resource size
-    u4 _uncompressed_size;  // Expected uncompressed size
+    u8 _size;    // Resource size
+    u8 _uncompressed_size;  // Expected uncompressed size
     u4 _decompressor_name_offset;    // Strings table decompressor offset
     u4 _decompressor_config_offset; // Strings table config offset
     u1 _is_terminal; // Last decompressor 1, otherwise 0.
@@ -95,6 +93,8 @@
      */
     inline const char* get_name() const { return _name; }
 
+    static u8 getU8(u1* ptr, Endian *endian);
+    static u4 getU4(u1* ptr, Endian *endian);
 
 protected:
     ImageDecompressor(const char* name) : _name(name) {
@@ -107,7 +107,7 @@
     static void image_decompressor_close();
     static ImageDecompressor* get_decompressor(const char * decompressor_name) ;
     static void decompress_resource(u1* compressed, u1* uncompressed,
-        u4 uncompressed_size, const ImageStrings* strings);
+        u8 uncompressed_size, const ImageStrings* strings, Endian* _endian);
 };
 
 /**
--- a/src/java.base/share/native/libjimage/imageFile.cpp	Tue Nov 17 15:12:29 2015 -0800
+++ b/src/java.base/share/native/libjimage/imageFile.cpp	Tue Nov 17 15:13:05 2015 -0800
@@ -577,7 +577,7 @@
         // If not memory mapped read in bytes.
         if (!MemoryMapImage) {
             // Allocate buffer for compression.
-            compressed_data = new u1[(u4)compressed_size];
+            compressed_data = new u1[(size_t)compressed_size];
             // Read bytes from offset beyond the image index.
             bool is_read = read_at(compressed_data, compressed_size, _index_size + offset);
             assert(is_read && "error reading from image or short read");
@@ -587,8 +587,8 @@
         // Get image string table.
         const ImageStrings strings = get_strings();
         // Decompress resource.
-        ImageDecompressor::decompress_resource(compressed_data, uncompressed_data, (u4)uncompressed_size,
-                        &strings);
+        ImageDecompressor::decompress_resource(compressed_data, uncompressed_data, uncompressed_size,
+                        &strings, _endian);
         // If not memory mapped then release temporary buffer.
         if (!MemoryMapImage) {
                 delete compressed_data;
--- a/test/jdk/internal/jrtfs/Basic.java	Tue Nov 17 15:12:29 2015 -0800
+++ b/test/jdk/internal/jrtfs/Basic.java	Tue Nov 17 15:13:05 2015 -0800
@@ -28,6 +28,7 @@
  */
 
 import java.io.InputStream;
+import java.io.IOException;
 import java.io.DataInputStream;
 import java.nio.file.DirectoryStream;
 import java.nio.file.InvalidPathException;
@@ -583,4 +584,43 @@
         }
         assertTrue(ipe != null);
     }
+
+    @DataProvider(name="packagesLinkedDirs")
+    private Object[][] packagesLinkedDirs() {
+        return new Object[][] {
+            { "/packages/java.lang/java.base/java/lang/ref"             },
+            { "/./packages/java.lang/java.base/java/lang/ref"           },
+            { "packages/java.lang/java.base/java/lang/ref"              },
+            { "/packages/../packages/java.lang/java.base/java/lang/ref" },
+            { "/packages/java.lang/java.base/java/util/zip"             },
+            { "/./packages/java.lang/java.base/java/util/zip"           },
+            { "packages/java.lang/java.base/java/util/zip"              },
+            { "/packages/../packages/java.lang/java.base/java/util/zip" },
+            { "/packages/com.oracle/java.xml.ws/com"                    },
+            { "/./packages/com.oracle/java.xml.ws/com"                  },
+            { "packages/com.oracle/java.xml.ws/com"                     },
+            { "/packages/../packages/com.oracle/java.xml.ws/com"        }
+        };
+    }
+
+    // @bug 8141521: jrt file system's DirectoryStream reports child paths
+    // with wrong paths for directories under /packages
+    @Test(dataProvider = "packagesLinkedDirs")
+    public void dirStreamPackagesDirTest(String dirName) throws IOException {
+        FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
+        Path path = fs.getPath(dirName);
+
+        int childCount = 0, dirPrefixOkayCount = 0;
+        try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(path)) {
+            for (Path child : dirStream) {
+                childCount++;
+                if (child.toString().startsWith(dirName)) {
+                    dirPrefixOkayCount++;
+                }
+            }
+        }
+
+        assertTrue(childCount != 0);
+        assertEquals(dirPrefixOkayCount, childCount);
+    }
 }