提交 6b10b34a 编写于 作者: L lana

Merge

......@@ -55,3 +55,7 @@ e6a5d095c356a547cf5b3c8885885aca5e91e09b jdk7-b77
1143e498f813b8223b5e3a696d79da7ff7c25354 jdk7-b78
918920710d65432a2d54fdf407c1524a5571c4ad jdk7-b79
049cfaaa9a7374e3768a79969a799e8b59ad52fa jdk7-b80
10b993d417fcdb40480dad7032ac241f4b87f1af jdk7-b81
69ef657320ad5c35cfa12e4d8322d877e778f8b3 jdk7-b82
9027c6b9d7e2c9ca04a1add691b5b50d0f22b1aa jdk7-b83
7cb9388bb1a16365fa5118c5efa38b1cd58be40d jdk7-b84
......@@ -240,7 +240,12 @@ import_product:
all build:: sanity-all post-sanity-all
SUBDIRS = tools java javax org sun sunw com jpda mkdemo mksample launchers
SUBDIRS = tools java javax sun com
SUBDIRS_tools = launchers
SUBDIRS_misc = org sunw jpda mkdemo mksample
include $(BUILDDIR)/common/Subdirs.gmk
all build::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,8 @@ PRODUCT = com
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = sun
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -38,10 +38,19 @@ ifndef OPENJDK
endif
endif
# jarsigner is part of JRE
SUBDIRS = java security net/ssl jarsigner
SUBDIRS_management = jmx
SUBDIRS_desktop = image inputmethods
SUBDIRS_enterprise = crypto/provider jndi \
org xml rowset net/httpserver
SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
# Omit mirror since it's built with the apt tool.
SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
java org xml rowset net/httpserver net/ssl demo \
tools jarsigner tracing servicetag nio
SUBDIRS_tools = tools
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -38,6 +38,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = jvmti
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -38,6 +38,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = hprof
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -32,6 +32,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = indicim thaiim
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -31,7 +31,10 @@ BUILDDIR = ../../..
PRODUCT = plugin
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = browser pack
SUBDIRS = pack
SUBDIRS_misc = browser
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -32,6 +32,8 @@ PRODUCT = plugin
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dom net
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -51,6 +51,8 @@ else
SUBDIRS = snmp
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build:
$(SUBDIRS-loop)
......
......@@ -31,6 +31,8 @@ BUILDDIR = ../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = toolkit cosnaming ldap rmi dns
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -31,6 +31,8 @@ BUILDDIR = ../../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = registry
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -31,6 +31,8 @@ BUILDDIR = ../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = sctp
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,8 @@ PRODUCT = org
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = apache
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -31,6 +31,7 @@ BUILDDIR = ../../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = xml
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -30,7 +30,10 @@
BUILDDIR = ../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = jgss sasl auth auth/module
SUBDIRS = auth
SUBDIRS_misc = jgss sasl auth/module
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -35,6 +35,8 @@ include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = com/sun/tools/extcheck
SUBDIRS = attach
include $(BUILDDIR)/common/Subdirs.gmk
all build:
$(SUBDIRS-loop)
clean clobber::
......
......@@ -33,6 +33,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dtrace
include $(BUILDDIR)/common/Subdirs.gmk
all build:
$(SUBDIRS-loop)
clean clobber::
......
......@@ -576,17 +576,17 @@ endef
define install-file
$(prep-target)
$(CP) $< $@
$(install-module-file)
@$(install-module-file)
endef
define chmod-file
$(CHMOD) $1 $@
$(call chmod-module-file, $1)
@$(call chmod-module-file, $1)
endef
define install-sym-link
$(LN) -s $1 $@
$(call install-module-sym-link, $1)
@$(call install-module-sym-link, $1)
endef
#
......@@ -607,131 +607,9 @@ define java-vm-cleanup
if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
endef
# Default make settings for processing SUBDIRS with clobber or clean names
SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false
SUBDIRS_MAKEFLAGS-clean = INCREMENTAL_BUILD=false
# Current directory
CURRENT_DIRECTORY := $(shell $(PWD))
# If no timing wanted, we need to define these as empty
ifdef NO_TIMING
TIMING_ID:=NA
define TIMING_start
t=0:0:0:0
endef
define TIMING_end
time_used=0
endef
else # NO_TIMING
# Default timing id
TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY))
# Timing start (must be used in same shell, e.g. same command line)
# Defines the shell variable $1 to have the start time.
define TIMING_start
$1=`$(DATE) +%j:%H:%M:%S`
endef
# Timing end (must be used in same shell, e.g. same command line)
# Expects shell variable $1 to have been defined as the start time.
# Expects shell variable $2 to have timing id string
# Sets total_seconds shell variable as the total seconds used.
# Sets time_used shell variable to contain format "%dh%dm%ds"
define TIMING_end
begTime="$${$1}"; \
timing_id="$${$2}"; \
endTime=`$(DATE) +%j:%H:%M:%S`; \
d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
if [ "$${d1}" = "" ] ; then d1=0; fi; \
h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
if [ "$${h1}" = "" ] ; then h1=0; fi; \
m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
if [ "$${m1}" = "" ] ; then m1=0; fi; \
s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
if [ "$${s1}" = "" ] ; then s1=0; fi; \
d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
if [ "$${d2}" = "" ] ; then d2=0; fi; \
h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
if [ "$${h2}" = "" ] ; then h2=0; fi; \
m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
if [ "$${m2}" = "" ] ; then m2=0; fi; \
s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
if [ "$${s2}" = "" ] ; then s2=0; fi; \
t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \
'+' $${m1} '*' 60 '+' $${s1}`; \
t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \
'+' $${m2} '*' 60 '+' $${s2}`; \
total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \
if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \
t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \
t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \
t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \
time_used=$${t_sec}; \
if [ "$${t_hour}" != "0h" ] ; then \
time_used=$${t_hour}$${t_min}$${t_sec}; \
elif [ "$${t_min}" != "0m" ] ; then \
time_used=$${t_min}$${t_sec}; \
else \
time_used=$${t_sec}; \
fi; \
$(PRINTF) " Timing: %05d seconds or %s for %s\n" \
$${total_seconds} $${time_used} $${timing_id}
endef
endif # NO_TIMING
# Given a SUBDIRS list, cd into them and make them
# SUBDIRS_MAKEFLAGS Make settings for a subdir make
# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target
define SUBDIRS-loop
@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)"
@for i in DUMMY $(SUBDIRS) ; do \
if [ "$$i" != "DUMMY" ] ; then \
$(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
$(call TIMING_start,startTime); \
curDir=$(CURRENT_DIRECTORY); \
$(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
$(SUBDIRS_MAKEFLAGS) \
$(SUBDIRS_MAKEFLAGS-$@) \
FULL_VERSION=$(FULL_VERSION) \
RELEASE=$(RELEASE) || exit 1; \
$(CD) $${curDir}; \
$(call TIMING_end,startTime,timing_id); \
$(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
fi ; \
done
@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)"
endef
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make
define OTHERSUBDIRS-loop
@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
@for i in DUMMY $(OTHERSUBDIRS) ; do \
if [ "$$i" != "DUMMY" ] ; then \
$(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
$(call TIMING_start,startTime); \
curDir=$(CURRENT_DIRECTORY); \
$(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
$(OTHERSUBDIRS_MAKEFLAGS) \
FULL_VERSION=$(FULL_VERSION) \
RELEASE=$(RELEASE) || exit 1; \
$(CD) $${curDir}; \
$(call TIMING_end,startTime,timing_id); \
$(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
fi ; \
done
@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
endef
#
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
# used for this file, otherwise the default settings are used.
......@@ -819,7 +697,7 @@ endef
define install-import-file
$(install-importonly-file)
$(install-module-file)
@$(install-module-file)
endef
.PHONY: all build clean clobber
......@@ -71,7 +71,8 @@ sanity-base: pre-sanity \
sane-cacerts \
sane-ant_version \
sane-zip_version \
sane-msvcrt_path
sane-msvcrt_path \
sane-build_modules
# The rules sanity-* have a one-to-one correspondence with the major targets
# Each sanity-* rule should have no body to ensure that the post-sanity-* is the
......
# Copyright 2010 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
#
#
# Generic makefile for building subdirectories.
#
# SUBDIRS variables to specify the subdirectories to build recursively.
# Makefile has to include Subdirs.gmk AFTER all SUBDIRS variables are
# defined.
#
# This file does not contain any rule.
#
# WARNING: This file is shared with other workspaces.
# So when it includes other files, it must use JDK_TOPDIR.
#
# SUBDIRS subdirs for the base module always get built
# SUBDIRS_<group> subdirs for the named group
#
# By default, subdirs specified in the SUBDIRS and all SUBDIRS_*
# variables will be built.
#
# BUILD_MODULES variable can be used to specify one or more groups
# to be built (BUILD_MODULES=all will build all groups).
#
# Variables of the currently supported groups are:
# SUBDIRS_desktop
# SUBDIRS_management
# SUBDIRS_enterprise
# SUBDIRS_misc
# SUBDIRS_tools
#
# Change to the above list also need to update
# make/common/shared/Sanity.gmk. NOTE: this list is subject
# to change till the JDK 7 SE profiles/modules are finalized.
#
# Eventually we want to restructure the make directory
# according to these grouping (e.g. make/desktop/...) and
# the SUBDIRS_<group> variables would not be needed.
#
# To build the desktop and tools groups only, you can do:
# gnumake BUILD_MODULES="desktop tools" ...
#
# Iterate the subdirectories specified in $1.
# - cd into each subdir and make them
# Given a SUBDIRS* list (first argument), cd into them and make them
# SUBDIRS_MAKEFLAGS Make settings for a subdir make
# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target
#
define subdirs-group-loop
@$(ECHO) "Begin Processing SUBDIRS: $($1)"
@for i in DUMMY $($1) ; do \
if [ "$$i" != "DUMMY" ] ; then \
$(MAKE) -C $$i $@ $(SUBDIRS_MAKEFLAGS) $(SUBDIRS_MAKEFLAGS-$@) \
FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
fi ; \
done
@$(ECHO) "Done Processing SUBDIRS: $($1)"
endef
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make
define OTHERSUBDIRS-loop
@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
@for i in DUMMY $(OTHERSUBDIRS) ; do \
if [ "$$i" != "DUMMY" ] ; then \
$(MAKE) -C $$i $@ $(OTHERSUBDIRS_MAKEFLAGS) \
FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
fi ; \
done
@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
endef
#
# Iterate the list specified in SUBDIRS_<group> only if
# SUBDIRS_<group> is set and <group> or "all" is specified
# in the BUILD_MODULES variable
#
ifdef SUBDIRS_desktop
ifneq (,$(findstring desktop, $(BUILD_MODULES)))
define subdirs-desktop-loop
@$(call subdirs-group-loop,SUBDIRS_desktop)
endef
else
define subdirs-desktop-loop
endef
endif
else
define subdirs-desktop-loop
endef
endif # SUBDIRS_desktop
ifdef SUBDIRS_enterprise
ifneq (,$(findstring enterprise, $(BUILD_MODULES)))
define subdirs-enterprise-loop
@$(call subdirs-group-loop,SUBDIRS_enterprise)
endef
else
define subdirs-enterprise-loop
endef
endif
else
define subdirs-enterprise-loop
endef
endif # SUBDIRS_enterprise
ifdef SUBDIRS_management
ifneq (,$(findstring management, $(BUILD_MODULES)))
define subdirs-management-loop
@$(call subdirs-group-loop,SUBDIRS_management)
endef
else
define subdirs-management-loop
endef
endif
else
define subdirs-management-loop
endef
endif # SUBDIRS_management
ifdef SUBDIRS_misc
ifneq (,$(findstring misc, $(BUILD_MODULES)))
define subdirs-misc-loop
@$(call subdirs-group-loop,SUBDIRS_misc)
endef
else
define subdirs-misc-loop
endef
endif
else
define subdirs-misc-loop
endef
endif # SUBDIRS_misc
ifdef SUBDIRS_tools
ifneq (,$(findstring tools, $(BUILD_MODULES)))
define subdirs-tools-loop
@$(call subdirs-group-loop,SUBDIRS_tools)
endef
else
define subdirs-tools-loop
endef
endif
else
define subdirs-tools-loop
endef
endif # SUBDIRS_tools
#
# If BUILD_MODULES is not set or it's set to "all",
# iterate all groups.
SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
$(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
ifndef BUILD_MODULES
define SUBDIRS-loop
@$(call subdirs-group-loop,SUBDIRS_all)
endef
else
ifneq (,$(findstring all, $(BUILD_MODULES)))
define SUBDIRS-loop
@$(call subdirs-group-loop,SUBDIRS_all)
endef
else # BUILD_MODULES set
#
# Iterate SUBDIRS and the groups specified in BUILD_MODULES
#
define SUBDIRS-loop
@$(call subdirs-group-loop,SUBDIRS)
@$(subdirs-desktop-loop)
@$(subdirs-enterprise-loop)
@$(subdirs-management-loop)
@$(subdirs-misc-loop)
@$(subdirs-tools-loop)
endef
endif
endif # BUILD_MODULES
......@@ -138,6 +138,10 @@ JAVACFLAGS += $(OTHER_JAVACFLAGS)
# Needed for javah
JAVAHFLAGS += -bootclasspath $(CLASSBINDIR)
# Needed for javadoc to ensure it builds documentation
# against the newly built classes
JAVADOCFLAGS += -bootclasspath $(CLASSBINDIR)
# Needed for JAVADOC and BOOT_JAVACFLAGS
NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
......@@ -155,14 +159,15 @@ ifdef LANGTOOLS_DIST
-jar $(JAVAH_JAR) $(JAVAHFLAGS)
JAVADOC_CMD = $(BOOT_JAVA_CMD) \
"-Xbootclasspath/p:$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)$(CLASSPATH_SEPARATOR)$(DOCLETS_JAR)" \
-jar $(JAVADOC_JAR)
-jar $(JAVADOC_JAR) $(JAVADOCFLAGS)
else
# If no explicit tools, use boot tools (add VM flags in this case)
JAVAC_CMD = $(JAVA_TOOLS_DIR)/javac $(JAVAC_JVM_FLAGS) \
$(JAVACFLAGS)
JAVAH_CMD = $(JAVA_TOOLS_DIR)/javah \
$(JAVAHFLAGS)
JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%)
JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%) \
$(JAVADOCFLAGS)
endif
# Override of what javac to use (see deploy workspace)
......
#
# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2005-2010 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
......@@ -218,7 +218,8 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk
sane-zip_version \
sane-unzip_version \
sane-msvcrt_path \
sane-freetype
sane-freetype \
sane-build_modules
######################################################
# check for COPYRIGHT_YEAR variable
......@@ -844,6 +845,21 @@ else
sane-freetype:
endif
######################################################
# if specified, BUILD_MODULES must contain valid values.
######################################################
MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
sane-build_modules:
ifdef BUILD_MODULES
@for m in $(BUILD_MODULES) ; do \
valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
if [ "x$$valid" = "x" ] ; then \
$(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \
"" >> $(ERROR_FILE); \
fi \
done
endif
######################################################
# CUPS_HEADERS_PATH must be valid
######################################################
......@@ -1093,6 +1109,7 @@ endif
# Check for existence of misc Hotspot imported files
######################################################
HOTSPOT_INCLUDE_FILE_LIST = jvmti.h
HOTSPOT_INCLUDE_FILE_LIST += jvmticmlr.h
#HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h
#HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h
#HOTSPOT_INCLUDE_FILE_LIST += jmm.h
......
......@@ -69,7 +69,7 @@ DRAFT = '<br><strong>DRAFT&nbsp;'$(MILESTONE)-$(BUILD_NUMBER)'</strong>'
THIS_YEAR := $(shell $(DATE) | $(SED) -e 's/ / /g' | $(CUT) -d' ' -f6)
TRADEMARK = &\#x2122;
IGNORED_TAGS = beaninfo revised since.unbundled spec Note ToDo
IGNORED_TAGS = beaninfo revised since.unbundled spec specdefault Note ToDo
JLS3_URL = http://java.sun.com/docs/books/jls/
JLS3_CITE = <a href="$(JLS3_URL)"> \
......
......@@ -38,9 +38,13 @@ SUBDIRS += hpi version jvm redist verify fdlibm java sun_nio jli main zip
# Others
# Note: java_crw_demo java_hprof_demo are demos but must be delivered built in sdk
SUBDIRS += security npt java_crw_demo java_hprof_demo \
math awt util text applet net nio dyn \
sql rmi jar beans logging management instrument
SUBDIRS += security math util text net nio jar
SUBDIRS_desktop = awt applet beans
SUBDIRS_management = management
SUBDIRS_misc = npt java_crw_demo java_hprof_demo \
logging instrument dyn sql rmi
ifeq ($(PLATFORM), solaris)
......@@ -53,6 +57,8 @@ ifeq ($(PLATFORM), linux)
SUBDIRS += jexec
endif # PLATFORM
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -34,6 +34,8 @@ include $(BUILDDIR)/common/Defs.gmk
# Build specified the HPI implementations
#
SUBDIRS = $(HPIS)
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -218,6 +218,8 @@ ifeq ($(PLATFORM), solaris)
endif
SUBDIRS = reflect
include $(BUILDDIR)/common/Subdirs.gmk
all build:
$(SUBDIRS-loop)
clean clobber::
......
......@@ -49,7 +49,7 @@ Euro_Resources_properties := $(FILES_compiled_properties)
# $(BUILDDIR)/java/text/FILES_java.gmk contains the "sun.text.resources" for
# European language support
include $(BUILDDIR)/java/text/FILES_java.gmk
include $(BUILDDIR)/java/text/base/FILES_java.gmk
Euro_Resources_java += $(FILES_java)
......
#
# Copyright 1995-2005 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 1995-2010 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
......@@ -34,7 +34,8 @@ include $(BUILDDIR)/common/Defs.gmk
FILES_h = $(INCLUDEDIR)/jni.h \
$(PLATFORM_INCLUDE)/jni_md.h \
$(INCLUDEDIR)/jvmti.h \
$(INCLUDEDIR)/jvmti.h \
$(INCLUDEDIR)/jvmticmlr.h \
$(INCLUDEDIR)/classfile_constants.h
$(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
......
......@@ -36,6 +36,8 @@ SUBDIRS = java javaw
else
SUBDIRS = java
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -26,7 +26,6 @@
FILES_src = \
java/nio/Bits.java \
java/nio/Buffer.java \
java/nio/BufferPoolMXBean.java \
java/nio/ByteOrder.java \
java/nio/MappedByteBuffer.java \
java/nio/StringCharBuffer.java \
......
......@@ -304,7 +304,11 @@ endif # PLATFORM
# Rules
#
SUBDIRS_management = mxbean
include $(BUILDDIR)/common/Subdirs.gmk
build: sources
$(SUBDIRS-loop)
clean clobber::
$(RM) -r $(NIO_GEN) $(SNIO_GEN)
......
#
# Copyright 2010 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 = ../../..
MODULE = management
PACKAGE = java.nio
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
FILES_java = java/nio/BufferPoolMXBean.java
include $(BUILDDIR)/common/Classes.gmk
......@@ -62,7 +62,10 @@ CLASSSHARINGDATA_DIR = $(BUILDDIR)/tools/sharing
# Needed to do file copy
ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))
SUBDIRS = fonts sajdi
SUBDIRS_desktop = fonts
SUBDIRS_tools = sajdi
include $(BUILDDIR)/common/Subdirs.gmk
all clean clobber::
$(SUBDIRS-loop)
......
......@@ -31,7 +31,7 @@ BUILDDIR = ../..
PACKAGE = sun.nio
PRODUCT = sun
OTHER_JAVACFLAGS += -Xlint:serial -Werror
OTHER_JAVACFLAGS += -Xlint:serial,-deprecation -Werror
include $(BUILDDIR)/common/Defs.gmk
#
......
#
# Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2010 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
......@@ -23,86 +23,19 @@
# have any questions.
#
BUILDDIR = ../..
MODULE = base
PACKAGE = java.text
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
#
# Files
#
include FILES_java.gmk
#
# Include
#
include $(BUILDDIR)/common/Classes.gmk
#
# Rules to add data files BreakIterator
#
TEXT_CLASSES = $(BUILDTOOLCLASSDIR)/java.text/classes
# input
#
# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime.
# They are used at JDK build phase in order to create $(BIFILES) which
# are used on runtime instead.
# Makefile for building all of java.text
#
TEXT_SRCDIR = $(SHARE_SRC)/classes/sun/text/resources
TEXT_SOURCES = $(TEXT_SRCDIR)/BreakIteratorRules.java \
$(TEXT_SRCDIR)/BreakIteratorInfo.java
UNICODEDATA = $(BUILDDIR)/tools/UnicodeData
# output
TEXT_CLASSDIR = $(CLASSBINDIR)/sun/text/resources
BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \
$(TEXT_CLASSDIR)/WordBreakIteratorData \
$(TEXT_CLASSDIR)/LineBreakIteratorData \
$(TEXT_CLASSDIR)/SentenceBreakIteratorData
ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \
$(TEXT_CLASSDIR)/uprops.icu \
$(TEXT_CLASSDIR)/ubidi.icu
# builder
GENERATEBREAKITERATORDATA_JARFILE = \
$(BUILDTOOLJARDIR)/generatebreakiteratordata.jar
$(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \
$(UNICODEDATA)/UnicodeData.txt \
$(TEXT_SOURCES)
$(prep-target)
$(RM) -r $(TEXT_CLASSES)
$(MKDIR) -p $(TEXT_CLASSES)
$(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \
-sourcepath $(TEXT_SRCDIR) \
$(TEXT_SOURCES)
$(MKDIR) -p $(TEXT_CLASSDIR)
$(BOOT_JAVA_CMD) -Xbootclasspath/p:$(TEXT_CLASSES) \
-jar $(GENERATEBREAKITERATORDATA_JARFILE) \
-o $(TEXT_CLASSDIR) \
-spec $(UNICODEDATA)/UnicodeData.txt
@$(java-vm-cleanup)
build: $(BIFILES) $(ICU_FILES)
#
# Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu
#
$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu
$(install-file)
BUILDDIR = ../..
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu
$(install-file)
SUBDIRS = base
SUBDIRS_desktop = bidi
$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu
$(install-file)
include $(BUILDDIR)/common/Subdirs.gmk
clean clobber::
$(RM) -r $(TEXT_CLASSES)
$(RM) -r $(BIFILES)
$(RM) $(ICU_FILES)
all build clean clobber::
$(SUBDIRS-loop)
......@@ -29,7 +29,6 @@ FILES_java = \
java/text/AttributedString.java \
java/text/BreakDictionary.java \
java/text/BreakIterator.java \
java/text/Bidi.java \
java/text/CharacterIterator.java \
java/text/CharacterIteratorFieldDelegate.java \
java/text/ChoiceFormat.java \
......@@ -76,10 +75,6 @@ FILES_java = \
sun/text/Normalizer.java \
sun/text/SupplementaryCharacterData.java \
sun/text/UCompactIntArray.java \
sun/text/bidi/BidiBase.java \
sun/text/bidi/BidiLine.java \
sun/text/bidi/BidiRun.java \
\
sun/text/normalizer/CharTrie.java \
sun/text/normalizer/CharacterIteratorWrapper.java \
sun/text/normalizer/ICUBinary.java \
......
#
# Copyright 1996-2006 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 = ../../..
MODULE = base
PACKAGE = java.text
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
#
# Files
#
include FILES_java.gmk
#
# Include
#
include $(BUILDDIR)/common/Classes.gmk
#
# Rules to add data files BreakIterator
#
TEXT_CLASSES = $(BUILDTOOLCLASSDIR)/java.text/classes
# input
#
# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime.
# They are used at JDK build phase in order to create $(BIFILES) which
# are used on runtime instead.
#
TEXT_SRCDIR = $(SHARE_SRC)/classes/sun/text/resources
TEXT_SOURCES = $(TEXT_SRCDIR)/BreakIteratorRules.java \
$(TEXT_SRCDIR)/BreakIteratorInfo.java
UNICODEDATA = $(BUILDDIR)/tools/UnicodeData
# output
TEXT_CLASSDIR = $(CLASSBINDIR)/sun/text/resources
BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \
$(TEXT_CLASSDIR)/WordBreakIteratorData \
$(TEXT_CLASSDIR)/LineBreakIteratorData \
$(TEXT_CLASSDIR)/SentenceBreakIteratorData
ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \
$(TEXT_CLASSDIR)/uprops.icu \
$(TEXT_CLASSDIR)/ubidi.icu
# builder
GENERATEBREAKITERATORDATA_JARFILE = \
$(BUILDTOOLJARDIR)/generatebreakiteratordata.jar
$(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \
$(UNICODEDATA)/UnicodeData.txt \
$(TEXT_SOURCES)
$(prep-target)
$(RM) -r $(TEXT_CLASSES)
$(MKDIR) -p $(TEXT_CLASSES)
$(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \
-sourcepath $(TEXT_SRCDIR) \
$(TEXT_SOURCES)
$(MKDIR) -p $(TEXT_CLASSDIR)
$(BOOT_JAVA_CMD) -Xbootclasspath/p:$(TEXT_CLASSES) \
-jar $(GENERATEBREAKITERATORDATA_JARFILE) \
-o $(TEXT_CLASSDIR) \
-spec $(UNICODEDATA)/UnicodeData.txt
@$(java-vm-cleanup)
build: $(BIFILES) $(ICU_FILES)
#
# Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu
#
$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu
$(install-file)
$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu
$(install-file)
$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu
$(install-file)
clean clobber::
$(RM) -r $(TEXT_CLASSES)
$(RM) -r $(BIFILES)
$(RM) $(ICU_FILES)
#
# Copyright 2010 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 = java.text
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
#
# Files for Bidi that is not in the base module
#
FILES_java = \
java/text/Bidi.java \
sun/text/bidi/BidiBase.java \
sun/text/bidi/BidiLine.java \
sun/text/bidi/BidiRun.java \
sun/text/CodePointIterator.java
#
# Include
#
include $(BUILDDIR)/common/Classes.gmk
......@@ -30,19 +30,24 @@
BUILDDIR = ..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = others
SUBDIRS_management = management
SUBDIRS_misc = \
crypto \
sql \
rmi
# imageio uses xml, so build it last
SUBDIRS_desktop = \
accessibility \
print \
swing \
sound \
imageio
SUBDIRS = \
others \
accessibility \
print \
swing \
crypto \
sound \
sql \
rmi \
management \
imageio
include $(BUILDDIR)/common/Subdirs.gmk
all build:
$(SUBDIRS-loop)
......
......@@ -31,6 +31,8 @@ BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = ssl
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -159,6 +159,7 @@ vpath %.cpp $(PLATFORM_SRC)/native/com/sun/media/sound
# Include rules
#
include $(BUILDDIR)/common/Library.gmk
include $(BUILDDIR)/common/Subdirs.gmk
#
# Rules that copy files.
......
......@@ -40,6 +40,7 @@ AUTO_JAVA_PRUNE = plaf
SUBDIRS = html32dtd plaf
include $(BUILDDIR)/common/Classes.gmk
include $(BUILDDIR)/common/Subdirs.gmk
build: other_files
$(SUBDIRS-loop)
......
......@@ -25,7 +25,7 @@
#
# Makefile to build the BeanInfo generation tool (ie, a doclet), and
# then the beaninfo itself. Swing versions prior to 1.2 is no longer
# then the beaninfo itself. Swing versions prior to 1.2 are no longer
# built.
#
# This makefile could be a lot simpler if we made it more regular.
......@@ -44,13 +44,12 @@ swing-1.2-beans-debug:
$(MAKE) DEBUG_FLAG=true make-swing-beans
LOCAL_JAVADOC = $(JAVADOC_CMD) $(JAVADOCFLAGS)
# get the absolute path to the jar command.
PREFIX = 1.2
JAVADOCFLAGS = $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION)
JAVADOCFLAGS += $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION)
SWINGPKG = javax/swing
LOCAL_JAVAC_FLAGS = $(OTHER_JAVACFLAGS)
# since LOCAL_JAVADOC runs on ALT_BOOTDIR, the doclet and all its classes must be compiled to match
# since JAVADOC_CMD runs on ALT_BOOTDIR, the doclet and all its classes must be compiled to match
DOCLET_JAVAC_FLAGS = -source 6 -target 6
include FILES.gmk
......@@ -114,7 +113,7 @@ mkbeaninfo: $(BEANSRCDIR) .delete.beanlist $(FILES_beans) .javadoc.beanlist
.javadoc.beanlist:
if [ -s $(TEMPDIR)/.beans.list ]; \
then $(LOCAL_JAVADOC) $(DOCLETFLAGS) -x $(DEBUG_FLAG) -d $(BEANSRCDIR) -t $(DOCLETSRC)/SwingBeanInfo.template -docletpath $(DOCLETDST) \
then $(JAVADOC_CMD) $(DOCLETFLAGS) -x $(DEBUG_FLAG) -d $(BEANSRCDIR) -t $(DOCLETSRC)/SwingBeanInfo.template -docletpath $(DOCLETDST) \
$(shell if [ -s $(TEMPDIR)/.beans.list ]; then $(CAT) $(TEMPDIR)/.beans.list; fi); \
fi
@$(java-vm-cleanup)
......
......@@ -35,6 +35,7 @@ include $(BUILDDIR)/common/Defs.gmk
# Core.
#
SUBDIRS = jdwp back front transport expr tty bdi gui
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -36,6 +36,8 @@ SUBDIRS = socket
ifeq ($(PLATFORM), windows)
SUBDIRS += shmem
endif # PLATFORM
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -31,7 +31,13 @@ BUILDDIR = ..
PRODUCT = demos
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = applets jfc jvmti management jni scripting jpda
SUBDIRS = jni
SUBDIRS_desktop = applets jfc
SUBDIRS_management = management
SUBDIRS_misc = scripting
SUBDIRS_tools = jpda jvmti
include $(BUILDDIR)/common/Subdirs.gmk
all build:: nbproject
$(SUBDIRS-loop)
......
......@@ -40,6 +40,7 @@ endif
SUBDIRS_MAKEFLAGS += DEMO_IS_APPLET=true
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -46,6 +46,7 @@ ifndef OPENJDK
SUBDIRS += Java2D SwingSet2 Stylepad
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -37,6 +37,8 @@ ifeq ($(PLATFORM),solaris)
SUBDIRS += Poller
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
#
# Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2004-2010 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
......@@ -34,12 +34,13 @@ include $(BUILDDIR)/common/Defs.gmk
# Can be built in any order, the JRE version of hprof and java_crw_demo are
# really built in make/java.
# The hprof target here just deliveres the sources and README files.
# The hprof target here just delivers the sources and README files.
# The java_crw_demo and agent_util files are copied into each demo that
# uses them.
SUBDIRS = \
versionCheck \
gctest \
compiledMethodLoad \
gctest \
heapViewer \
heapTracker \
minst \
......@@ -47,6 +48,8 @@ SUBDIRS = \
waiters \
hprof
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
#
# Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2004-2010 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
......@@ -27,8 +27,8 @@ Instructions on adding a jvmti demo agent.
Basically you want to mimic the jvmti demo agent "mtrace".
* Create and populate a source directory at src/demo/jvmti
(Try and re-use code in agent_util area like src/demo/jvmti/mtrace)
* Create and populate a source directory at src/share/demo/jvmti
(Try and re-use code in agent_util area like src/share/demo/jvmti/mtrace)
(This should include a small README.txt document on what this demo is)
* Make sure the appropriate "demo" copyright notice is added to all the
......@@ -44,7 +44,7 @@ Basically you want to mimic the jvmti demo agent "mtrace".
* Create test directory at test/demo/jvmti, create at least one test
(Use test/demo/jvmti/mtrace as a template)
* Don't forget to SCCS in all the new files
* Don't forget to check in all the new files
* Build and create images (cd make && gnumake && gnumake images)
(Do this on Solaris, Linux, and at least one Windows platform)
......@@ -54,5 +54,5 @@ Basically you want to mimic the jvmti demo agent "mtrace".
* Run the tests: cd test/demo/jvmti && runregress .
(Do this on Solaris, Linux, and at least one Windows platform)
Contact: jk-svc-group@sun.com for more information or help.
Contact: serviceability-dev@openjdk.java.net for more information or help.
#
# Copyright 2010 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 = ../../..
PRODUCT = demo/jvmti
DEMONAME = compiledMethodLoad
include $(BUILDDIR)/common/Defs.gmk
DEMO_ROOT = $(SHARE_SRC)/demo/jvmti/$(DEMONAME)
DEMO_TOPFILES = ./README.txt
DEMO_DESTDIR = $(DEMODIR)/jvmti/$(DEMONAME)
DEMO_OBJECTS = agent_util.$(OBJECT_SUFFIX)
#
# Demo jar building rules.
#
include $(BUILDDIR)/common/Demo.gmk
......@@ -38,6 +38,8 @@ SUBDIRS = FullThreadDump \
MemoryMonitor \
JTop
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,7 @@ PRODUCT = demos
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = jconsole-plugin
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -37,13 +37,18 @@ else
WEBSERVICES_SUBDIR = webservices
endif
SUBDIRS = nio jmx scripting $(WEBSERVICES_SUBDIR) nbproject
SUBDIRS =
SUBDIRS_misc = nio scripting nbproject
SUBDIRS_enterprise = $(WEBSERVICES_SUBDIR)
SUBDIRS_management = jmx
# include dtrace samples in Solaris builds
ifeq ($(PLATFORM), solaris)
SUBDIRS += dtrace
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,8 @@ PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = jmx-scandir
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,8 @@ PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = file multicast server
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,8 @@ PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = scriptpad
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,7 @@ PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = EbayClient EbayServer
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -32,6 +32,7 @@ PRODUCT = org
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = ietf jcp
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -31,6 +31,8 @@ BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = jgss
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -58,13 +58,18 @@ ifdef OPENJDK
else
RENDER_SUBDIR = dcpr
endif
# nio need to be compiled before awt to have all charsets ready
SUBDIRS = jar security javazic misc jkernel net audio $(RENDER_SUBDIR) image \
nio awt splashscreen $(XAWT_SUBDIR) \
$(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
jawt text launcher management $(ORG_SUBDIR) \
native2ascii serialver tools jconsole tracing
SUBDIRS = jar security javazic misc net nio text launcher
SUBDIRS_desktop = audio $(RENDER_SUBDIR) image \
awt splashscreen $(XAWT_SUBDIR) \
$(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
jawt font jpeg cmm applet beans
SUBDIRS_management = management
SUBDIRS_misc = jkernel $(ORG_SUBDIR) \
rmi $(JDBC_SUBDIR) tracing
SUBDIRS_tools = native2ascii serialver tools jconsole
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -179,6 +179,8 @@ FILES_cpp = \
awt_Mlib.cpp \
awt_new.cpp \
awt_TrayIcon.cpp \
awt_DCHolder.cpp \
awt_ole.cpp \
ShaderList.cpp \
D3DBlitLoops.cpp \
D3DBufImgOps.cpp \
......
......@@ -250,13 +250,14 @@ ifeq ($(PLATFORM), windows)
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WINDOWS
OTHER_LDLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib \
imm32.lib ole32.lib uuid.lib shell32.lib \
comdlg32.lib winmm.lib comctl32.lib delayimp.lib \
comdlg32.lib winmm.lib comctl32.lib \
shlwapi.lib delayimp.lib \
$(JVMLIB) \
/DELAYLOAD:user32.dll /DELAYLOAD:gdi32.dll \
/DELAYLOAD:shell32.dll /DELAYLOAD:winmm.dll \
/DELAYLOAD:winspool.drv /DELAYLOAD:imm32.dll \
/DELAYLOAD:ole32.dll /DELAYLOAD:comdlg32.dll \
/DELAYLOAD:comctl32.dll
/DELAYLOAD:comctl32.dll /DELAYLOAD:shlwapi.dll
clean:: awt.clean
......
此差异已折叠。
......@@ -36,6 +36,8 @@ else # !OPENJDK
ICCPROFILE_SRC_DIR = $(CLOSED_SRC)/share/lib/cmm/kcms
endif # OPENJDK
include $(BUILDDIR)/common/Subdirs.gmk
#
# ICC Profiles used by the CMM.
#
......
......@@ -43,6 +43,8 @@ ifeq ($(PLATFORM),solaris)
endif
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -47,6 +47,8 @@ else
endif
SUBDIRS += jmxremote
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -29,6 +29,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = others spi
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -26,7 +26,9 @@
BUILDDIR = ../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = nameservice
SUBDIRS_misc = nameservice
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -27,6 +27,8 @@ BUILDDIR = ../../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dns
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -29,6 +29,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = cs
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -32,6 +32,8 @@ PRODUCT = org
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = mozilla
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -32,6 +32,8 @@ PRODUCT = org
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = javascript
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......@@ -43,6 +43,8 @@ ifeq ($(PLATFORM), windows)
SUBDIRS += cgi
endif # PLATFORM
include $(BUILDDIR)/common/Subdirs.gmk
# Then do the rest
all build clean clobber ::
$(SUBDIRS-loop)
......
......@@ -67,8 +67,10 @@ ifdef DISABLE_INTREE_EC
INTREE_EC =
endif
SUBDIRS = $(INTREE_EC) other action util tools jgss krb5 smartcardio \
$(PKCS11) $(JGSS_WRAPPER) $(MSCAPI)
SUBDIRS = $(INTREE_EC) other action util krb5
SUBDIRS_misc = jgss $(PKCS11) $(JGSS_WRAPPER) $(MSCAPI) smartcardio
SUBDIRS_tools = tools
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -33,6 +33,8 @@ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dtrace
include $(BUILDDIR)/common/Subdirs.gmk
all build:
$(SUBDIRS-loop)
clean clobber::
......
......@@ -56,6 +56,8 @@ ifndef DISABLE_NIMBUS
SUBDIRS += generate_nimbus
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
......
......@@ -27,7 +27,6 @@ package com.sun.java.util.jar.pack;
import java.io.*;
import java.util.*;
import java.util.logging.Level;
import com.sun.java.util.jar.pack.Package.Class;
import com.sun.java.util.jar.pack.Package.File;
import com.sun.java.util.jar.pack.Package.InnerClass;
......@@ -162,7 +161,7 @@ class PackageReader extends BandStructure {
ok = true;
} catch (Exception ee) {
Utils.log.log(Level.WARNING, "Error on input: "+ee, ee);
Utils.log.warning("Error on input: "+ee, ee);
if (verbose > 0)
Utils.log.info("Stream offsets:"+
" served="+in.getBytesServed()+
......
......@@ -27,7 +27,6 @@ package com.sun.java.util.jar.pack;
import java.io.*;
import java.util.*;
import java.util.logging.Level;
import com.sun.java.util.jar.pack.Package.Class;
import com.sun.java.util.jar.pack.Package.File;
import com.sun.java.util.jar.pack.Package.InnerClass;
......@@ -84,7 +83,7 @@ class PackageWriter extends BandStructure {
ok = true;
} catch (Exception ee) {
Utils.log.log(Level.WARNING, "Error on output: "+ee, ee);
Utils.log.warning("Error on output: "+ee, ee);
//if (verbose > 0) ee.printStackTrace();
// Write partial output only if we are verbose.
if (verbose > 0) finalOut.close();
......
......@@ -28,9 +28,10 @@ package com.sun.java.util.jar.pack;
import java.util.*;
import java.util.jar.*;
import java.util.zip.*;
import java.util.logging.*;
import java.io.*;
import sun.util.logging.PlatformLogger;
class Utils {
static final String COM_PREFIX = "com.sun.java.util.jar.pack.";
static final String METAINF = "META-INF";
......@@ -130,31 +131,53 @@ class Utils {
= Boolean.getBoolean(Utils.COM_PREFIX+"nolog");
static final Logger log
= new Logger("java.util.jar.Pack200", null) {
public void log(LogRecord record) {
int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
if (verbose > 0) {
if (nolog &&
record.getLevel().intValue() < Level.WARNING.intValue()) {
System.out.println(record.getMessage());
} else {
super.log(record);
}
}
static class Pack200Logger {
private final String name;
private PlatformLogger log;
Pack200Logger(String name) {
this.name = name;
}
private synchronized PlatformLogger getLogger() {
if (log == null) {
log = PlatformLogger.getLogger(name);
}
return log;
}
public void warning(String msg, Object param) {
int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
if (verbose > 0) {
getLogger().warning(msg, param);
}
}
public void fine(String msg) {
int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
if (verbose > 0) {
System.out.println(msg);
public void warning(String msg) {
warning(msg, null);
}
public void info(String msg) {
int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
if (verbose > 0) {
if (nolog) {
System.out.println(msg);
} else {
getLogger().info(msg);
}
}
};
static {
LogManager.getLogManager().addLogger(log);
}
public void fine(String msg) {
int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
if (verbose > 0) {
System.out.println(msg);
}
}
}
static final Pack200Logger log
= new Pack200Logger("java.util.jar.Pack200");
// Returns the Max Version String of this implementation
static String getVersionString() {
return "Pack200, Vendor: Sun Microsystems, Version: " +
......
......@@ -28,6 +28,8 @@ import java.awt.peer.FileDialogPeer;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.File;
import sun.awt.AWTAccessor;
/**
* The <code>FileDialog</code> class displays a dialog window
......@@ -93,6 +95,25 @@ public class FileDialog extends Dialog {
*/
String file;
/**
* Contains the File instances for all the files that the user selects.
*
* @serial
* @see getFiles
* @since 1.7
*/
private File[] files;
/**
* Represents whether the file dialog allows the multiple file selection.
*
* @serial
* @see #setMultipleMode
* @see #isMultipleMode
* @since 1.7
*/
private boolean multipleMode = false;
/*
* The filter used as the file dialog's filename filter.
* The file dialog will only be displaying files whose
......@@ -123,6 +144,26 @@ public class FileDialog extends Dialog {
}
}
static {
AWTAccessor.setFileDialogAccessor(
new AWTAccessor.FileDialogAccessor() {
public void setFiles(FileDialog fileDialog, String directory, String files[]) {
fileDialog.setFiles(directory, files);
}
public void setFile(FileDialog fileDialog, String file) {
fileDialog.file = ("".equals(file)) ? null : file;
}
public void setDirectory(FileDialog fileDialog, String directory) {
fileDialog.dir = ("".equals(directory)) ? null : directory;
}
public boolean isMultipleMode(FileDialog fileDialog) {
synchronized (fileDialog.getObjectLock()) {
return fileDialog.multipleMode;
}
}
});
}
/**
* Initialize JNI field and method IDs for fields that may be
accessed from C.
......@@ -370,6 +411,51 @@ public class FileDialog extends Dialog {
return file;
}
/**
* Returns files that the user selects.
* <p>
* If the user cancels the file dialog,
* then the method returns an empty array.
*
* @return files that the user selects or an empty array
* if the user cancels the file dialog.
* @see #setFile(String)
* @see #getFile
* @since 1.7
*/
public File[] getFiles() {
synchronized (getObjectLock()) {
if (files != null) {
return files.clone();
} else {
return new File[0];
}
}
}
/**
* Stores the names of all the files that the user selects.
*
* Note that the method is private and it's intended to be used
* by the peers through the AWTAccessor API.
*
* @param directory the current directory
* @param files the array that contains the short names of
* all the files that the user selects.
*
* @see #getFiles
* @since 1.7
*/
private void setFiles(String directory, String files[]) {
synchronized (getObjectLock()) {
int filesNumber = (files != null) ? files.length : 0;
this.files = new File[filesNumber];
for (int i = 0; i < filesNumber; i++) {
this.files[i] = new File(directory, files[i]);
}
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
......@@ -380,7 +466,8 @@ public class FileDialog extends Dialog {
* as the file.
*
* @param file the file being set
* @see java.awt.FileDialog#getFile
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
......@@ -390,6 +477,34 @@ public class FileDialog extends Dialog {
}
}
/**
* Enables or disables multiple file selection for the file dialog.
*
* @param enable if {@code true}, multiple file selection is enabled;
* {@code false} - disabled.
* @see #isMultipleMode
* @since 1.7
*/
public void setMultipleMode(boolean enable) {
synchronized (getObjectLock()) {
this.multipleMode = enable;
}
}
/**
* Returns whether the file dialog allows the multiple file selection.
*
* @return {@code true} if the file dialog allows the multiple
* file selection; {@code false} otherwise.
* @see #setMultipleMode
* @since 1.7
*/
public boolean isMultipleMode() {
synchronized (getObjectLock()) {
return multipleMode;
}
}
/**
* Determines this file dialog's filename filter. A filename filter
* allows the user to specify which files appear in the file dialog
......
......@@ -110,7 +110,7 @@ public abstract class GraphicsEnvironment {
// long t1 = System.currentTimeMillis();
// System.out.println("GE creation took " + (t1-t0)+ "ms.");
if (isHeadless()) {
localEnv = new HeadlessGraphicsEnvironment(localEnv);
ge = new HeadlessGraphicsEnvironment(ge);
}
} catch (ClassNotFoundException e) {
throw new Error("Could not find class: "+nm);
......
/*
* Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-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
......@@ -663,15 +663,23 @@ public class PKIXParameters implements CertPathParameters {
*/
public Object clone() {
try {
Object copy = super.clone();
// Must clone these because addCertStore, et al. modify them
PKIXParameters copy = (PKIXParameters)super.clone();
// must clone these because addCertStore, et al. modify them
if (certStores != null) {
certStores = new ArrayList<CertStore>(certStores);
copy.certStores = new ArrayList<CertStore>(certStores);
}
if (certPathCheckers != null) {
certPathCheckers =
new ArrayList<PKIXCertPathChecker>(certPathCheckers);
copy.certPathCheckers =
new ArrayList<PKIXCertPathChecker>(certPathCheckers.size());
for (PKIXCertPathChecker checker : certPathCheckers) {
copy.certPathCheckers.add(
(PKIXCertPathChecker)checker.clone());
}
}
// other class fields are immutable to public, don't bother
// to clone the read-only fields.
return copy;
} catch (CloneNotSupportedException e) {
/* Cannot happen */
......
......@@ -860,6 +860,14 @@ public final class Pattern
*/
private transient int patternLength;
/**
* If the Start node might possibly match supplementary characters.
* It is set to true during compiling if
* (1) There is supplementary char in pattern, or
* (2) There is complement node of Category or Block
*/
private transient boolean hasSupplementary;
/**
* Compiles the given regular expression into a pattern. </p>
*
......@@ -1481,7 +1489,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
// Use double zero to terminate pattern
temp = new int[patternLength + 2];
boolean hasSupplementary = false;
hasSupplementary = false;
int c, count = 0;
// Convert all chars into code points
for (int x = 0; x < patternLength; x += Character.charCount(c)) {
......@@ -1787,7 +1795,8 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
* character or unpaired surrogate.
*/
private static final boolean isSupplementary(int ch) {
return ch >= Character.MIN_SUPPLEMENTARY_CODE_POINT || isSurrogate(ch);
return ch >= Character.MIN_SUPPLEMENTARY_CODE_POINT ||
Character.isSurrogate((char)ch);
}
/**
......@@ -1885,7 +1894,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
} else {
oneLetter = false;
}
node = family(oneLetter).maybeComplement(comp);
node = family(oneLetter, comp);
} else {
unread();
node = atom();
......@@ -2001,7 +2010,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
unread();
else
oneLetter = false;
return family(oneLetter).maybeComplement(comp);
return family(oneLetter, comp);
}
}
unread();
......@@ -2404,7 +2413,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
unread();
else
oneLetter = false;
return family(oneLetter).maybeComplement(comp);
return family(oneLetter, comp);
} else { // ordinary escape
unread();
ch = escape(true, true);
......@@ -2450,9 +2459,12 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
/**
* Parses a Unicode character family and returns its representative node.
*/
private CharProperty family(boolean singleLetter) {
private CharProperty family(boolean singleLetter,
boolean maybeComplement)
{
next();
String name;
CharProperty node;
if (singleLetter) {
int c = temp[cursor];
......@@ -2477,12 +2489,18 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
}
if (name.startsWith("In")) {
return unicodeBlockPropertyFor(name.substring(2));
node = unicodeBlockPropertyFor(name.substring(2));
} else {
if (name.startsWith("Is"))
name = name.substring(2);
return charPropertyNodeFor(name);
node = charPropertyNodeFor(name);
}
if (maybeComplement) {
if (node instanceof Category || node instanceof Block)
hasSupplementary = true;
node = node.complement();
}
return node;
}
/**
......@@ -2495,9 +2513,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
} catch (IllegalArgumentException iae) {
throw error("Unknown character block name {" + name + "}");
}
return new CharProperty() {
boolean isSatisfiedBy(int ch) {
return block == Character.UnicodeBlock.of(ch);}};
return new Block(block);
}
/**
......@@ -2968,13 +2984,6 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
// Utility methods for code point support
//
/**
* Tests a surrogate value.
*/
private static final boolean isSurrogate(int c) {
return c >= Character.MIN_HIGH_SURROGATE && c <= Character.MAX_LOW_SURROGATE;
}
private static final int countChars(CharSequence seq, int index,
int lengthInCodePoints) {
// optimization
......@@ -3174,20 +3183,17 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
matcher.hitEnd = true;
return false;
}
boolean ret = false;
int guard = matcher.to - minLength;
for (; i <= guard; i++) {
if (ret = next.match(matcher, i, seq))
break;
if (i == guard)
matcher.hitEnd = true;
}
if (ret) {
matcher.first = i;
matcher.groups[0] = matcher.first;
matcher.groups[1] = matcher.last;
if (next.match(matcher, i, seq)) {
matcher.first = i;
matcher.groups[0] = matcher.first;
matcher.groups[1] = matcher.last;
return true;
}
}
return ret;
matcher.hitEnd = true;
return false;
}
boolean study(TreeInfo info) {
next.study(info);
......@@ -3209,27 +3215,28 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
matcher.hitEnd = true;
return false;
}
boolean ret = false;
int guard = matcher.to - minLength;
while (i <= guard) {
if ((ret = next.match(matcher, i, seq)) || i == guard)
//if ((ret = next.match(matcher, i, seq)) || i == guard)
if (next.match(matcher, i, seq)) {
matcher.first = i;
matcher.groups[0] = matcher.first;
matcher.groups[1] = matcher.last;
return true;
}
if (i == guard)
break;
// Optimization to move to the next character. This is
// faster than countChars(seq, i, 1).
if (Character.isHighSurrogate(seq.charAt(i++))) {
if (i < seq.length() && Character.isLowSurrogate(seq.charAt(i))) {
if (i < seq.length() &&
Character.isLowSurrogate(seq.charAt(i))) {
i++;
}
}
if (i == guard)
matcher.hitEnd = true;
}
if (ret) {
matcher.first = i;
matcher.groups[0] = matcher.first;
matcher.groups[1] = matcher.last;
}
return ret;
matcher.hitEnd = true;
return false;
}
}
......@@ -3461,9 +3468,6 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
boolean isSatisfiedBy(int ch) {
return ! CharProperty.this.isSatisfiedBy(ch);}};
}
CharProperty maybeComplement(boolean complement) {
return complement ? complement() : this;
}
boolean match(Matcher matcher, int i, CharSequence seq) {
if (i < matcher.to) {
int ch = Character.codePointAt(seq, i);
......@@ -3548,6 +3552,20 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
}
}
/**
* Node class that matches a Unicode block.
*/
static final class Block extends CharProperty {
final Character.UnicodeBlock block;
Block(Character.UnicodeBlock block) {
this.block = block;
}
boolean isSatisfiedBy(int ch) {
return block == Character.UnicodeBlock.of(ch);
}
}
/**
* Node class that matches a Unicode category.
*/
......
/*
* Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-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
......@@ -627,6 +627,69 @@ public class TransferHandler implements Serializable {
this(null);
}
/**
* image for the {@code startDrag} method
*
* @see java.awt.dnd.DragGestureEvent#startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl)
*/
private Image dragImage;
/**
* anchor offset for the {@code startDrag} method
*
* @see java.awt.dnd.DragGestureEvent#startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl)
*/
private Point dragImageOffset;
/**
* Sets the drag image parameter. The image has to be prepared
* for rendering by the moment of the call. The image is stored
* by reference because of some performance reasons.
*
* @param img an image to drag
*/
public void setDragImage(Image img) {
dragImage = img;
}
/**
* Returns the drag image. If there is no image to drag,
* the returned value is {@code null}.
*
* @return the reference to the drag image
*/
public Image getDragImage() {
return dragImage;
}
/**
* Sets an anchor offset for the image to drag.
* It can not be {@code null}.
*
* @param p a {@code Point} object that corresponds
* to coordinates of an anchor offset of the image
* relative to the upper left corner of the image
*/
public void setDragImageOffset(Point p) {
dragImageOffset = new Point(p);
}
/**
* Returns an anchor offset for the image to drag.
*
* @return a {@code Point} object that corresponds
* to coordinates of an anchor offset of the image
* relative to the upper left corner of the image.
* The point {@code (0,0)} returns by default.
*/
public Point getDragImageOffset() {
if (dragImageOffset == null) {
return new Point(0,0);
}
return new Point(dragImageOffset);
}
/**
* Causes the Swing drag support to be initiated. This is called by
* the various UI implementations in the <code>javax.swing.plaf.basic</code>
......@@ -1522,7 +1585,12 @@ public class TransferHandler implements Serializable {
scrolls = c.getAutoscrolls();
c.setAutoscrolls(false);
try {
dge.startDrag(null, t, this);
Image im = th.getDragImage();
if (im == null) {
dge.startDrag(null, t, this);
} else {
dge.startDrag(null, im, th.getDragImageOffset(), t, this);
}
return;
} catch (RuntimeException re) {
c.setAutoscrolls(scrolls);
......
......@@ -390,6 +390,30 @@ public final class AWTAccessor {
boolean isTrayIconPopup(PopupMenu popupMenu);
}
/*
* An accessor for the FileDialog class
*/
public interface FileDialogAccessor {
/*
* Sets the files the user selects
*/
void setFiles(FileDialog fileDialog, String directory, String files[]);
/*
* Sets the file the user selects
*/
void setFile(FileDialog fileDialog, String file);
/*
* Sets the directory the user selects
*/
void setDirectory(FileDialog fileDialog, String directory);
/*
* Returns whether the file dialog allows the multiple file selection.
*/
boolean isMultipleMode(FileDialog fileDialog);
}
/*
* The java.awt.Component class accessor object.
......@@ -431,6 +455,11 @@ public final class AWTAccessor {
*/
private static PopupMenuAccessor popupMenuAccessor;
/*
* The java.awt.FileDialog class accessor object.
*/
private static FileDialogAccessor fileDialogAccessor;
/*
* Set an accessor object for the java.awt.Component class.
*/
......@@ -567,4 +596,22 @@ public final class AWTAccessor {
}
return popupMenuAccessor;
}
/*
* Set an accessor object for the java.awt.FileDialog class.
*/
public static void setFileDialogAccessor(FileDialogAccessor fda) {
fileDialogAccessor = fda;
}
/*
* Retrieve the accessor object for the java.awt.FileDialog class.
*/
public static FileDialogAccessor getFileDialogAccessor() {
if (fileDialogAccessor == null) {
unsafe.ensureClassInitialized(FileDialog.class);
}
return fileDialogAccessor;
}
}
......@@ -13,7 +13,7 @@ public class ExtendedKeyCodes {
*/
// Keycodes declared in KeyEvent.java with corresponding Unicode values.
private final static HashMap<Integer, Integer> regularKeyCodesMap =
new HashMap<Integer,Integer>(122, 1.0f);
new HashMap<Integer,Integer>(83, 1.0f);
// Keycodes derived from Unicode values. Here should be collected codes
// for characters appearing on the primary layer of at least one
......@@ -22,7 +22,6 @@ public class ExtendedKeyCodes {
private final static HashSet<Integer> extendedKeyCodesSet =
new HashSet<Integer>(501, 1.0f);
final public static int getExtendedKeyCodeForChar( int c ) {
int rc = KeyEvent.VK_UNDEFINED;
int uc = Character.toUpperCase( c );
int lc = Character.toLowerCase( c );
if (regularKeyCodesMap.containsKey( c )) {
......@@ -38,22 +37,25 @@ public class ExtendedKeyCodes {
}else if (extendedKeyCodesSet.contains( lc )) {
return lc;
}
return rc;
return KeyEvent.VK_UNDEFINED;
}
static {
regularKeyCodesMap.put(0x0a, KeyEvent.VK_ENTER);
regularKeyCodesMap.put(0x08, KeyEvent.VK_BACK_SPACE);
regularKeyCodesMap.put(0x09, KeyEvent.VK_TAB);
regularKeyCodesMap.put(0x0a, KeyEvent.VK_ENTER);
regularKeyCodesMap.put(0x1B, KeyEvent.VK_ESCAPE);
regularKeyCodesMap.put(0x20AC, KeyEvent.VK_EURO_SIGN);
regularKeyCodesMap.put(0x20, KeyEvent.VK_SPACE);
regularKeyCodesMap.put(0x21, KeyEvent.VK_PAGE_UP);
regularKeyCodesMap.put(0x22, KeyEvent.VK_PAGE_DOWN);
regularKeyCodesMap.put(0x23, KeyEvent.VK_END);
regularKeyCodesMap.put(0x24, KeyEvent.VK_HOME);
regularKeyCodesMap.put(0x25, KeyEvent.VK_LEFT);
regularKeyCodesMap.put(0x26, KeyEvent.VK_UP);
regularKeyCodesMap.put(0x27, KeyEvent.VK_RIGHT);
regularKeyCodesMap.put(0x28, KeyEvent.VK_DOWN);
regularKeyCodesMap.put(0x21, KeyEvent.VK_EXCLAMATION_MARK);
regularKeyCodesMap.put(0x22, KeyEvent.VK_QUOTEDBL);
regularKeyCodesMap.put(0x23, KeyEvent.VK_NUMBER_SIGN);
regularKeyCodesMap.put(0x24, KeyEvent.VK_DOLLAR);
regularKeyCodesMap.put(0x26, KeyEvent.VK_AMPERSAND);
regularKeyCodesMap.put(0x27, KeyEvent.VK_QUOTE);
regularKeyCodesMap.put(0x28, KeyEvent.VK_LEFT_PARENTHESIS);
regularKeyCodesMap.put(0x29, KeyEvent.VK_RIGHT_PARENTHESIS);
regularKeyCodesMap.put(0x2A, KeyEvent.VK_ASTERISK);
regularKeyCodesMap.put(0x2B, KeyEvent.VK_PLUS);
regularKeyCodesMap.put(0x2C, KeyEvent.VK_COMMA);
regularKeyCodesMap.put(0x2D, KeyEvent.VK_MINUS);
regularKeyCodesMap.put(0x2E, KeyEvent.VK_PERIOD);
......@@ -68,102 +70,59 @@ public class ExtendedKeyCodes {
regularKeyCodesMap.put(0x37, KeyEvent.VK_7);
regularKeyCodesMap.put(0x38, KeyEvent.VK_8);
regularKeyCodesMap.put(0x39, KeyEvent.VK_9);
regularKeyCodesMap.put(0x3A, KeyEvent.VK_COLON);
regularKeyCodesMap.put(0x3B, KeyEvent.VK_SEMICOLON);
regularKeyCodesMap.put(0x3C, KeyEvent.VK_LESS);
regularKeyCodesMap.put(0x3D, KeyEvent.VK_EQUALS);
regularKeyCodesMap.put(0x3E, KeyEvent.VK_GREATER);
regularKeyCodesMap.put(0x40, KeyEvent.VK_AT);
regularKeyCodesMap.put(0x41, KeyEvent.VK_A);
regularKeyCodesMap.put(0x61, KeyEvent.VK_A);
regularKeyCodesMap.put(0x42, KeyEvent.VK_B);
regularKeyCodesMap.put(0x62, KeyEvent.VK_B);
regularKeyCodesMap.put(0x43, KeyEvent.VK_C);
regularKeyCodesMap.put(0x63, KeyEvent.VK_C);
regularKeyCodesMap.put(0x44, KeyEvent.VK_D);
regularKeyCodesMap.put(0x64, KeyEvent.VK_D);
regularKeyCodesMap.put(0x45, KeyEvent.VK_E);
regularKeyCodesMap.put(0x65, KeyEvent.VK_E);
regularKeyCodesMap.put(0x46, KeyEvent.VK_F);
regularKeyCodesMap.put(0x66, KeyEvent.VK_F);
regularKeyCodesMap.put(0x47, KeyEvent.VK_G);
regularKeyCodesMap.put(0x67, KeyEvent.VK_G);
regularKeyCodesMap.put(0x48, KeyEvent.VK_H);
regularKeyCodesMap.put(0x68, KeyEvent.VK_H);
regularKeyCodesMap.put(0x49, KeyEvent.VK_I);
regularKeyCodesMap.put(0x69, KeyEvent.VK_I);
regularKeyCodesMap.put(0x4A, KeyEvent.VK_J);
regularKeyCodesMap.put(0x6A, KeyEvent.VK_J);
regularKeyCodesMap.put(0x4B, KeyEvent.VK_K);
regularKeyCodesMap.put(0x6B, KeyEvent.VK_K);
regularKeyCodesMap.put(0x4C, KeyEvent.VK_L);
regularKeyCodesMap.put(0x6C, KeyEvent.VK_L);
regularKeyCodesMap.put(0x4D, KeyEvent.VK_M);
regularKeyCodesMap.put(0x6D, KeyEvent.VK_M);
regularKeyCodesMap.put(0x4E, KeyEvent.VK_N);
regularKeyCodesMap.put(0x6E, KeyEvent.VK_N);
regularKeyCodesMap.put(0x4F, KeyEvent.VK_O);
regularKeyCodesMap.put(0x6F, KeyEvent.VK_O);
regularKeyCodesMap.put(0x50, KeyEvent.VK_P);
regularKeyCodesMap.put(0x70, KeyEvent.VK_P);
regularKeyCodesMap.put(0x51, KeyEvent.VK_Q);
regularKeyCodesMap.put(0x71, KeyEvent.VK_Q);
regularKeyCodesMap.put(0x52, KeyEvent.VK_R);
regularKeyCodesMap.put(0x72, KeyEvent.VK_R);
regularKeyCodesMap.put(0x53, KeyEvent.VK_S);
regularKeyCodesMap.put(0x73, KeyEvent.VK_S);
regularKeyCodesMap.put(0x54, KeyEvent.VK_T);
regularKeyCodesMap.put(0x74, KeyEvent.VK_T);
regularKeyCodesMap.put(0x55, KeyEvent.VK_U);
regularKeyCodesMap.put(0x75, KeyEvent.VK_U);
regularKeyCodesMap.put(0x56, KeyEvent.VK_V);
regularKeyCodesMap.put(0x76, KeyEvent.VK_V);
regularKeyCodesMap.put(0x57, KeyEvent.VK_W);
regularKeyCodesMap.put(0x77, KeyEvent.VK_W);
regularKeyCodesMap.put(0x58, KeyEvent.VK_X);
regularKeyCodesMap.put(0x78, KeyEvent.VK_X);
regularKeyCodesMap.put(0x59, KeyEvent.VK_Y);
regularKeyCodesMap.put(0x79, KeyEvent.VK_Y);
regularKeyCodesMap.put(0x5A, KeyEvent.VK_Z);
regularKeyCodesMap.put(0x7A, KeyEvent.VK_Z);
regularKeyCodesMap.put(0x5B, KeyEvent.VK_OPEN_BRACKET);
regularKeyCodesMap.put(0x5C, KeyEvent.VK_BACK_SLASH);
regularKeyCodesMap.put(0x5D, KeyEvent.VK_CLOSE_BRACKET);
// regularKeyCodesMap.put(0x60, KeyEvent.VK_NUMPAD0);
// regularKeyCodesMap.put(0x61, KeyEvent.VK_NUMPAD1);
// regularKeyCodesMap.put(0x62, KeyEvent.VK_NUMPAD2);
// regularKeyCodesMap.put(0x63, KeyEvent.VK_NUMPAD3);
// regularKeyCodesMap.put(0x64, KeyEvent.VK_NUMPAD4);
// regularKeyCodesMap.put(0x65, KeyEvent.VK_NUMPAD5);
// regularKeyCodesMap.put(0x66, KeyEvent.VK_NUMPAD6);
// regularKeyCodesMap.put(0x67, KeyEvent.VK_NUMPAD7);
// regularKeyCodesMap.put(0x68, KeyEvent.VK_NUMPAD8);
// regularKeyCodesMap.put(0x69, KeyEvent.VK_NUMPAD9);
regularKeyCodesMap.put(0x6A, KeyEvent.VK_MULTIPLY);
regularKeyCodesMap.put(0x6B, KeyEvent.VK_ADD);
regularKeyCodesMap.put(0x6C, KeyEvent.VK_SEPARATER);
regularKeyCodesMap.put(0x6D, KeyEvent.VK_SUBTRACT);
regularKeyCodesMap.put(0x6E, KeyEvent.VK_DECIMAL);
regularKeyCodesMap.put(0x6F, KeyEvent.VK_DIVIDE);
regularKeyCodesMap.put(0x7F, KeyEvent.VK_DELETE);
regularKeyCodesMap.put(0xC0, KeyEvent.VK_BACK_QUOTE);
regularKeyCodesMap.put(0xDE, KeyEvent.VK_QUOTE);
regularKeyCodesMap.put(0x26, KeyEvent.VK_AMPERSAND);
regularKeyCodesMap.put(0x2A, KeyEvent.VK_ASTERISK);
regularKeyCodesMap.put(0x22, KeyEvent.VK_QUOTEDBL);
regularKeyCodesMap.put(0x3C, KeyEvent.VK_LESS);
regularKeyCodesMap.put(0x3E, KeyEvent.VK_GREATER);
regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX);
regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE);
regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE);
regularKeyCodesMap.put(0x70, KeyEvent.VK_P);
regularKeyCodesMap.put(0x71, KeyEvent.VK_Q);
regularKeyCodesMap.put(0x72, KeyEvent.VK_R);
regularKeyCodesMap.put(0x73, KeyEvent.VK_S);
regularKeyCodesMap.put(0x74, KeyEvent.VK_T);
regularKeyCodesMap.put(0x75, KeyEvent.VK_U);
regularKeyCodesMap.put(0x76, KeyEvent.VK_V);
regularKeyCodesMap.put(0x77, KeyEvent.VK_W);
regularKeyCodesMap.put(0x78, KeyEvent.VK_X);
regularKeyCodesMap.put(0x79, KeyEvent.VK_Y);
regularKeyCodesMap.put(0x7A, KeyEvent.VK_Z);
regularKeyCodesMap.put(0x7B, KeyEvent.VK_BRACELEFT);
regularKeyCodesMap.put(0x7D, KeyEvent.VK_BRACERIGHT);
regularKeyCodesMap.put(0x40, KeyEvent.VK_AT);
regularKeyCodesMap.put(0x3A, KeyEvent.VK_COLON);
regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX);
regularKeyCodesMap.put(0x24, KeyEvent.VK_DOLLAR);
regularKeyCodesMap.put(0x20AC, KeyEvent.VK_EURO_SIGN);
regularKeyCodesMap.put(0x21, KeyEvent.VK_EXCLAMATION_MARK);
regularKeyCodesMap.put(0x7F, KeyEvent.VK_DELETE);
regularKeyCodesMap.put(0xA1, KeyEvent.VK_INVERTED_EXCLAMATION_MARK);
regularKeyCodesMap.put(0x28, KeyEvent.VK_LEFT_PARENTHESIS);
regularKeyCodesMap.put(0x23, KeyEvent.VK_NUMBER_SIGN);
regularKeyCodesMap.put(0x2B, KeyEvent.VK_PLUS);
regularKeyCodesMap.put(0x29, KeyEvent.VK_RIGHT_PARENTHESIS);
regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE);
extendedKeyCodesSet.add(0x01000000+0x0060);
extendedKeyCodesSet.add(0x01000000+0x007C);
......
/*
* Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-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
......@@ -67,6 +67,8 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer
private DragGestureEvent trigger;
private Component component;
private Cursor cursor;
private Image dragImage;
private Point dragImageOffset;
private long nativeCtxt;
private DragSourceContext dragSourceContext;
private int sourceActions;
......@@ -120,6 +122,8 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer
dragSourceContext = dsc;
cursor = c;
sourceActions = getDragSourceContext().getSourceActions();
dragImage = di;
dragImageOffset = p;
Transferable transferable = getDragSourceContext().getTransferable();
SortedMap formatMap = DataTransferer.getInstance().getFormatsForTransferable
......@@ -168,6 +172,31 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer
return cursor;
}
/**
* Returns the drag image. If there is no image to drag,
* the returned value is {@code null}
*
* @return the reference to the drag image
*/
public Image getDragImage() {
return dragImage;
}
/**
* Returns an anchor offset for the image to drag.
*
* @return a {@code Point} object that corresponds
* to coordinates of an anchor offset of the image
* relative to the upper left corner of the image.
* The point {@code (0,0)} returns by default.
*/
public Point getDragImageOffset() {
if (dragImageOffset == null) {
return new Point(0,0);
}
return new Point(dragImageOffset);
}
/**
* downcall into native code
*/
......@@ -317,6 +346,8 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer
startSecondaryEventLoop();
setNativeContext(0);
dragImage = null;
dragImageOffset = null;
}
public static void setDragDropInProgress(boolean b)
......
......@@ -68,38 +68,34 @@ public final class FontManagerFactory {
return instance;
}
String fmClassName = AccessController.doPrivileged(
new GetPropertyAction("sun.font.fontmanager",
DEFAULT_CLASS));
try {
@SuppressWarnings("unchecked")
ClassLoader cl = (ClassLoader)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return ClassLoader.getSystemClassLoader();
}
});
@SuppressWarnings("unchecked")
Class fmClass = Class.forName(fmClassName, true, cl);
instance = (FontManager) fmClass.newInstance();
} catch (ClassNotFoundException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
} catch (InstantiationException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
} catch (IllegalAccessException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
}
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
String fmClassName =
System.getProperty("sun.font.fontmanager",
DEFAULT_CLASS);
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class fmClass = Class.forName(fmClassName, true, cl);
instance = (FontManager) fmClass.newInstance();
} catch (ClassNotFoundException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
} catch (InstantiationException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
} catch (IllegalAccessException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
}
return null;
}
});
return instance;
}
......
......@@ -32,9 +32,9 @@ import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.swing.plaf.FontUIResource;
import sun.security.action.GetPropertyAction;
import sun.util.logging.PlatformLogger;
/**
......@@ -42,79 +42,82 @@ import sun.util.logging.PlatformLogger;
*/
public final class FontUtilities {
public static final boolean isSolaris;
public static boolean isSolaris;
public static final boolean isLinux;
public static boolean isLinux;
public static final boolean isSolaris8;
public static boolean isSolaris8;
public static final boolean isSolaris9;
public static boolean isSolaris9;
public static final boolean isOpenSolaris;
public static boolean isOpenSolaris;
public static final boolean useT2K;
public static boolean useT2K;
public static final boolean isWindows;
public static boolean isWindows;
public static final boolean isOpenJDK;
public static boolean isOpenJDK;
static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf";
// This static initializer block figures out the OS constants.
static {
String osName = AccessController.doPrivileged(
new GetPropertyAction("os.name", "unknownOS"));
isSolaris = osName.startsWith("SunOS");
AccessController.doPrivileged(new PrivilegedAction () {
public Object run() {
String osName = System.getProperty("os.name", "unknownOS");
isSolaris = osName.startsWith("SunOS");
isLinux = osName.startsWith("Linux");
isLinux = osName.startsWith("Linux");
String t2kStr = AccessController.doPrivileged(
new GetPropertyAction("sun.java2d.font.scaler"));
if (t2kStr != null) {
useT2K = "t2k".equals(t2kStr);
} else {
useT2K = false;
}
if (isSolaris) {
String version = AccessController.doPrivileged(
new GetPropertyAction("os.version", "0.0"));
isSolaris8 = version.startsWith("5.8");
isSolaris9 = version.startsWith("5.9");
float ver = Float.parseFloat(version);
if (ver > 5.10f) {
File f = new File("/etc/release");
String line = null;
try {
FileInputStream fis = new FileInputStream(f);
InputStreamReader isr = new InputStreamReader(
fis, "ISO-8859-1");
BufferedReader br = new BufferedReader(isr);
line = br.readLine();
fis.close();
} catch (Exception ex) {
// Nothing to do here.
String t2kStr = System.getProperty("sun.java2d.font.scaler");
if (t2kStr != null) {
useT2K = "t2k".equals(t2kStr);
} else {
useT2K = false;
}
if (line != null && line.indexOf("OpenSolaris") >= 0) {
isOpenSolaris = true;
if (isSolaris) {
String version = System.getProperty("os.version", "0.0");
isSolaris8 = version.startsWith("5.8");
isSolaris9 = version.startsWith("5.9");
float ver = Float.parseFloat(version);
if (ver > 5.10f) {
File f = new File("/etc/release");
String line = null;
try {
FileInputStream fis = new FileInputStream(f);
InputStreamReader isr = new InputStreamReader(
fis, "ISO-8859-1");
BufferedReader br = new BufferedReader(isr);
line = br.readLine();
fis.close();
} catch (Exception ex) {
// Nothing to do here.
}
if (line != null && line.indexOf("OpenSolaris") >= 0) {
isOpenSolaris = true;
} else {
isOpenSolaris = false;
}
} else {
isOpenSolaris = false;
}
} else {
isSolaris8 = false;
isSolaris9 = false;
isOpenSolaris = false;
}
} else {
isOpenSolaris= false;
isWindows = osName.startsWith("Windows");
String jreLibDirName = System.getProperty("java.home", "")
+ File.separator + "lib";
String jreFontDirName =
jreLibDirName + File.separator + "fonts";
File lucidaFile = new File(jreFontDirName + File.separator
+ LUCIDA_FILE_NAME);
isOpenJDK = !lucidaFile.exists();
return null;
}
} else {
isSolaris8 = false;
isSolaris9 = false;
isOpenSolaris = false;
}
isWindows = osName.startsWith("Windows");
String jreLibDirName = AccessController.doPrivileged(
new GetPropertyAction("java.home","")) + File.separator + "lib";
String jreFontDirName = jreLibDirName + File.separator + "fonts";
File lucidaFile =
new File(jreFontDirName + File.separator + LUCIDA_FILE_NAME);
isOpenJDK = !lucidaFile.exists();
});
}
/**
......
......@@ -113,7 +113,7 @@ public class ByteToCharUTF8 extends ByteToCharConverter {
savedSize = 1;
} else {
savedSize = 2;
savedBytes[1] = (byte)input[byteOff++];
savedBytes[1] = input[byteOff++];
}
break;
}
......@@ -135,11 +135,11 @@ public class ByteToCharUTF8 extends ByteToCharConverter {
savedSize = 1;
} else if (byteOff + 1 >= inEnd) {
savedSize = 2;
savedBytes[1] = (byte)input[byteOff++];
savedBytes[1] = input[byteOff++];
} else {
savedSize = 3;
savedBytes[1] = (byte)input[byteOff++];
savedBytes[2] = (byte)input[byteOff++];
savedBytes[1] = input[byteOff++];
savedBytes[2] = input[byteOff++];
}
break;
}
......@@ -154,10 +154,10 @@ public class ByteToCharUTF8 extends ByteToCharConverter {
throw new MalformedInputException();
}
// this byte sequence is UTF16 character
int ucs4 = (int)(0x07 & byte1) << 18 |
(int)(0x3f & byte2) << 12 |
(int)(0x3f & byte3) << 6 |
(int)(0x3f & byte4);
int ucs4 = (0x07 & byte1) << 18 |
(0x3f & byte2) << 12 |
(0x3f & byte3) << 6 |
(0x3f & byte4);
outputChar[0] = (char)((ucs4 - 0x10000) / 0x400 + 0xd800);
outputChar[1] = (char)((ucs4 - 0x10000) % 0x400 + 0xdc00);
outputSize = 2;
......
......@@ -46,7 +46,7 @@ public class CharToByteUnicode extends CharToByteConverter {
protected int byteOrder = UNKNOWN;
public CharToByteUnicode() {
String enc = (String) java.security.AccessController.doPrivileged(
String enc = java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("sun.io.unicode.encoding",
"UnicodeBig"));
if (enc.equals("UnicodeBig"))
......
......@@ -50,11 +50,11 @@ public class CharacterEncoding {
private static boolean sjisIsMS932;
private static Map aliasTable;
private static Map<String,String> aliasTable;
private static volatile boolean installedAll;
static {
aliasTable = new HashMap(460, 1.0f); /* MDA */
aliasTable = new HashMap<>(460, 1.0f); /* MDA */
aliasTable.put("us-ascii", "ASCII");
aliasTable.put("ascii", "ASCII");
......@@ -119,11 +119,11 @@ public class CharacterEncoding {
}
// need to use Locale.US so we can load ISO converters in tr_TR locale
String lower = name.toLowerCase(Locale.US);
String val = (String) aliasTable.get(lower);
String val = aliasTable.get(lower);
if (val == null && !installedAll) {
installAll();
val = (String) aliasTable.get(lower);
val = aliasTable.get(lower);
}
return val;
}
......@@ -131,7 +131,7 @@ public class CharacterEncoding {
private static synchronized void installAll() {
if (!installedAll) {
GetPropertyAction a = new GetPropertyAction("sun.nio.cs.map");
String map = ((String)AccessController.doPrivileged(a));
String map = AccessController.doPrivileged(a);
if (map != null) {
sjisIsMS932 = map.equalsIgnoreCase("Windows-31J/Shift_JIS");
} else {
......@@ -857,9 +857,9 @@ public class CharacterEncoding {
* Auto Detect converter.
*/
static String getSJISName() {
String encodeName = (String) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
String encodeName = AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
String osName = System.getProperty("os.name");
if (osName.equals("Solaris") || osName.equals("SunOS")){
return "PCK";
......@@ -880,9 +880,9 @@ public class CharacterEncoding {
static String getEUCJPName() {
String encodeName = (String) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
String encodeName = AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
String osName = System.getProperty("os.name");
if (osName.equals("Solaris") || osName.equals("SunOS"))
return "eucJP-open";
......
......@@ -85,10 +85,11 @@ public class Converters {
* this code can be involved in the startup sequence it's important to keep
* the footprint down.
*/
private static SoftReference[][] classCache
= new SoftReference[][] {
new SoftReference[CACHE_SIZE],
new SoftReference[CACHE_SIZE]
@SuppressWarnings("unchecked")
private static SoftReference<Object[]>[][] classCache
= (SoftReference<Object[]>[][]) new SoftReference<?>[][] {
new SoftReference<?>[CACHE_SIZE],
new SoftReference<?>[CACHE_SIZE]
};
private static void moveToFront(Object[] oa, int i) {
......@@ -98,28 +99,28 @@ public class Converters {
oa[0] = ob;
}
private static Class cache(int type, Object encoding) {
SoftReference[] srs = classCache[type];
private static Class<?> cache(int type, Object encoding) {
SoftReference<Object[]>[] srs = classCache[type];
for (int i = 0; i < CACHE_SIZE; i++) {
SoftReference sr = srs[i];
SoftReference<Object[]> sr = srs[i];
if (sr == null)
continue;
Object[] oa = (Object[])sr.get();
Object[] oa = sr.get();
if (oa == null) {
srs[i] = null;
continue;
}
if (oa[1].equals(encoding)) {
moveToFront(srs, i);
return (Class)oa[0];
return (Class<?>)oa[0];
}
}
return null;
}
private static Class cache(int type, Object encoding, Class c) {
SoftReference[] srs = classCache[type];
srs[CACHE_SIZE - 1] = new SoftReference(new Object[] { c, encoding });
private static Class<?> cache(int type, Object encoding, Class<?> c) {
SoftReference<Object[]>[] srs = classCache[type];
srs[CACHE_SIZE - 1] = new SoftReference<Object[]>(new Object[] { c, encoding });
moveToFront(srs, CACHE_SIZE - 1);
return c;
}
......@@ -129,12 +130,12 @@ public class Converters {
*/
public static boolean isCached(int type, String encoding) {
synchronized (lock) {
SoftReference[] srs = classCache[type];
SoftReference<Object[]>[] srs = classCache[type];
for (int i = 0; i < CACHE_SIZE; i++) {
SoftReference sr = srs[i];
SoftReference<Object[]> sr = srs[i];
if (sr == null)
continue;
Object[] oa = (Object[])sr.get();
Object[] oa = sr.get();
if (oa == null) {
srs[i] = null;
continue;
......@@ -152,9 +153,9 @@ public class Converters {
private static String getConverterPackageName() {
String cp = converterPackageName;
if (cp != null) return cp;
java.security.PrivilegedAction pa =
java.security.PrivilegedAction<String> pa =
new sun.security.action.GetPropertyAction("file.encoding.pkg");
cp = (String)java.security.AccessController.doPrivileged(pa);
cp = java.security.AccessController.doPrivileged(pa);
if (cp != null) {
/* Property is set, so take it as the true converter package */
converterPackageName = cp;
......@@ -168,9 +169,9 @@ public class Converters {
public static String getDefaultEncodingName() {
synchronized (lock) {
if (defaultEncoding == null) {
java.security.PrivilegedAction pa =
java.security.PrivilegedAction<String> pa =
new sun.security.action.GetPropertyAction("file.encoding");
defaultEncoding = (String)java.security.AccessController.doPrivileged(pa);
defaultEncoding = java.security.AccessController.doPrivileged(pa);
}
}
return defaultEncoding;
......@@ -194,7 +195,7 @@ public class Converters {
* encoding, or throw an UnsupportedEncodingException if no such class can
* be found
*/
private static Class getConverterClass(int type, String encoding)
private static Class<?> getConverterClass(int type, String encoding)
throws UnsupportedEncodingException
{
String enc = null;
......@@ -241,7 +242,7 @@ public class Converters {
* Instantiate the given converter class, or throw an
* UnsupportedEncodingException if it cannot be instantiated
*/
private static Object newConverter(String enc, Class c)
private static Object newConverter(String enc, Class<?> c)
throws UnsupportedEncodingException
{
try {
......@@ -261,7 +262,7 @@ public class Converters {
static Object newConverter(int type, String enc)
throws UnsupportedEncodingException
{
Class c;
Class<?> c;
synchronized (lock) {
c = cache(type, enc);
if (c == null) {
......@@ -279,9 +280,9 @@ public class Converters {
* not yet defined, return a class that implements the fallback default
* encoding, which is just ISO 8859-1.
*/
private static Class getDefaultConverterClass(int type) {
private static Class<?> getDefaultConverterClass(int type) {
boolean fillCache = false;
Class c;
Class<?> c;
/* First check the class cache */
c = cache(type, DEFAULT_NAME);
......@@ -325,7 +326,7 @@ public class Converters {
* encoding cannot be determined.
*/
static Object newDefaultConverter(int type) {
Class c;
Class<?> c;
synchronized (lock) {
c = getDefaultConverterClass(type);
}
......
......@@ -68,27 +68,42 @@ class Flag {
}
static Flag getFlag(String name) {
Flag[] fs = new Flag[1];
String[] names = new String[1];
names[0] = name;
int count = getFlags(names, fs, 1);
if (count == 1) {
return fs[0];
} else {
List<Flag> flags = getFlags(names, 1);
if (flags.isEmpty()) {
return null;
} else {
// flags should have only one element
return flags.get(0);
}
}
static List<Flag> getAllFlags() {
int numFlags = getInternalFlagCount();
Flag[] fs = new Flag[numFlags];
// Get all internal flags with names = null
int count = getFlags(null, fs, numFlags);
return Arrays.asList(fs);
return getFlags(null, numFlags);
}
private static List<Flag> getFlags(String[] names, int numFlags) {
Flag[] flags = new Flag[numFlags];
int count = getFlags(names, flags, numFlags);
List<Flag> result = new ArrayList<Flag>();
for (Flag f : flags) {
if (f != null) {
result.add(f);
}
}
return result;
}
private static native String[] getAllFlagNames();
// getFlags sets each element in the given flags array
// with a Flag object only if the name is valid and the
// type is supported. The flags array may contain null elements.
private static native int getFlags(String[] names, Flag[] flags, int count);
private static native int getInternalFlagCount();
......
......@@ -671,6 +671,10 @@ public class FtpClient extends sun.net.ftp.FtpClient {
}
if (!issueCommand(cmd)) {
s.close();
if (getLastReplyCode() == FtpReplyCode.FILE_UNAVAILABLE) {
// Ensure backward compatibility
throw new FileNotFoundException(cmd);
}
throw new sun.net.ftp.FtpProtocolException(cmd + ":" + getResponseString(), getLastReplyCode());
}
return s;
......@@ -688,7 +692,16 @@ public class FtpClient extends sun.net.ftp.FtpClient {
Socket clientSocket;
if (passiveMode) {
return openPassiveDataConnection(cmd);
try {
return openPassiveDataConnection(cmd);
} catch (sun.net.ftp.FtpProtocolException e) {
// If Passive mode failed, fall back on PORT
// Otherwise throw exception
String errmsg = e.getMessage();
if (!errmsg.startsWith("PASV") && !errmsg.startsWith("EPSV")) {
throw e;
}
}
}
ServerSocket portSocket;
InetAddress myAddress;
......
......@@ -111,7 +111,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
* at the same time, then all but the first will block until
* the first completes its authentication.
*/
static private HashMap requests = new HashMap ();
static private HashMap<String,Thread> requests = new HashMap<>();
/* check if a request for this destination is in progress
* return false immediately if not. Otherwise block until
......@@ -125,7 +125,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
synchronized (requests) {
Thread t, c;
c = Thread.currentThread();
if ((t=(Thread)requests.get(key))==null) {
if ((t = requests.get(key)) == null) {
requests.put (key, c);
return false;
}
......@@ -147,8 +147,11 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
*/
static private void requestCompleted (String key) {
synchronized (requests) {
boolean waspresent = requests.remove (key) != null;
assert waspresent;
Thread thread = requests.get(key);
if (thread != null && thread == Thread.currentThread()) {
boolean waspresent = requests.remove(key) != null;
assert waspresent;
}
requests.notifyAll();
}
}
......
......@@ -423,7 +423,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
// Try keep-alive only on first attempt
if (!failedOnce && http.getHttpKeepAliveSet()) {
if (http.usingProxy) {
if (http.usingProxy && tunnelState() != TunnelState.TUNNELING) {
requests.setIfNotSet("Proxy-Connection", "keep-alive");
} else {
requests.setIfNotSet("Connection", "keep-alive");
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册