提交 36ea5fda 编写于 作者: Y yan

Merge

...@@ -37,3 +37,4 @@ d5a1223e961891564de25c39fba6f2442d0fb045 jdk7-b57 ...@@ -37,3 +37,4 @@ d5a1223e961891564de25c39fba6f2442d0fb045 jdk7-b57
0c3ef2d612a47667829eb17a192decef23f1c536 jdk7-b60 0c3ef2d612a47667829eb17a192decef23f1c536 jdk7-b60
f72c0dc047b9b2e797beee68ae0b50decb1f020d jdk7-b61 f72c0dc047b9b2e797beee68ae0b50decb1f020d jdk7-b61
12e11fab9a839a9666a996a8f9a02fd8fa03aab6 jdk7-b62 12e11fab9a839a9666a996a8f9a02fd8fa03aab6 jdk7-b62
2ed6ed6b5bfc7dd724925b90dbb31223df59c25d jdk7-b63
...@@ -91,10 +91,10 @@ ifeq ($(PLATFORM), windows) ...@@ -91,10 +91,10 @@ ifeq ($(PLATFORM), windows)
CXXFLAGS_COMMON += $(MS_RUNTIME_OPTION) CXXFLAGS_COMMON += $(MS_RUNTIME_OPTION)
LDOUTPUT = -Fe LDOUTPUT = -Fe
# J2SE name required here # JDK name required here
RC_FLAGS += /D "J2SE_FNAME=$(PGRM).exe" \ RC_FLAGS += /D "JDK_FNAME=$(PGRM).exe" \
/D "J2SE_INTERNAL_NAME=$(PGRM)" \ /D "JDK_INTERNAL_NAME=$(PGRM)" \
/D "J2SE_FTYPE=0x1L" /D "JDK_FTYPE=0x1L"
RES = $(OBJDIR)/$(PGRM).res RES = $(OBJDIR)/$(PGRM).res
else else
...@@ -133,13 +133,19 @@ unpacker: ...@@ -133,13 +133,19 @@ unpacker:
$(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_OPT= LDMAPFLAGS_DBG= $(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_OPT= LDMAPFLAGS_DBG=
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
IMVERSIONVALUE=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
SED_ALL_MANIFEST=$(SED) -e 's%IMVERSION%$(IMVERSIONVALUE)%g'
updatefiles::
$(CAT) $(TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest | $(SED_ALL_MANIFEST) > $(OBJDIR)/unpack200.exe.manifest
winres:: $(RES) winres:: $(RES)
else else
updatefiles::
$(ECHO) "Manifest not required for Unix"
winres:: winres::
$(ECHO) "Resource files not required for Unix" $(ECHO) "Resource files not required for Unix"
endif endif
$(UNPACK_EXE): $(UNPACK_EXE_FILES_o) winres $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres
$(prep-target) $(prep-target)
$(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX) $(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
ifdef MT ifdef MT
......
...@@ -27,6 +27,7 @@ SUNWprivate_1.1 { ...@@ -27,6 +27,7 @@ SUNWprivate_1.1 {
global: global:
Java_sun_nio_ch_SctpNet_socket0; Java_sun_nio_ch_SctpNet_socket0;
Java_sun_nio_ch_SctpNet_bindx; Java_sun_nio_ch_SctpNet_bindx;
Java_sun_nio_ch_SctpNet_branch0;
Java_sun_nio_ch_SctpNet_getLocalAddresses0; Java_sun_nio_ch_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_SctpNet_getRemoteAddresses0; Java_sun_nio_ch_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_SctpNet_getPrimAddrOption0; Java_sun_nio_ch_SctpNet_getPrimAddrOption0;
......
# #
# Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -464,11 +464,48 @@ JDK_RC_NAME = \ ...@@ -464,11 +464,48 @@ JDK_RC_NAME = \
JDK_RC_FVER = \ JDK_RC_FVER = \
$(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER) $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER)
# J2SE name required here # JDK name required here
RC_FLAGS += -d "J2SE_BUILD_ID=$(JDK_RC_BUILD_ID)" \ RC_FLAGS += -d "JDK_BUILD_ID=$(JDK_RC_BUILD_ID)" \
-d "J2SE_COMPANY=$(JDK_RC_COMPANY)" \ -d "JDK_COMPANY=$(JDK_RC_COMPANY)" \
-d "J2SE_COMPONENT=$(JDK_RC_COMPONENT)" \ -d "JDK_COMPONENT=$(JDK_RC_COMPONENT)" \
-d "J2SE_VER=$(JDK_RC_VER)" \ -d "JDK_VER=$(JDK_RC_VER)" \
-d "J2SE_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \ -d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
-d "J2SE_NAME=$(JDK_RC_NAME)" \ -d "JDK_NAME=$(JDK_RC_NAME)" \
-d "J2SE_FVER=$(JDK_RC_FVER)" -d "JDK_FVER=$(JDK_RC_FVER)"
# Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available
ifeq ($(ARCH_DATA_MODEL), 32)
ifneq ($(KERNEL), off)
# This is a hack to use until 7-Zip (and UPX) bundles can be put
# under /java/devtools.
ifndef DEPLOY_TOPDIR
DEPLOY_TOPDIR=$(JDK_TOPDIR)/../deploy
endif
# Uncomment this block to cause build failure if above assumption false
#DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \
# $(ECHO) deploy_not_a_peer_of_j2se ; \
#fi )
#ifeq ($(DCHK), deploy_not_a_peer_of_j2se)
# If a build failure points to control coming here it means
# it means deploy is not in the same directory
# as j2se. Java Kernel can't tolerate that for the time being.
#endif
EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \
$(ECHO) true ; \
else \
$(ECHO) false ; \
fi )
ifeq ($(EC_TMP), true)
EXTRA_COMP_INSTALL_PATH = lib\\\\deploy\\\\lzma.dll
# Crazy but true: deploy/make/plugin/jinstall/Makefile.jkernel does
# not include deploy/make/common/Defs-windows.gmk, either directly
# or indirectly. But it does include this file, so redundantly declare
# these variables that are in deploy/make/common/Defs-windows.gmk for
# the sake of the Java Kernel part of the deploy build. Whew!
EXTRA_COMP_LIB_NAME = lzma.dll
EXTRA_COMP_PATH = $(OUTPUTDIR)/tmp/deploy/lzma/win32/obj
EXTRA_COMP_CMD_PATH = $(EXTRA_COMP_PATH)/lzma.exe
EXTRA_COMP_LIB_PATH = $(EXTRA_COMP_PATH)/$(EXTRA_COMP_LIB_NAME)
endif
endif
endif
...@@ -207,10 +207,10 @@ ifndef LOCAL_RESOURCE_FILE ...@@ -207,10 +207,10 @@ ifndef LOCAL_RESOURCE_FILE
endif endif
@$(ECHO) Created $@ @$(ECHO) Created $@
# J2SE name required here # JDK name required here
RC_FLAGS += /D "J2SE_FNAME=$(LIBRARY).dll" \ RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
/D "J2SE_INTERNAL_NAME=$(LIBRARY)" \ /D "JDK_INTERNAL_NAME=$(LIBRARY)" \
/D "J2SE_FTYPE=0x2L" /D "JDK_FTYPE=0x2L"
$(OBJDIR)/$(LIBRARY).res: $(VERSIONINFO_RESOURCE) $(OBJDIR)/$(LIBRARY).res: $(VERSIONINFO_RESOURCE)
ifndef LOCAL_RESOURCE_FILE ifndef LOCAL_RESOURCE_FILE
......
...@@ -123,10 +123,10 @@ $(ACTUAL_PROGRAM):: classes $(JVMCFG) $(INIT) ...@@ -123,10 +123,10 @@ $(ACTUAL_PROGRAM):: classes $(JVMCFG) $(INIT)
# #
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
# J2SE name required here # JDK name required here
RC_FLAGS += /D "J2SE_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \ RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
/D "J2SE_INTERNAL_NAME=$(PROGRAM)" \ /D "JDK_INTERNAL_NAME=$(PROGRAM)" \
/D "J2SE_FTYPE=0x1L" /D "JDK_FTYPE=0x1L"
$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE) $(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
@$(prep-target) @$(prep-target)
......
...@@ -97,7 +97,7 @@ else ...@@ -97,7 +97,7 @@ else
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
LICENSE_DOCLIST_JDK = $(subst $(LICENSE_VERSION),,\ LICENSE_DOCLIST_JDK = $(subst $(LICENSE_VERSION),,\
$(shell $(CD) $(SHARE_JDK_DOC_SRC) && \ $(shell $(CD) $(SHARE_JDK_DOC_SRC) && \
$(LS) *LICENSE*$(LICENSE_VERSION))) $(LS) *LICENSE*$(LICENSE_VERSION)))
LICENSE_DOCLIST_JRE = $(subst $(LICENSE_VERSION),,\ LICENSE_DOCLIST_JRE = $(subst $(LICENSE_VERSION),,\
$(shell $(CD) $(SHARE_JRE_DOC_SRC) && \ $(shell $(CD) $(SHARE_JRE_DOC_SRC) && \
$(LS) *LICENSE*$(LICENSE_VERSION))) $(LS) *LICENSE*$(LICENSE_VERSION)))
...@@ -401,7 +401,7 @@ TOOLS = \ ...@@ -401,7 +401,7 @@ TOOLS = \
sun/tools/jstack \ sun/tools/jstack \
sun/tools/jinfo \ sun/tools/jinfo \
sun/tools/jmap sun/tools/jmap
# classes that go into jsse.jar # classes that go into jsse.jar
JSSE_CLASSES_DIRS = \ JSSE_CLASSES_DIRS = \
sun/security/provider/Sun.class \ sun/security/provider/Sun.class \
...@@ -645,7 +645,7 @@ $(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \ ...@@ -645,7 +645,7 @@ $(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \
@$(java-vm-cleanup) @$(java-vm-cleanup)
# Create the manifest file. # Create the manifest file.
JAR_MANIFEST_FILE=$(TEMPDIR)/manifest.tmp JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp
$(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST) $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
$(prep-target) $(prep-target)
$(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) >> $@ $(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) >> $@
...@@ -653,25 +653,22 @@ $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST) ...@@ -653,25 +653,22 @@ $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
$(CAT) $(BEANMANIFEST) >> $@ $(CAT) $(BEANMANIFEST) >> $@
# Create resources.jar containing non-class files # Create resources.jar containing non-class files
RESOURCES_JAR=$(TEMPDIR)/resources-orig.jar RESOURCES_JAR=$(ABS_TEMPDIR)/resources-orig.jar
RES_JAR_ARGLIST=$(RES_JAR_FILELIST)_args $(RESOURCES_JAR): $(RES_JAR_FILELIST) $(JAR_MANIFEST_FILE)
$(RES_JAR_ARGLIST): $(RES_JAR_FILELIST)
$(prep-target)
$(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
$(RESOURCES_JAR): $(RES_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
$(prep-target) $(prep-target)
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ $(CD) $(CLASSBINDIR) && \
@$(RES_JAR_ARGLIST) $(BOOT_JAR_JFLAGS) $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
@$(java-vm-cleanup) @$(RES_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
# Create jsse.jar containing SunJSSE implementation classes # Create jsse.jar containing SunJSSE implementation classes
JSSE_JAR=$(TEMPDIR)/jsse-orig.jar JSSE_JAR=$(ABS_TEMPDIR)/jsse-orig.jar
$(JSSE_JAR): $(JAR_MANIFEST_FILE) $(JSSE_JAR): $(JAR_MANIFEST_FILE)
$(prep-target) $(prep-target)
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ $(CD) $(CLASSBINDIR) && \
$(JSSE_CLASSES_DIRS:%=-C $(CLASSBINDIR) %) \ $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
$(BOOT_JAR_JFLAGS) $(JSSE_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup) @$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
# Create sec-bin.zip # Create sec-bin.zip
SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip
...@@ -713,15 +710,12 @@ endif ...@@ -713,15 +710,12 @@ endif
# Create rt.jar # Create rt.jar
RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
RT_JAR_ARGLIST=$(RT_JAR_FILELIST)_args $(RT_JAR): $(RT_JAR_FILELIST) $(JAR_MANIFEST_FILE)
$(RT_JAR_ARGLIST): $(RT_JAR_FILELIST)
$(prep-target) $(prep-target)
$(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@ $(CD) $(CLASSBINDIR) && \
$(RT_JAR): $(RT_JAR_ARGLIST) $(JAR_MANIFEST_FILE) $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
$(prep-target) @$(RT_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \ @$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
@$(RT_JAR_ARGLIST) $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
# Meta-index construction to make core class loaders lazier # Meta-index construction to make core class loaders lazier
...@@ -795,6 +789,11 @@ ifeq ($(PLATFORM), windows) ...@@ -795,6 +789,11 @@ ifeq ($(PLATFORM), windows)
$(CD) $(JRE_IMAGE_DIR)/lib && \ $(CD) $(JRE_IMAGE_DIR)/lib && \
$(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \ $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX) hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
ifeq ($(ARCH_DATA_MODEL), 32)
@# The Java Kernel JRE image ships with a special VM. It is not included
@# in the full JRE image, so remove it. Also, is it only for 32-bit windows.
$(CD) $(JRE_IMAGE_DIR)/bin && $(RM) -r kernel
endif
endif # Windows endif # Windows
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
$(call copy-man-pages,$(JRE_IMAGE_DIR),$(JRE_MAN_PAGES)) $(call copy-man-pages,$(JRE_IMAGE_DIR),$(JRE_MAN_PAGES))
...@@ -944,10 +943,10 @@ initial-image-jdk:: initial-image-jdk-setup \ ...@@ -944,10 +943,10 @@ initial-image-jdk:: initial-image-jdk-setup \
@# @#
@# lib/tools.jar @# lib/tools.jar
@# @#
$(BOOT_JAR_CMD) c0f $(LIBDIR)/tools.jar $(addprefix \ $(CD) $(CLASSBINDIR) && \
-C $(CLASSBINDIR) , $(TOOLS)) \ $(BOOT_JAR_CMD) c0f $(ABS_LIBDIR)/tools.jar \
$(BOOT_JAR_JFLAGS) $(TOOLS) $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup) @$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar $(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
@# @#
@# lib/ct.sym @# lib/ct.sym
......
...@@ -35,8 +35,8 @@ ifeq ($(PLATFORM), windows) ...@@ -35,8 +35,8 @@ ifeq ($(PLATFORM), windows)
LIBEXE = $(COMPILER_PATH)lib LIBEXE = $(COMPILER_PATH)lib
LINK = $(COMPILER_PATH)link LINK = $(COMPILER_PATH)link
RC = $(MSDEVTOOLS_PATH)rc RC = $(MSDEVTOOLS_PATH)rc
RSC = $(MSDEVTOOLS_PATH)rc
LINK32 = $(LINK) LINK32 = $(LINK)
RSC = $(RC)
# Fill in unknown values # Fill in unknown values
COMPILER_NAME=Unknown MSVC Compiler COMPILER_NAME=Unknown MSVC Compiler
...@@ -98,6 +98,9 @@ ifeq ($(PLATFORM), windows) ...@@ -98,6 +98,9 @@ ifeq ($(PLATFORM), windows)
endif endif
ifeq ($(CC_MAJORVER), 14) ifeq ($(CC_MAJORVER), 14)
ifeq ($(ARCH), amd64) ifeq ($(ARCH), amd64)
#rebase and midl moved out of Visual Studio into the SDK:
REBASE = $(MSDEVTOOLS_PATH)/rebase
MTL = $(MSDEVTOOLS_PATH)/midl.exe
ifeq ($(CC_MICROVER), 30701) ifeq ($(CC_MICROVER), 30701)
# This should be: CC_VER=14.00.30701 LINK_VER=8.00.30701 # This should be: CC_VER=14.00.30701 LINK_VER=8.00.30701
# WARNING: it says 14, but it is such an early build it doesn't # WARNING: it says 14, but it is such an early build it doesn't
...@@ -110,6 +113,8 @@ ifeq ($(PLATFORM), windows) ...@@ -110,6 +113,8 @@ ifeq ($(PLATFORM), windows)
COMPILER_NAME=Microsoft Platform SDK - April 2005 Edition (3790.1830) COMPILER_NAME=Microsoft Platform SDK - April 2005 Edition (3790.1830)
COMPILER_VERSION=VS2005 COMPILER_VERSION=VS2005
endif endif
else
REBASE = $(COMPILER_PATH)../rebase
endif endif
endif endif
ifeq ($(CC_MAJORVER), 15) ifeq ($(CC_MAJORVER), 15)
...@@ -120,7 +125,6 @@ ifeq ($(PLATFORM), windows) ...@@ -120,7 +125,6 @@ ifeq ($(PLATFORM), windows)
endif endif
# This will cause problems if ALT_COMPILER_PATH is defined to "" # This will cause problems if ALT_COMPILER_PATH is defined to ""
# which is a directive to use the PATH. # which is a directive to use the PATH.
REBASE = $(COMPILER_PATH)../REBASE
ifndef COMPILER_PATH ifndef COMPILER_PATH
COMPILER_PATH := $(error COMPILER_PATH cannot be empty here) COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
endif endif
......
...@@ -72,6 +72,7 @@ ADB = $(UTILS_COMMAND_PATH)adb ...@@ -72,6 +72,7 @@ ADB = $(UTILS_COMMAND_PATH)adb
AR = $(UTILS_CCS_BIN_PATH)ar AR = $(UTILS_CCS_BIN_PATH)ar
AS = $(UTILS_CCS_BIN_PATH)as AS = $(UTILS_CCS_BIN_PATH)as
BASENAME = $(UTILS_COMMAND_PATH)basename BASENAME = $(UTILS_COMMAND_PATH)basename
BZIP2 = $(UTILS_COMMAND_PATH)bzip2
CAT = $(UTILS_COMMAND_PATH)cat CAT = $(UTILS_COMMAND_PATH)cat
CHMOD = $(UTILS_COMMAND_PATH)chmod CHMOD = $(UTILS_COMMAND_PATH)chmod
CMP = $(UTILS_USR_BIN_PATH)cmp CMP = $(UTILS_USR_BIN_PATH)cmp
...@@ -157,6 +158,7 @@ ifeq ($(PLATFORM),windows) ...@@ -157,6 +158,7 @@ ifeq ($(PLATFORM),windows)
endif endif
# Re-define some utilities # Re-define some utilities
LEX =# override GNU Make intrinsic: no lex on windows LEX =# override GNU Make intrinsic: no lex on windows
SHA1SUM = $(UNIXCOMMAND_PATH)openssl sha1
endif endif
# Linux specific # Linux specific
......
...@@ -520,7 +520,7 @@ ifdef ALT_INSTALL_MSSDK ...@@ -520,7 +520,7 @@ ifdef ALT_INSTALL_MSSDK
xALT_INSTALL_MSSDK :="$(subst \,/,$(ALT_INSTALL_MSSDK))" xALT_INSTALL_MSSDK :="$(subst \,/,$(ALT_INSTALL_MSSDK))"
INSTALL_MSSDK :=$(call FullPath,$(xALT_INSTALL_MSSDK)) INSTALL_MSSDK :=$(call FullPath,$(xALT_INSTALL_MSSDK))
else else
INSTALL_MSSDK :=$(_psdk) INSTALL_MSSDK :=$(_ms_sdk)
endif endif
INSTALL_MSSDK:=$(call AltCheckSpaces,INSTALL_MSSDK) INSTALL_MSSDK:=$(call AltCheckSpaces,INSTALL_MSSDK)
...@@ -631,7 +631,12 @@ JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH) ...@@ -631,7 +631,12 @@ JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
ifdef ALT_HOTSPOT_IMPORT_PATH ifdef ALT_HOTSPOT_IMPORT_PATH
HOTSPOT_IMPORT_PATH :=$(call FullPath,$(ALT_HOTSPOT_IMPORT_PATH)) HOTSPOT_IMPORT_PATH :=$(call FullPath,$(ALT_HOTSPOT_IMPORT_PATH))
else else
HOTSPOT_IMPORT_PATH =$(JDK_IMPORT_PATH) # Default locations include the current $OUTPUTDIR, RE Promotions,
# and a JDK. Please be aware the JDK does not include a Kernel VM.
_HOTSPOT_IMPORT_PATH1 = $(OUTPUTDIR)/hotspot/import
_HOTSPOT_IMPORT_PATH2 = $(PROMOTED_BUILD_DISTDIR)/hotspot/import
_HOTSPOT_IMPORT_PATH3 = $(JDK_IMPORT_PATH)
HOTSPOT_IMPORT_PATH := $(call DirExists,$(_HOTSPOT_IMPORT_PATH1),$(_HOTSPOT_IMPORT_PATH2),$(_HOTSPOT_IMPORT_PATH3))
endif endif
HOTSPOT_IMPORT_PATH:=$(call AltCheckSpaces,HOTSPOT_IMPORT_PATH) HOTSPOT_IMPORT_PATH:=$(call AltCheckSpaces,HOTSPOT_IMPORT_PATH)
HOTSPOT_IMPORT_PATH:=$(call AltCheckValue,HOTSPOT_IMPORT_PATH) HOTSPOT_IMPORT_PATH:=$(call AltCheckValue,HOTSPOT_IMPORT_PATH)
...@@ -665,4 +670,3 @@ else ...@@ -665,4 +670,3 @@ else
endif endif
HOTSPOT_LIB_PATH:=$(call AltCheckSpaces,HOTSPOT_LIB_PATH) HOTSPOT_LIB_PATH:=$(call AltCheckSpaces,HOTSPOT_LIB_PATH)
HOTSPOT_LIB_PATH:=$(call AltCheckValue,HOTSPOT_LIB_PATH) HOTSPOT_LIB_PATH:=$(call AltCheckValue,HOTSPOT_LIB_PATH)
...@@ -292,6 +292,7 @@ endif ...@@ -292,6 +292,7 @@ endif
PROMOTED_RE_AREA = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted PROMOTED_RE_AREA = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted
PROMOTED_BUILD_LATEST = latest PROMOTED_BUILD_LATEST = latest
PROMOTED_BUILD_BASEDIR = $(PROMOTED_RE_AREA)/$(PROMOTED_BUILD_LATEST) PROMOTED_BUILD_BASEDIR = $(PROMOTED_RE_AREA)/$(PROMOTED_BUILD_LATEST)
PROMOTED_BUILD_DISTDIR = $(PROMOTED_BUILD_BASEDIR)/dist/$(PLATFORM)-$(ARCH)
PROMOTED_BUILD_BINARIES = $(PROMOTED_BUILD_BASEDIR)/binaries PROMOTED_BUILD_BINARIES = $(PROMOTED_BUILD_BASEDIR)/binaries
# PARALLEL_COMPILE_JOBS: is the number of compiles done in parallel. # PARALLEL_COMPILE_JOBS: is the number of compiles done in parallel.
......
...@@ -1567,10 +1567,50 @@ ifeq ($(ARCH_DATA_MODEL), 32) ...@@ -1567,10 +1567,50 @@ ifeq ($(ARCH_DATA_MODEL), 32)
" and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \ " and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
"" >> $(ERROR_FILE) ; \ "" >> $(ERROR_FILE) ; \
fi fi
endif
@#
@# Check for presence of headers required for new Java Plug-In ("plugin2")
@#
@if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/plugin2_mozilla_headers/npapi.h ]; then \
$(ECHO) "ERROR: You do not have access to valid Mozilla header files for the new Java Plug-In. \n" \
" Please check your access to \n" \
" $(subst \,/,$(MOZILLA_HEADERS_PATH))/plugin2_mozilla_headers/npapi.h \n" \
" and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
"" >> $(ERROR_FILE) ; \
fi
endif
######################################################
# Make sure Java Kernel VM is accessible
######################################################
sane-kernel-vm:
ifeq ($(PLATFORM), windows)
ifeq ($(ARCH_DATA_MODEL), 32)
@if [ ! -r $(HOTSPOT_KERNEL_PATH)/jvm.dll ]; then \
$(ECHO) "WARNING: Your HOTSPOT_IMPORT_PATH does not include a Kernel VM... \n" \
" The kernel installer may not be built (unless hotspot is also). \n" \
" $(HOTSPOT_KERNEL_PATH)/jvm.dll \n" \
" Please check the value of ALT_HOTSPOT_IMPORT_PATH. \n" \
>> $(WARNING_FILE) ; \
fi
endif endif
endif endif
######################################################
# SECURITY_BASELINE_131 test
######################################################
security_baseline_131:
ifeq ($(PLATFORM), windows)
@if [ -z "$(SECURITY_BASELINE_131)" ]; then \
$(ECHO) "WARNING: Your SECURITY_BASELINE_131 setting is empty.\n" \
" Setting it to the default value of 1.3.1_20.\n" \
" It is recommended to set SECURITY_BASELINE_131.\n" \
"" >> $(WARNING_FILE) ; \
fi
endif
###################################################### ######################################################
# SECURITY_BASELINE_142 test # SECURITY_BASELINE_142 test
###################################################### ######################################################
...@@ -1597,6 +1637,19 @@ ifeq ($(PLATFORM), windows) ...@@ -1597,6 +1637,19 @@ ifeq ($(PLATFORM), windows)
fi fi
endif endif
######################################################
# SECURITY_BASELINE_160 test
######################################################
security_baseline_160:
ifeq ($(PLATFORM), windows)
@if [ -z "$(SECURITY_BASELINE_160)" ]; then \
$(ECHO) "WARNING: Your SECURITY_BASELINE_160 setting is empty.\n" \
" Setting it to the default value of 1.6.0_11.\n" \
" It is recommended to set SECURITY_BASELINE_160.\n" \
"" >> $(WARNING_FILE) ; \
fi
endif
###################################################### ######################################################
# this should be the last rule in any target's sanity rule. # this should be the last rule in any target's sanity rule.
......
...@@ -217,6 +217,7 @@ CORE_PKGS = \ ...@@ -217,6 +217,7 @@ CORE_PKGS = \
javax.swing.plaf.basic \ javax.swing.plaf.basic \
javax.swing.plaf.metal \ javax.swing.plaf.metal \
javax.swing.plaf.multi \ javax.swing.plaf.multi \
javax.swing.plaf.nimbus \
javax.swing.plaf.synth \ javax.swing.plaf.synth \
javax.tools \ javax.tools \
javax.transaction \ javax.transaction \
......
...@@ -64,6 +64,7 @@ FILES_c = \ ...@@ -64,6 +64,7 @@ FILES_c = \
jio.c \ jio.c \
logging.c \ logging.c \
jni_util.c \ jni_util.c \
jni_util_md.c \
jdk_util.c \ jdk_util.c \
jdk_util_md.c \ jdk_util_md.c \
check_version.c \ check_version.c \
......
...@@ -412,6 +412,7 @@ JAVA_JAVA_java = \ ...@@ -412,6 +412,7 @@ JAVA_JAVA_java = \
java/io/FileReader.java \ java/io/FileReader.java \
java/io/PipedReader.java \ java/io/PipedReader.java \
java/io/StringReader.java \ java/io/StringReader.java \
java/io/TempFileHelper.java \
java/io/Writer.java \ java/io/Writer.java \
java/io/BufferedWriter.java \ java/io/BufferedWriter.java \
java/io/PrintWriter.java \ java/io/PrintWriter.java \
......
...@@ -280,6 +280,9 @@ SUNWprivate_1.1 { ...@@ -280,6 +280,9 @@ SUNWprivate_1.1 {
Java_sun_misc_VM_initialize; Java_sun_misc_VM_initialize;
Java_sun_misc_VMSupport_initAgentProperties; Java_sun_misc_VMSupport_initAgentProperties;
# ZipFile.c needs this one
throwFileNotFoundException;
# Java_sun_misc_VM_getState; threads.c # Java_sun_misc_VM_getState; threads.c
# Java_sun_misc_VM_threadsSuspended; threads.c # Java_sun_misc_VM_threadsSuspended; threads.c
# Java_sun_misc_VM_unsuspendSomeThreads; threads.c # Java_sun_misc_VM_unsuspendSomeThreads; threads.c
......
...@@ -86,8 +86,6 @@ FILES_src = \ ...@@ -86,8 +86,6 @@ FILES_src = \
java/nio/file/CopyOption.java \ java/nio/file/CopyOption.java \
java/nio/file/DirectoryNotEmptyException.java \ java/nio/file/DirectoryNotEmptyException.java \
java/nio/file/DirectoryStream.java \ java/nio/file/DirectoryStream.java \
java/nio/file/DirectoryStreamFilters.java \
java/nio/file/FileAction.java \
java/nio/file/FileAlreadyExistsException.java \ java/nio/file/FileAlreadyExistsException.java \
java/nio/file/FileRef.java \ java/nio/file/FileRef.java \
java/nio/file/FileStore.java \ java/nio/file/FileStore.java \
...@@ -141,6 +139,7 @@ FILES_src = \ ...@@ -141,6 +139,7 @@ FILES_src = \
java/nio/file/attribute/FileStoreAttributeView.java \ java/nio/file/attribute/FileStoreAttributeView.java \
java/nio/file/attribute/FileStoreSpaceAttributeView.java \ java/nio/file/attribute/FileStoreSpaceAttributeView.java \
java/nio/file/attribute/FileStoreSpaceAttributes.java \ java/nio/file/attribute/FileStoreSpaceAttributes.java \
java/nio/file/attribute/FileTime.java \
java/nio/file/attribute/GroupPrincipal.java \ java/nio/file/attribute/GroupPrincipal.java \
java/nio/file/attribute/UserDefinedFileAttributeView.java \ java/nio/file/attribute/UserDefinedFileAttributeView.java \
java/nio/file/attribute/PosixFileAttributeView.java \ java/nio/file/attribute/PosixFileAttributeView.java \
...@@ -151,7 +150,6 @@ FILES_src = \ ...@@ -151,7 +150,6 @@ FILES_src = \
java/nio/file/attribute/UserPrincipalLookupService.java \ java/nio/file/attribute/UserPrincipalLookupService.java \
java/nio/file/attribute/UserPrincipalNotFoundException.java \ java/nio/file/attribute/UserPrincipalNotFoundException.java \
\ \
java/nio/file/spi/AbstractPath.java \
java/nio/file/spi/FileSystemProvider.java \ java/nio/file/spi/FileSystemProvider.java \
java/nio/file/spi/FileTypeDetector.java \ java/nio/file/spi/FileTypeDetector.java \
\ \
...@@ -248,8 +246,8 @@ FILES_src = \ ...@@ -248,8 +246,8 @@ FILES_src = \
\ \
sun/nio/fs/AbstractAclFileAttributeView.java \ sun/nio/fs/AbstractAclFileAttributeView.java \
sun/nio/fs/AbstractBasicFileAttributeView.java \ sun/nio/fs/AbstractBasicFileAttributeView.java \
sun/nio/fs/AbstractFileStoreSpaceAttributeView.java \
sun/nio/fs/AbstractFileTypeDetector.java \ sun/nio/fs/AbstractFileTypeDetector.java \
sun/nio/fs/AbstractPath.java \
sun/nio/fs/AbstractPoller.java \ sun/nio/fs/AbstractPoller.java \
sun/nio/fs/AbstractUserDefinedFileAttributeView.java \ sun/nio/fs/AbstractUserDefinedFileAttributeView.java \
sun/nio/fs/AbstractWatchKey.java \ sun/nio/fs/AbstractWatchKey.java \
...@@ -258,12 +256,13 @@ FILES_src = \ ...@@ -258,12 +256,13 @@ FILES_src = \
sun/nio/fs/Cancellable.java \ sun/nio/fs/Cancellable.java \
sun/nio/fs/DefaultFileSystemProvider.java \ sun/nio/fs/DefaultFileSystemProvider.java \
sun/nio/fs/DefaultFileTypeDetector.java \ sun/nio/fs/DefaultFileTypeDetector.java \
sun/nio/fs/DynamicFileAttributeView.java \
sun/nio/fs/FileOwnerAttributeViewImpl.java \ sun/nio/fs/FileOwnerAttributeViewImpl.java \
sun/nio/fs/Globs.java \ sun/nio/fs/Globs.java \
sun/nio/fs/MimeType.java \
sun/nio/fs/NativeBuffer.java \ sun/nio/fs/NativeBuffer.java \
sun/nio/fs/NativeBuffers.java \ sun/nio/fs/NativeBuffers.java \
sun/nio/fs/Reflect.java \ sun/nio/fs/Reflect.java \
sun/nio/fs/Util.java \
\ \
java/net/DatagramSocket.java \ java/net/DatagramSocket.java \
java/net/DatagramSocketImpl.java \ java/net/DatagramSocketImpl.java \
......
...@@ -142,7 +142,7 @@ SUNWprivate_1.1 { ...@@ -142,7 +142,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_LinuxNativeDispatcher_fremovexattr0; Java_sun_nio_fs_LinuxNativeDispatcher_fremovexattr0;
Java_sun_nio_fs_LinuxNativeDispatcher_setmntent0; Java_sun_nio_fs_LinuxNativeDispatcher_setmntent0;
Java_sun_nio_fs_LinuxNativeDispatcher_endmntent; Java_sun_nio_fs_LinuxNativeDispatcher_endmntent;
Java_sun_nio_fs_UnixNativeDispatcher_initIDs; Java_sun_nio_fs_UnixNativeDispatcher_init;
Java_sun_nio_fs_UnixNativeDispatcher_getcwd; Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
Java_sun_nio_fs_UnixNativeDispatcher_strerror; Java_sun_nio_fs_UnixNativeDispatcher_strerror;
Java_sun_nio_fs_UnixNativeDispatcher_dup; Java_sun_nio_fs_UnixNativeDispatcher_dup;
......
...@@ -120,7 +120,7 @@ SUNWprivate_1.1 { ...@@ -120,7 +120,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio; Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs; Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs; Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
Java_sun_nio_fs_UnixNativeDispatcher_initIDs; Java_sun_nio_fs_UnixNativeDispatcher_init;
Java_sun_nio_fs_UnixNativeDispatcher_getcwd; Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
Java_sun_nio_fs_UnixNativeDispatcher_strerror; Java_sun_nio_fs_UnixNativeDispatcher_strerror;
Java_sun_nio_fs_UnixNativeDispatcher_dup; Java_sun_nio_fs_UnixNativeDispatcher_dup;
......
...@@ -119,10 +119,15 @@ IMPORT_LIST += \ ...@@ -119,10 +119,15 @@ IMPORT_LIST += \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME) $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
# Hotspot client is only available on 32-bit builds # Add .map and .pdb files to the import path for client and kernel VMs.
# These are only available on 32-bit windows builds.
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \ IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME)
ifeq ($(DO_KERNEL), true)
IMPORT_LIST += $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME) \
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME)
endif
endif endif
$(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME) $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
...@@ -134,6 +139,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME): ...@@ -134,6 +139,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
@$(prep-target) @$(prep-target)
-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME) $@ -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME) $@
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME): $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
@$(prep-target) @$(prep-target)
-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@ -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
...@@ -142,6 +151,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME): ...@@ -142,6 +151,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
@$(prep-target) @$(prep-target)
-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME) $@ -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME) $@
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME):
@$(prep-target) @$(prep-target)
-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@ -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
...@@ -195,6 +208,9 @@ endif # PLATFORM ...@@ -195,6 +208,9 @@ endif # PLATFORM
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
$(install-import-file) $(install-import-file)
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME)
$(install-file)
$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME) $(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
$(install-import-file) $(install-import-file)
...@@ -224,6 +240,9 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.tx ...@@ -224,6 +240,9 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.tx
$(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
$(install-import-file) $(install-import-file)
$(LIB_LOCATION)/$(KERNEL_LOCATION)/Xusage.txt : $(HOTSPOT_KERNEL_PATH)/Xusage.txt
$(install-file)
ifeq ($(INCLUDE_SA), true) ifeq ($(INCLUDE_SA), true)
# The Serviceability Agent is built in the Hotspot workspace. # The Serviceability Agent is built in the Hotspot workspace.
# It contains two files: # It contains two files:
......
...@@ -51,6 +51,7 @@ SUNWprivate_1.1 { ...@@ -51,6 +51,7 @@ SUNWprivate_1.1 {
Java_java_util_zip_Inflater_reset; Java_java_util_zip_Inflater_reset;
Java_java_util_zip_Inflater_setDictionary; Java_java_util_zip_Inflater_setDictionary;
Java_java_util_zip_ZipFile_close; Java_java_util_zip_ZipFile_close;
Java_java_util_zip_ZipFile_getCommentBytes;
Java_java_util_zip_ZipFile_freeEntry; Java_java_util_zip_ZipFile_freeEntry;
Java_java_util_zip_ZipFile_getEntry; Java_java_util_zip_ZipFile_getEntry;
Java_java_util_zip_ZipFile_getEntryBytes; Java_java_util_zip_ZipFile_getEntryBytes;
......
...@@ -33,6 +33,12 @@ PRODUCT = jpda ...@@ -33,6 +33,12 @@ PRODUCT = jpda
PROGRAM = jdb PROGRAM = jdb
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
# #
# Java Files to compile are found automatically. # Java Files to compile are found automatically.
# #
......
...@@ -59,7 +59,7 @@ else ...@@ -59,7 +59,7 @@ else
RENDER_SUBDIR = dcpr RENDER_SUBDIR = dcpr
endif endif
# nio need to be compiled before awt to have all charsets ready # nio need to be compiled before awt to have all charsets ready
SUBDIRS = jar security javazic misc net audio $(RENDER_SUBDIR) image \ SUBDIRS = jar security javazic misc jkernel net audio $(RENDER_SUBDIR) image \
nio awt splashscreen $(XAWT_SUBDIR) \ nio awt splashscreen $(XAWT_SUBDIR) \
$(HEADLESS_SUBDIR) $(DGA_SUBDIR) \ $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \ font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
......
...@@ -32,6 +32,12 @@ PACKAGE = sun.applet ...@@ -32,6 +32,12 @@ PACKAGE = sun.applet
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
# #
# Files to compile. # Files to compile.
# #
......
...@@ -32,6 +32,13 @@ PACKAGE = sun.tools ...@@ -32,6 +32,13 @@ PACKAGE = sun.tools
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
# #
# Files # Files
# #
......
...@@ -54,9 +54,9 @@ Link America/Los_Angeles PST ...@@ -54,9 +54,9 @@ Link America/Los_Angeles PST
Link Pacific/Guadalcanal SST Link Pacific/Guadalcanal SST
Link Asia/Saigon VST Link Asia/Saigon VST
# The follwong link is required to generate J2SE 1.2.x and 1.3.x # The follwong link is required to generate JDK 1.2.x and 1.3.x
# compatible zones. In the Olson public source, MET is defined as # compatible zones. In the Olson public source, MET is defined as
# GMT+1:00 with the C-Eur rules. In J2SE, MET is defined as an alias # GMT+1:00 with the C-Eur rules. In JDK, MET is defined as an alias
# of Asia/Tehran. This line must be removed if a full set of Olson # of Asia/Tehran. This line must be removed if a full set of Olson
# zones is generated. Otherwise, MET appears twice in the # zones is generated. Otherwise, MET appears twice in the
# ZoneInfoMappings.IDs table. # ZoneInfoMappings.IDs table.
......
...@@ -32,6 +32,13 @@ PACKAGE = sun.tools.jconsole ...@@ -32,6 +32,13 @@ PACKAGE = sun.tools.jconsole
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
JARFILE = $(LIBDIR)/jconsole.jar JARFILE = $(LIBDIR)/jconsole.jar
OTHER_JAVACFLAGS += -encoding iso8859-1 OTHER_JAVACFLAGS += -encoding iso8859-1
......
# #
# Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2008 - 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as # under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. # published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
# #
# This code is distributed in the hope that it will be useful, but WITHOUT # This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
...@@ -21,51 +23,20 @@ ...@@ -21,51 +23,20 @@
# have any questions. # have any questions.
# #
# @test FILES_cpp = \
# @bug 4313887 stdafx.cpp \
# @summary Unit test for probeContentType method kernel.cpp \
# @library .. DownloadDialog.cpp \
# @build ContentType SimpleFileTypeDetector DownloadHelper.cpp \
# @run shell content_type.sh DownloadHelper.cpp
# if TESTJAVA isn't set then we assume an interactive run.
if [ -z "$TESTJAVA" ]; then FILES_rc = kernel.rc
TESTSRC=.
TESTCLASSES=.
JAVA=java
else
JAVA="${TESTJAVA}/bin/java"
fi
OS=`uname -s` # FILES_export definitions for Win32
case "$OS" in
Windows_* )
CLASSPATH="${TESTCLASSES};${TESTSRC}"
;;
* )
CLASSPATH=${TESTCLASSES}:${TESTSRC}
;;
esac
export CLASSPATH
failures=0 FILES_export = \
sun/jkernel/DownloadManager.java \
go() { sun/jkernel/Mutex.java \
echo '' sun/jkernel/Bundle.java \
$JAVA $1 $2 $3 2>&1 sun/jkernel/BackgroundDownloader.java \
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
# Run the test
go ContentType
#
# Results
#
echo ''
if [ $failures -gt 0 ];
then echo "$failures test(s) failed";
else echo "All test(s) passed"; fi
exit $failures
#
# Copyright 2008 - 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
FILES_java = \
$(TARGDIR)sun/jkernel/BackgroundDownloader.java \
$(TARGDIR)sun/jkernel/Bundle.java \
$(TARGDIR)sun/jkernel/ByteArrayToFromHexDigits.java \
$(TARGDIR)sun/jkernel/BundleCheck.java \
$(TARGDIR)sun/jkernel/DownloadManager.java \
$(TARGDIR)sun/jkernel/Mutex.java \
$(TARGDIR)sun/jkernel/StandaloneByteArrayAccess.java \
$(TARGDIR)sun/jkernel/StandaloneMessageDigest.java \
$(TARGDIR)sun/jkernel/StandaloneSHA.java \
FILES_export = \
sun/jkernel/DownloadManager.java \
sun/jkernel/Mutex.java \
sun/jkernel/Bundle.java \
sun/jkernel/BackgroundDownloader.java
#
# Copyright 2008 - 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
BUILDDIR = ../..
PACKAGE = sun.jkernel
LIBRARY = jkernel
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
#
# Use highest optimization level
#
_OPT = $(CC_HIGHEST_OPT)
# This re-directs all the class files to a separate location
CLASSDESTDIR = $(TEMPDIR)/classes
#
# Java source files
#
include FILES_java.gmk
AUTO_FILES_JAVA_DIRS = sun/jkernel
LOCALE_SUFFIXES = $(JDK_LOCALES)
#
# Native source files
#
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(PLATFORM), windows)
include FILES_c_windows.gmk
vpath %.cpp $(PLATFORM_SRC)/native/sun/jkernel
VERSIONINFO_RESOURCE = $(PLATFORM_SRC)/native/sun/jkernel/kernel.rc
LDLIBS += urlmon.lib wininet.lib shlwapi.lib version.lib comctl32.lib gdi32.lib -def:$(PLATFORM_SRC)/native/sun/jkernel/kernel.def
include $(BUILDDIR)/common/Library.gmk
endif
endif
#
# Resources
#
include $(TOPDIR)/make/common/internal/Resources.gmk
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
# If extra compression is going to be available in the deploy build enable
# its use here by defining the JRE-relative pathname of the shared library
ifeq ($(PLATFORM), windows)
ifdef EXTRA_COMP_INSTALL_PATH
CPPFLAGS += -DEXTRA_COMP_INSTALL_PATH=$(EXTRA_COMP_INSTALL_PATH)
endif
endif
...@@ -33,6 +33,13 @@ PRODUCT = sun ...@@ -33,6 +33,13 @@ PRODUCT = sun
OTHER_JAVACFLAGS += -Xlint:serial -Werror OTHER_JAVACFLAGS += -Xlint:serial -Werror
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
# #
# Files # Files
# #
......
...@@ -66,6 +66,9 @@ FILES_java = \ ...@@ -66,6 +66,9 @@ FILES_java = \
sun/net/www/protocol/file/Handler.java \ sun/net/www/protocol/file/Handler.java \
sun/net/www/protocol/file/FileURLConnection.java \ sun/net/www/protocol/file/FileURLConnection.java \
sun/net/www/http/HttpClient.java \ sun/net/www/http/HttpClient.java \
sun/net/www/http/HttpCapture.java \
sun/net/www/http/HttpCaptureInputStream.java \
sun/net/www/http/HttpCaptureOutputStream.java \
sun/net/www/http/PosterOutputStream.java \ sun/net/www/http/PosterOutputStream.java \
sun/net/www/http/ChunkedInputStream.java \ sun/net/www/http/ChunkedInputStream.java \
sun/net/www/http/ChunkedOutputStream.java \ sun/net/www/http/ChunkedOutputStream.java \
...@@ -75,6 +78,7 @@ FILES_java = \ ...@@ -75,6 +78,7 @@ FILES_java = \
sun/net/www/http/Hurryable.java \ sun/net/www/http/Hurryable.java \
sun/net/www/protocol/http/Handler.java \ sun/net/www/protocol/http/Handler.java \
sun/net/www/protocol/http/HttpURLConnection.java \ sun/net/www/protocol/http/HttpURLConnection.java \
sun/net/www/protocol/http/HttpLogFormatter.java \
sun/net/www/protocol/http/HttpAuthenticator.java \ sun/net/www/protocol/http/HttpAuthenticator.java \
sun/net/www/protocol/http/AuthenticationHeader.java \ sun/net/www/protocol/http/AuthenticationHeader.java \
sun/net/www/protocol/http/AuthenticationInfo.java \ sun/net/www/protocol/http/AuthenticationInfo.java \
......
...@@ -151,7 +151,6 @@ FILES_src = \ ...@@ -151,7 +151,6 @@ FILES_src = \
sun/io/ByteToCharJISAutoDetect.java \ sun/io/ByteToCharJISAutoDetect.java \
sun/io/ByteToCharJohab.java \ sun/io/ByteToCharJohab.java \
sun/io/ByteToCharMS874.java \ sun/io/ByteToCharMS874.java \
sun/io/ByteToCharMS932DB.java \
sun/io/ByteToCharMS932.java \ sun/io/ByteToCharMS932.java \
sun/io/ByteToCharMS936.java \ sun/io/ByteToCharMS936.java \
sun/io/ByteToCharMS949.java \ sun/io/ByteToCharMS949.java \
...@@ -283,7 +282,6 @@ FILES_src = \ ...@@ -283,7 +282,6 @@ FILES_src = \
sun/io/CharToByteISO8859_8.java \ sun/io/CharToByteISO8859_8.java \
sun/io/CharToByteJohab.java \ sun/io/CharToByteJohab.java \
sun/io/CharToByteMS874.java \ sun/io/CharToByteMS874.java \
sun/io/CharToByteMS932DB.java \
sun/io/CharToByteMS932.java \ sun/io/CharToByteMS932.java \
sun/io/CharToByteMS936.java \ sun/io/CharToByteMS936.java \
sun/io/CharToByteMS949.java \ sun/io/CharToByteMS949.java \
...@@ -388,7 +386,15 @@ FILES_gen_extcs = \ ...@@ -388,7 +386,15 @@ FILES_gen_extcs = \
sun/nio/cs/ext/IBM948.java \ sun/nio/cs/ext/IBM948.java \
sun/nio/cs/ext/IBM949.java \ sun/nio/cs/ext/IBM949.java \
sun/nio/cs/ext/IBM950.java \ sun/nio/cs/ext/IBM950.java \
sun/nio/cs/ext/IBM970.java sun/nio/cs/ext/IBM970.java \
sun/nio/cs/ext/EUC_CN.java \
sun/nio/cs/ext/EUC_KR.java \
sun/nio/cs/ext/Johab.java \
sun/nio/cs/ext/MS932.java \
sun/nio/cs/ext/MS936.java \
sun/nio/cs/ext/MS949.java \
sun/nio/cs/ext/MS950.java \
sun/nio/cs/ext/GBK.java
FILES_java = $(FILES_src) $(FILES_gen_extcs) FILES_java = $(FILES_src) $(FILES_gen_extcs)
...@@ -105,7 +105,7 @@ $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \ ...@@ -105,7 +105,7 @@ $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
$(install-file) $(install-file)
$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT) $(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
$(BOOT_JAR_CMD) cf $(CHARSETS_JAR) \ $(BOOT_JAR_CMD) cf0 $(CHARSETS_JAR) \
-C $(CLASSDESTDIR) sun \ -C $(CLASSDESTDIR) sun \
-C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \ -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \
$(BOOT_JAR_JFLAGS) $(BOOT_JAR_JFLAGS)
......
...@@ -32,6 +32,13 @@ PACKAGE = sun.rmi.rmic ...@@ -32,6 +32,13 @@ PACKAGE = sun.rmi.rmic
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
#
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
# #
# Files # Files
# #
......
...@@ -32,6 +32,14 @@ PACKAGE = sun.tools.serialver ...@@ -32,6 +32,14 @@ PACKAGE = sun.tools.serialver
PRODUCT = sun PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
#
# This program must contain a manifest that defines the execution level
# needed to follow standard Vista User Access Control Guidelines
# This must be set before Program.gmk is included
#
BUILD_MANIFEST=true
# #
# Files # Files
# #
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
#
# (1)entries that exist only in MS932DB.c2b.private
# (diff result of MS932DB.b2c.private and MS932DB.c2b.private)
# (2)added the jis0201 c->b only entries
# u+203e -> 0x7e
# u+00a5 -> 0x5c
#
0x7e 0x203e
0x5c 0x00a5
#
0x8143 0x00b8 # CEDILLA
0x8145 0x00b7 # MIDDLE DOT
0x8150 0x00af # MACRON
0x8191 0x00a2 # CENT SIGN
0x8192 0x00a3 # POUND SIGN
0x81ca 0x00ac # NOT SIGN
0x81e1 0x00ab # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
0x81e2 0x00bb # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
0x8394 0x3094 # HIRAGANA LETTER VU
0x83ca 0x00b5 # MICRO SIGN
此差异已折叠。
#
# These are the entries exist only in MS932DB.b2c.private
# (diff result of MS932DB.b2c.private and MS932DB.c2b.private)
#
0x8790 0x2252 # APPROXIMATELY EQUAL TO OR THE IMAGE OF
0x8791 0x2261 # IDENTICAL TO
0x8792 0x222b # INTEGRAL
0x8795 0x221a # SQUARE ROOT
0x8796 0x22a5 # UP TACK
0x8797 0x2220 # ANGLE
0x879a 0x2235 # BECAUSE
0x879b 0x2229 # INTERSECTION
0x879c 0x222a # UNION
0xed40 0x7e8a # CJK UNIFIED IDEOGRAPH-7E8A
0xed41 0x891c # CJK UNIFIED IDEOGRAPH-891C
0xed42 0x9348 # CJK UNIFIED IDEOGRAPH-9348
0xed43 0x9288 # CJK UNIFIED IDEOGRAPH-9288
0xed44 0x84dc # CJK UNIFIED IDEOGRAPH-84DC
0xed45 0x4fc9 # CJK UNIFIED IDEOGRAPH-4FC9
0xed46 0x70bb # CJK UNIFIED IDEOGRAPH-70BB
0xed47 0x6631 # CJK UNIFIED IDEOGRAPH-6631
0xed48 0x68c8 # CJK UNIFIED IDEOGRAPH-68C8
0xed49 0x92f9 # CJK UNIFIED IDEOGRAPH-92F9
0xed4a 0x66fb # CJK UNIFIED IDEOGRAPH-66FB
0xed4b 0x5f45 # CJK UNIFIED IDEOGRAPH-5F45
0xed4c 0x4e28 # CJK UNIFIED IDEOGRAPH-4E28
0xed4d 0x4ee1 # CJK UNIFIED IDEOGRAPH-4EE1
0xed4e 0x4efc # CJK UNIFIED IDEOGRAPH-4EFC
0xed4f 0x4f00 # CJK UNIFIED IDEOGRAPH-4F00
0xed50 0x4f03 # CJK UNIFIED IDEOGRAPH-4F03
0xed51 0x4f39 # CJK UNIFIED IDEOGRAPH-4F39
0xed52 0x4f56 # CJK UNIFIED IDEOGRAPH-4F56
0xed53 0x4f92 # CJK UNIFIED IDEOGRAPH-4F92
0xed54 0x4f8a # CJK UNIFIED IDEOGRAPH-4F8A
0xed55 0x4f9a # CJK UNIFIED IDEOGRAPH-4F9A
0xed56 0x4f94 # CJK UNIFIED IDEOGRAPH-4F94
0xed57 0x4fcd # CJK UNIFIED IDEOGRAPH-4FCD
0xed58 0x5040 # CJK UNIFIED IDEOGRAPH-5040
0xed59 0x5022 # CJK UNIFIED IDEOGRAPH-5022
0xed5a 0x4fff # CJK UNIFIED IDEOGRAPH-4FFF
0xed5b 0x501e # CJK UNIFIED IDEOGRAPH-501E
0xed5c 0x5046 # CJK UNIFIED IDEOGRAPH-5046
0xed5d 0x5070 # CJK UNIFIED IDEOGRAPH-5070
0xed5e 0x5042 # CJK UNIFIED IDEOGRAPH-5042
0xed5f 0x5094 # CJK UNIFIED IDEOGRAPH-5094
0xed60 0x50f4 # CJK UNIFIED IDEOGRAPH-50F4
0xed61 0x50d8 # CJK UNIFIED IDEOGRAPH-50D8
0xed62 0x514a # CJK UNIFIED IDEOGRAPH-514A
0xed63 0x5164 # CJK UNIFIED IDEOGRAPH-5164
0xed64 0x519d # CJK UNIFIED IDEOGRAPH-519D
0xed65 0x51be # CJK UNIFIED IDEOGRAPH-51BE
0xed66 0x51ec # CJK UNIFIED IDEOGRAPH-51EC
0xed67 0x5215 # CJK UNIFIED IDEOGRAPH-5215
0xed68 0x529c # CJK UNIFIED IDEOGRAPH-529C
0xed69 0x52a6 # CJK UNIFIED IDEOGRAPH-52A6
0xed6a 0x52c0 # CJK UNIFIED IDEOGRAPH-52C0
0xed6b 0x52db # CJK UNIFIED IDEOGRAPH-52DB
0xed6c 0x5300 # CJK UNIFIED IDEOGRAPH-5300
0xed6d 0x5307 # CJK UNIFIED IDEOGRAPH-5307
0xed6e 0x5324 # CJK UNIFIED IDEOGRAPH-5324
0xed6f 0x5372 # CJK UNIFIED IDEOGRAPH-5372
0xed70 0x5393 # CJK UNIFIED IDEOGRAPH-5393
0xed71 0x53b2 # CJK UNIFIED IDEOGRAPH-53B2
0xed72 0x53dd # CJK UNIFIED IDEOGRAPH-53DD
0xed73 0xfa0e # CJK COMPATIBILITY IDEOGRAPH-FA0E
0xed74 0x549c # CJK UNIFIED IDEOGRAPH-549C
0xed75 0x548a # CJK UNIFIED IDEOGRAPH-548A
0xed76 0x54a9 # CJK UNIFIED IDEOGRAPH-54A9
0xed77 0x54ff # CJK UNIFIED IDEOGRAPH-54FF
0xed78 0x5586 # CJK UNIFIED IDEOGRAPH-5586
0xed79 0x5759 # CJK UNIFIED IDEOGRAPH-5759
0xed7a 0x5765 # CJK UNIFIED IDEOGRAPH-5765
0xed7b 0x57ac # CJK UNIFIED IDEOGRAPH-57AC
0xed7c 0x57c8 # CJK UNIFIED IDEOGRAPH-57C8
0xed7d 0x57c7 # CJK UNIFIED IDEOGRAPH-57C7
0xed7e 0xfa0f # CJK COMPATIBILITY IDEOGRAPH-FA0F
0xed80 0xfa10 # CJK COMPATIBILITY IDEOGRAPH-FA10
0xed81 0x589e # CJK UNIFIED IDEOGRAPH-589E
0xed82 0x58b2 # CJK UNIFIED IDEOGRAPH-58B2
0xed83 0x590b # CJK UNIFIED IDEOGRAPH-590B
0xed84 0x5953 # CJK UNIFIED IDEOGRAPH-5953
0xed85 0x595b # CJK UNIFIED IDEOGRAPH-595B
0xed86 0x595d # CJK UNIFIED IDEOGRAPH-595D
0xed87 0x5963 # CJK UNIFIED IDEOGRAPH-5963
0xed88 0x59a4 # CJK UNIFIED IDEOGRAPH-59A4
0xed89 0x59ba # CJK UNIFIED IDEOGRAPH-59BA
0xed8a 0x5b56 # CJK UNIFIED IDEOGRAPH-5B56
0xed8b 0x5bc0 # CJK UNIFIED IDEOGRAPH-5BC0
0xed8c 0x752f # CJK UNIFIED IDEOGRAPH-752F
0xed8d 0x5bd8 # CJK UNIFIED IDEOGRAPH-5BD8
0xed8e 0x5bec # CJK UNIFIED IDEOGRAPH-5BEC
0xed8f 0x5c1e # CJK UNIFIED IDEOGRAPH-5C1E
0xed90 0x5ca6 # CJK UNIFIED IDEOGRAPH-5CA6
0xed91 0x5cba # CJK UNIFIED IDEOGRAPH-5CBA
0xed92 0x5cf5 # CJK UNIFIED IDEOGRAPH-5CF5
0xed93 0x5d27 # CJK UNIFIED IDEOGRAPH-5D27
0xed94 0x5d53 # CJK UNIFIED IDEOGRAPH-5D53
0xed95 0xfa11 # CJK COMPATIBILITY IDEOGRAPH-FA11
0xed96 0x5d42 # CJK UNIFIED IDEOGRAPH-5D42
0xed97 0x5d6d # CJK UNIFIED IDEOGRAPH-5D6D
0xed98 0x5db8 # CJK UNIFIED IDEOGRAPH-5DB8
0xed99 0x5db9 # CJK UNIFIED IDEOGRAPH-5DB9
0xed9a 0x5dd0 # CJK UNIFIED IDEOGRAPH-5DD0
0xed9b 0x5f21 # CJK UNIFIED IDEOGRAPH-5F21
0xed9c 0x5f34 # CJK UNIFIED IDEOGRAPH-5F34
0xed9d 0x5f67 # CJK UNIFIED IDEOGRAPH-5F67
0xed9e 0x5fb7 # CJK UNIFIED IDEOGRAPH-5FB7
0xed9f 0x5fde # CJK UNIFIED IDEOGRAPH-5FDE
0xeda0 0x605d # CJK UNIFIED IDEOGRAPH-605D
0xeda1 0x6085 # CJK UNIFIED IDEOGRAPH-6085
0xeda2 0x608a # CJK UNIFIED IDEOGRAPH-608A
0xeda3 0x60de # CJK UNIFIED IDEOGRAPH-60DE
0xeda4 0x60d5 # CJK UNIFIED IDEOGRAPH-60D5
0xeda5 0x6120 # CJK UNIFIED IDEOGRAPH-6120
0xeda6 0x60f2 # CJK UNIFIED IDEOGRAPH-60F2
0xeda7 0x6111 # CJK UNIFIED IDEOGRAPH-6111
0xeda8 0x6137 # CJK UNIFIED IDEOGRAPH-6137
0xeda9 0x6130 # CJK UNIFIED IDEOGRAPH-6130
0xedaa 0x6198 # CJK UNIFIED IDEOGRAPH-6198
0xedab 0x6213 # CJK UNIFIED IDEOGRAPH-6213
0xedac 0x62a6 # CJK UNIFIED IDEOGRAPH-62A6
0xedad 0x63f5 # CJK UNIFIED IDEOGRAPH-63F5
0xedae 0x6460 # CJK UNIFIED IDEOGRAPH-6460
0xedaf 0x649d # CJK UNIFIED IDEOGRAPH-649D
0xedb0 0x64ce # CJK UNIFIED IDEOGRAPH-64CE
0xedb1 0x654e # CJK UNIFIED IDEOGRAPH-654E
0xedb2 0x6600 # CJK UNIFIED IDEOGRAPH-6600
0xedb3 0x6615 # CJK UNIFIED IDEOGRAPH-6615
0xedb4 0x663b # CJK UNIFIED IDEOGRAPH-663B
0xedb5 0x6609 # CJK UNIFIED IDEOGRAPH-6609
0xedb6 0x662e # CJK UNIFIED IDEOGRAPH-662E
0xedb7 0x661e # CJK UNIFIED IDEOGRAPH-661E
0xedb8 0x6624 # CJK UNIFIED IDEOGRAPH-6624
0xedb9 0x6665 # CJK UNIFIED IDEOGRAPH-6665
0xedba 0x6657 # CJK UNIFIED IDEOGRAPH-6657
0xedbb 0x6659 # CJK UNIFIED IDEOGRAPH-6659
0xedbc 0xfa12 # CJK COMPATIBILITY IDEOGRAPH-FA12
0xedbd 0x6673 # CJK UNIFIED IDEOGRAPH-6673
0xedbe 0x6699 # CJK UNIFIED IDEOGRAPH-6699
0xedbf 0x66a0 # CJK UNIFIED IDEOGRAPH-66A0
0xedc0 0x66b2 # CJK UNIFIED IDEOGRAPH-66B2
0xedc1 0x66bf # CJK UNIFIED IDEOGRAPH-66BF
0xedc2 0x66fa # CJK UNIFIED IDEOGRAPH-66FA
0xedc3 0x670e # CJK UNIFIED IDEOGRAPH-670E
0xedc4 0xf929 # CJK COMPATIBILITY IDEOGRAPH-F929
0xedc5 0x6766 # CJK UNIFIED IDEOGRAPH-6766
0xedc6 0x67bb # CJK UNIFIED IDEOGRAPH-67BB
0xedc7 0x6852 # CJK UNIFIED IDEOGRAPH-6852
0xedc8 0x67c0 # CJK UNIFIED IDEOGRAPH-67C0
0xedc9 0x6801 # CJK UNIFIED IDEOGRAPH-6801
0xedca 0x6844 # CJK UNIFIED IDEOGRAPH-6844
0xedcb 0x68cf # CJK UNIFIED IDEOGRAPH-68CF
0xedcc 0xfa13 # CJK COMPATIBILITY IDEOGRAPH-FA13
0xedcd 0x6968 # CJK UNIFIED IDEOGRAPH-6968
0xedce 0xfa14 # CJK COMPATIBILITY IDEOGRAPH-FA14
0xedcf 0x6998 # CJK UNIFIED IDEOGRAPH-6998
0xedd0 0x69e2 # CJK UNIFIED IDEOGRAPH-69E2
0xedd1 0x6a30 # CJK UNIFIED IDEOGRAPH-6A30
0xedd2 0x6a6b # CJK UNIFIED IDEOGRAPH-6A6B
0xedd3 0x6a46 # CJK UNIFIED IDEOGRAPH-6A46
0xedd4 0x6a73 # CJK UNIFIED IDEOGRAPH-6A73
0xedd5 0x6a7e # CJK UNIFIED IDEOGRAPH-6A7E
0xedd6 0x6ae2 # CJK UNIFIED IDEOGRAPH-6AE2
0xedd7 0x6ae4 # CJK UNIFIED IDEOGRAPH-6AE4
0xedd8 0x6bd6 # CJK UNIFIED IDEOGRAPH-6BD6
0xedd9 0x6c3f # CJK UNIFIED IDEOGRAPH-6C3F
0xedda 0x6c5c # CJK UNIFIED IDEOGRAPH-6C5C
0xeddb 0x6c86 # CJK UNIFIED IDEOGRAPH-6C86
0xeddc 0x6c6f # CJK UNIFIED IDEOGRAPH-6C6F
0xeddd 0x6cda # CJK UNIFIED IDEOGRAPH-6CDA
0xedde 0x6d04 # CJK UNIFIED IDEOGRAPH-6D04
0xeddf 0x6d87 # CJK UNIFIED IDEOGRAPH-6D87
0xede0 0x6d6f # CJK UNIFIED IDEOGRAPH-6D6F
0xede1 0x6d96 # CJK UNIFIED IDEOGRAPH-6D96
0xede2 0x6dac # CJK UNIFIED IDEOGRAPH-6DAC
0xede3 0x6dcf # CJK UNIFIED IDEOGRAPH-6DCF
0xede4 0x6df8 # CJK UNIFIED IDEOGRAPH-6DF8
0xede5 0x6df2 # CJK UNIFIED IDEOGRAPH-6DF2
0xede6 0x6dfc # CJK UNIFIED IDEOGRAPH-6DFC
0xede7 0x6e39 # CJK UNIFIED IDEOGRAPH-6E39
0xede8 0x6e5c # CJK UNIFIED IDEOGRAPH-6E5C
0xede9 0x6e27 # CJK UNIFIED IDEOGRAPH-6E27
0xedea 0x6e3c # CJK UNIFIED IDEOGRAPH-6E3C
0xedeb 0x6ebf # CJK UNIFIED IDEOGRAPH-6EBF
0xedec 0x6f88 # CJK UNIFIED IDEOGRAPH-6F88
0xeded 0x6fb5 # CJK UNIFIED IDEOGRAPH-6FB5
0xedee 0x6ff5 # CJK UNIFIED IDEOGRAPH-6FF5
0xedef 0x7005 # CJK UNIFIED IDEOGRAPH-7005
0xedf0 0x7007 # CJK UNIFIED IDEOGRAPH-7007
0xedf1 0x7028 # CJK UNIFIED IDEOGRAPH-7028
0xedf2 0x7085 # CJK UNIFIED IDEOGRAPH-7085
0xedf3 0x70ab # CJK UNIFIED IDEOGRAPH-70AB
0xedf4 0x710f # CJK UNIFIED IDEOGRAPH-710F
0xedf5 0x7104 # CJK UNIFIED IDEOGRAPH-7104
0xedf6 0x715c # CJK UNIFIED IDEOGRAPH-715C
0xedf7 0x7146 # CJK UNIFIED IDEOGRAPH-7146
0xedf8 0x7147 # CJK UNIFIED IDEOGRAPH-7147
0xedf9 0xfa15 # CJK COMPATIBILITY IDEOGRAPH-FA15
0xedfa 0x71c1 # CJK UNIFIED IDEOGRAPH-71C1
0xedfb 0x71fe # CJK UNIFIED IDEOGRAPH-71FE
0xedfc 0x72b1 # CJK UNIFIED IDEOGRAPH-72B1
0xee40 0x72be # CJK UNIFIED IDEOGRAPH-72BE
0xee41 0x7324 # CJK UNIFIED IDEOGRAPH-7324
0xee42 0xfa16 # CJK COMPATIBILITY IDEOGRAPH-FA16
0xee43 0x7377 # CJK UNIFIED IDEOGRAPH-7377
0xee44 0x73bd # CJK UNIFIED IDEOGRAPH-73BD
0xee45 0x73c9 # CJK UNIFIED IDEOGRAPH-73C9
0xee46 0x73d6 # CJK UNIFIED IDEOGRAPH-73D6
0xee47 0x73e3 # CJK UNIFIED IDEOGRAPH-73E3
0xee48 0x73d2 # CJK UNIFIED IDEOGRAPH-73D2
0xee49 0x7407 # CJK UNIFIED IDEOGRAPH-7407
0xee4a 0x73f5 # CJK UNIFIED IDEOGRAPH-73F5
0xee4b 0x7426 # CJK UNIFIED IDEOGRAPH-7426
0xee4c 0x742a # CJK UNIFIED IDEOGRAPH-742A
0xee4d 0x7429 # CJK UNIFIED IDEOGRAPH-7429
0xee4e 0x742e # CJK UNIFIED IDEOGRAPH-742E
0xee4f 0x7462 # CJK UNIFIED IDEOGRAPH-7462
0xee50 0x7489 # CJK UNIFIED IDEOGRAPH-7489
0xee51 0x749f # CJK UNIFIED IDEOGRAPH-749F
0xee52 0x7501 # CJK UNIFIED IDEOGRAPH-7501
0xee53 0x756f # CJK UNIFIED IDEOGRAPH-756F
0xee54 0x7682 # CJK UNIFIED IDEOGRAPH-7682
0xee55 0x769c # CJK UNIFIED IDEOGRAPH-769C
0xee56 0x769e # CJK UNIFIED IDEOGRAPH-769E
0xee57 0x769b # CJK UNIFIED IDEOGRAPH-769B
0xee58 0x76a6 # CJK UNIFIED IDEOGRAPH-76A6
0xee59 0xfa17 # CJK COMPATIBILITY IDEOGRAPH-FA17
0xee5a 0x7746 # CJK UNIFIED IDEOGRAPH-7746
0xee5b 0x52af # CJK UNIFIED IDEOGRAPH-52AF
0xee5c 0x7821 # CJK UNIFIED IDEOGRAPH-7821
0xee5d 0x784e # CJK UNIFIED IDEOGRAPH-784E
0xee5e 0x7864 # CJK UNIFIED IDEOGRAPH-7864
0xee5f 0x787a # CJK UNIFIED IDEOGRAPH-787A
0xee60 0x7930 # CJK UNIFIED IDEOGRAPH-7930
0xee61 0xfa18 # CJK COMPATIBILITY IDEOGRAPH-FA18
0xee62 0xfa19 # CJK COMPATIBILITY IDEOGRAPH-FA19
0xee63 0xfa1a # CJK COMPATIBILITY IDEOGRAPH-FA1A
0xee64 0x7994 # CJK UNIFIED IDEOGRAPH-7994
0xee65 0xfa1b # CJK COMPATIBILITY IDEOGRAPH-FA1B
0xee66 0x799b # CJK UNIFIED IDEOGRAPH-799B
0xee67 0x7ad1 # CJK UNIFIED IDEOGRAPH-7AD1
0xee68 0x7ae7 # CJK UNIFIED IDEOGRAPH-7AE7
0xee69 0xfa1c # CJK COMPATIBILITY IDEOGRAPH-FA1C
0xee6a 0x7aeb # CJK UNIFIED IDEOGRAPH-7AEB
0xee6b 0x7b9e # CJK UNIFIED IDEOGRAPH-7B9E
0xee6c 0xfa1d # CJK COMPATIBILITY IDEOGRAPH-FA1D
0xee6d 0x7d48 # CJK UNIFIED IDEOGRAPH-7D48
0xee6e 0x7d5c # CJK UNIFIED IDEOGRAPH-7D5C
0xee6f 0x7db7 # CJK UNIFIED IDEOGRAPH-7DB7
0xee70 0x7da0 # CJK UNIFIED IDEOGRAPH-7DA0
0xee71 0x7dd6 # CJK UNIFIED IDEOGRAPH-7DD6
0xee72 0x7e52 # CJK UNIFIED IDEOGRAPH-7E52
0xee73 0x7f47 # CJK UNIFIED IDEOGRAPH-7F47
0xee74 0x7fa1 # CJK UNIFIED IDEOGRAPH-7FA1
0xee75 0xfa1e # CJK COMPATIBILITY IDEOGRAPH-FA1E
0xee76 0x8301 # CJK UNIFIED IDEOGRAPH-8301
0xee77 0x8362 # CJK UNIFIED IDEOGRAPH-8362
0xee78 0x837f # CJK UNIFIED IDEOGRAPH-837F
0xee79 0x83c7 # CJK UNIFIED IDEOGRAPH-83C7
0xee7a 0x83f6 # CJK UNIFIED IDEOGRAPH-83F6
0xee7b 0x8448 # CJK UNIFIED IDEOGRAPH-8448
0xee7c 0x84b4 # CJK UNIFIED IDEOGRAPH-84B4
0xee7d 0x8553 # CJK UNIFIED IDEOGRAPH-8553
0xee7e 0x8559 # CJK UNIFIED IDEOGRAPH-8559
0xee80 0x856b # CJK UNIFIED IDEOGRAPH-856B
0xee81 0xfa1f # CJK COMPATIBILITY IDEOGRAPH-FA1F
0xee82 0x85b0 # CJK UNIFIED IDEOGRAPH-85B0
0xee83 0xfa20 # CJK COMPATIBILITY IDEOGRAPH-FA20
0xee84 0xfa21 # CJK COMPATIBILITY IDEOGRAPH-FA21
0xee85 0x8807 # CJK UNIFIED IDEOGRAPH-8807
0xee86 0x88f5 # CJK UNIFIED IDEOGRAPH-88F5
0xee87 0x8a12 # CJK UNIFIED IDEOGRAPH-8A12
0xee88 0x8a37 # CJK UNIFIED IDEOGRAPH-8A37
0xee89 0x8a79 # CJK UNIFIED IDEOGRAPH-8A79
0xee8a 0x8aa7 # CJK UNIFIED IDEOGRAPH-8AA7
0xee8b 0x8abe # CJK UNIFIED IDEOGRAPH-8ABE
0xee8c 0x8adf # CJK UNIFIED IDEOGRAPH-8ADF
0xee8d 0xfa22 # CJK COMPATIBILITY IDEOGRAPH-FA22
0xee8e 0x8af6 # CJK UNIFIED IDEOGRAPH-8AF6
0xee8f 0x8b53 # CJK UNIFIED IDEOGRAPH-8B53
0xee90 0x8b7f # CJK UNIFIED IDEOGRAPH-8B7F
0xee91 0x8cf0 # CJK UNIFIED IDEOGRAPH-8CF0
0xee92 0x8cf4 # CJK UNIFIED IDEOGRAPH-8CF4
0xee93 0x8d12 # CJK UNIFIED IDEOGRAPH-8D12
0xee94 0x8d76 # CJK UNIFIED IDEOGRAPH-8D76
0xee95 0xfa23 # CJK COMPATIBILITY IDEOGRAPH-FA23
0xee96 0x8ecf # CJK UNIFIED IDEOGRAPH-8ECF
0xee97 0xfa24 # CJK COMPATIBILITY IDEOGRAPH-FA24
0xee98 0xfa25 # CJK COMPATIBILITY IDEOGRAPH-FA25
0xee99 0x9067 # CJK UNIFIED IDEOGRAPH-9067
0xee9a 0x90de # CJK UNIFIED IDEOGRAPH-90DE
0xee9b 0xfa26 # CJK COMPATIBILITY IDEOGRAPH-FA26
0xee9c 0x9115 # CJK UNIFIED IDEOGRAPH-9115
0xee9d 0x9127 # CJK UNIFIED IDEOGRAPH-9127
0xee9e 0x91da # CJK UNIFIED IDEOGRAPH-91DA
0xee9f 0x91d7 # CJK UNIFIED IDEOGRAPH-91D7
0xeea0 0x91de # CJK UNIFIED IDEOGRAPH-91DE
0xeea1 0x91ed # CJK UNIFIED IDEOGRAPH-91ED
0xeea2 0x91ee # CJK UNIFIED IDEOGRAPH-91EE
0xeea3 0x91e4 # CJK UNIFIED IDEOGRAPH-91E4
0xeea4 0x91e5 # CJK UNIFIED IDEOGRAPH-91E5
0xeea5 0x9206 # CJK UNIFIED IDEOGRAPH-9206
0xeea6 0x9210 # CJK UNIFIED IDEOGRAPH-9210
0xeea7 0x920a # CJK UNIFIED IDEOGRAPH-920A
0xeea8 0x923a # CJK UNIFIED IDEOGRAPH-923A
0xeea9 0x9240 # CJK UNIFIED IDEOGRAPH-9240
0xeeaa 0x923c # CJK UNIFIED IDEOGRAPH-923C
0xeeab 0x924e # CJK UNIFIED IDEOGRAPH-924E
0xeeac 0x9259 # CJK UNIFIED IDEOGRAPH-9259
0xeead 0x9251 # CJK UNIFIED IDEOGRAPH-9251
0xeeae 0x9239 # CJK UNIFIED IDEOGRAPH-9239
0xeeaf 0x9267 # CJK UNIFIED IDEOGRAPH-9267
0xeeb0 0x92a7 # CJK UNIFIED IDEOGRAPH-92A7
0xeeb1 0x9277 # CJK UNIFIED IDEOGRAPH-9277
0xeeb2 0x9278 # CJK UNIFIED IDEOGRAPH-9278
0xeeb3 0x92e7 # CJK UNIFIED IDEOGRAPH-92E7
0xeeb4 0x92d7 # CJK UNIFIED IDEOGRAPH-92D7
0xeeb5 0x92d9 # CJK UNIFIED IDEOGRAPH-92D9
0xeeb6 0x92d0 # CJK UNIFIED IDEOGRAPH-92D0
0xeeb7 0xfa27 # CJK COMPATIBILITY IDEOGRAPH-FA27
0xeeb8 0x92d5 # CJK UNIFIED IDEOGRAPH-92D5
0xeeb9 0x92e0 # CJK UNIFIED IDEOGRAPH-92E0
0xeeba 0x92d3 # CJK UNIFIED IDEOGRAPH-92D3
0xeebb 0x9325 # CJK UNIFIED IDEOGRAPH-9325
0xeebc 0x9321 # CJK UNIFIED IDEOGRAPH-9321
0xeebd 0x92fb # CJK UNIFIED IDEOGRAPH-92FB
0xeebe 0xfa28 # CJK COMPATIBILITY IDEOGRAPH-FA28
0xeebf 0x931e # CJK UNIFIED IDEOGRAPH-931E
0xeec0 0x92ff # CJK UNIFIED IDEOGRAPH-92FF
0xeec1 0x931d # CJK UNIFIED IDEOGRAPH-931D
0xeec2 0x9302 # CJK UNIFIED IDEOGRAPH-9302
0xeec3 0x9370 # CJK UNIFIED IDEOGRAPH-9370
0xeec4 0x9357 # CJK UNIFIED IDEOGRAPH-9357
0xeec5 0x93a4 # CJK UNIFIED IDEOGRAPH-93A4
0xeec6 0x93c6 # CJK UNIFIED IDEOGRAPH-93C6
0xeec7 0x93de # CJK UNIFIED IDEOGRAPH-93DE
0xeec8 0x93f8 # CJK UNIFIED IDEOGRAPH-93F8
0xeec9 0x9431 # CJK UNIFIED IDEOGRAPH-9431
0xeeca 0x9445 # CJK UNIFIED IDEOGRAPH-9445
0xeecb 0x9448 # CJK UNIFIED IDEOGRAPH-9448
0xeecc 0x9592 # CJK UNIFIED IDEOGRAPH-9592
0xeecd 0xf9dc # CJK COMPATIBILITY IDEOGRAPH-F9DC
0xeece 0xfa29 # CJK COMPATIBILITY IDEOGRAPH-FA29
0xeecf 0x969d # CJK UNIFIED IDEOGRAPH-969D
0xeed0 0x96af # CJK UNIFIED IDEOGRAPH-96AF
0xeed1 0x9733 # CJK UNIFIED IDEOGRAPH-9733
0xeed2 0x973b # CJK UNIFIED IDEOGRAPH-973B
0xeed3 0x9743 # CJK UNIFIED IDEOGRAPH-9743
0xeed4 0x974d # CJK UNIFIED IDEOGRAPH-974D
0xeed5 0x974f # CJK UNIFIED IDEOGRAPH-974F
0xeed6 0x9751 # CJK UNIFIED IDEOGRAPH-9751
0xeed7 0x9755 # CJK UNIFIED IDEOGRAPH-9755
0xeed8 0x9857 # CJK UNIFIED IDEOGRAPH-9857
0xeed9 0x9865 # CJK UNIFIED IDEOGRAPH-9865
0xeeda 0xfa2a # CJK COMPATIBILITY IDEOGRAPH-FA2A
0xeedb 0xfa2b # CJK COMPATIBILITY IDEOGRAPH-FA2B
0xeedc 0x9927 # CJK UNIFIED IDEOGRAPH-9927
0xeedd 0xfa2c # CJK COMPATIBILITY IDEOGRAPH-FA2C
0xeede 0x999e # CJK UNIFIED IDEOGRAPH-999E
0xeedf 0x9a4e # CJK UNIFIED IDEOGRAPH-9A4E
0xeee0 0x9ad9 # CJK UNIFIED IDEOGRAPH-9AD9
0xeee1 0x9adc # CJK UNIFIED IDEOGRAPH-9ADC
0xeee2 0x9b75 # CJK UNIFIED IDEOGRAPH-9B75
0xeee3 0x9b72 # CJK UNIFIED IDEOGRAPH-9B72
0xeee4 0x9b8f # CJK UNIFIED IDEOGRAPH-9B8F
0xeee5 0x9bb1 # CJK UNIFIED IDEOGRAPH-9BB1
0xeee6 0x9bbb # CJK UNIFIED IDEOGRAPH-9BBB
0xeee7 0x9c00 # CJK UNIFIED IDEOGRAPH-9C00
0xeee8 0x9d70 # CJK UNIFIED IDEOGRAPH-9D70
0xeee9 0x9d6b # CJK UNIFIED IDEOGRAPH-9D6B
0xeeea 0xfa2d # CJK COMPATIBILITY IDEOGRAPH-FA2D
0xeeeb 0x9e19 # CJK UNIFIED IDEOGRAPH-9E19
0xeeec 0x9ed1 # CJK UNIFIED IDEOGRAPH-9ED1
0xeeef 0x2170 # SMALL ROMAN NUMERAL ONE
0xeef0 0x2171 # SMALL ROMAN NUMERAL TWO
0xeef1 0x2172 # SMALL ROMAN NUMERAL THREE
0xeef2 0x2173 # SMALL ROMAN NUMERAL FOUR
0xeef3 0x2174 # SMALL ROMAN NUMERAL FIVE
0xeef4 0x2175 # SMALL ROMAN NUMERAL SIX
0xeef5 0x2176 # SMALL ROMAN NUMERAL SEVEN
0xeef6 0x2177 # SMALL ROMAN NUMERAL EIGHT
0xeef7 0x2178 # SMALL ROMAN NUMERAL NINE
0xeef8 0x2179 # SMALL ROMAN NUMERAL TEN
0xeef9 0xffe2 # FULLWIDTH NOT SIGN
0xeefa 0xffe4 # FULLWIDTH BROKEN BAR
0xeefb 0xff07 # FULLWIDTH APOSTROPHE
0xeefc 0xff02 # FULLWIDTH QUOTATION MARK
0xfa4a 0x2160 # ROMAN NUMERAL ONE
0xfa4b 0x2161 # ROMAN NUMERAL TWO
0xfa4c 0x2162 # ROMAN NUMERAL THREE
0xfa4d 0x2163 # ROMAN NUMERAL FOUR
0xfa4e 0x2164 # ROMAN NUMERAL FIVE
0xfa4f 0x2165 # ROMAN NUMERAL SIX
0xfa50 0x2166 # ROMAN NUMERAL SEVEN
0xfa51 0x2167 # ROMAN NUMERAL EIGHT
0xfa52 0x2168 # ROMAN NUMERAL NINE
0xfa53 0x2169 # ROMAN NUMERAL TEN
0xfa54 0xffe2 # FULLWIDTH NOT SIGN
0xfa58 0x3231 # PARENTHESIZED IDEOGRAPH STOCK
0xfa59 0x2116 # NUMERO SIGN
0xfa5a 0x2121 # TELEPHONE SIGN
0xfa5b 0x2235 # BECAUSE
此差异已折叠。
此差异已折叠。
此差异已折叠。
#
# copy/paste of MS950.b2c-irreversible
#
# removed the entries of MS950.c2b-irreversible etries, this .nr
# table only includes "b->c only" entries
# (we don't need a MS950.c2b, the entries of MS950.c2b-irreversible
# are added in MS950.b2c already)
#
0xF9FA 0x256D
0xF9FB 0x256E
0xF9FC 0x2570
0xF9FD 0x256F
0xA2CC 0x5341
0xA2CE 0x5345
0xF9F9 0x2550
0xF9E9 0x255E
0xF9EA 0x256A
0xF9EB 0x2561
# #
#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max #clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
# #
Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
MS932 windows-31j MS932 basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
......
...@@ -35,7 +35,7 @@ import static build.tools.charsetmapping.CharsetMapping.*; ...@@ -35,7 +35,7 @@ import static build.tools.charsetmapping.CharsetMapping.*;
public class GenerateDBCS { public class GenerateDBCS {
// pattern used by this class to read in mapping table // pattern used by this class to read in mapping table
static Pattern mPattern = Pattern.compile("(\\p{XDigit}++)\\s++(\\p{XDigit}++)(\\s++#.*)?"); static Pattern mPattern = Pattern.compile("(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
public static void genDBCS(String args[]) throws Exception { public static void genDBCS(String args[]) throws Exception {
Scanner s = new Scanner(new File(args[0], args[2])); Scanner s = new Scanner(new File(args[0], args[2]));
...@@ -260,10 +260,12 @@ public class GenerateDBCS { ...@@ -260,10 +260,12 @@ public class GenerateDBCS {
"StandardCharsets.aliases_" + clzName : "StandardCharsets.aliases_" + clzName :
"ExtendedCharsets.aliasesFor(\"" + csName + "\")") "ExtendedCharsets.aliasesFor(\"" + csName + "\")")
.replace("$NAME_CS$" , csName) .replace("$NAME_CS$" , csName)
.replace("$CONTAINS$", isASCII ? .replace("$CONTAINS$",
" return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof " "MS932".equals(clzName)?
+ clzName + "));": "return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof JIS_X_0201) || (cs instanceof " + clzName + "));":
" return (cs instanceof " + clzName + ");") (isASCII ?
"return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof " + clzName + "));":
"return (cs instanceof " + clzName + ");"))
.replace("$HISTORICALNAME$", .replace("$HISTORICALNAME$",
(hisName == null)? "" : (hisName == null)? "" :
" public String historicalName() { return \"" + hisName + "\"; }") " public String historicalName() { return \"" + hisName + "\"; }")
......
...@@ -683,10 +683,16 @@ static void ...@@ -683,10 +683,16 @@ static void
SetClassPath(const char *s) SetClassPath(const char *s)
{ {
char *def; char *def;
const char *orig = s;
static const char format[] = "-Djava.class.path=%s";
s = JLI_WildcardExpandClasspath(s); s = JLI_WildcardExpandClasspath(s);
def = JLI_MemAlloc(JLI_StrLen(s) + 40); def = JLI_MemAlloc(sizeof(format)
sprintf(def, "-Djava.class.path=%s", s); - 2 /* strlen("%s") */
+ JLI_StrLen(s));
sprintf(def, format, s);
AddOption(def, NULL); AddOption(def, NULL);
if (s != orig)
JLI_MemFree((char *) s);
} }
/* /*
......
...@@ -506,6 +506,19 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { ...@@ -506,6 +506,19 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
writeFileHeader(fileSize, offset); writeFileHeader(fileSize, offset);
/* According to MSDN description, the top-down image layout
* is allowed only if compression type is BI_RGB or BI_BITFIELDS.
* Images with any other compression type must be wrote in the
* bottom-up layout.
*/
if (compressionType == BMPConstants.BI_RGB ||
compressionType == BMPConstants.BI_BITFIELDS)
{
isTopDown = bmpParam.isTopDown();
} else {
isTopDown = false;
}
writeInfoHeader(headerSize, bitsPerPixel); writeInfoHeader(headerSize, bitsPerPixel);
// compression // compression
...@@ -588,8 +601,6 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { ...@@ -588,8 +601,6 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
return; return;
} }
isTopDown = bmpParam.isTopDown();
int maxBandOffset = bandOffsets[0]; int maxBandOffset = bandOffsets[0];
for (int i = 1; i < bandOffsets.length; i++) for (int i = 1; i < bandOffsets.length; i++)
if (bandOffsets[i] > maxBandOffset) if (bandOffsets[i] > maxBandOffset)
...@@ -1299,7 +1310,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { ...@@ -1299,7 +1310,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
stream.writeInt(w); stream.writeInt(w);
// height // height
stream.writeInt(h); stream.writeInt(isTopDown ? -h : h);
// number of planes // number of planes
stream.writeShort(1); stream.writeShort(1);
......
...@@ -27,6 +27,8 @@ package com.sun.imageio.plugins.common; ...@@ -27,6 +27,8 @@ package com.sun.imageio.plugins.common;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.io.IOException;
import javax.imageio.stream.ImageInputStream;
/** /**
* This class contains utility methods that may be useful to ImageReader * This class contains utility methods that may be useful to ImageReader
...@@ -198,4 +200,17 @@ public class ReaderUtil { ...@@ -198,4 +200,17 @@ public class ReaderUtil {
vals, 1); vals, 1);
return vals; return vals;
} }
public static int readMultiByteInteger(ImageInputStream iis)
throws IOException
{
int value = iis.readByte();
int result = value & 0x7f;
while((value & 0x80) == 0x80) {
result <<= 7;
value = iis.readByte();
result |= (value & 0x7f);
}
return result;
}
} }
...@@ -215,17 +215,21 @@ public class JPEG { ...@@ -215,17 +215,21 @@ public class JPEG {
public static class JCS { public static class JCS {
public static final ColorSpace sRGB = public static final ColorSpace sRGB =
ColorSpace.getInstance(ColorSpace.CS_sRGB); ColorSpace.getInstance(ColorSpace.CS_sRGB);
public static final ColorSpace YCC;
private static ColorSpace YCC = null;
static { private static boolean yccInited = false;
ColorSpace cs = null;
try { public static ColorSpace getYCC() {
cs = ColorSpace.getInstance(ColorSpace.CS_PYCC); if (!yccInited) {
} catch (IllegalArgumentException e) { try {
// PYCC.pf may not always be installed YCC = ColorSpace.getInstance(ColorSpace.CS_PYCC);
} finally { } catch (IllegalArgumentException e) {
YCC = cs; // PYCC.pf may not always be installed
} finally {
yccInited = true;
}
} }
return YCC;
} }
} }
......
...@@ -41,6 +41,7 @@ import java.awt.Rectangle; ...@@ -41,6 +41,7 @@ import java.awt.Rectangle;
import java.awt.color.ColorSpace; import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile; import java.awt.color.ICC_Profile;
import java.awt.color.ICC_ColorSpace; import java.awt.color.ICC_ColorSpace;
import java.awt.color.CMMException;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.Raster; import java.awt.image.Raster;
import java.awt.image.WritableRaster; import java.awt.image.WritableRaster;
...@@ -53,6 +54,7 @@ import java.io.IOException; ...@@ -53,6 +54,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Iterator; import java.util.Iterator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.NoSuchElementException;
import sun.java2d.Disposer; import sun.java2d.Disposer;
import sun.java2d.DisposerRecord; import sun.java2d.DisposerRecord;
...@@ -215,51 +217,6 @@ public class JPEGImageReader extends ImageReader { ...@@ -215,51 +217,6 @@ public class JPEGImageReader extends ImageReader {
/** The DisposerRecord that handles the actual disposal of this reader. */ /** The DisposerRecord that handles the actual disposal of this reader. */
private DisposerRecord disposerRecord; private DisposerRecord disposerRecord;
/**
* Maintain an array of the default image types corresponding to the
* various supported IJG colorspace codes.
*/
private static final ImageTypeSpecifier [] defaultTypes =
new ImageTypeSpecifier [JPEG.NUM_JCS_CODES];
static {
defaultTypes[JPEG.JCS_GRAYSCALE] =
ImageTypeSpecifier.createFromBufferedImageType
(BufferedImage.TYPE_BYTE_GRAY);
defaultTypes[JPEG.JCS_RGB] =
ImageTypeSpecifier.createInterleaved
(JPEG.JCS.sRGB,
JPEG.bOffsRGB,
DataBuffer.TYPE_BYTE,
false,
false);
defaultTypes[JPEG.JCS_RGBA] =
ImageTypeSpecifier.createPacked
(JPEG.JCS.sRGB,
0xff000000,
0x00ff0000,
0x0000ff00,
0x000000ff,
DataBuffer.TYPE_INT,
false);
if (JPEG.JCS.YCC != null) {
defaultTypes[JPEG.JCS_YCC] =
ImageTypeSpecifier.createInterleaved
(JPEG.JCS.YCC,
JPEG.bandOffsets[2],
DataBuffer.TYPE_BYTE,
false,
false);
defaultTypes[JPEG.JCS_YCCA] =
ImageTypeSpecifier.createInterleaved
(JPEG.JCS.YCC,
JPEG.bandOffsets[3],
DataBuffer.TYPE_BYTE,
true,
false);
}
}
/** Sets up static C structures. */ /** Sets up static C structures. */
private static native void initReaderIDs(Class iisClass, private static native void initReaderIDs(Class iisClass,
Class qTableClass, Class qTableClass,
...@@ -673,6 +630,17 @@ public class JPEGImageReader extends ImageReader { ...@@ -673,6 +630,17 @@ public class JPEGImageReader extends ImageReader {
!java.util.Arrays.equals(oldData, newData)) !java.util.Arrays.equals(oldData, newData))
{ {
iccCS = new ICC_ColorSpace(newProfile); iccCS = new ICC_ColorSpace(newProfile);
// verify new color space
try {
float[] colors = iccCS.fromRGB(new float[] {1f, 0f, 0f});
} catch (CMMException e) {
/*
* Embedded profile seems to be corrupted.
* Ignore this profile.
*/
iccCS = null;
warningOccurred(WARNING_IGNORE_INVALID_ICC);
}
} }
} }
...@@ -706,11 +674,11 @@ public class JPEGImageReader extends ImageReader { ...@@ -706,11 +674,11 @@ public class JPEGImageReader extends ImageReader {
* Return an ImageTypeSpecifier corresponding to the given * Return an ImageTypeSpecifier corresponding to the given
* color space code, or null if the color space is unsupported. * color space code, or null if the color space is unsupported.
*/ */
private ImageTypeSpecifier getImageType(int code) { private ImageTypeProducer getImageType(int code) {
ImageTypeSpecifier ret = null; ImageTypeProducer ret = null;
if ((code > 0) && (code < JPEG.NUM_JCS_CODES)) { if ((code > 0) && (code < JPEG.NUM_JCS_CODES)) {
ret = defaultTypes[code]; ret = ImageTypeProducer.getTypeProducer(code);
} }
return ret; return ret;
} }
...@@ -724,7 +692,7 @@ public class JPEGImageReader extends ImageReader { ...@@ -724,7 +692,7 @@ public class JPEGImageReader extends ImageReader {
} }
// Returns null if it can't be represented // Returns null if it can't be represented
return getImageType(colorSpaceCode); return getImageType(colorSpaceCode).getType();
} finally { } finally {
clearThreadLock(); clearThreadLock();
} }
...@@ -758,13 +726,13 @@ public class JPEGImageReader extends ImageReader { ...@@ -758,13 +726,13 @@ public class JPEGImageReader extends ImageReader {
// Get the raw ITS, if there is one. Note that this // Get the raw ITS, if there is one. Note that this
// won't always be the same as the default. // won't always be the same as the default.
ImageTypeSpecifier raw = getImageType(colorSpaceCode); ImageTypeProducer raw = getImageType(colorSpaceCode);
// Given the encoded colorspace, build a list of ITS's // Given the encoded colorspace, build a list of ITS's
// representing outputs you could handle starting // representing outputs you could handle starting
// with the default. // with the default.
ArrayList list = new ArrayList(1); ArrayList<ImageTypeProducer> list = new ArrayList<ImageTypeProducer>(1);
switch (colorSpaceCode) { switch (colorSpaceCode) {
case JPEG.JCS_GRAYSCALE: case JPEG.JCS_GRAYSCALE:
...@@ -774,9 +742,7 @@ public class JPEGImageReader extends ImageReader { ...@@ -774,9 +742,7 @@ public class JPEGImageReader extends ImageReader {
case JPEG.JCS_RGB: case JPEG.JCS_RGB:
list.add(raw); list.add(raw);
list.add(getImageType(JPEG.JCS_GRAYSCALE)); list.add(getImageType(JPEG.JCS_GRAYSCALE));
if (JPEG.JCS.YCC != null) { list.add(getImageType(JPEG.JCS_YCC));
list.add(getImageType(JPEG.JCS_YCC));
}
break; break;
case JPEG.JCS_RGBA: case JPEG.JCS_RGBA:
list.add(raw); list.add(raw);
...@@ -801,19 +767,21 @@ public class JPEGImageReader extends ImageReader { ...@@ -801,19 +767,21 @@ public class JPEGImageReader extends ImageReader {
list.add(getImageType(JPEG.JCS_RGB)); list.add(getImageType(JPEG.JCS_RGB));
if (iccCS != null) { if (iccCS != null) {
list.add(ImageTypeSpecifier.createInterleaved list.add(new ImageTypeProducer() {
protected ImageTypeSpecifier produce() {
return ImageTypeSpecifier.createInterleaved
(iccCS, (iccCS,
JPEG.bOffsRGB, // Assume it's for RGB JPEG.bOffsRGB, // Assume it's for RGB
DataBuffer.TYPE_BYTE, DataBuffer.TYPE_BYTE,
false, false,
false)); false);
}
});
} }
list.add(getImageType(JPEG.JCS_GRAYSCALE)); list.add(getImageType(JPEG.JCS_GRAYSCALE));
if (JPEG.JCS.YCC != null) { // Might be null if PYCC.pf not installed list.add(getImageType(JPEG.JCS_YCC));
list.add(getImageType(JPEG.JCS_YCC));
}
break; break;
case JPEG.JCS_YCbCrA: // Default is to convert to RGBA case JPEG.JCS_YCbCrA: // Default is to convert to RGBA
// As there is no YCbCr ColorSpace, we can't support // As there is no YCbCr ColorSpace, we can't support
...@@ -822,7 +790,7 @@ public class JPEGImageReader extends ImageReader { ...@@ -822,7 +790,7 @@ public class JPEGImageReader extends ImageReader {
break; break;
} }
return list.iterator(); return new ImageTypeIterator(list.iterator());
} }
/** /**
...@@ -872,6 +840,10 @@ public class JPEGImageReader extends ImageReader { ...@@ -872,6 +840,10 @@ public class JPEGImageReader extends ImageReader {
if (csType == ColorSpace.TYPE_RGB) { // We want RGB if (csType == ColorSpace.TYPE_RGB) { // We want RGB
// IJG can do this for us more efficiently // IJG can do this for us more efficiently
setOutColorSpace(structPointer, JPEG.JCS_RGB); setOutColorSpace(structPointer, JPEG.JCS_RGB);
// Update java state according to changes
// in the native part of decoder.
outColorSpaceCode = JPEG.JCS_RGB;
numComponents = 3;
} else if (csType != ColorSpace.TYPE_GRAY) { } else if (csType != ColorSpace.TYPE_GRAY) {
throw new IIOException("Incompatible color conversion"); throw new IIOException("Incompatible color conversion");
} }
...@@ -881,6 +853,10 @@ public class JPEGImageReader extends ImageReader { ...@@ -881,6 +853,10 @@ public class JPEGImageReader extends ImageReader {
if (colorSpaceCode == JPEG.JCS_YCbCr) { if (colorSpaceCode == JPEG.JCS_YCbCr) {
// If the jpeg space is YCbCr, IJG can do it // If the jpeg space is YCbCr, IJG can do it
setOutColorSpace(structPointer, JPEG.JCS_GRAYSCALE); setOutColorSpace(structPointer, JPEG.JCS_GRAYSCALE);
// Update java state according to changes
// in the native part of decoder.
outColorSpaceCode = JPEG.JCS_GRAYSCALE;
numComponents = 1;
} }
} else if ((iccCS != null) && } else if ((iccCS != null) &&
(cm.getNumComponents() == numComponents) && (cm.getNumComponents() == numComponents) &&
...@@ -906,20 +882,26 @@ public class JPEGImageReader extends ImageReader { ...@@ -906,20 +882,26 @@ public class JPEGImageReader extends ImageReader {
} }
break; break;
case JPEG.JCS_YCC: case JPEG.JCS_YCC:
if (JPEG.JCS.YCC == null) { // We can't do YCC at all {
throw new IIOException("Incompatible color conversion"); ColorSpace YCC = JPEG.JCS.getYCC();
} if (YCC == null) { // We can't do YCC at all
if ((cs != JPEG.JCS.YCC) && throw new IIOException("Incompatible color conversion");
(cm.getNumComponents() == numComponents)) { }
convert = new ColorConvertOp(JPEG.JCS.YCC, cs, null); if ((cs != YCC) &&
(cm.getNumComponents() == numComponents)) {
convert = new ColorConvertOp(YCC, cs, null);
}
} }
break; break;
case JPEG.JCS_YCCA: case JPEG.JCS_YCCA:
// No conversions available; image must be YCCA {
if ((JPEG.JCS.YCC == null) || // We can't do YCC at all ColorSpace YCC = JPEG.JCS.getYCC();
(cs != JPEG.JCS.YCC) || // No conversions available; image must be YCCA
(cm.getNumComponents() != numComponents)) { if ((YCC == null) || // We can't do YCC at all
throw new IIOException("Incompatible color conversion"); (cs != YCC) ||
(cm.getNumComponents() != numComponents)) {
throw new IIOException("Incompatible color conversion");
}
} }
break; break;
default: default:
...@@ -1554,3 +1536,140 @@ public class JPEGImageReader extends ImageReader { ...@@ -1554,3 +1536,140 @@ public class JPEGImageReader extends ImageReader {
} }
} }
} }
/**
* An internal helper class that wraps producer's iterator
* and extracts specifier instances on demand.
*/
class ImageTypeIterator implements Iterator<ImageTypeSpecifier> {
private Iterator<ImageTypeProducer> producers;
private ImageTypeSpecifier theNext = null;
public ImageTypeIterator(Iterator<ImageTypeProducer> producers) {
this.producers = producers;
}
public boolean hasNext() {
if (theNext != null) {
return true;
}
if (!producers.hasNext()) {
return false;
}
do {
theNext = producers.next().getType();
} while (theNext == null && producers.hasNext());
return (theNext != null);
}
public ImageTypeSpecifier next() {
if (theNext != null || hasNext()) {
ImageTypeSpecifier t = theNext;
theNext = null;
return t;
} else {
throw new NoSuchElementException();
}
}
public void remove() {
producers.remove();
}
}
/**
* An internal helper class that provides means for deferred creation
* of ImageTypeSpecifier instance required to describe available
* destination types.
*
* This implementation only supports standard
* jpeg color spaces (defined by corresponding JCS color space code).
*
* To support other color spaces one can override produce() method to
* return custom instance of ImageTypeSpecifier.
*/
class ImageTypeProducer {
private ImageTypeSpecifier type = null;
boolean failed = false;
private int csCode;
public ImageTypeProducer(int csCode) {
this.csCode = csCode;
}
public ImageTypeProducer() {
csCode = -1; // undefined
}
public synchronized ImageTypeSpecifier getType() {
if (!failed && type == null) {
try {
type = produce();
} catch (Throwable e) {
failed = true;
}
}
return type;
}
private static final ImageTypeProducer [] defaultTypes =
new ImageTypeProducer [JPEG.NUM_JCS_CODES];
public synchronized static ImageTypeProducer getTypeProducer(int csCode) {
if (csCode < 0 || csCode >= JPEG.NUM_JCS_CODES) {
return null;
}
if (defaultTypes[csCode] == null) {
defaultTypes[csCode] = new ImageTypeProducer(csCode);
}
return defaultTypes[csCode];
}
protected ImageTypeSpecifier produce() {
switch (csCode) {
case JPEG.JCS_GRAYSCALE:
return ImageTypeSpecifier.createFromBufferedImageType
(BufferedImage.TYPE_BYTE_GRAY);
case JPEG.JCS_RGB:
return ImageTypeSpecifier.createInterleaved(JPEG.JCS.sRGB,
JPEG.bOffsRGB,
DataBuffer.TYPE_BYTE,
false,
false);
case JPEG.JCS_RGBA:
return ImageTypeSpecifier.createPacked(JPEG.JCS.sRGB,
0xff000000,
0x00ff0000,
0x0000ff00,
0x000000ff,
DataBuffer.TYPE_INT,
false);
case JPEG.JCS_YCC:
if (JPEG.JCS.getYCC() != null) {
return ImageTypeSpecifier.createInterleaved(
JPEG.JCS.getYCC(),
JPEG.bandOffsets[2],
DataBuffer.TYPE_BYTE,
false,
false);
} else {
return null;
}
case JPEG.JCS_YCCA:
if (JPEG.JCS.getYCC() != null) {
return ImageTypeSpecifier.createInterleaved(
JPEG.JCS.getYCC(),
JPEG.bandOffsets[3],
DataBuffer.TYPE_BYTE,
true,
false);
} else {
return null;
}
default:
return null;
}
}
}
...@@ -812,7 +812,7 @@ public class JPEGImageWriter extends ImageWriter { ...@@ -812,7 +812,7 @@ public class JPEGImageWriter extends ImageWriter {
} }
break; break;
case ColorSpace.TYPE_3CLR: case ColorSpace.TYPE_3CLR:
if (cs == JPEG.JCS.YCC) { if (cs == JPEG.JCS.getYCC()) {
if (!alpha) { if (!alpha) {
if (jfif != null) { if (jfif != null) {
convertTosRGB = true; convertTosRGB = true;
...@@ -1494,7 +1494,7 @@ public class JPEGImageWriter extends ImageWriter { ...@@ -1494,7 +1494,7 @@ public class JPEGImageWriter extends ImageWriter {
} }
break; break;
case ColorSpace.TYPE_3CLR: case ColorSpace.TYPE_3CLR:
if (cs == JPEG.JCS.YCC) { if (cs == JPEG.JCS.getYCC()) {
if (alpha) { if (alpha) {
retval = JPEG.JCS_YCCA; retval = JPEG.JCS_YCCA;
} else { } else {
...@@ -1533,7 +1533,7 @@ public class JPEGImageWriter extends ImageWriter { ...@@ -1533,7 +1533,7 @@ public class JPEGImageWriter extends ImageWriter {
} }
break; break;
case ColorSpace.TYPE_3CLR: case ColorSpace.TYPE_3CLR:
if (cs == JPEG.JCS.YCC) { if (cs == JPEG.JCS.getYCC()) {
if (alpha) { if (alpha) {
retval = JPEG.JCS_YCCA; retval = JPEG.JCS_YCCA;
} else { } else {
...@@ -1579,7 +1579,7 @@ public class JPEGImageWriter extends ImageWriter { ...@@ -1579,7 +1579,7 @@ public class JPEGImageWriter extends ImageWriter {
} }
break; break;
case ColorSpace.TYPE_3CLR: case ColorSpace.TYPE_3CLR:
if (cs == JPEG.JCS.YCC) { if (cs == JPEG.JCS.getYCC()) {
if (alpha) { if (alpha) {
retval = JPEG.JCS_YCCA; retval = JPEG.JCS_YCCA;
} else { } else {
......
...@@ -490,7 +490,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { ...@@ -490,7 +490,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
} }
break; break;
case ColorSpace.TYPE_3CLR: case ColorSpace.TYPE_3CLR:
if (cs == JPEG.JCS.YCC) { if (cs == JPEG.JCS.getYCC()) {
wantJFIF = false; wantJFIF = false;
componentIDs[0] = (byte) 'Y'; componentIDs[0] = (byte) 'Y';
componentIDs[1] = (byte) 'C'; componentIDs[1] = (byte) 'C';
......
...@@ -45,6 +45,7 @@ import java.util.ArrayList; ...@@ -45,6 +45,7 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import com.sun.imageio.plugins.common.I18N; import com.sun.imageio.plugins.common.I18N;
import com.sun.imageio.plugins.common.ReaderUtil;
/** This class is the Java Image IO plugin reader for WBMP images. /** This class is the Java Image IO plugin reader for WBMP images.
* It may subsample the image, clip the image, * It may subsample the image, clip the image,
...@@ -141,11 +142,11 @@ public class WBMPImageReader extends ImageReader { ...@@ -141,11 +142,11 @@ public class WBMPImageReader extends ImageReader {
metadata.wbmpType = wbmpType; metadata.wbmpType = wbmpType;
// Read image width // Read image width
width = readMultiByteInteger(); width = ReaderUtil.readMultiByteInteger(iis);
metadata.width = width; metadata.width = width;
// Read image height // Read image height
height = readMultiByteInteger(); height = ReaderUtil.readMultiByteInteger(iis);
metadata.height = height; metadata.height = height;
gotHeader = true; gotHeader = true;
...@@ -311,17 +312,6 @@ public class WBMPImageReader extends ImageReader { ...@@ -311,17 +312,6 @@ public class WBMPImageReader extends ImageReader {
gotHeader = false; gotHeader = false;
} }
private int readMultiByteInteger() throws IOException {
int value = iis.readByte();
int result = value & 0x7f;
while((value & 0x80) == 0x80) {
result <<= 7;
value = iis.readByte();
result |= (value & 0x7f);
}
return result;
}
/* /*
* This method verifies that given byte is valid wbmp type marker. * This method verifies that given byte is valid wbmp type marker.
* At the moment only 0x0 marker is described by wbmp spec. * At the moment only 0x0 marker is described by wbmp spec.
......
...@@ -33,9 +33,13 @@ import javax.imageio.spi.ServiceRegistry; ...@@ -33,9 +33,13 @@ import javax.imageio.spi.ServiceRegistry;
import java.io.IOException; import java.io.IOException;
import javax.imageio.ImageReader; import javax.imageio.ImageReader;
import javax.imageio.IIOException; import javax.imageio.IIOException;
import com.sun.imageio.plugins.common.ReaderUtil;
public class WBMPImageReaderSpi extends ImageReaderSpi { public class WBMPImageReaderSpi extends ImageReaderSpi {
private static final int MAX_WBMP_WIDTH = 1024;
private static final int MAX_WBMP_HEIGHT = 768;
private static String [] writerSpiNames = private static String [] writerSpiNames =
{"com.sun.imageio.plugins.wbmp.WBMPImageWriterSpi"}; {"com.sun.imageio.plugins.wbmp.WBMPImageWriterSpi"};
private static String[] formatNames = {"wbmp", "WBMP"}; private static String[] formatNames = {"wbmp", "WBMP"};
...@@ -79,16 +83,44 @@ public class WBMPImageReaderSpi extends ImageReaderSpi { ...@@ -79,16 +83,44 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
} }
ImageInputStream stream = (ImageInputStream)source; ImageInputStream stream = (ImageInputStream)source;
byte[] b = new byte[3];
stream.mark(); stream.mark();
stream.readFully(b); int type = stream.readByte(); // TypeField
int fixHeaderField = stream.readByte();
// check WBMP "header"
if (type != 0 || fixHeaderField != 0) {
// while WBMP reader does not support ext WBMP headers
stream.reset();
return false;
}
int width = ReaderUtil.readMultiByteInteger(stream);
int height = ReaderUtil.readMultiByteInteger(stream);
// check image dimension
if (width <= 0 || height <= 0) {
stream.reset();
return false;
}
long dataLength = stream.length();
if (dataLength == -1) {
// We can't verify that amount of data in the stream
// corresponds to image dimension because we do not know
// the length of the data stream.
// Assuming that wbmp image are used for mobile devices,
// let's introduce an upper limit for image dimension.
// In case if exact amount of raster data is unknown,
// let's reject images with dimension above the limit.
stream.reset();
return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT);
}
dataLength -= stream.getStreamPosition();
stream.reset(); stream.reset();
return ((b[0] == (byte)0) && // TypeField == 0 long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1);
b[1] == 0 && // FixHeaderField == 0xxx00000; not support ext header
((b[2] & 0x8f) != 0 || (b[2] & 0x7f) != 0)); // First width byte return (dataLength == scanSize * height);
//XXX: b[2] & 0x8f) != 0 for the bug in Sony Ericsson encoder.
} }
public ImageReader createReaderInstance(Object extension) public ImageReader createReaderInstance(Object extension)
......
/* /*
* Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -27,13 +27,17 @@ package com.sun.java.swing; ...@@ -27,13 +27,17 @@ package com.sun.java.swing;
import sun.awt.EventQueueDelegate; import sun.awt.EventQueueDelegate;
import sun.awt.AppContext; import sun.awt.AppContext;
import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.EventQueue; import java.awt.EventQueue;
import java.awt.Component; import java.awt.Component;
import java.awt.Container;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.RepaintManager; import javax.swing.RepaintManager;
import javax.swing.SwingUtilities;
/** /**
* A collection of utility methods for Swing. * A collection of utility methods for Swing.
...@@ -69,6 +73,43 @@ public class SwingUtilities3 { ...@@ -69,6 +73,43 @@ public class SwingUtilities3 {
repaintManager); repaintManager);
} }
private static final Map<Container, Boolean> vsyncedMap =
Collections.synchronizedMap(new WeakHashMap<Container, Boolean>());
/**
* Sets vsyncRequested state for the {@code rootContainer}. If
* {@code isRequested} is {@code true} then vsynced
* {@code BufferStrategy} is enabled for this {@code rootContainer}.
*
* Note: requesting vsynced painting does not guarantee one. The outcome
* depends on current RepaintManager's RepaintManager.PaintManager
* and on the capabilities of the graphics hardware/software and what not.
*
* @param rootContainer topmost container. Should be either {@code Window}
* or {@code Applet}
* @param isRequested the value to set vsyncRequested state to
*/
public static void setVsyncRequested(Container rootContainer,
boolean isRequested) {
assert SwingUtilities.getRoot(rootContainer) == rootContainer;
if (isRequested) {
vsyncedMap.put(rootContainer, Boolean.TRUE);
} else {
vsyncedMap.remove(rootContainer);
}
}
/**
* Checks if vsync painting is requested for {@code rootContainer}
*
* @param rootContainer topmost container. Should be either Window or Applet
* @return {@code true} if vsync painting is requested for {@code rootContainer}
*/
public static boolean isVsyncRequested(Container rootContainer) {
assert SwingUtilities.getRoot(rootContainer) == rootContainer;
return Boolean.TRUE == vsyncedMap.get(rootContainer);
}
/** /**
* Returns delegate {@code RepaintManager} for {@code component} hierarchy. * Returns delegate {@code RepaintManager} for {@code component} hierarchy.
*/ */
......
/* /*
* Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -139,7 +139,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { ...@@ -139,7 +139,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
}); });
isSunDesktop = val.booleanValue(); isSunDesktop = val.booleanValue();
} }
if (isSunDesktop) { if (isSunDesktop && !sun.java2d.SunGraphicsEnvironment.isOpenSolaris) {
isSunCJK = true; isSunCJK = true;
} }
} }
......
...@@ -445,18 +445,19 @@ public class Font implements java.io.Serializable ...@@ -445,18 +445,19 @@ public class Font implements java.io.Serializable
*/ */
private AttributeValues getAttributeValues() { private AttributeValues getAttributeValues() {
if (values == null) { if (values == null) {
values = new AttributeValues(); AttributeValues valuesTmp = new AttributeValues();
values.setFamily(name); valuesTmp.setFamily(name);
values.setSize(pointSize); // expects the float value. valuesTmp.setSize(pointSize); // expects the float value.
if ((style & BOLD) != 0) { if ((style & BOLD) != 0) {
values.setWeight(2); // WEIGHT_BOLD valuesTmp.setWeight(2); // WEIGHT_BOLD
} }
if ((style & ITALIC) != 0) { if ((style & ITALIC) != 0) {
values.setPosture(.2f); // POSTURE_OBLIQUE valuesTmp.setPosture(.2f); // POSTURE_OBLIQUE
} }
values.defineAll(PRIMARY_MASK); // for streaming compatibility valuesTmp.defineAll(PRIMARY_MASK); // for streaming compatibility
values = valuesTmp;
} }
return values; return values;
......
...@@ -79,8 +79,9 @@ public abstract class GraphicsEnvironment { ...@@ -79,8 +79,9 @@ public abstract class GraphicsEnvironment {
try { try {
// long t0 = System.currentTimeMillis(); // long t0 = System.currentTimeMillis();
localEnv = ClassLoader cl = ClassLoader.getSystemClassLoader();
(GraphicsEnvironment) Class.forName(nm).newInstance(); Class geCls = Class.forName(nm, true, cl);
localEnv = (GraphicsEnvironment)geCls.newInstance();
// long t1 = System.currentTimeMillis(); // long t1 = System.currentTimeMillis();
// System.out.println("GE creation took " + (t1-t0)+ "ms."); // System.out.println("GE creation took " + (t1-t0)+ "ms.");
if (isHeadless()) { if (isHeadless()) {
......
...@@ -863,11 +863,16 @@ public class ICC_Profile implements Serializable { ...@@ -863,11 +863,16 @@ public class ICC_Profile implements Serializable {
case ColorSpace.CS_PYCC: case ColorSpace.CS_PYCC:
synchronized(ICC_Profile.class) { synchronized(ICC_Profile.class) {
if (PYCCprofile == null) { if (PYCCprofile == null) {
ProfileDeferralInfo pInfo = if (getProfileFile("PYCC.pf") != null) {
new ProfileDeferralInfo("PYCC.pf", ProfileDeferralInfo pInfo =
ColorSpace.TYPE_3CLR, 3, new ProfileDeferralInfo("PYCC.pf",
CLASS_DISPLAY); ColorSpace.TYPE_3CLR, 3,
PYCCprofile = getDeferredInstance(pInfo); CLASS_DISPLAY);
PYCCprofile = getDeferredInstance(pInfo);
} else {
throw new IllegalArgumentException(
"Can't load standard profile: PYCC.pf");
}
} }
thisProfile = PYCCprofile; thisProfile = PYCCprofile;
} }
...@@ -1783,17 +1788,33 @@ public class ICC_Profile implements Serializable { ...@@ -1783,17 +1788,33 @@ public class ICC_Profile implements Serializable {
return (FileInputStream)java.security.AccessController.doPrivileged( return (FileInputStream)java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() { new java.security.PrivilegedAction() {
public Object run() { public Object run() {
return privilegedOpenProfile(fileName); File f = privilegedGetProfileFile(fileName);
if (f != null) {
try {
return new FileInputStream(f);
} catch (FileNotFoundException e) {
}
}
return null;
}
});
}
private static File getProfileFile(final String fileName) {
return (File)java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
return privilegedGetProfileFile(fileName);
} }
}); });
} }
/* /*
* this version is called from doPrivileged in privilegedOpenProfile. * this version is called from doPrivileged in openProfile
* the whole method is privileged! * or getProfileFile, so the whole method is privileged!
*/ */
private static FileInputStream privilegedOpenProfile(String fileName) {
FileInputStream fis = null; private static File privilegedGetProfileFile(String fileName) {
String path, dir, fullPath; String path, dir, fullPath;
File f = new File(fileName); /* try absolute file name */ File f = new File(fileName); /* try absolute file name */
...@@ -1823,19 +1844,24 @@ public class ICC_Profile implements Serializable { ...@@ -1823,19 +1844,24 @@ public class ICC_Profile implements Serializable {
} }
if (!f.isFile()) { /* try the directory of built-in profiles */ if (!f.isFile()) { /* try the directory of built-in profiles */
dir = System.getProperty("java.home") + dir = System.getProperty("java.home") +
File.separatorChar + "lib" + File.separatorChar + "cmm"; File.separatorChar + "lib" + File.separatorChar + "cmm";
fullPath = dir + File.separatorChar + fileName; fullPath = dir + File.separatorChar + fileName;
f = new File(fullPath); f = new File(fullPath);
if (!f.isFile()) {
//make sure file was installed in the kernel mode
try {
//kernel uses platform independent paths =>
// should not use platform separator char
sun.jkernel.DownloadManager.downloadFile("lib/cmm/"+fileName);
} catch (IOException ioe) {}
}
} }
if (f.isFile()) { if (f.isFile()) {
try { return f;
fis = new FileInputStream(f);
} catch (FileNotFoundException e) {
}
} }
return fis; return null;
} }
......
...@@ -93,7 +93,7 @@ class EnumPersistenceDelegate extends PersistenceDelegate { ...@@ -93,7 +93,7 @@ class EnumPersistenceDelegate extends PersistenceDelegate {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Enum e = (Enum) oldInstance; Enum e = (Enum) oldInstance;
return new Expression(e, Enum.class, "valueOf", new Object[]{e.getClass(), e.name()}); return new Expression(e, Enum.class, "valueOf", new Object[]{e.getDeclaringClass(), e.name()});
} }
} }
......
...@@ -30,15 +30,15 @@ import java.net.URI; ...@@ -30,15 +30,15 @@ import java.net.URI;
import java.net.URL; import java.net.URL;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.*; import java.util.List;
import java.nio.file.*; import java.util.ArrayList;
import java.nio.file.attribute.*;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileAttribute;
import sun.security.action.GetPropertyAction; import sun.security.action.GetPropertyAction;
/** /**
* An abstract representation of file and directory pathnames. * An abstract representation of file and directory pathnames.
* *
...@@ -787,7 +787,7 @@ public class File ...@@ -787,7 +787,7 @@ public class File
* java.lang.SecurityManager#checkRead(java.lang.String)}</code> * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* method denies read access to the file * method denies read access to the file
* *
* @see Attributes#readBasicFileAttributes * @see java.nio.file.attribute.Attributes#readBasicFileAttributes
*/ */
public boolean isDirectory() { public boolean isDirectory() {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
...@@ -813,7 +813,7 @@ public class File ...@@ -813,7 +813,7 @@ public class File
* java.lang.SecurityManager#checkRead(java.lang.String)}</code> * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* method denies read access to the file * method denies read access to the file
* *
* @see Attributes#readBasicFileAttributes * @see java.nio.file.attribute.Attributes#readBasicFileAttributes
*/ */
public boolean isFile() { public boolean isFile() {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
...@@ -863,7 +863,7 @@ public class File ...@@ -863,7 +863,7 @@ public class File
* java.lang.SecurityManager#checkRead(java.lang.String)}</code> * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* method denies read access to the file * method denies read access to the file
* *
* @see Attributes#readBasicFileAttributes * @see java.nio.file.attribute.Attributes#readBasicFileAttributes
*/ */
public long lastModified() { public long lastModified() {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
...@@ -887,7 +887,7 @@ public class File ...@@ -887,7 +887,7 @@ public class File
* java.lang.SecurityManager#checkRead(java.lang.String)}</code> * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* method denies read access to the file * method denies read access to the file
* *
* @see Attributes#readBasicFileAttributes * @see java.nio.file.attribute.Attributes#readBasicFileAttributes
*/ */
public long length() { public long length() {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
...@@ -1369,9 +1369,10 @@ public class File ...@@ -1369,9 +1369,10 @@ public class File
* Sets the owner's or everybody's write permission for this abstract * Sets the owner's or everybody's write permission for this abstract
* pathname. * pathname.
* *
* <p> The {@link Attributes Attributes} class defines methods that operate * <p> The {@link java.nio.file.attribute.Attributes Attributes} class
* on file attributes including file permissions. This may be used when * defines methods that operate on file attributes including file
* finer manipulation of file permissions is required. * permissions. This may be used when finer manipulation of file permissions
* is required.
* *
* @param writable * @param writable
* If <code>true</code>, sets the access permission to allow write * If <code>true</code>, sets the access permission to allow write
...@@ -1436,9 +1437,10 @@ public class File ...@@ -1436,9 +1437,10 @@ public class File
* Sets the owner's or everybody's read permission for this abstract * Sets the owner's or everybody's read permission for this abstract
* pathname. * pathname.
* *
* <p> The {@link Attributes Attributes} class defines methods that operate * <p> The {@link java.nio.file.attribute.Attributes Attributes} class
* on file attributes including file permissions. This may be used when * defines methods that operate on file attributes including file
* finer manipulation of file permissions is required. * permissions. This may be used when finer manipulation of file permissions
* is required.
* *
* @param readable * @param readable
* If <code>true</code>, sets the access permission to allow read * If <code>true</code>, sets the access permission to allow read
...@@ -1509,9 +1511,10 @@ public class File ...@@ -1509,9 +1511,10 @@ public class File
* Sets the owner's or everybody's execute permission for this abstract * Sets the owner's or everybody's execute permission for this abstract
* pathname. * pathname.
* *
* <p> The {@link Attributes Attributes} class defines methods that operate * <p> The {@link java.nio.file.attribute.Attributes Attributes} class
* on file attributes including file permissions. This may be used when * defines methods that operate on file attributes including file
* finer manipulation of file permissions is required. * permissions. This may be used when finer manipulation of file permissions
* is required.
* *
* @param executable * @param executable
* If <code>true</code>, sets the access permission to allow execute * If <code>true</code>, sets the access permission to allow execute
...@@ -1748,16 +1751,17 @@ public class File ...@@ -1748,16 +1751,17 @@ public class File
return fs.getSpace(this, FileSystem.SPACE_USABLE); return fs.getSpace(this, FileSystem.SPACE_USABLE);
} }
/* -- Temporary files -- */ /* -- Temporary files -- */
private static class TemporaryDirectory { static class TempDirectory {
private TemporaryDirectory() { } private TempDirectory() { }
static final String valueAsString = fs.normalize( // temporary directory location
AccessController.doPrivileged(new GetPropertyAction("java.io.tmpdir"))); private static final File tmpdir = new File(fs.normalize(AccessController
static final File valueAsFile = .doPrivileged(new GetPropertyAction("java.io.tmpdir"))));
new File(valueAsString, fs.prefixLength(valueAsString)); static File location() {
return tmpdir;
}
// file name generation // file name generation
private static final SecureRandom random = new SecureRandom(); private static final SecureRandom random = new SecureRandom();
...@@ -1770,25 +1774,6 @@ public class File ...@@ -1770,25 +1774,6 @@ public class File
} }
return new File(dir, prefix + Long.toString(n) + suffix); return new File(dir, prefix + Long.toString(n) + suffix);
} }
// default file permissions
static final FileAttribute<Set<PosixFilePermission>> defaultPosixFilePermissions =
PosixFilePermissions.asFileAttribute(EnumSet
.of(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE));
static final boolean isPosix = isPosix();
static boolean isPosix() {
return AccessController.doPrivileged(
new PrivilegedAction<Boolean>() {
public Boolean run() {
try {
return FileSystems.getDefault().getPath(valueAsString)
.getFileStore().supportsFileAttributeView("posix");
} catch (IOException e) {
throw new IOError(e);
}
}
});
}
} }
/** /**
...@@ -1869,12 +1854,11 @@ public class File ...@@ -1869,12 +1854,11 @@ public class File
if (suffix == null) if (suffix == null)
suffix = ".tmp"; suffix = ".tmp";
File tmpdir = (directory != null) ? File tmpdir = (directory != null) ? directory : TempDirectory.location();
directory : TemporaryDirectory.valueAsFile;
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
File f; File f;
do { do {
f = TemporaryDirectory.generateFile(prefix, suffix, tmpdir); f = TempDirectory.generateFile(prefix, suffix, tmpdir);
if (sm != null) { if (sm != null) {
try { try {
sm.checkWrite(f.getPath()); sm.checkWrite(f.getPath());
...@@ -1891,11 +1875,17 @@ public class File ...@@ -1891,11 +1875,17 @@ public class File
/** /**
* Creates an empty file in the default temporary-file directory, using * Creates an empty file in the default temporary-file directory, using
* the given prefix and suffix to generate its name. Invoking this method * the given prefix and suffix to generate its name. Invoking this method
* is equivalent to invoking <code>{@link #createTempFile(java.lang.String, * is equivalent to invoking <code>{@link #createTempFile(java.lang.String,
* java.lang.String, java.io.File) * java.lang.String, java.io.File)
* createTempFile(prefix,&nbsp;suffix,&nbsp;null)}</code>. * createTempFile(prefix,&nbsp;suffix,&nbsp;null)}</code>.
* *
* <p> The {@link #createTemporaryFile(String,String,FileAttribute[])} method
* provides an alternative method to create an empty file in the
* temporary-file directory. Files created by that method may have more
* restrictive access permissions to files created by this method and so
* may be more suited to security-sensitive applications.
*
* @param prefix The prefix string to be used in generating the file's * @param prefix The prefix string to be used in generating the file's
* name; must be at least three characters long * name; must be at least three characters long
* *
...@@ -1926,17 +1916,7 @@ public class File ...@@ -1926,17 +1916,7 @@ public class File
/** /**
* Creates an empty file in the default temporary-file directory, using * Creates an empty file in the default temporary-file directory, using
* the given prefix and suffix to generate its name. This method is * the given prefix and suffix to generate its name.
* equivalent to invoking the {@link #createTempFile(String,String)
* createTempFile(prefix,&nbsp;suffix)} method with the addition that the
* resulting pathname may be requested to be deleted when the Java virtual
* machine terminates, and the initial file attributes to set atomically
* when creating the file may be specified.
*
* <p> When the value of the {@code deleteOnExit} method is {@code true}
* then the resulting file is requested to be deleted when the Java virtual
* machine terminates as if by invoking the {@link #deleteOnExit deleteOnExit}
* method.
* *
* <p> The {@code attrs} parameter is an optional array of {@link FileAttribute * <p> The {@code attrs} parameter is an optional array of {@link FileAttribute
* attributes} to set atomically when creating the file. Each attribute is * attributes} to set atomically when creating the file. Each attribute is
...@@ -1944,6 +1924,12 @@ public class File ...@@ -1944,6 +1924,12 @@ public class File
* of the same name is included in the array then all but the last occurrence * of the same name is included in the array then all but the last occurrence
* is ignored. * is ignored.
* *
* <p> Where the {@code attrs} parameter does not specify <i>access
* permissions</i> to set atomically when creating the file, then the
* resulting file may have more restrictive access permissions than files
* created by the {@link #createTempFile(java.lang.String, java.lang.String)}
* method.
*
* @param prefix * @param prefix
* The prefix string to be used in generating the file's * The prefix string to be used in generating the file's
* name; must be at least three characters long * name; must be at least three characters long
...@@ -1951,9 +1937,6 @@ public class File ...@@ -1951,9 +1937,6 @@ public class File
* The suffix string to be used in generating the file's * The suffix string to be used in generating the file's
* name; may be {@code null}, in which case the suffix * name; may be {@code null}, in which case the suffix
* {@code ".tmp"} will be used * {@code ".tmp"} will be used
* @param deleteOnExit
* {@code true} if the file denoted by resulting pathname be
* deleted when the Java virtual machine terminates
* @param attrs * @param attrs
* An optional list of file attributes to set atomically when creating * An optional list of file attributes to set atomically when creating
* the file * the file
...@@ -1961,7 +1944,7 @@ public class File ...@@ -1961,7 +1944,7 @@ public class File
* @return An abstract pathname denoting a newly-created empty file * @return An abstract pathname denoting a newly-created empty file
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If the <code>prefix</code> argument contains fewer than three * If the {@code prefix} argument contains fewer than three
* characters * characters
* @throws UnsupportedOperationException * @throws UnsupportedOperationException
* If the array contains an attribute that cannot be set atomically * If the array contains an attribute that cannot be set atomically
...@@ -1971,74 +1954,19 @@ public class File ...@@ -1971,74 +1954,19 @@ public class File
* @throws SecurityException * @throws SecurityException
* If a security manager exists and its <code>{@link * If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code> * java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* method does not allow a file to be created. When the {@code * method does not allow a file to be created.
* deleteOnExit} parameter has the value {@code true} then the *
* security manager's {@link
* java.lang.SecurityManager#checkDelete(java.lang.String)} is
* invoked to check delete access to the file.
* @since 1.7 * @since 1.7
*/ */
public static File createTempFile(String prefix, public static File createTemporaryFile(String prefix,
String suffix, String suffix,
boolean deleteOnExit, FileAttribute<?>... attrs)
FileAttribute<?>... attrs)
throws IOException throws IOException
{ {
if (prefix.length() < 3) if (prefix.length() < 3)
throw new IllegalArgumentException("Prefix string too short"); throw new IllegalArgumentException("Prefix string too short");
suffix = (suffix == null) ? ".tmp" : suffix; suffix = (suffix == null) ? ".tmp" : suffix;
return TempFileHelper.createFile(prefix, suffix, attrs);
// special case POSIX environments so that 0600 is used as the file mode
if (TemporaryDirectory.isPosix) {
if (attrs.length == 0) {
// no attributes so use default permissions
attrs = new FileAttribute<?>[1];
attrs[0] = TemporaryDirectory.defaultPosixFilePermissions;
} else {
// check if posix permissions given; if not use default
boolean hasPermissions = false;
for (int i=0; i<attrs.length; i++) {
if (attrs[i].name().equals("posix:permissions")) {
hasPermissions = true;
break;
}
}
if (!hasPermissions) {
FileAttribute<?>[] copy = new FileAttribute<?>[attrs.length+1];
System.arraycopy(attrs, 0, copy, 0, attrs.length);
attrs = copy;
attrs[attrs.length-1] =
TemporaryDirectory.defaultPosixFilePermissions;
}
}
}
// use Path#createFile to create file
SecurityManager sm = System.getSecurityManager();
for (;;) {
File f = TemporaryDirectory
.generateFile(prefix, suffix, TemporaryDirectory.valueAsFile);
if (sm != null && deleteOnExit)
sm.checkDelete(f.getPath());
try {
f.toPath().createFile(attrs);
if (deleteOnExit)
DeleteOnExitHook.add(f.getPath());
return f;
} catch (InvalidPathException e) {
// don't reveal temporary directory location
if (sm != null)
throw new IllegalArgumentException("Invalid prefix or suffix");
throw e;
} catch (SecurityException e) {
// don't reveal temporary directory location
if (sm != null)
throw new SecurityException("Unable to create temporary file");
throw e;
} catch (FileAlreadyExistsException e) {
// ignore
}
}
} }
/* -- Basic infrastructure -- */ /* -- Basic infrastructure -- */
...@@ -2153,40 +2081,45 @@ public class File ...@@ -2153,40 +2081,45 @@ public class File
/** /**
* Returns a {@link Path java.nio.file.Path} object constructed from the * Returns a {@link Path java.nio.file.Path} object constructed from the
* this abstract path. The first invocation of this method works as if * this abstract path. The resulting {@code Path} is associated with the
* invoking it were equivalent to evaluating the expression: * {@link java.nio.file.FileSystems#getDefault default-filesystem}.
*
* <p> The first invocation of this method works as if invoking it were
* equivalent to evaluating the expression:
* <blockquote><pre> * <blockquote><pre>
* {@link FileSystems#getDefault FileSystems.getDefault}().{@link FileSystem#getPath getPath}(this.{@link #getPath getPath}()); * {@link java.nio.file.FileSystems#getDefault FileSystems.getDefault}().{@link
* java.nio.file.FileSystem#getPath getPath}(this.{@link #getPath getPath}());
* </pre></blockquote> * </pre></blockquote>
* Subsequent invocations of this method return the same {@code Path}. * Subsequent invocations of this method return the same {@code Path}.
* *
* <p> If this abstract pathname is the empty abstract pathname then this * <p> If this abstract pathname is the empty abstract pathname then this
* method returns a {@code Path} that may be used to access to the current * method returns a {@code Path} that may be used to access the current
* user directory. * user directory.
* *
* @return A {@code Path} constructed from this abstract path. The resulting * @return a {@code Path} constructed from this abstract path
* {@code Path} is associated with the {@link FileSystems#getDefault
* default-filesystem}.
* *
* @throws InvalidPathException * @throws InvalidPathException
* If a {@code Path} object cannot be constructed from the abstract * if a {@code Path} object cannot be constructed from the abstract
* path (see {@link java.nio.file.FileSystem#getPath FileSystem.getPath}) * path (see {@link java.nio.file.FileSystem#getPath FileSystem.getPath})
* *
* @since 1.7 * @since 1.7
*/ */
public Path toPath() { public Path toPath() {
if (filePath == null) { Path result = filePath;
if (result == null) {
synchronized (this) { synchronized (this) {
if (filePath == null) { result = filePath;
if (result == null) {
if (path.length() == 0) { if (path.length() == 0) {
// assume default file system treats "." as current directory // assume default file system treats "." as current directory
filePath = Paths.get("."); result = Paths.get(".");
} else { } else {
filePath = Paths.get(path); result = Paths.get(path);
} }
filePath = result;
} }
} }
} }
return filePath; return result;
} }
} }
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package java.io;
import java.nio.file.FileSystems;
import java.nio.file.InvalidPathException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import static java.nio.file.attribute.PosixFilePermission.*;
import java.util.Set;
import java.util.EnumSet;
/**
* Helper class to support creation of temporary files and directory with
* initial attributes.
*/
class TempFileHelper {
private TempFileHelper() { }
// default file and directory permissions (lazily initialized)
private static class PermissionsHolder {
static final boolean hasPosixPermissions = FileSystems.getDefault()
.supportedFileAttributeViews().contains("posix");
static final FileAttribute<Set<PosixFilePermission>> filePermissions =
PosixFilePermissions.asFileAttribute(EnumSet.of(OWNER_READ, OWNER_WRITE));
static final FileAttribute<Set<PosixFilePermission>> directoryPermissions =
PosixFilePermissions.asFileAttribute(EnumSet
.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE));
}
/**
* Creates a file or directory in the temporary directory.
*/
private static File create(String prefix,
String suffix,
FileAttribute[] attrs,
boolean isDirectory)
throws IOException
{
// in POSIX environments use default file and directory permissions
// if initial permissions not given by caller.
if (PermissionsHolder.hasPosixPermissions) {
if (attrs.length == 0) {
// no attributes so use default permissions
attrs = new FileAttribute<?>[1];
attrs[0] = (isDirectory) ? PermissionsHolder.directoryPermissions :
PermissionsHolder.filePermissions;
} else {
// check if posix permissions given; if not use default
boolean hasPermissions = false;
for (int i=0; i<attrs.length; i++) {
if (attrs[i].name().equals("posix:permissions")) {
hasPermissions = true;
break;
}
}
if (!hasPermissions) {
FileAttribute<?>[] copy = new FileAttribute<?>[attrs.length+1];
System.arraycopy(attrs, 0, copy, 0, attrs.length);
attrs = copy;
attrs[attrs.length-1] = (isDirectory) ?
PermissionsHolder.directoryPermissions :
PermissionsHolder.filePermissions;
}
}
}
// loop generating random names until file or directory can be created
SecurityManager sm = System.getSecurityManager();
for (;;) {
File tmpdir = File.TempDirectory.location();
File f = File.TempDirectory.generateFile(prefix, suffix, tmpdir);
try {
if (isDirectory) {
f.toPath().createDirectory(attrs);
} else {
f.toPath().createFile(attrs);
}
return f;
} catch (InvalidPathException e) {
// don't reveal temporary directory location
if (sm != null)
throw new IllegalArgumentException("Invalid prefix or suffix");
throw e;
} catch (SecurityException e) {
// don't reveal temporary directory location
if (sm != null)
throw new SecurityException("Unable to create temporary file");
throw e;
} catch (FileAlreadyExistsException e) {
// ignore
}
}
}
/**
* Creates a file in the temporary directory.
*/
static File createFile(String prefix, String suffix, FileAttribute[] attrs)
throws IOException
{
return create(prefix, suffix, attrs, false);
}
/**
* Creates a directory in the temporary directory.
*/
static File createDirectory(String prefix, FileAttribute[] attrs)
throws IOException
{
return create(prefix, "", attrs, true);
}
}
...@@ -58,6 +58,7 @@ import sun.misc.URLClassPath; ...@@ -58,6 +58,7 @@ import sun.misc.URLClassPath;
import sun.misc.VM; import sun.misc.VM;
import sun.reflect.Reflection; import sun.reflect.Reflection;
import sun.security.util.SecurityConstants; import sun.security.util.SecurityConstants;
import sun.jkernel.DownloadManager;
/** /**
* A class loader is an object that is responsible for loading classes. The * A class loader is an object that is responsible for loading classes. The
...@@ -1280,6 +1281,21 @@ public abstract class ClassLoader { ...@@ -1280,6 +1281,21 @@ public abstract class ClassLoader {
* Find resources from the VM's built-in classloader. * Find resources from the VM's built-in classloader.
*/ */
private static URL getBootstrapResource(String name) { private static URL getBootstrapResource(String name) {
try {
// If this is a known JRE resource, ensure that its bundle is
// downloaded. If it isn't known, we just ignore the download
// failure and check to see if we can find the resource anyway
// (which is possible if the boot class path has been modified).
if (sun.misc.VM.isBootedKernelVM()) {
sun.jkernel.DownloadManager.getBootClassPathEntryForResource(
name);
}
} catch (NoClassDefFoundError e) {
// This happens while Java itself is being compiled; DownloadManager
// isn't accessible when this code is first invoked. It isn't an
// issue, as if we can't find DownloadManager, we can safely assume
// that additional code is not available for download.
}
URLClassPath ucp = getBootstrapClassPath(); URLClassPath ucp = getBootstrapClassPath();
Resource res = ucp.getResource(name); Resource res = ucp.getResource(name);
return res != null ? res.getURL() : null; return res != null ? res.getURL() : null;
...@@ -1305,13 +1321,9 @@ public abstract class ClassLoader { ...@@ -1305,13 +1321,9 @@ public abstract class ClassLoader {
// Returns the URLClassPath that is used for finding system resources. // Returns the URLClassPath that is used for finding system resources.
static URLClassPath getBootstrapClassPath() { static URLClassPath getBootstrapClassPath() {
if (bootstrapClassPath == null) { return sun.misc.Launcher.getBootstrapClassPath();
bootstrapClassPath = sun.misc.Launcher.getBootstrapClassPath();
}
return bootstrapClassPath;
} }
private static URLClassPath bootstrapClassPath;
/** /**
* Returns an input stream for reading the specified resource. * Returns an input stream for reading the specified resource.
...@@ -1800,6 +1812,24 @@ public abstract class ClassLoader { ...@@ -1800,6 +1812,24 @@ public abstract class ClassLoader {
// Invoked in the java.lang.Runtime class to implement load and loadLibrary. // Invoked in the java.lang.Runtime class to implement load and loadLibrary.
static void loadLibrary(Class fromClass, String name, static void loadLibrary(Class fromClass, String name,
boolean isAbsolute) { boolean isAbsolute) {
try {
if (VM.isBootedKernelVM() && !DownloadManager.isJREComplete() &&
!DownloadManager.isCurrentThreadDownloading()) {
DownloadManager.downloadFile("bin/" +
System.mapLibraryName(name));
// it doesn't matter if the downloadFile call returns false --
// it probably just means that this is a user library, as
// opposed to a JRE library
}
} catch (IOException e) {
throw new UnsatisfiedLinkError("Error downloading library " +
name + ": " + e);
} catch (NoClassDefFoundError e) {
// This happens while Java itself is being compiled; DownloadManager
// isn't accessible when this code is first invoked. It isn't an
// issue, as if we can't find DownloadManager, we can safely assume
// that additional code is not available for download.
}
ClassLoader loader = ClassLoader loader =
(fromClass == null) ? null : fromClass.getClassLoader(); (fromClass == null) ? null : fromClass.getClassLoader();
if (sys_paths == null) { if (sys_paths == null) {
......
...@@ -1106,12 +1106,22 @@ public final class System { ...@@ -1106,12 +1106,22 @@ public final class System {
initProperties(props); initProperties(props);
sun.misc.Version.init(); sun.misc.Version.init();
// Workaround until DownloadManager initialization is revisited.
// Make JavaLangAccess available early enough for internal
// Shutdown hooks to be registered
setJavaLangAccess();
// Gets and removes system properties that configure the Integer // Gets and removes system properties that configure the Integer
// cache used to support the object identity semantics of autoboxing. // cache used to support the object identity semantics of autoboxing.
// At this time, the size of the cache may be controlled by the // At this time, the size of the cache may be controlled by the
// -XX:AutoBoxCacheMax=<size> option. // vm option -XX:AutoBoxCacheMax=<size>.
Integer.getAndRemoveCacheProperties(); Integer.getAndRemoveCacheProperties();
// Load the zip library now in order to keep java.util.zip.ZipFile
// from trying to use itself to load this library later.
loadLibrary("zip");
FileInputStream fdIn = new FileInputStream(FileDescriptor.in); FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out); FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err); FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
...@@ -1119,10 +1129,6 @@ public final class System { ...@@ -1119,10 +1129,6 @@ public final class System {
setOut0(new PrintStream(new BufferedOutputStream(fdOut, 128), true)); setOut0(new PrintStream(new BufferedOutputStream(fdOut, 128), true));
setErr0(new PrintStream(new BufferedOutputStream(fdErr, 128), true)); setErr0(new PrintStream(new BufferedOutputStream(fdErr, 128), true));
// Load the zip library now in order to keep java.util.zip.ZipFile
// from trying to use itself to load this library later.
loadLibrary("zip");
// Setup Java signal handlers for HUP, TERM, and INT (where available). // Setup Java signal handlers for HUP, TERM, and INT (where available).
Terminator.setup(); Terminator.setup();
...@@ -1152,7 +1158,9 @@ public final class System { ...@@ -1152,7 +1158,9 @@ public final class System {
// way as other threads; we must do it ourselves here. // way as other threads; we must do it ourselves here.
Thread current = Thread.currentThread(); Thread current = Thread.currentThread();
current.getThreadGroup().add(current); current.getThreadGroup().add(current);
}
private static void setJavaLangAccess() {
// Allow privileged classes outside of java.lang // Allow privileged classes outside of java.lang
sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){ sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
public sun.reflect.ConstantPool getConstantPool(Class klass) { public sun.reflect.ConstantPool getConstantPool(Class klass) {
......
/* /*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -40,6 +40,12 @@ public enum ElementType { ...@@ -40,6 +40,12 @@ public enum ElementType {
/** Class, interface (including annotation type), or enum declaration */ /** Class, interface (including annotation type), or enum declaration */
TYPE, TYPE,
/** Uses of a type */
TYPE_USE,
/** type parameters */
TYPE_PARAMETER,
/** Field declaration (includes enum constants) */ /** Field declaration (includes enum constants) */
FIELD, FIELD,
......
...@@ -34,7 +34,6 @@ import java.util.logging.LoggingMXBean; ...@@ -34,7 +34,6 @@ import java.util.logging.LoggingMXBean;
import java.util.logging.LogManager; import java.util.logging.LogManager;
import java.nio.BufferPoolMXBean; import java.nio.BufferPoolMXBean;
import javax.management.MBeanServerConnection; import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName; import javax.management.ObjectName;
import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.HotSpotDiagnosticMXBean;
...@@ -198,10 +197,7 @@ enum PlatformComponent { ...@@ -198,10 +197,7 @@ enum PlatformComponent {
"java.nio", "BufferPool", keyProperties("name"), "java.nio", "BufferPool", keyProperties("name"),
new MXBeanFetcher<BufferPoolMXBean>() { new MXBeanFetcher<BufferPoolMXBean>() {
public List<BufferPoolMXBean> getMXBeans() { public List<BufferPoolMXBean> getMXBeans() {
List<BufferPoolMXBean> pools = new ArrayList<BufferPoolMXBean>(2); return ManagementFactoryHelper.getBufferPoolMXBeans();
pools.add( sun.misc.SharedSecrets.getJavaNioAccess().getDirectBufferPoolMXBean() );
pools.add( sun.nio.ch.FileChannelImpl.getMappedBufferPoolMXBean() );
return pools;
} }
}), }),
......
...@@ -1101,7 +1101,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> { ...@@ -1101,7 +1101,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
// See "Hacker's Delight" section 2-12 for explanation of // See "Hacker's Delight" section 2-12 for explanation of
// the overflow test. // the overflow test.
if ( (((sum ^ xs) & (sum ^ ys))) >= 0L) // not overflowed if ( (((sum ^ xs) & (sum ^ ys))) >= 0L) // not overflowed
return new BigDecimal(null, sum, rscale, 0); return BigDecimal.valueOf(sum, rscale);
} }
if (fst == null) if (fst == null)
fst = BigInteger.valueOf(xs); fst = BigInteger.valueOf(xs);
...@@ -1311,9 +1311,9 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> { ...@@ -1311,9 +1311,9 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
* would occur since division is expensive on most CPUs. * would occur since division is expensive on most CPUs.
*/ */
long product = x * y; long product = x * y;
int prec = this.precision() + multiplicand.precision(); long prec = this.precision() + multiplicand.precision();
if (prec < 19 || (prec < 21 && (y == 0 || product / y == x))) if (prec < 19 || (prec < 21 && (y == 0 || product / y == x)))
return new BigDecimal(null, product, productScale, 0); return BigDecimal.valueOf(product, productScale);
return new BigDecimal(BigInteger.valueOf(x).multiply(y), INFLATED, return new BigDecimal(BigInteger.valueOf(x).multiply(y), INFLATED,
productScale, 0); productScale, 0);
} }
...@@ -1584,7 +1584,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> { ...@@ -1584,7 +1584,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
return (preferredScale >= 0 && return (preferredScale >= 0 &&
preferredScale < ZERO_SCALED_BY.length) ? preferredScale < ZERO_SCALED_BY.length) ?
ZERO_SCALED_BY[preferredScale] : ZERO_SCALED_BY[preferredScale] :
new BigDecimal(null, 0, preferredScale, 1); BigDecimal.valueOf(0, preferredScale);
else { else {
this.inflate(); this.inflate();
divisor.inflate(); divisor.inflate();
......
...@@ -29,7 +29,6 @@ import java.io.OutputStream; ...@@ -29,7 +29,6 @@ import java.io.OutputStream;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedExceptionAction; import java.security.PrivilegedExceptionAction;
import java.util.prefs.Preferences;
import sun.net.www.ParseUtil; import sun.net.www.ParseUtil;
/* import org.ietf.jgss.*; */ /* import org.ietf.jgss.*; */
...@@ -41,7 +40,7 @@ import sun.net.www.ParseUtil; ...@@ -41,7 +40,7 @@ import sun.net.www.ParseUtil;
class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
private String server = null; private String server = null;
private int port = DEFAULT_PORT; private int serverPort = DEFAULT_PORT;
private InetSocketAddress external_address; private InetSocketAddress external_address;
private boolean useV4 = false; private boolean useV4 = false;
private Socket cmdsock = null; private Socket cmdsock = null;
...@@ -54,7 +53,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -54,7 +53,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
SocksSocketImpl(String server, int port) { SocksSocketImpl(String server, int port) {
this.server = server; this.server = server;
this.port = (port == -1 ? DEFAULT_PORT : port); this.serverPort = (port == -1 ? DEFAULT_PORT : port);
} }
SocksSocketImpl(Proxy proxy) { SocksSocketImpl(Proxy proxy) {
...@@ -63,7 +62,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -63,7 +62,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
InetSocketAddress ad = (InetSocketAddress) a; InetSocketAddress ad = (InetSocketAddress) a;
// Use getHostString() to avoid reverse lookups // Use getHostString() to avoid reverse lookups
server = ad.getHostString(); server = ad.getHostString();
port = ad.getPort(); serverPort = ad.getPort();
} }
} }
...@@ -113,16 +112,12 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -113,16 +112,12 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
*/ */
private boolean authenticate(byte method, InputStream in, private boolean authenticate(byte method, InputStream in,
BufferedOutputStream out) throws IOException { BufferedOutputStream out) throws IOException {
byte[] data = null;
int i;
// No Authentication required. We're done then! // No Authentication required. We're done then!
if (method == NO_AUTH) if (method == NO_AUTH)
return true; return true;
/** /**
* User/Password authentication. Try, in that order : * User/Password authentication. Try, in that order :
* - The application provided Authenticator, if any * - The application provided Authenticator, if any
* - The user preferences java.net.socks.username &
* java.net.socks.password
* - the user.name & no password (backward compatibility behavior). * - the user.name & no password (backward compatibility behavior).
*/ */
if (method == USER_PASSW) { if (method == USER_PASSW) {
...@@ -134,40 +129,15 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -134,40 +129,15 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
new java.security.PrivilegedAction<PasswordAuthentication>() { new java.security.PrivilegedAction<PasswordAuthentication>() {
public PasswordAuthentication run() { public PasswordAuthentication run() {
return Authenticator.requestPasswordAuthentication( return Authenticator.requestPasswordAuthentication(
server, addr, port, "SOCKS5", "SOCKS authentication", null); server, addr, serverPort, "SOCKS5", "SOCKS authentication", null);
} }
}); });
if (pw != null) { if (pw != null) {
userName = pw.getUserName(); userName = pw.getUserName();
password = new String(pw.getPassword()); password = new String(pw.getPassword());
} else { } else {
final Preferences prefs = Preferences.userRoot().node("/java/net/socks"); userName = java.security.AccessController.doPrivileged(
try {
userName = AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction<String>() {
public String run() throws IOException {
return prefs.get("username", null);
}
});
} catch (java.security.PrivilegedActionException pae) {
throw (IOException) pae.getException();
}
if (userName != null) {
try {
password = AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction<String>() {
public String run() throws IOException {
return prefs.get("password", null);
}
});
} catch (java.security.PrivilegedActionException pae) {
throw (IOException) pae.getException();
}
} else {
userName = java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("user.name")); new sun.security.action.GetPropertyAction("user.name"));
}
} }
if (userName == null) if (userName == null)
return false; return false;
...@@ -188,8 +158,8 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -188,8 +158,8 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
} else } else
out.write(0); out.write(0);
out.flush(); out.flush();
data = new byte[2]; byte[] data = new byte[2];
i = readSocksReply(in, data); int i = readSocksReply(in, data);
if (i != 2 || data[1] != 0) { if (i != 2 || data[1] != 0) {
/* RFC 1929 specifies that the connection MUST be closed if /* RFC 1929 specifies that the connection MUST be closed if
authentication fails */ authentication fails */
...@@ -322,6 +292,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -322,6 +292,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
* @throws IllegalArgumentException if endpoint is null or a * @throws IllegalArgumentException if endpoint is null or a
* SocketAddress subclass not supported by this socket * SocketAddress subclass not supported by this socket
*/ */
@Override
protected void connect(SocketAddress endpoint, int timeout) throws IOException { protected void connect(SocketAddress endpoint, int timeout) throws IOException {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
if (endpoint == null || !(endpoint instanceof InetSocketAddress)) if (endpoint == null || !(endpoint instanceof InetSocketAddress))
...@@ -352,7 +323,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -352,7 +323,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
super.connect(epoint, timeout); super.connect(epoint, timeout);
return; return;
} }
URI uri = null; URI uri;
// Use getHostString() to avoid reverse lookups // Use getHostString() to avoid reverse lookups
String host = epoint.getHostString(); String host = epoint.getHostString();
// IPv6 litteral? // IPv6 litteral?
...@@ -365,6 +336,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -365,6 +336,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
// This shouldn't happen // This shouldn't happen
assert false : e; assert false : e;
uri = null;
} }
Proxy p = null; Proxy p = null;
IOException savedExc = null; IOException savedExc = null;
...@@ -386,18 +358,18 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -386,18 +358,18 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
throw new SocketException("Unknow address type for proxy: " + p); throw new SocketException("Unknow address type for proxy: " + p);
// Use getHostString() to avoid reverse lookups // Use getHostString() to avoid reverse lookups
server = ((InetSocketAddress) p.address()).getHostString(); server = ((InetSocketAddress) p.address()).getHostString();
port = ((InetSocketAddress) p.address()).getPort(); serverPort = ((InetSocketAddress) p.address()).getPort();
// Connects to the SOCKS server // Connects to the SOCKS server
try { try {
privilegedConnect(server, port, timeout); privilegedConnect(server, serverPort, timeout);
// Worked, let's get outta here // Worked, let's get outta here
break; break;
} catch (IOException e) { } catch (IOException e) {
// Ooops, let's notify the ProxySelector // Ooops, let's notify the ProxySelector
sel.connectFailed(uri,p.address(),e); sel.connectFailed(uri,p.address(),e);
server = null; server = null;
port = -1; serverPort = -1;
savedExc = e; savedExc = e;
// Will continue the while loop and try the next proxy // Will continue the while loop and try the next proxy
} }
...@@ -414,7 +386,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -414,7 +386,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
} else { } else {
// Connects to the SOCKS server // Connects to the SOCKS server
try { try {
privilegedConnect(server, port, timeout); privilegedConnect(server, serverPort, timeout);
} catch (IOException e) { } catch (IOException e) {
throw new SocketException(e.getMessage()); throw new SocketException(e.getMessage());
} }
...@@ -487,7 +459,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -487,7 +459,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
if (i != 4) if (i != 4)
throw new SocketException("Reply from SOCKS server has bad length"); throw new SocketException("Reply from SOCKS server has bad length");
SocketException ex = null; SocketException ex = null;
int nport, len; int len;
byte[] addr; byte[] addr;
switch (data[1]) { switch (data[1]) {
case REQUEST_OK: case REQUEST_OK:
...@@ -502,8 +474,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -502,8 +474,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
i = readSocksReply(in, data); i = readSocksReply(in, data);
if (i != 2) if (i != 2)
throw new SocketException("Reply from SOCKS server badly formatted"); throw new SocketException("Reply from SOCKS server badly formatted");
nport = ((int)data[0] & 0xff) << 8;
nport += ((int)data[1] & 0xff);
break; break;
case DOMAIN_NAME: case DOMAIN_NAME:
len = data[1]; len = data[1];
...@@ -515,8 +485,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -515,8 +485,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
i = readSocksReply(in, data); i = readSocksReply(in, data);
if (i != 2) if (i != 2)
throw new SocketException("Reply from SOCKS server badly formatted"); throw new SocketException("Reply from SOCKS server badly formatted");
nport = ((int)data[0] & 0xff) << 8;
nport += ((int)data[1] & 0xff);
break; break;
case IPV6: case IPV6:
len = data[1]; len = data[1];
...@@ -528,8 +496,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -528,8 +496,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
i = readSocksReply(in, data); i = readSocksReply(in, data);
if (i != 2) if (i != 2)
throw new SocketException("Reply from SOCKS server badly formatted"); throw new SocketException("Reply from SOCKS server badly formatted");
nport = ((int)data[0] & 0xff) << 8;
nport += ((int)data[1] & 0xff);
break; break;
default: default:
ex = new SocketException("Reply from SOCKS server contains wrong code"); ex = new SocketException("Reply from SOCKS server contains wrong code");
...@@ -663,7 +629,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -663,7 +629,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
*/ */
return; return;
} }
URI uri = null; URI uri;
// Use getHostString() to avoid reverse lookups // Use getHostString() to avoid reverse lookups
String host = saddr.getHostString(); String host = saddr.getHostString();
// IPv6 litteral? // IPv6 litteral?
...@@ -676,6 +642,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -676,6 +642,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
// This shouldn't happen // This shouldn't happen
assert false : e; assert false : e;
uri = null;
} }
Proxy p = null; Proxy p = null;
Exception savedExc = null; Exception savedExc = null;
...@@ -695,7 +662,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -695,7 +662,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
throw new SocketException("Unknow address type for proxy: " + p); throw new SocketException("Unknow address type for proxy: " + p);
// Use getHostString() to avoid reverse lookups // Use getHostString() to avoid reverse lookups
server = ((InetSocketAddress) p.address()).getHostString(); server = ((InetSocketAddress) p.address()).getHostString();
port = ((InetSocketAddress) p.address()).getPort(); serverPort = ((InetSocketAddress) p.address()).getPort();
// Connects to the SOCKS server // Connects to the SOCKS server
try { try {
...@@ -703,7 +670,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -703,7 +670,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
new PrivilegedExceptionAction<Void>() { new PrivilegedExceptionAction<Void>() {
public Void run() throws Exception { public Void run() throws Exception {
cmdsock = new Socket(new PlainSocketImpl()); cmdsock = new Socket(new PlainSocketImpl());
cmdsock.connect(new InetSocketAddress(server, port)); cmdsock.connect(new InetSocketAddress(server, serverPort));
cmdIn = cmdsock.getInputStream(); cmdIn = cmdsock.getInputStream();
cmdOut = cmdsock.getOutputStream(); cmdOut = cmdsock.getOutputStream();
return null; return null;
...@@ -713,7 +680,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -713,7 +680,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
// Ooops, let's notify the ProxySelector // Ooops, let's notify the ProxySelector
sel.connectFailed(uri,p.address(),new SocketException(e.getMessage())); sel.connectFailed(uri,p.address(),new SocketException(e.getMessage()));
server = null; server = null;
port = -1; serverPort = -1;
cmdsock = null; cmdsock = null;
savedExc = e; savedExc = e;
// Will continue the while loop and try the next proxy // Will continue the while loop and try the next proxy
...@@ -734,7 +701,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -734,7 +701,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
new PrivilegedExceptionAction<Void>() { new PrivilegedExceptionAction<Void>() {
public Void run() throws Exception { public Void run() throws Exception {
cmdsock = new Socket(new PlainSocketImpl()); cmdsock = new Socket(new PlainSocketImpl());
cmdsock.connect(new InetSocketAddress(server, port)); cmdsock.connect(new InetSocketAddress(server, serverPort));
cmdIn = cmdsock.getInputStream(); cmdIn = cmdsock.getInputStream();
cmdOut = cmdsock.getOutputStream(); cmdOut = cmdsock.getOutputStream();
return null; return null;
...@@ -809,7 +776,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -809,7 +776,6 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
switch (data[1]) { switch (data[1]) {
case REQUEST_OK: case REQUEST_OK:
// success! // success!
InetSocketAddress real_end = null;
switch(data[3]) { switch(data[3]) {
case IPV4: case IPV4:
addr = new byte[4]; addr = new byte[4];
...@@ -1016,6 +982,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -1016,6 +982,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
* @return the value of this socket's <code>address</code> field. * @return the value of this socket's <code>address</code> field.
* @see java.net.SocketImpl#address * @see java.net.SocketImpl#address
*/ */
@Override
protected InetAddress getInetAddress() { protected InetAddress getInetAddress() {
if (external_address != null) if (external_address != null)
return external_address.getAddress(); return external_address.getAddress();
...@@ -1029,6 +996,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -1029,6 +996,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
* @return the value of this socket's <code>port</code> field. * @return the value of this socket's <code>port</code> field.
* @see java.net.SocketImpl#port * @see java.net.SocketImpl#port
*/ */
@Override
protected int getPort() { protected int getPort() {
if (external_address != null) if (external_address != null)
return external_address.getPort(); return external_address.getPort();
...@@ -1036,6 +1004,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -1036,6 +1004,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
return super.getPort(); return super.getPort();
} }
@Override
protected int getLocalPort() { protected int getLocalPort() {
if (socket != null) if (socket != null)
return super.getLocalPort(); return super.getLocalPort();
...@@ -1045,6 +1014,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { ...@@ -1045,6 +1014,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
return super.getLocalPort(); return super.getLocalPort();
} }
@Override
protected void close() throws IOException { protected void close() throws IOException {
if (cmdsock != null) if (cmdsock != null)
cmdsock.close(); cmdsock.close();
......
...@@ -26,11 +26,8 @@ ...@@ -26,11 +26,8 @@
package java.nio; package java.nio;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.misc.Unsafe; import sun.misc.Unsafe;
import sun.misc.VM; import sun.misc.VM;
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
/** /**
* Access to bits, native and otherwise. * Access to bits, native and otherwise.
...@@ -676,55 +673,34 @@ class Bits { // package-private ...@@ -676,55 +673,34 @@ class Bits { // package-private
} }
} }
// -- Management interface for monitoring of direct buffer usage -- // -- Monitoring of direct buffer usage --
static { static {
// setup access to this package in SharedSecrets // setup access to this package in SharedSecrets
sun.misc.SharedSecrets.setJavaNioAccess( sun.misc.SharedSecrets.setJavaNioAccess(
new sun.misc.JavaNioAccess() { new sun.misc.JavaNioAccess() {
@Override @Override
public BufferPoolMXBean getDirectBufferPoolMXBean() { public sun.misc.JavaNioAccess.BufferPool getDirectBufferPool() {
return LazyInitialization.directBufferPoolMXBean; return new sun.misc.JavaNioAccess.BufferPool() {
@Override
public String getName() {
return "direct";
}
@Override
public long getCount() {
return Bits.count;
}
@Override
public long getTotalCapacity() {
return Bits.usedMemory;
}
@Override
public long getMemoryUsed() {
return Bits.reservedMemory;
}
};
} }
} });
);
}
// Lazy initialization of management interface
private static class LazyInitialization {
static final BufferPoolMXBean directBufferPoolMXBean = directBufferPoolMXBean();
private static BufferPoolMXBean directBufferPoolMXBean() {
final String pool = "direct";
final ObjectName obj;
try {
obj = new ObjectName("java.nio:type=BufferPool,name=" + pool);
} catch (MalformedObjectNameException x) {
throw new AssertionError(x);
}
return new BufferPoolMXBean() {
@Override
public ObjectName getObjectName() {
return obj;
}
@Override
public String getName() {
return pool;
}
@Override
public long getCount() {
return Bits.count;
}
@Override
public long getTotalCapacity() {
return Bits.usedMemory;
}
@Override
public long getMemoryUsed() {
return Bits.reservedMemory;
}
};
}
} }
// -- Bulk get/put acceleration -- // -- Bulk get/put acceleration --
......
...@@ -30,7 +30,6 @@ package java.nio; ...@@ -30,7 +30,6 @@ package java.nio;
import sun.misc.Cleaner; import sun.misc.Cleaner;
import sun.misc.Unsafe; import sun.misc.Unsafe;
import sun.nio.ch.DirectBuffer; import sun.nio.ch.DirectBuffer;
import sun.nio.ch.FileChannelImpl;
class Direct$Type$Buffer$RW$$BO$ class Direct$Type$Buffer$RW$$BO$
......
...@@ -47,7 +47,7 @@ import java.io.IOException; ...@@ -47,7 +47,7 @@ import java.io.IOException;
* so that method invocations on the implementation class can be chained. * so that method invocations on the implementation class can be chained.
* *
* @since 1.7 * @since 1.7
* @see java.nio.file.FileRef#newByteChannel * @see java.nio.file.Path#newByteChannel
*/ */
public interface SeekableByteChannel public interface SeekableByteChannel
......
...@@ -30,7 +30,7 @@ package java.nio.file; ...@@ -30,7 +30,7 @@ package java.nio.file;
* *
* @since 1.7 * @since 1.7
* *
* @see FileRef#checkAccess * @see Path#checkAccess
*/ */
public enum AccessMode { public enum AccessMode {
......
...@@ -27,6 +27,7 @@ package java.nio.file; ...@@ -27,6 +27,7 @@ package java.nio.file;
import java.util.Iterator; import java.util.Iterator;
import java.io.Closeable; import java.io.Closeable;
import java.io.IOException;
/** /**
* An object to iterate over the entries in a directory. A directory stream * An object to iterate over the entries in a directory. A directory stream
...@@ -50,13 +51,10 @@ import java.io.Closeable; ...@@ -50,13 +51,10 @@ import java.io.Closeable;
* *
* <p> A {@code DirectoryStream} is opened upon creation and is closed by * <p> A {@code DirectoryStream} is opened upon creation and is closed by
* invoking the {@link #close close} method. Closing the directory stream * invoking the {@link #close close} method. Closing the directory stream
* releases any resources associated with the stream. The {@link * releases any resources associated with the stream. Once a directory stream
* Files#withDirectory Files.withDirectory} utility method is useful for cases * is closed, all further method invocations on the iterator throw {@link
* where a task is performed on entries in a directory. This method automatically * java.util.concurrent.ConcurrentModificationException} with cause {@link
* closes the directory stream when iteration is complete (or an error occurs). * ClosedDirectoryStreamException}.
* Once a directory stream is closed, all further method invocations on the
* iterator throw {@link java.util.concurrent.ConcurrentModificationException}
* with cause {@link ClosedDirectoryStreamException}.
* *
* <p> A directory stream is not required to be <i>asynchronously closeable</i>. * <p> A directory stream is not required to be <i>asynchronously closeable</i>.
* If a thread is blocked on the directory stream's iterator reading from the * If a thread is blocked on the directory stream's iterator reading from the
...@@ -79,7 +77,7 @@ import java.io.Closeable; ...@@ -79,7 +77,7 @@ import java.io.Closeable;
* *
* <p> The iterator's {@link Iterator#remove() remove} method removes the * <p> The iterator's {@link Iterator#remove() remove} method removes the
* directory entry for the last element returned by the iterator, as if by * directory entry for the last element returned by the iterator, as if by
* invoking the {@link FileRef#delete delete} method. If an I/O error or * invoking the {@link Path#delete delete} method. If an I/O error or
* security exception occurs then {@code ConcurrentModificationException} is * security exception occurs then {@code ConcurrentModificationException} is
* thrown with the cause. * thrown with the cause.
* *
...@@ -104,10 +102,6 @@ public interface DirectoryStream<T> ...@@ -104,10 +102,6 @@ public interface DirectoryStream<T>
* newDirectoryStream} method when opening a directory to iterate over the * newDirectoryStream} method when opening a directory to iterate over the
* entries in the directory. * entries in the directory.
* *
* <p> The {@link DirectoryStreamFilters} class defines factory methods to
* create filters for a number of common usages and also methods to combine
* filters.
*
* @param <T> the type of the directory entry * @param <T> the type of the directory entry
* *
* @since 1.7 * @since 1.7
...@@ -120,8 +114,11 @@ public interface DirectoryStream<T> ...@@ -120,8 +114,11 @@ public interface DirectoryStream<T>
* the directory entry to be tested * the directory entry to be tested
* *
* @return {@code true} if the directory entry should be accepted * @return {@code true} if the directory entry should be accepted
*
* @throws IOException
* If an I/O error occurs
*/ */
boolean accept(T entry); boolean accept(T entry) throws IOException;
} }
/** /**
......
/*
* Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package java.nio.file;
import java.io.IOException;
import java.io.IOError;
import sun.nio.fs.MimeType;
/**
* This class consists exclusively of static methods that construct or combine
* filters.
*
* @since 1.7
*/
public final class DirectoryStreamFilters {
private DirectoryStreamFilters() { }
/**
* Constructs a directory stream filter that filters directory entries by
* their <a href="http://www.ietf.org/rfc/rfc2045.txt">MIME</a> content
* type. The directory stream filter's {@link
* java.nio.file.DirectoryStream.Filter#accept accept} method returns {@code
* true} if the content type of the directory entry can be determined by
* invoking the {@link Files#probeContentType probeContentType} method, and
* the content type matches the given content type.
*
* <p> The {@code type} parameter is the value of a Multipurpose Internet
* Mail Extension (MIME) content type as defined by <a
* href="http://www.ietf.org/rfc/rfc2045.txt"><i>RFC&nbsp;2045: Multipurpose
* Internet Mail Extensions (MIME) Part One: Format of Internet Message
* Bodies</i></a>. It is parsable according to the grammar in the RFC. Any
* space characters (<code>'&#92;u0020'</code>) surrounding its components are
* ignored. The {@code type} parameter is parsed into its primary and subtype
* components which are used to match the primary and subtype components of
* each directory entry's content type. Parameters are not allowed. The
* primary type matches if it has value {@code '*'} or is equal to the
* primary type of the directory entry's content type without regard to
* case. The subtype matches if has the value {@code '*'} or is equal to the
* subtype of the directory entry's content type without regard to case. If
* both the primary and subtype match then the filter's {@code accept} method
* returns {@code true}. If the content type of a directory entry cannot be
* determined then the entry is filtered.
*
* <p> The {@code accept} method of the resulting directory stream filter
* throws {@link IOError} if the probing of the content type fails by
* throwing an {@link IOException}. Security exceptions are also propogated
* to the caller of the {@code accept} method.
*
* <p> <b>Usage Example:</b>
* Suppose we require to list only the HTML files in a directory.
* <pre>
* DirectoryStream.Filter&lt;FileRef&gt; filter =
* DirectoryStreamFilters.newContentTypeFilter("text/html");
* </pre>
*
* @param type
* the content type
*
* @return a new directory stream filter
*
* @throws IllegalArgumentException
* if the {@code type} parameter cannot be parsed as a MIME type
* or it has parameters
*/
public static <T extends FileRef> DirectoryStream.Filter<T>
newContentTypeFilter(String type)
{
final MimeType matchType = MimeType.parse(type);
if (matchType.hasParameters())
throw new IllegalArgumentException("Parameters not allowed");
return new DirectoryStream.Filter<T>() {
@Override
public boolean accept(T entry) {
String fileType;
try {
fileType = Files.probeContentType(entry);
} catch (IOException x) {
throw new IOError(x);
}
if (fileType != null) {
return matchType.match(fileType);
}
return false;
}
};
}
/**
* Returns a directory stream filter that {@link DirectoryStream.Filter#accept
* accepts} a directory entry if the entry is accepted by all of the given
* filters.
*
* <p> This method returns a filter that invokes, in iterator order, the
* {@code accept} method of each of the filters. If {@code false} is returned
* by any of the filters then the directory entry is filtered. If the
* directory entry is not filtered then the resulting filter accepts the
* entry. If the iterator returns zero elements then the resulting filter
* accepts all directory entries.
*
* <p> <b>Usage Example:</b>
* <pre>
* List&lt;DirectoryStream.Filter&lt;? super Path&gt;&gt; filters = ...
* DirectoryStream.Filter&lt;Path&gt; filter = DirectoryStreamFilters.allOf(filters);
* </pre>
*
* @param filters
* the sequence of filters
*
* @return the resulting filter
*/
public static <T> DirectoryStream.Filter<T>
allOf(final Iterable<? extends DirectoryStream.Filter<? super T>> filters)
{
if (filters == null)
throw new NullPointerException("'filters' is null");
return new DirectoryStream.Filter<T>() {
@Override
public boolean accept(T entry) {
for (DirectoryStream.Filter<? super T> filter: filters) {
if (!filter.accept(entry))
return false;
}
return true;
}
};
}
/**
* Returns a directory stream filter that {@link DirectoryStream.Filter#accept
* accepts} a directory entry if the entry is accepted by one or more of
* the given filters.
*
* <p> This method returns a filter that invokes, in iteration order, the
* {@code accept} method of each of filter. If {@code true} is returned by
* any of the filters then the directory entry is accepted. If none of the
* filters accepts the directory entry then it is filtered. If the iterator
* returns zero elements then the resulting filter filters all directory
* entries.
*
* @param filters
* the sequence of filters
*
* @return the resulting filter
*/
public static <T> DirectoryStream.Filter<T>
anyOf(final Iterable<? extends DirectoryStream.Filter<? super T>> filters)
{
if (filters == null)
throw new NullPointerException("'filters' is null");
return new DirectoryStream.Filter<T>() {
@Override
public boolean accept(T entry) {
for (DirectoryStream.Filter<? super T> filter: filters) {
if (filter.accept(entry))
return true;
}
return false;
}
};
}
/**
* Returns a directory stream filter that is the <em>complement</em> of the
* given filter. The resulting filter {@link
* java.nio.file.DirectoryStream.Filter#accept accepts} a directory entry
* if filtered by the given filter, and filters any entries that are accepted
* by the given filter.
*
* @param filter
* the given filter
*
* @return the resulting filter that is the complement of the given filter
*/
public static <T> DirectoryStream.Filter<T>
complementOf(final DirectoryStream.Filter<T> filter)
{
if (filter == null)
throw new NullPointerException("'filter' is null");
return new DirectoryStream.Filter<T>() {
@Override
public boolean accept(T entry) {
return !filter.accept(entry);
}
};
}
}
...@@ -26,12 +26,13 @@ ...@@ -26,12 +26,13 @@
package java.nio.file; package java.nio.file;
import java.nio.file.attribute.*; import java.nio.file.attribute.*;
import java.io.IOException;
/** /**
* Storage for files. A {@code FileStore} represents a storage pool, device, * Storage for files. A {@code FileStore} represents a storage pool, device,
* partition, volume, concrete file system or other implementation specific means * partition, volume, concrete file system or other implementation specific means
* of file storage. The {@code FileStore} for where a file is stored is obtained * of file storage. The {@code FileStore} for where a file is stored is obtained
* by invoking the {@link FileRef#getFileStore getFileStore} method, or all file * by invoking the {@link Path#getFileStore getFileStore} method, or all file
* stores can be enumerated by invoking the {@link FileSystem#getFileStores * stores can be enumerated by invoking the {@link FileSystem#getFileStores
* getFileStores} method. * getFileStores} method.
* *
...@@ -146,24 +147,41 @@ public abstract class FileStore { ...@@ -146,24 +147,41 @@ public abstract class FileStore {
getFileStoreAttributeView(Class<V> type); getFileStoreAttributeView(Class<V> type);
/** /**
* Returns a {@code FileStoreAttributeView} of the given name. * Reads the value of a file store attribute.
* *
* <p> This method is intended to be used where <em>dynamic access</em> to * <p> The {@code attribute} parameter identifies the attribute to be read
* file store attributes is required. The {@code name} parameter specifies * and takes the form:
* the {@link FileAttributeView#name name} of the file store attribute view * <blockquote>
* and this method returns an instance of that view if supported. * <i>view-name</i><b>:</b><i>attribute-name</i>
* </blockquote>
* where the character {@code ':'} stands for itself.
*
* <p> <i>view-name</i> is the {@link FileStoreAttributeView#name name} of
* a {@link FileStore AttributeView} that identifies a set of file attributes.
* <i>attribute-name</i> is the name of the attribute.
* *
* <p> For {@code FileStore} objects created by the default provider, then * <p> For {@code FileStore} objects created by the default provider, then
* the file stores support the {@link FileStoreSpaceAttributeView} that * the file stores support the {@link FileStoreSpaceAttributeView} that
* provides access to space attributes. In that case invoking this method * provides access to space attributes.
* with a parameter value of {@code "space"} will always return an instance
* of that class.
* *
* @param name * <p> <b>Usage Example:</b>
* the name of the attribute view * Suppose we want to know if ZFS compression is enabled (assuming the "zfs"
* view is supported):
* <pre>
* boolean compression = (Boolean)fs.getAttribute("zfs:compression");
* </pre>
* *
* @return a file store attribute view of the given name, or {@code null} * @param attribute
* if the attribute view is not available * the attribute to read
* @return the attribute value; {@code null} may be a valid valid for some
* attributes
*
* @throws UnsupportedOperationException
* if the attribute view is not available or it does not support
* reading the attribute
* @throws IOException
* if an I/O error occurs
*/ */
public abstract FileStoreAttributeView getFileStoreAttributeView(String name); public abstract Object getAttribute(String attribute) throws IOException;
} }
...@@ -50,8 +50,6 @@ class FileTreeWalker { ...@@ -50,8 +50,6 @@ class FileTreeWalker {
case FOLLOW_LINKS : fl = true; break; case FOLLOW_LINKS : fl = true; break;
case DETECT_CYCLES : dc = true; break; case DETECT_CYCLES : dc = true; break;
default: default:
if (option == null)
throw new NullPointerException("Visit options contains 'null'");
throw new AssertionError("Should not get here"); throw new AssertionError("Should not get here");
} }
} }
...@@ -239,13 +237,13 @@ class FileTreeWalker { ...@@ -239,13 +237,13 @@ class FileTreeWalker {
} }
private static class AncestorDirectory { private static class AncestorDirectory {
private final FileRef dir; private final Path dir;
private final Object key; private final Object key;
AncestorDirectory(FileRef dir, Object key) { AncestorDirectory(Path dir, Object key) {
this.dir = dir; this.dir = dir;
this.key = key; this.key = key;
} }
FileRef file() { Path file() {
return dir; return dir;
} }
Object fileKey() { Object fileKey() {
......
...@@ -42,9 +42,9 @@ import java.io.IOException; ...@@ -42,9 +42,9 @@ import java.io.IOException;
* &#64;Override * &#64;Override
* public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
* try { * try {
* file.delete(false); * file.delete();
* } catch (IOException exc) { * } catch (IOException exc) {
* // failed to delete * // failed to delete, do error handling here
* } * }
* return FileVisitResult.CONTINUE; * return FileVisitResult.CONTINUE;
* } * }
...@@ -52,9 +52,9 @@ import java.io.IOException; ...@@ -52,9 +52,9 @@ import java.io.IOException;
* public FileVisitResult postVisitDirectory(Path dir, IOException e) { * public FileVisitResult postVisitDirectory(Path dir, IOException e) {
* if (e == null) { * if (e == null) {
* try { * try {
* dir.delete(false); * dir.delete();
* } catch (IOException exc) { * } catch (IOException exc) {
* // failed to delete * // failed to delete, do error handling here
* } * }
* } else { * } else {
* // directory iteration failed * // directory iteration failed
...@@ -80,7 +80,8 @@ import java.io.IOException; ...@@ -80,7 +80,8 @@ import java.io.IOException;
* } catch (FileAlreadyExistsException e) { * } catch (FileAlreadyExistsException e) {
* // ignore * // ignore
* } catch (IOException e) { * } catch (IOException e) {
* // copy failed, skip rest of directory and descendants * // copy failed, do error handling here
* // skip rest of directory and descendants
* return SKIP_SUBTREE; * return SKIP_SUBTREE;
* } * }
* return CONTINUE; * return CONTINUE;
...@@ -90,7 +91,7 @@ import java.io.IOException; ...@@ -90,7 +91,7 @@ import java.io.IOException;
* try { * try {
* file.copyTo(target.resolve(source.relativize(file))); * file.copyTo(target.resolve(source.relativize(file)));
* } catch (IOException e) { * } catch (IOException e) {
* // copy failed * // copy failed, do error handling here
* } * }
* return CONTINUE; * return CONTINUE;
* } * }
...@@ -100,7 +101,7 @@ import java.io.IOException; ...@@ -100,7 +101,7 @@ import java.io.IOException;
* @since 1.7 * @since 1.7
*/ */
public interface FileVisitor<T extends FileRef> { public interface FileVisitor<T> {
/** /**
* Invoked for a directory before entries in the directory are visited. * Invoked for a directory before entries in the directory are visited.
......
...@@ -26,13 +26,15 @@ ...@@ -26,13 +26,15 @@
package java.nio.file; package java.nio.file;
import java.nio.file.spi.FileTypeDetector; import java.nio.file.spi.FileTypeDetector;
import java.nio.file.attribute.*;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
/** /**
* Utility methods for files and directories. * This class consists exclusively of static methods that operate on files or
* directories.
* *
* @since 1.7 * @since 1.7
*/ */
...@@ -109,8 +111,6 @@ public final class Files { ...@@ -109,8 +111,6 @@ public final class Files {
* @throws SecurityException * @throws SecurityException
* If a security manager is installed and it denies an unspecified * If a security manager is installed and it denies an unspecified
* permission required by a file type detector implementation. * permission required by a file type detector implementation.
*
* @see DirectoryStreamFilters#newContentTypeFilter
*/ */
public static String probeContentType(FileRef file) public static String probeContentType(FileRef file)
throws IOException throws IOException
...@@ -127,158 +127,6 @@ public final class Files { ...@@ -127,158 +127,6 @@ public final class Files {
.probeContentType(file); .probeContentType(file);
} }
/**
* Invokes a {@link FileAction} for each entry in a directory accepted
* by a given {@link java.nio.file.DirectoryStream.Filter filter}.
*
* <p> This method opens the given directory and invokes the file action's
* {@link FileAction#invoke invoke} method for each entry accepted by the
* filter. When iteration is completed then the directory is closed. If the
* {@link DirectoryStream#close close} method throws an {@code IOException}
* then it is silently ignored.
*
* <p> If the {@code FileAction}'s {@code invoke} method terminates due
* to an uncaught {@link IOException}, {@code Error} or {@code RuntimeException}
* then the exception is propagated by this method after closing the
* directory.
*
* @param dir
* The directory
* @param filter
* The filter
* @param action
* The {@code FileAction} to invoke for each accepted entry
*
* @throws NotDirectoryException
* If the {@code dir} parameter is not a directory <i>(optional
* specific exception)</i>
* @throws IOException
* If an I/O error occurs or the {@code invoke} method terminates
* due to an uncaught {@code IOException}
* @throws SecurityException
* In the case of the default provider, the {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to the directory.
*/
public static void withDirectory(Path dir,
DirectoryStream.Filter<? super Path> filter,
FileAction<? super Path> action)
throws IOException
{
// explicit null check required in case directory is empty
if (action == null)
throw new NullPointerException();
DirectoryStream<Path> stream = dir.newDirectoryStream(filter);
try {
// set to true when invoking the action so as to distinguish a
// CME thrown by the iteration from a CME thrown by the invoke
boolean inAction = false;
try {
for (Path entry: stream) {
inAction = true;
action.invoke(entry);
inAction = false;
}
} catch (ConcurrentModificationException cme) {
if (!inAction) {
Throwable cause = cme.getCause();
if (cause instanceof IOException)
throw (IOException)cause;
}
throw cme;
}
} finally {
try {
stream.close();
} catch (IOException x) { }
}
}
/**
* Invokes a {@link FileAction} for each entry in a directory with a
* file name that matches a given pattern.
*
* <p> This method opens the given directory and invokes the file action's
* {@link FileAction#invoke invoke} method for each entry that matches the
* given pattern. When iteration is completed then the directory is closed.
* If the {@link DirectoryStream#close close} method throws an {@code
* IOException} then it is silently ignored.
*
* <p> If the {@code FileAction}'s {@code invoke} method terminates due
* to an uncaught {@link IOException}, {@code Error} or {@code RuntimeException}
* then the exception is propagated by this method after closing the
* directory.
*
* <p> The globbing pattern language supported by this method is as
* specified by the {@link FileSystem#getPathMatcher getPathMatcher} method.
*
* @param dir
* The directory
* @param glob
* The globbing pattern
* @param action
* The {@code FileAction} to invoke for each entry
*
* @throws NotDirectoryException
* If the {@code dir} parameter is not a directory <i>(optional
* specific exception)</i>
* @throws IOException
* If an I/O error occurs or the {@code invoke} method terminates
* due to an uncaught {@code IOException}
* @throws SecurityException
* In the case of the default provider, the {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to the directory.
*/
public static void withDirectory(Path dir,
String glob,
FileAction<? super Path> action)
throws IOException
{
if (glob == null)
throw new NullPointerException("'glob' is null");
final PathMatcher matcher = dir.getFileSystem().getPathMatcher("glob:" + glob);
DirectoryStream.Filter<Path> filter = new DirectoryStream.Filter<Path>() {
@Override
public boolean accept(Path entry) {
return matcher.matches(entry.getName());
}
};
withDirectory(dir, filter, action);
}
/**
* Invokes a {@link FileAction} for all entries in a directory.
*
* <p> This method works as if invoking it were equivalent to evaluating the
* expression:
* <blockquote><pre>
* withDirectory(dir, "*", action)
* </pre></blockquote>
*
* @param dir
* The directory
* @param action
* The {@code FileAction} to invoke for each entry
*
* @throws NotDirectoryException
* If the {@code dir} parameter is not a directory <i>(optional
* specific exception)</i>
* @throws IOException
* If an I/O error occurs or the {@code invoke} method terminates
* due to an uncaught {@code IOException}
* @throws SecurityException
* In the case of the default provider, the {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to the directory.
*/
public static void withDirectory(Path dir, FileAction<? super Path> action)
throws IOException
{
withDirectory(dir, "*", action);
}
/** /**
* Walks a file tree. * Walks a file tree.
* *
...@@ -328,7 +176,7 @@ public final class Files { ...@@ -328,7 +176,7 @@ public final class Files {
* arises when there is an entry in a directory that is an ancestor of the * arises when there is an entry in a directory that is an ancestor of the
* directory. Cycle detection is done by recording the {@link * directory. Cycle detection is done by recording the {@link
* java.nio.file.attribute.BasicFileAttributes#fileKey file-key} of directories, * java.nio.file.attribute.BasicFileAttributes#fileKey file-key} of directories,
* or if file keys are not available, by invoking the {@link FileRef#isSameFile * or if file keys are not available, by invoking the {@link Path#isSameFile
* isSameFile} method to test if a directory is the same file as an * isSameFile} method to test if a directory is the same file as an
* ancestor. When a cycle is detected the {@link FileVisitor#visitFile * ancestor. When a cycle is detected the {@link FileVisitor#visitFile
* visitFile} is invoked with the attributes of the directory. The {@link * visitFile} is invoked with the attributes of the directory. The {@link
...@@ -403,4 +251,108 @@ public final class Files { ...@@ -403,4 +251,108 @@ public final class Files {
Integer.MAX_VALUE, Integer.MAX_VALUE,
visitor); visitor);
} }
/**
* Creates a directory by creating all nonexistent parent directories first.
*
* <p> The {@code attrs} parameter is an optional array of {@link FileAttribute
* file-attributes} to set atomically when creating the nonexistent
* directories. Each file attribute is identified by its {@link
* FileAttribute#name name}. If more than one attribute of the same name is
* included in the array then all but the last occurrence is ignored.
*
* <p> If this method fails, then it may do so after creating some, but not
* all, of the parent directories.
*
* @param dir
* the directory to create
*
* @param attrs
* an optional list of file attributes to set atomically when
* creating the directory
*
* @throws UnsupportedOperationException
* if the array contains an attribute that cannot be set atomically
* when creating the directory
* @throws FileAlreadyExistsException
* if {@code dir} exists but is not a directory <i>(optional specific
* exception)</i>
* @throws IOException
* if an I/O error occurs
* @throws SecurityException
* in the case of the default provider, and a security manager is
* installed, the {@link SecurityManager#checkWrite(String) checkWrite}
* method is invoked prior to attempting to create a directory and
* its {@link SecurityManager#checkRead(String) checkRead} is
* invoked for each parent directory that is checked. If {@code
* dir} is not an absolute path then its {@link Path#toAbsolutePath
* toAbsolutePath} may need to be invoked to get its absolute path.
* This may invoke the security manager's {@link
* SecurityManager#checkPropertyAccess(String) checkPropertyAccess}
* method to check access to the system property {@code user.dir}
*
*/
public static void createDirectories(Path dir, FileAttribute<?>... attrs)
throws IOException
{
// attempt to create the directory
try {
createAndCheckIsDirectory(dir, attrs);
return;
} catch (FileAlreadyExistsException x) {
// file exists and is not a directory
throw x;
} catch (IOException x) {
// parent may not exist or other reason
}
// find existing parent (may require absolute path)
SecurityException se = null;
try {
dir = dir.toAbsolutePath();
} catch (SecurityException x) {
// don't have permission to get absolute path
se = x;
}
Path parent = dir.getParent();
while (parent != null) {
try {
parent.checkAccess();
break;
} catch (NoSuchFileException x) {
// does not exist
}
parent = parent.getParent();
}
if (parent == null) {
// unable to find existing parent
if (se != null)
throw se;
throw new IOException("Root directory does not exist");
}
// create directories
Path child = parent;
for (Path name: parent.relativize(dir)) {
child = child.resolve(name);
createAndCheckIsDirectory(child, attrs);
}
}
/**
* Attempts to create a directory. Does nothing if the directory already
* exists.
*/
private static void createAndCheckIsDirectory(Path dir, FileAttribute<?>... attrs)
throws IOException
{
try {
dir.createDirectory(attrs);
} catch (FileAlreadyExistsException x) {
boolean isDirectory = Attributes
.readBasicFileAttributes(dir, LinkOption.NOFOLLOW_LINKS).isDirectory();
if (!isDirectory)
throw x;
}
}
} }
...@@ -95,7 +95,7 @@ public final class LinkPermission extends BasicPermission { ...@@ -95,7 +95,7 @@ public final class LinkPermission extends BasicPermission {
* {@code null} * {@code null}
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
* if name is empty or invalid * if name is empty or invalid, or actions is a non-empty string
*/ */
public LinkPermission(String name, String actions) { public LinkPermission(String name, String actions) {
super(name); super(name);
......
...@@ -30,7 +30,7 @@ package java.nio.file; ...@@ -30,7 +30,7 @@ package java.nio.file;
* *
* <p> Objects of this type are used by methods such as {@link * <p> Objects of this type are used by methods such as {@link
* Path#newOutputStream(OpenOption[]) newOutputStream}, {@link * Path#newOutputStream(OpenOption[]) newOutputStream}, {@link
* FileRef#newByteChannel newByteChannel}, {@link * Path#newByteChannel newByteChannel}, {@link
* java.nio.channels.FileChannel#open FileChannel.open}, and {@link * java.nio.channels.FileChannel#open FileChannel.open}, and {@link
* java.nio.channels.AsynchronousFileChannel#open AsynchronousFileChannel.open} * java.nio.channels.AsynchronousFileChannel#open AsynchronousFileChannel.open}
* when opening or creating a file. * when opening or creating a file.
......
...@@ -35,7 +35,7 @@ import java.net.URI; ...@@ -35,7 +35,7 @@ import java.net.URI;
* @since 1.7 * @since 1.7
*/ */
public class Paths { public final class Paths {
private Paths() { } private Paths() { }
/** /**
...@@ -106,8 +106,9 @@ public class Paths { ...@@ -106,8 +106,9 @@ public class Paths {
* if preconditions on the {@code uri} parameter do not hold. The * if preconditions on the {@code uri} parameter do not hold. The
* format of the URI is provider specific. * format of the URI is provider specific.
* @throws FileSystemNotFoundException * @throws FileSystemNotFoundException
* if the file system identified by the URI does not exist or the * The file system, identified by the URI, does not exist and
* provider identified by the URI's scheme component is not installed * cannot be created automatically, or the provider identified by
* the URI's scheme component is not installed
* @throws SecurityException * @throws SecurityException
* if a security manager is installed and it denies an unspecified * if a security manager is installed and it denies an unspecified
* permission to access the file system * permission to access the file system
......
...@@ -36,7 +36,7 @@ import java.io.IOException; ...@@ -36,7 +36,7 @@ import java.io.IOException;
* traverse file trees or otherwise operate on directories in a race-free manner. * traverse file trees or otherwise operate on directories in a race-free manner.
* Race conditions can arise when a sequence of file operations cannot be * Race conditions can arise when a sequence of file operations cannot be
* carried out in isolation. Each of the file operations defined by this * carried out in isolation. Each of the file operations defined by this
* interface specify a relative {@link Path}. All access to the file is relative * interface specify a relative path. All access to the file is relative
* to the open directory irrespective of if the directory is moved or replaced * to the open directory irrespective of if the directory is moved or replaced
* by an attacker while the directory is open. A {@code SecureDirectoryStream} * by an attacker while the directory is open. A {@code SecureDirectoryStream}
* may also be used as a virtual <em>working directory</em>. * may also be used as a virtual <em>working directory</em>.
...@@ -65,8 +65,8 @@ import java.io.IOException; ...@@ -65,8 +65,8 @@ import java.io.IOException;
* @since 1.7 * @since 1.7
*/ */
public abstract class SecureDirectoryStream public abstract class SecureDirectoryStream<T>
implements DirectoryStream<Path> implements DirectoryStream<T>
{ {
/** /**
* Initialize a new instance of this class. * Initialize a new instance of this class.
...@@ -78,13 +78,12 @@ public abstract class SecureDirectoryStream ...@@ -78,13 +78,12 @@ public abstract class SecureDirectoryStream
* SecureDirectoryStream} to iterate over the entries in the directory. * SecureDirectoryStream} to iterate over the entries in the directory.
* *
* <p> This method works in exactly the manner specified by the {@link * <p> This method works in exactly the manner specified by the {@link
* Path#newDirectoryStream newDirectoryStream} method for the case that * Path#newDirectoryStream() newDirectoryStream} method for the case that
* the {@code path} parameter is an {@link Path#isAbsolute absolute} path. * the {@code path} parameter is an {@link Path#isAbsolute absolute} path.
* When the parameter is a relative path then the directory to open is * When the parameter is a relative path then the directory to open is
* relative to this open directory. The {@code followLinks} parameter * relative to this open directory. The {@link
* determines if links should be followed. If this parameter is {@code * LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} option may be used to
* false} and the file is a symbolic link then this method fails (by * ensure that this method fails if the file is a symbolic link.
* throwing an I/O exception).
* *
* <p> The new directory stream, once created, is not dependent upon the * <p> The new directory stream, once created, is not dependent upon the
* directory stream used to create it. Closing this directory stream has no * directory stream used to create it. Closing this directory stream has no
...@@ -92,10 +91,8 @@ public abstract class SecureDirectoryStream ...@@ -92,10 +91,8 @@ public abstract class SecureDirectoryStream
* *
* @param path * @param path
* the path to the directory to open * the path to the directory to open
* @param followLinks * @param options
* {@code true} if the links should be followed * options indicating how symbolic links are handled
* @param filter
* the directory stream filter or {@code null}.
* *
* @return a new and open {@code SecureDirectoryStream} object * @return a new and open {@code SecureDirectoryStream} object
* *
...@@ -111,9 +108,8 @@ public abstract class SecureDirectoryStream ...@@ -111,9 +108,8 @@ public abstract class SecureDirectoryStream
* installed, the {@link SecurityManager#checkRead(String) checkRead} * installed, the {@link SecurityManager#checkRead(String) checkRead}
* method is invoked to check read access to the directory. * method is invoked to check read access to the directory.
*/ */
public abstract SecureDirectoryStream newDirectoryStream(Path path, public abstract SecureDirectoryStream<T> newDirectoryStream(T path,
boolean followLinks, LinkOption... options)
DirectoryStream.Filter<? super Path> filter)
throws IOException; throws IOException;
/** /**
...@@ -162,7 +158,7 @@ public abstract class SecureDirectoryStream ...@@ -162,7 +158,7 @@ public abstract class SecureDirectoryStream
* checkWrite} method is invoked to check write access to the path * checkWrite} method is invoked to check write access to the path
* if the file is opened for writing. * if the file is opened for writing.
*/ */
public abstract SeekableByteChannel newByteChannel(Path path, public abstract SeekableByteChannel newByteChannel(T path,
Set<? extends OpenOption> options, Set<? extends OpenOption> options,
FileAttribute<?>... attrs) FileAttribute<?>... attrs)
throws IOException; throws IOException;
...@@ -170,7 +166,7 @@ public abstract class SecureDirectoryStream ...@@ -170,7 +166,7 @@ public abstract class SecureDirectoryStream
/** /**
* Deletes a file. * Deletes a file.
* *
* <p> Unlike the {@link FileRef#delete delete()} method, this method * <p> Unlike the {@link Path#delete delete()} method, this method
* does not first examine the file to determine if the file is a directory. * does not first examine the file to determine if the file is a directory.
* Whether a directory is deleted by this method is system dependent and * Whether a directory is deleted by this method is system dependent and
* therefore not specified. If the file is a symbolic-link then the link is * therefore not specified. If the file is a symbolic-link then the link is
...@@ -191,12 +187,12 @@ public abstract class SecureDirectoryStream ...@@ -191,12 +187,12 @@ public abstract class SecureDirectoryStream
* installed, the {@link SecurityManager#checkDelete(String) checkDelete} * installed, the {@link SecurityManager#checkDelete(String) checkDelete}
* method is invoked to check delete access to the file * method is invoked to check delete access to the file
*/ */
public abstract void deleteFile(Path path) throws IOException; public abstract void deleteFile(T path) throws IOException;
/** /**
* Deletes a directory. * Deletes a directory.
* *
* <p> Unlike the {@link FileRef#delete delete()} method, this method * <p> Unlike the {@link Path#delete delete()} method, this method
* does not first examine the file to determine if the file is a directory. * does not first examine the file to determine if the file is a directory.
* Whether non-directories are deleted by this method is system dependent and * Whether non-directories are deleted by this method is system dependent and
* therefore not specified. When the parameter is a relative path then the * therefore not specified. When the parameter is a relative path then the
...@@ -219,7 +215,7 @@ public abstract class SecureDirectoryStream ...@@ -219,7 +215,7 @@ public abstract class SecureDirectoryStream
* installed, the {@link SecurityManager#checkDelete(String) checkDelete} * installed, the {@link SecurityManager#checkDelete(String) checkDelete}
* method is invoked to check delete access to the directory * method is invoked to check delete access to the directory
*/ */
public abstract void deleteDirectory(Path path) throws IOException; public abstract void deleteDirectory(T path) throws IOException;
/** /**
* Move a file from this directory to another directory. * Move a file from this directory to another directory.
...@@ -259,7 +255,7 @@ public abstract class SecureDirectoryStream ...@@ -259,7 +255,7 @@ public abstract class SecureDirectoryStream
* method is invoked to check write access to both the source and * method is invoked to check write access to both the source and
* target file. * target file.
*/ */
public abstract void move(Path srcpath, SecureDirectoryStream targetdir, Path targetpath) public abstract void move(T srcpath, SecureDirectoryStream<T> targetdir, T targetpath)
throws IOException; throws IOException;
/** /**
...@@ -318,7 +314,7 @@ public abstract class SecureDirectoryStream ...@@ -318,7 +314,7 @@ public abstract class SecureDirectoryStream
* type is not available * type is not available
* *
*/ */
public abstract <V extends FileAttributeView> V getFileAttributeView(Path path, public abstract <V extends FileAttributeView> V getFileAttributeView(T path,
Class<V> type, Class<V> type,
LinkOption... options); LinkOption... options);
} }
...@@ -40,7 +40,7 @@ import java.io.IOError; ...@@ -40,7 +40,7 @@ import java.io.IOError;
* @since 1.7 * @since 1.7
*/ */
public class SimpleFileVisitor<T extends FileRef> implements FileVisitor<T> { public class SimpleFileVisitor<T> implements FileVisitor<T> {
/** /**
* Initializes a new instance of this class. * Initializes a new instance of this class.
*/ */
......
...@@ -31,7 +31,7 @@ package java.nio.file; ...@@ -31,7 +31,7 @@ package java.nio.file;
* @since 1.7 * @since 1.7
*/ */
public class StandardWatchEventKind { public final class StandardWatchEventKind {
private StandardWatchEventKind() { } private StandardWatchEventKind() { }
/** /**
......
...@@ -103,7 +103,7 @@ public abstract class WatchKey { ...@@ -103,7 +103,7 @@ public abstract class WatchKey {
* *
* <p> Note that this method does not wait if there are no events pending. * <p> Note that this method does not wait if there are no events pending.
* *
* @return the list of the events retrieved * @return the list of the events retrieved; may be empty
*/ */
public abstract List<WatchEvent<?>> pollEvents(); public abstract List<WatchEvent<?>> pollEvents();
...@@ -128,7 +128,7 @@ public abstract class WatchKey { ...@@ -128,7 +128,7 @@ public abstract class WatchKey {
* will be invalid. If the watch key is enqueued, waiting to be retrieved * will be invalid. If the watch key is enqueued, waiting to be retrieved
* from the watch service, then it will remain in the queue until it is * from the watch service, then it will remain in the queue until it is
* removed. Pending events, if any, remain pending and may be retrieved by * removed. Pending events, if any, remain pending and may be retrieved by
* invoking the {@link #pollEvents pollEvents} method event after the key is * invoking the {@link #pollEvents pollEvents} method after the key is
* cancelled. * cancelled.
* *
* <p> If this watch key has already been cancelled then invoking this * <p> If this watch key has already been cancelled then invoking this
......
...@@ -110,13 +110,13 @@ import java.io.IOException; ...@@ -110,13 +110,13 @@ import java.io.IOException;
* </table> * </table>
* </blockquote> * </blockquote>
* *
* <p> The {@link #getAttribute getAttribute} or {@link #readAttributes * <p> The {@link FileRef#getAttribute getAttribute} method may be used to read
* readAttributes} methods may be used to read the ACL or owner attributes as if * the ACL or owner attributes as if by invoking the {@link #getAcl getAcl} or
* by invoking the {@link #getAcl getAcl} or {@link #getOwner getOwner} methods. * {@link #getOwner getOwner} methods.
* *
* <p> The {@link #setAttribute setAttribute} method may be used to update the * <p> The {@link FileRef#setAttribute setAttribute} method may be used to
* ACL or owner attributes as if by invoking the {@link #setAcl setAcl} or {@link * update the ACL or owner attributes as if by invoking the {@link #setAcl setAcl}
* #setOwner setOwner} methods. * or {@link #setOwner setOwner} methods.
* *
* <h4> Setting the ACL when creating a file </h4> * <h4> Setting the ACL when creating a file </h4>
* *
......
...@@ -25,20 +25,12 @@ ...@@ -25,20 +25,12 @@
package java.nio.file.attribute; package java.nio.file.attribute;
import java.util.*;
import java.io.IOException;
/** /**
* An object that provides a read-only or updatable <em>view</em> of non-opaque * An object that provides a read-only or updatable <em>view</em> of non-opaque
* values associated with an object in a filesystem. This interface is extended * values associated with an object in a filesystem. This interface is extended
* or implemented by specific attribute views that define the attributes * or implemented by specific attribute views that define the attributes
* supported by the view. A specific attribute view will typically define * supported by the view. A specific attribute view will typically define
* type-safe methods to read or update the attributes that it supports. It also * type-safe methods to read or update the attributes that it supports.
* provides <em>dynamic access</em> where the {@link #readAttributes
* readAttributes}, {@link #getAttribute getAttribute} and {@link #setAttribute
* setAttributs} methods are used to access the attributes by names defined
* by the attribute view. Implementations must ensure that the attribute names
* do not contain the colon (':') or comma (',') characters.
* *
* @since 1.7 * @since 1.7
*/ */
...@@ -48,71 +40,4 @@ public interface AttributeView { ...@@ -48,71 +40,4 @@ public interface AttributeView {
* Returns the name of the attribute view. * Returns the name of the attribute view.
*/ */
String name(); String name();
/**
* Reads the value of an attribute.
*
* @param attribute
* the attribute name (case sensitive)
*
* @return the value of the attribute, or {@code null} if the attribute is
* not supported
*
* @throws IOException
* if an I/O error occurs
* @throws SecurityException
* if a security manager is set and it denies access
*/
Object getAttribute(String attribute) throws IOException;
/**
* Sets/updates the value of an attribute.
*
* @param attribute
* the attribute name (case sensitive)
* @param value
* the attribute value
*
* @throws UnsupportedOperationException
* if the attribute is not supported or this attribute view does
* not support updating the value of the attribute
* @throws IllegalArgumentException
* if the attribute value is of the correct type but has an
* inappropriate value
* @throws ClassCastException
* if the attribute value is not of the expected type or is a
* collection containing elements that are not of the expected
* type
* @throws IOException
* if an I/O error occurs
* @throws SecurityException
* if a security manager is set and it denies access
*/
void setAttribute(String attribute, Object value) throws IOException;
/**
* Reads all, or a subset, of the attributes supported by this file attribute
* view.
*
* <p> The {@code first} and {@code rest} parameters are the names of the
* attributes to read. If any of the parameters has the value {@code "*"}
* then all attributes are read. Attributes that are not supported are
* ignored and will not be present in the returned map. It is implementation
* specific if all attributes are read as an atomic operation with respect
* to other file system operations.
*
* @param first
* the name of an attribute to read (case sensitive)
* @param rest
* the names of other attributes to read (case sensitive)
*
* @return an unmodifiable map of the attributes; may be empty. Its keys are
* the attribute names, its values are the attribute values
*
* @throws IOException
* if an I/O error occurs
* @throws SecurityException
* if a security manager is set and it denies access
*/
Map<String,?> readAttributes(String first, String... rest) throws IOException;
} }
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
package java.nio.file.attribute; package java.nio.file.attribute;
import java.util.concurrent.TimeUnit;
import java.io.IOException; import java.io.IOException;
/** /**
...@@ -49,19 +48,15 @@ import java.io.IOException; ...@@ -49,19 +48,15 @@ import java.io.IOException;
* </tr> * </tr>
* <tr> * <tr>
* <td> "lastModifiedTime" </td> * <td> "lastModifiedTime" </td>
* <td> {@link Long} </td> * <td> {@link FileTime} </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> "lastAccessTime" </td> * <td> "lastAccessTime" </td>
* <td> {@link Long} </td> * <td> {@link FileTime} </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> "creationTime" </td> * <td> "creationTime" </td>
* <td> {@link Long} </td> * <td> {@link FileTime} </td>
* </tr>
* <tr>
* <td> "resolution" </td>
* <td> {@link java.util.concurrent.TimeUnit} </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> "size" </td> * <td> "size" </td>
...@@ -84,26 +79,19 @@ import java.io.IOException; ...@@ -84,26 +79,19 @@ import java.io.IOException;
* <td> {@link Boolean} </td> * <td> {@link Boolean} </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> "linkCount" </td>
* <td> {@link Integer} </td>
* </tr>
* <tr>
* <td> "fileKey" </td> * <td> "fileKey" </td>
* <td> {@link Object} </td> * <td> {@link Object} </td>
* </tr> * </tr>
* </table> * </table>
* </blockquote> * </blockquote>
* *
* <p> The {@link #getAttribute getAttribute} or {@link * <p> The {@link java.nio.file.FileRef#getAttribute getAttribute} method may be
* #readAttributes(String,String[]) readAttributes(String,String[])} methods may * used to read any of these attributes as if by invoking the {@link
* be used to read any of these attributes as if by invoking the {@link
* #readAttributes() readAttributes()} method. * #readAttributes() readAttributes()} method.
* *
* <p> The {@link #setAttribute setAttribute} method may be used to update the * <p> The {@link java.nio.file.FileRef#setAttribute setAttribute} method may be
* file's last modified time, last access time or create time attributes as if * used to update the file's last modified time, last access time or create time
* by invoking the {@link #setTimes setTimes} method. In that case, the time * attributes as if by invoking the {@link #setTimes setTimes} method.
* value is interpreted in {@link TimeUnit#MILLISECONDS milliseconds} and
* converted to the precision supported by the file system.
* *
* @since 1.7 * @since 1.7
* @see Attributes * @see Attributes
...@@ -141,11 +129,11 @@ public interface BasicFileAttributeView ...@@ -141,11 +129,11 @@ public interface BasicFileAttributeView
* and create time attributes. * and create time attributes.
* *
* <p> This method updates the file's timestamp attributes. The values are * <p> This method updates the file's timestamp attributes. The values are
* measured since the epoch (00:00:00 GMT, January 1, 1970) and converted to * converted to the epoch and precision supported by the file system.
* the precision supported by the file system. Converting from finer to * Converting from finer to coarser granularities result in precision loss.
* coarser granularities result in precision loss. If a value is larger * The behavior of this method when attempting to set a timestamp to a value
* than the maximum supported by the file system then the corresponding * that is outside the range supported by the underlying file store is not
* timestamp is set to its maximum value. * defined. It may or not fail by throwing an {@code IOException}.
* *
* <p> If any of the {@code lastModifiedTime}, {@code lastAccessTime}, * <p> If any of the {@code lastModifiedTime}, {@code lastAccessTime},
* or {@code createTime} parameters has the value {@code null} then the * or {@code createTime} parameters has the value {@code null} then the
...@@ -153,25 +141,19 @@ public interface BasicFileAttributeView ...@@ -153,25 +141,19 @@ public interface BasicFileAttributeView
* read the existing values of the file attributes when only some, but not * read the existing values of the file attributes when only some, but not
* all, of the timestamp attributes are updated. Consequently, this method * all, of the timestamp attributes are updated. Consequently, this method
* may not be an atomic operation with respect to other file system * may not be an atomic operation with respect to other file system
* operations. If all of the {@code lastModifiedTime}, {@code * operations. Reading and re-writing existing values may also result in
* precision loss. If all of the {@code lastModifiedTime}, {@code
* lastAccessTime} and {@code createTime} parameters are {@code null} then * lastAccessTime} and {@code createTime} parameters are {@code null} then
* this method has no effect. * this method has no effect.
* *
* @param lastModifiedTime * @param lastModifiedTime
* the new last modified time, or {@code -1L} to update it to * the new last modified time, or {@code null} to not change the
* the current time, or {@code null} to not change the attribute * value
* @param lastAccessTime * @param lastAccessTime
* the last access time, or {@code -1L} to update it to * the last access time, or {@code null} to not change the value
* the current time, or {@code null} to not change the attribute.
* @param createTime * @param createTime
* the file's create time, or {@code -1L} to update it to * the file's create time, or {@code null} to not change the value
* the current time, or {@code null} to not change the attribute
* @param unit
* a {@code TimeUnit} determining how to interpret the time values
* *
* @throws IllegalArgumentException
* if any of the parameters is a negative value other than {@code
* -1L}
* @throws IOException * @throws IOException
* if an I/O error occurs * if an I/O error occurs
* @throws SecurityException * @throws SecurityException
...@@ -179,8 +161,7 @@ public interface BasicFileAttributeView ...@@ -179,8 +161,7 @@ public interface BasicFileAttributeView
* installed, its {@link SecurityManager#checkWrite(String) checkWrite} * installed, its {@link SecurityManager#checkWrite(String) checkWrite}
* method is invoked to check write access to the file * method is invoked to check write access to the file
*/ */
void setTimes(Long lastModifiedTime, void setTimes(FileTime lastModifiedTime,
Long lastAccessTime, FileTime lastAccessTime,
Long createTime, FileTime createTime) throws IOException;
TimeUnit unit) throws IOException;
} }
...@@ -65,17 +65,17 @@ import java.io.IOException; ...@@ -65,17 +65,17 @@ import java.io.IOException;
* </table> * </table>
* </blockquote> * </blockquote>
* *
* <p> The {@link #getAttribute getAttribute} or {@link #readAttributes(String,String[]) * <p> The {@link java.nio.file.FileRef#getAttribute getAttribute} method may
* readAttributes(String,String[])} methods may be used to read any of these * be used to read any of these attributes, or any of the attributes defined by
* attributes, or any of the attributes defined by {@link BasicFileAttributeView} * {@link BasicFileAttributeView} as if by invoking the {@link #readAttributes
* as if by invoking the {@link #readAttributes readAttributes()} method. * readAttributes()} method.
* *
* <p> The {@link #setAttribute setAttribute} method may be used to update the * <p> The {@link java.nio.file.FileRef#setAttribute setAttribute} method may
* file's last modified time, last access time or create time attributes as * be used to update the file's last modified time, last access time or create
* defined by {@link BasicFileAttributeView}. It may also be used to update * time attributes as defined by {@link BasicFileAttributeView}. It may also be
* the DOS attributes as if by invoking the {@link #setReadOnly setReadOnly}, * used to update the DOS attributes as if by invoking the {@link #setReadOnly
* {@link #setHidden setHidden}, {@link #setSystem setSystem}, and {@link * setReadOnly}, {@link #setHidden setHidden}, {@link #setSystem setSystem}, and
* #setArchive setArchive} methods respectively. * {@link #setArchive setArchive} methods respectively.
* *
* @since 1.7 * @since 1.7
*/ */
......
...@@ -34,7 +34,6 @@ package java.nio.file.attribute; ...@@ -34,7 +34,6 @@ package java.nio.file.attribute;
* @since 1.7 * @since 1.7
* *
* @see java.nio.file.FileRef#getFileAttributeView(Class,java.nio.file.LinkOption[]) * @see java.nio.file.FileRef#getFileAttributeView(Class,java.nio.file.LinkOption[])
* @see java.nio.file.FileRef#getFileAttributeView(String,java.nio.file.LinkOption[])
*/ */
public interface FileAttributeView public interface FileAttributeView
......
...@@ -52,10 +52,8 @@ import java.io.IOException; ...@@ -52,10 +52,8 @@ import java.io.IOException;
* </tr> * </tr>
* </table> * </table>
* </blockquote> * </blockquote>
* <p> The {@link #getAttribute getAttribute} or {@link #readAttributes * <p> The {@link java.nio.file.FileStore#getAttribute getAttribute} method may
* readAttributes(String,String[])} methods may be used to read any of these * be used to read any of these attributes.
* attributes as if by invoking the {@link #readAttributes readAttributes()}
* method.
* *
* @since 1.7 * @since 1.7
*/ */
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册