Merge
This commit is contained in:
commit
5048b49f70
@ -23,6 +23,10 @@
|
|||||||
# questions.
|
# questions.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
include $(SPEC)
|
include $(SPEC)
|
||||||
@ -31,428 +35,487 @@ include JavaCompilation.gmk
|
|||||||
include NativeCompilation.gmk
|
include NativeCompilation.gmk
|
||||||
include SetupJavaCompilers.gmk
|
include SetupJavaCompilers.gmk
|
||||||
include TextFileProcessing.gmk
|
include TextFileProcessing.gmk
|
||||||
|
include ZipArchive.gmk
|
||||||
|
|
||||||
# Prepare the find cache.
|
# Prepare the find cache.
|
||||||
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
|
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
|
||||||
|
|
||||||
# Append demo goals to this variable.
|
# Append demo goals to this variable.
|
||||||
BUILD_DEMOS =
|
TARGETS =
|
||||||
|
|
||||||
# The demo structure and contents should really be cleaned up.
|
# The demo structure and contents should really be cleaned up.
|
||||||
# Now every other demo has its own quirks where to put the
|
# Now every other demo has its own quirks where to put the
|
||||||
# READMEs and other files.
|
# READMEs and other files.
|
||||||
|
|
||||||
DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
|
DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
|
||||||
DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share
|
|
||||||
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
|
|
||||||
DEMO_OS_TYPE_SRC := $(JDK_TOPDIR)/src/demo/$(OPENJDK_TARGET_OS_TYPE)
|
|
||||||
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||||
|
|
||||||
##################################################################################################
|
DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
|
||||||
|
|
||||||
# This rule will be depended on due to the MANIFEST line
|
# This rule will be depended on due to the MANIFEST line in SetupBuildDemo
|
||||||
|
# and SetupBuildJvmtiDemo.
|
||||||
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
|
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
|
||||||
SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
||||||
OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
|
OUTPUT_FILE := $(DEMO_MANIFEST), \
|
||||||
REPLACEMENTS := \
|
REPLACEMENTS := \
|
||||||
@@RELEASE@@ => $(RELEASE) ; \
|
@@RELEASE@@ => $(RELEASE) ; \
|
||||||
@@COMPANY_NAME@@ => $(COMPANY_NAME) , \
|
@@COMPANY_NAME@@ => $(COMPANY_NAME) , \
|
||||||
))
|
))
|
||||||
|
|
||||||
define SetupAppletDemo
|
################################################################################
|
||||||
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
|
# Build applet demos.
|
||||||
|
|
||||||
|
# Setup make rules for building a demo applet.
|
||||||
|
#
|
||||||
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||||
|
# and the targets generated are listed in a variable by that name. It is also
|
||||||
|
# used to locate the name of the applet subdir, and to determine the name
|
||||||
|
# of the output directory.
|
||||||
|
#
|
||||||
|
# Remaining parameters are named arguments. These include:
|
||||||
|
# SRC_DIR Alternative source directory to use for the demos.
|
||||||
|
# DISABLE_SJAVAC Passed to SetupJavaCompilation
|
||||||
|
|
||||||
|
SetupBuildAppletDemo = $(NamedParamsMacroTemplate)
|
||||||
|
define SetupBuildAppletDemoBody
|
||||||
|
ifeq ($$($1_SRC_DIR), )
|
||||||
|
$1_SRC_DIR := $(DEMO_SHARE_SRC)/applets
|
||||||
|
endif
|
||||||
|
|
||||||
|
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_APPLET_$1, \
|
||||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||||
SRC := $(JDK_TOPDIR)/src/$3demo/share/applets/$1, \
|
SRC := $$($1_SRC_DIR)/$1, \
|
||||||
BIN := $(SUPPORT_OUTPUTDIR)/demo/image/applets/$1, \
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/image/applets/$1, \
|
||||||
COPY := .html .java .xyz .obj .au .gif, \
|
COPY := .html .java .xyz .obj .au .gif, \
|
||||||
DISABLE_SJAVAC := $2))
|
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
|
||||||
BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
|
))
|
||||||
|
|
||||||
|
$1 := $$(BUILD_DEMO_APPLET_$1)
|
||||||
|
|
||||||
|
TARGETS += $$($1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
||||||
$(eval $(call SetupAppletDemo,ArcTest))
|
$(eval $(call SetupBuildAppletDemo, ArcTest))
|
||||||
$(eval $(call SetupAppletDemo,BarChart))
|
$(eval $(call SetupBuildAppletDemo, BarChart))
|
||||||
$(eval $(call SetupAppletDemo,Blink))
|
$(eval $(call SetupBuildAppletDemo, Blink))
|
||||||
$(eval $(call SetupAppletDemo,CardTest))
|
$(eval $(call SetupBuildAppletDemo, CardTest))
|
||||||
$(eval $(call SetupAppletDemo,Clock))
|
$(eval $(call SetupBuildAppletDemo, Clock))
|
||||||
$(eval $(call SetupAppletDemo,DitherTest))
|
$(eval $(call SetupBuildAppletDemo, DitherTest))
|
||||||
$(eval $(call SetupAppletDemo,DrawTest))
|
$(eval $(call SetupBuildAppletDemo, DrawTest))
|
||||||
$(eval $(call SetupAppletDemo,Fractal))
|
$(eval $(call SetupBuildAppletDemo, Fractal))
|
||||||
$(eval $(call SetupAppletDemo,GraphicsTest))
|
$(eval $(call SetupBuildAppletDemo, GraphicsTest))
|
||||||
$(eval $(call SetupAppletDemo,NervousText))
|
$(eval $(call SetupBuildAppletDemo, NervousText))
|
||||||
$(eval $(call SetupAppletDemo,SimpleGraph))
|
$(eval $(call SetupBuildAppletDemo, SimpleGraph))
|
||||||
$(eval $(call SetupAppletDemo,SortDemo))
|
$(eval $(call SetupBuildAppletDemo, SortDemo))
|
||||||
$(eval $(call SetupAppletDemo,SpreadSheet))
|
$(eval $(call SetupBuildAppletDemo, SpreadSheet))
|
||||||
|
|
||||||
ifndef OPENJDK
|
|
||||||
$(eval $(call SetupAppletDemo,Animator,,closed/))
|
|
||||||
$(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
|
|
||||||
$(eval $(call SetupAppletDemo,JumpingBox,,closed/))
|
|
||||||
$(eval $(call SetupAppletDemo,TicTacToe,,closed/))
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################################################################################################
|
################################################################################
|
||||||
|
# Build normal demos.
|
||||||
|
|
||||||
PATTERNS_TO_COPY = .html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf .xyz .obj
|
COPY_TO_JAR := .html .txt .properties .js .gif .jpg .theme .data .opt .c .h \
|
||||||
|
.png .ttf .xyz .obj README COPYRIGHT
|
||||||
|
|
||||||
define SetupDemo
|
COPY_TO_IMAGE := *.html *.txt *.png *.xml README*
|
||||||
# Param 1 = Name of the demo
|
|
||||||
# Param 2 = Subdirectory of the demo below the demo directory.
|
|
||||||
# Param 3 = Additional javac flags.
|
|
||||||
# Param 4 = The main class for the jar.
|
|
||||||
# Param 5 = Additional source directory.
|
|
||||||
# Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
|
|
||||||
# Param 7 = List of files to copy
|
|
||||||
# Param 8 = Base name of jar file. Defaults to $1
|
|
||||||
# Param 9 = Exclude list
|
|
||||||
# Param 10 = Extra copy patterns
|
|
||||||
# Param 11 = Extra manifest attribute
|
|
||||||
# Param 12 = Suffix for compiler setup name
|
|
||||||
|
|
||||||
$1_SRC_BASE := $(JDK_TOPDIR)/src/$6demo/share/$2/$1
|
# Setup make rules for building a demo.
|
||||||
# In some demos the source is found in a subdir called src.
|
#
|
||||||
$1_MAIN_SRC := $$(wildcard $$($1_SRC_BASE)/src)
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||||
ifeq ($$($1_MAIN_SRC), )
|
# and the targets generated are listed in a variable by that name.
|
||||||
|
#
|
||||||
|
# Remaining parameters are named arguments. These include:
|
||||||
|
# DEMO_SUBDIR The name of the subdir of the demo, below the demo top dir.
|
||||||
|
# EXTRA_SRC_DIR Additional source directory.
|
||||||
|
# SRC_SUB_DIR Optional subdir to locate source code in
|
||||||
|
# SRC_DIR Alternative source directory to use for the demos.
|
||||||
|
# EXCLUDE_FILES Exclude file list
|
||||||
|
# JAR_NAME Base name of jar file. Defaults to $1.
|
||||||
|
# MAIN_CLASS The main class for the jar. Defaults to $1.
|
||||||
|
# EXTRA_COPY_TO_JAR Additional files to copy to jar (as patterns)
|
||||||
|
# EXTRA_COPY_TO_IMAGE Additional files to copy to images (as wildcards)
|
||||||
|
# EXTRA_MANIFEST_ATTR Extra manifest attribute
|
||||||
|
# SKIP_COMPILATION Skip Java compilation iff true
|
||||||
|
# DISABLE_SJAVAC Passed to SetupJavaCompilation
|
||||||
|
SetupBuildDemo = $(NamedParamsMacroTemplate)
|
||||||
|
define SetupBuildDemoBody
|
||||||
|
ifeq ($$($1_SRC_DIR), )
|
||||||
|
$1_SRC_DIR := $(DEMO_SHARE_SRC)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$1_SRC_BASE := $$($1_SRC_DIR)/$$($1_DEMO_SUBDIR)/$1
|
||||||
|
|
||||||
|
# In some demos the source is found in a subdir
|
||||||
|
ifneq ($$($1_SRC_SUB_DIR), )
|
||||||
|
$1_MAIN_SRC := $$($1_SRC_BASE)/$$($1_SRC_SUB_DIR)
|
||||||
|
else
|
||||||
|
# for allmost all
|
||||||
$1_MAIN_SRC := $$($1_SRC_BASE)
|
$1_MAIN_SRC := $$($1_SRC_BASE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($8, )
|
# Default is to use demo name as jar file name.
|
||||||
$1_JARFILE := $8.jar
|
ifeq ($$($1_JAR_NAME), )
|
||||||
else
|
$1_JAR_NAME := $1
|
||||||
$1_JARFILE := $1.jar
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(findstring $1,Laffy SwingSet3), )
|
# Default is to use demo name as jar main class.
|
||||||
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1, \
|
ifeq ($$($1_MAIN_CLASS), )
|
||||||
|
$1_MAIN_CLASS := $1
|
||||||
|
else ifeq ($$($1_MAIN_CLASS), NONE)
|
||||||
|
$1_MAIN_CLASS :=
|
||||||
|
$1_EXTRA_MANIFEST_ATTR += Main-Class: \n
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($$($1_SKIP_COMPILATION), true)
|
||||||
|
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \
|
||||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||||
ADD_JAVAC_FLAGS := $3, \
|
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
|
||||||
SRC := $$($1_MAIN_SRC) $5, \
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \
|
||||||
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/$2/$1, \
|
COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \
|
||||||
COPY := $(PATTERNS_TO_COPY) $(10), \
|
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/$$($1_JAR_NAME).jar, \
|
||||||
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
|
JARMAIN := $$($1_MAIN_CLASS), \
|
||||||
JARMAIN := $4, \
|
MANIFEST := $(DEMO_MANIFEST), \
|
||||||
MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
|
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
|
||||||
EXTRA_MANIFEST_ATTR := $(11), \
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
|
||||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
|
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
||||||
EXCLUDE_FILES := $9, \
|
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
|
||||||
DISABLE_SJAVAC := $(12)))
|
))
|
||||||
|
|
||||||
BUILD_DEMOS += $$(BUILD_DEMO_$1) \
|
$1 += $$(BUILD_DEMO_$1)
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE) \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Copy files.
|
# Copy files. Sort is needed to remove duplicates.
|
||||||
$1_COPY_TARGETS := $$(patsubst $$($1_SRC_BASE)/%, \
|
$1_COPY_FILES := $$(sort $$(wildcard $$(addprefix $$($1_SRC_BASE)/, \
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%, \
|
$(COPY_TO_IMAGE) $$($1_EXTRA_COPY_TO_IMAGE))))
|
||||||
$$(wildcard $$(addprefix $$($1_SRC_BASE)/, $7)))
|
$$(eval $$(call SetupCopyFiles, COPY_DEMO_$1, \
|
||||||
ifneq ($7, )
|
SRC := $$($1_SRC_BASE), \
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%: $$($1_SRC_BASE)/%
|
DEST := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1, \
|
||||||
$$(call install-file)
|
FILES := $$($1_COPY_FILES), \
|
||||||
$(CHMOD) -f ug+w $$@
|
))
|
||||||
|
|
||||||
BUILD_DEMOS += $$($1_COPY_TARGETS)
|
$1 += $$(COPY_DEMO_$1)
|
||||||
endif
|
|
||||||
|
|
||||||
|
TARGETS += $$($1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
|
CODEPOINT_SERVICE := java.awt.im.spi.InputMethodDescriptor
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services: \
|
CODEPOINT_METAINF_SERVICE_FILE := \
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar \
|
$(SUPPORT_OUTPUTDIR)/demos/classes/jfc/CodePointIM/META-INF/services/$(CODEPOINT_SERVICE)
|
||||||
$(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
|
|
||||||
(cd $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM && \
|
|
||||||
$(MKDIR) -p _the.tmp/META-INF/services && \
|
|
||||||
$(CP) $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
|
|
||||||
cd ./_the.tmp && \
|
|
||||||
$(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
|
|
||||||
cd ./META-INF/services && \
|
|
||||||
$(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
|
|
||||||
$(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.tmp
|
|
||||||
$(TOUCH) $@
|
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services
|
$(eval $(call SetupBuildDemo, CodePointIM, \
|
||||||
|
DEMO_SUBDIR := jfc, \
|
||||||
|
EXTRA_COPY_TO_JAR := $(CODEPOINT_SERVICE), \
|
||||||
|
))
|
||||||
|
|
||||||
|
# We also need to copy the CODEPOINT_SERVICE file to the META-INF/services
|
||||||
|
# location, and make sure the jar depends on that file to get it included.
|
||||||
|
$(CODEPOINT_METAINF_SERVICE_FILE): $(DEMO_SHARE_SRC)/jfc/CodePointIM/$(CODEPOINT_SERVICE)
|
||||||
|
$(call install-file)
|
||||||
|
|
||||||
|
$(BUILD_DEMO_CodePointIM_JAR): $(CODEPOINT_METAINF_SERVICE_FILE)
|
||||||
|
|
||||||
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
||||||
$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
|
$(eval $(call SetupBuildDemo, MoleculeViewer, \
|
||||||
$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
|
DEMO_SUBDIR := applets, \
|
||||||
$(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
|
MAIN_CLASS := XYZChemModel, \
|
||||||
endif
|
EXTRA_COPY_TO_IMAGE := *.java, \
|
||||||
$(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
|
))
|
||||||
$(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
|
|
||||||
$(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
|
|
||||||
$(eval $(call SetupDemo,Notepad,jfc,,Notepad,,,README*))
|
|
||||||
$(eval $(call SetupDemo,SampleTree,jfc,,SampleTree,,,README*))
|
|
||||||
$(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
|
|
||||||
$(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
|
|
||||||
$(eval $(call SetupDemo,jconsole-plugin,scripting,,,,,*.xml *.txt,,,,Main-Class: \n))
|
|
||||||
$(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
|
|
||||||
$(eval $(call SetupDemo,JTop,management,,JTop,,,README*))
|
|
||||||
$(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
|
|
||||||
$(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
|
|
||||||
|
|
||||||
ifndef OPENJDK
|
$(eval $(call SetupBuildDemo, WireFrame, \
|
||||||
$(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
|
DEMO_SUBDIR := applets, \
|
||||||
$(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
|
MAIN_CLASS := ThreeD, \
|
||||||
|
EXTRA_COPY_TO_IMAGE := *.java, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
|
$(eval $(call SetupBuildDemo, SwingApplet, \
|
||||||
$(eval $(call SetupDemo,Stylepad,jfc,,Stylepad, \
|
DEMO_SUBDIR := jfc, \
|
||||||
$(DEMO_SHARE_SRC)/jfc/Notepad,closed/,*.txt,,$(DEMO_SHARE_SRC)/jfc/Notepad/README.txt))
|
))
|
||||||
$(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
|
|
||||||
SplashScreen-Image: resources/images/splash.png,true))
|
|
||||||
|
|
||||||
BUILD_DEMOS += $(patsubst $(DEMO_CLOSED_SHARE_SRC)/nbproject/%, \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
|
|
||||||
$(call CacheFind, $(DEMO_CLOSED_SHARE_SRC)/nbproject))
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_CLOSED_SHARE_SRC)/nbproject/%
|
|
||||||
$(call install-file)
|
|
||||||
$(CHMOD) -f ug+w $@
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################################################################################################
|
$(eval $(call SetupBuildDemo, FileChooserDemo, \
|
||||||
|
DEMO_SUBDIR := jfc, \
|
||||||
|
))
|
||||||
|
|
||||||
# In the old makefiles, j2dbench was not compiled.
|
$(eval $(call SetupBuildDemo, Font2DTest, \
|
||||||
#$(eval $(call SetupDemo,J2DBench, java2d, /src, , j2dbench/J2DBench))
|
DEMO_SUBDIR := jfc, \
|
||||||
|
))
|
||||||
|
|
||||||
# JVMTI demos are a bit strange and share some files, but be careful the
|
$(eval $(call SetupBuildDemo, Metalworks, \
|
||||||
# shared files are just the *.c and *.h files, not the README or sample
|
DEMO_SUBDIR := jfc, \
|
||||||
# makefiles. So we always exclude the README.txt and sample.makefile.txt
|
))
|
||||||
# from the extra sources.
|
|
||||||
define SetupJVMTIDemo
|
$(eval $(call SetupBuildDemo, Notepad, \
|
||||||
# Param 1 = Name of the demo
|
DEMO_SUBDIR := jfc, \
|
||||||
# Param 2 = add these directories to the includes, default is agent_util
|
))
|
||||||
# Param 3 = extra CFLAGS
|
|
||||||
# Param 4 = C or C++ (defaults to C)
|
$(eval $(call SetupBuildDemo, SampleTree, \
|
||||||
# Param 5 = libs for unix
|
DEMO_SUBDIR := jfc, \
|
||||||
# Param 6 = libs for windows
|
))
|
||||||
# Param 7 = libs for solaris
|
|
||||||
# Param 8 = libs for linux
|
$(eval $(call SetupBuildDemo, TableExample, \
|
||||||
# Param 9 = extra directories with required sources
|
DEMO_SUBDIR := jfc, \
|
||||||
# Param 10 = DISABLED_WARNINGS_gcc
|
))
|
||||||
# Param 11 = DISABLED_WARNINGS_microsoft
|
|
||||||
# Param 12 = DISABLED_WARNINGS_clang
|
$(eval $(call SetupBuildDemo, TransparentRuler, \
|
||||||
BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
|
DEMO_SUBDIR := jfc, \
|
||||||
$$(wildcard $(DEMO_OS_TYPE_SRC)/jvmti/$1) \
|
MAIN_CLASS := transparentruler.Ruler, \
|
||||||
$$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \
|
))
|
||||||
$9
|
|
||||||
BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
|
$(eval $(call SetupBuildDemo, jconsole-plugin, \
|
||||||
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, $2)) \
|
DEMO_SUBDIR := scripting, \
|
||||||
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, $2))
|
SRC_SUB_DIR := src, \
|
||||||
BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
|
MAIN_CLASS := NONE, \
|
||||||
ifeq (C++, $4)
|
))
|
||||||
BUILD_DEMO_JVMTI_$1_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
|
||||||
$1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
|
$(eval $(call SetupBuildDemo, FullThreadDump, \
|
||||||
|
DEMO_SUBDIR := management, \
|
||||||
|
))
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildDemo, JTop, \
|
||||||
|
DEMO_SUBDIR := management, \
|
||||||
|
))
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildDemo, MemoryMonitor, \
|
||||||
|
DEMO_SUBDIR := management, \
|
||||||
|
))
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildDemo, VerboseGC, \
|
||||||
|
DEMO_SUBDIR := management, \
|
||||||
|
))
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Build JVMTI demos.
|
||||||
|
|
||||||
|
# Setup make rules for building a JVMTI demo.
|
||||||
|
#
|
||||||
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||||
|
# and the targets generated are listed in a variable by that name.
|
||||||
|
#
|
||||||
|
# Remaining parameters are named arguments. These include:
|
||||||
|
# EXTRA_SRC_SUBDIR Also include these subdirectories
|
||||||
|
# TOOLCHAIN Optionally specify toolchain to use
|
||||||
|
SetupBuildJvmtiDemo = $(NamedParamsMacroTemplate)
|
||||||
|
define SetupBuildJvmtiDemoBody
|
||||||
|
$1_SRC := \
|
||||||
|
$(DEMO_SHARE_SRC)/jvmti/$1 \
|
||||||
|
$$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, \
|
||||||
|
agent_util $$($1_EXTRA_SRC_SUBDIR)))
|
||||||
|
|
||||||
|
### Build the native lib
|
||||||
|
$1_CFLAGS_INCLUDE := $$(addprefix -I, $$($1_SRC))
|
||||||
|
|
||||||
|
$1_CXXFLAGS := $$($1_CFLAGS_INCLUDE) $(CXXFLAGS_JDKLIB) $(CXXFLAGS_DEBUG_SYMBOLS)
|
||||||
|
|
||||||
|
ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX)
|
||||||
|
# For C++, we also need some special treatment.
|
||||||
|
$1_LDFLAGS := $(LDFLAGS_CXX_JDK)
|
||||||
|
$1_LIBS := $(LIBCXX)
|
||||||
|
|
||||||
|
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
|
||||||
|
$1_CXXFLAGS := $$(filter-out -xregs=no%appl, $$($1_CXXFLAGS))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(DEMO_SHARE_SRC)/jvmti/$1 \
|
|
||||||
$$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
|
|
||||||
$(CXXFLAGS_DEBUG_SYMBOLS)
|
|
||||||
ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
|
|
||||||
$1_FILTER := -xregs=no%appl
|
|
||||||
$1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
|
|
||||||
# eval call below, the comma gets expanded too early.
|
|
||||||
BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
|
|
||||||
-I$(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
|
|
||||||
|
|
||||||
# Remove the -incremental:no setting to get .ilk-files like in the old build.
|
# Remove the -incremental:no setting to get .ilk-files like in the old build.
|
||||||
$$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
|
$$(eval $$(call SetupNativeCompilation, BUILD_DEMO_JVMTI_NATIVE_$1, \
|
||||||
SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
|
SRC := $$($1_SRC), \
|
||||||
TOOLCHAIN := $$(BUILD_DEMO_JVMTI_$1_TOOLCHAIN), \
|
TOOLCHAIN := $$($1_TOOLCHAIN), \
|
||||||
OPTIMIZATION := LOW, \
|
OPTIMIZATION := LOW, \
|
||||||
|
CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \
|
||||||
CXXFLAGS := $$($1_CXXFLAGS), \
|
CXXFLAGS := $$($1_CXXFLAGS), \
|
||||||
DISABLED_WARNINGS_gcc := $(10), \
|
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)) \
|
||||||
DISABLED_WARNINGS_clang := $(12), \
|
$$($1_LDFLAGS), \
|
||||||
DISABLED_WARNINGS_microsoft := $(11), \
|
|
||||||
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
|
|
||||||
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
|
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
|
||||||
LIBS := $$($1_EXTRA_CXX), \
|
LIBS := $$($1_LIBS), \
|
||||||
LIBS_unix := $5, \
|
LIBS_solaris := -lc, \
|
||||||
LIBS_linux := $8, \
|
|
||||||
LIBS_solaris := $7 -lc, \
|
|
||||||
LIBS_windows := $6, \
|
|
||||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||||
RC_FLAGS := $$(RC_FLAGS) \
|
RC_FLAGS := $$(RC_FLAGS) \
|
||||||
-D "JDK_FNAME=$1.dll" \
|
-D "JDK_FNAME=$1.dll" \
|
||||||
-D "JDK_INTERNAL_NAME=$1" \
|
-D "JDK_INTERNAL_NAME=$1" \
|
||||||
-D "JDK_FTYPE=0x2L", \
|
-D "JDK_FTYPE=0x2L", \
|
||||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1, \
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1, \
|
||||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib, \
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib, \
|
||||||
LIBRARY := $1))
|
LIBRARY := $1, \
|
||||||
|
))
|
||||||
|
|
||||||
$$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
|
$1 += $$(BUILD_DEMO_JVMTI_NATIVE_$1)
|
||||||
SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
|
|
||||||
EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
|
|
||||||
ZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip))
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
|
### Build the jar, if we have java sources
|
||||||
|
ifneq ($$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java), )
|
||||||
|
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_JVMTI_JAVA_$1, \
|
||||||
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||||
|
SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
|
||||||
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jvmti/$1, \
|
||||||
|
COPY := $(COPY_TO_JAR), \
|
||||||
|
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/$1.jar, \
|
||||||
|
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
|
||||||
|
MANIFEST := $(DEMO_MANIFEST), \
|
||||||
|
))
|
||||||
|
|
||||||
|
$1 += $$(BUILD_DEMO_JVMTI_JAVA_$1_JAR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
### Build the source zip
|
||||||
|
$1_EXCLUDE_FILES := \
|
||||||
|
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, \
|
||||||
|
agent_util $$($1_EXTRA_SRC_SUBDIR))) \
|
||||||
|
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, \
|
||||||
|
agent_util $$($1_EXTRA_SRC_SUBDIR)))
|
||||||
|
|
||||||
|
$$(eval $$(call SetupZipArchive, BUILD_DEMO_JVMTI_SRC_$1, \
|
||||||
|
SRC := $$($1_SRC), \
|
||||||
|
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
||||||
|
ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/src.zip, \
|
||||||
|
))
|
||||||
|
|
||||||
|
$1 += $$(BUILD_DEMO_JVMTI_SRC_$1)
|
||||||
|
|
||||||
|
# Copy files to image
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
|
||||||
$$(call install-file)
|
$$(call install-file)
|
||||||
$(CHMOD) -f ug+w $$@
|
$(CHMOD) -f ug+w $$@
|
||||||
|
|
||||||
ifneq (, $$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java))
|
$1 += $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt
|
||||||
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
|
|
||||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
|
||||||
SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
|
|
||||||
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jvmti/$1, \
|
|
||||||
COPY := $(PATTERNS_TO_COPY), \
|
|
||||||
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
|
|
||||||
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
|
|
||||||
MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf))
|
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
|
|
||||||
endif
|
|
||||||
|
|
||||||
BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt
|
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
# These files normally end up in OBJECT_DIR but for demos they
|
# These lib and exp files normally end up in OBJECT_DIR but for demos they
|
||||||
# are supposed to be included in the distro.
|
# are supposed to be included in the distro. Since they are created as
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
|
# a side-effect of the library compilation, make does not know about them.
|
||||||
$(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.lib $$@
|
$1_SUPPORT_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1
|
||||||
|
$1_IMAGE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
|
$$($1_SUPPORT_OUTPUTDIR)/$1.lib: $$(BUILD_DEMO_JVMTI_NATIVE_$1)
|
||||||
$(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.exp $$@
|
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib \
|
$$($1_SUPPORT_OUTPUTDIR)/$1.exp: $$(BUILD_DEMO_JVMTI_NATIVE_$1)
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp
|
|
||||||
|
$$($1_IMAGE_OUTPUTDIR)/$1.lib: $$($1_SUPPORT_OUTPUTDIR)/$1.lib
|
||||||
|
$$(call install-file)
|
||||||
|
|
||||||
|
$$($1_IMAGE_OUTPUTDIR)/$1.exp: $$($1_SUPPORT_OUTPUTDIR)/$1.exp
|
||||||
|
$$(call install-file)
|
||||||
|
|
||||||
|
$1 += $$($1_IMAGE_OUTPUTDIR)/$1.lib $$($1_IMAGE_OUTPUTDIR)/$1.exp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
TARGETS += $$($1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util))
|
$(eval $(call SetupBuildJvmtiDemo, compiledMethodLoad))
|
||||||
$(eval $(call SetupJVMTIDemo,gctest, agent_util))
|
$(eval $(call SetupBuildJvmtiDemo, gctest))
|
||||||
$(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo))
|
$(eval $(call SetupBuildJvmtiDemo, heapViewer))
|
||||||
$(eval $(call SetupJVMTIDemo,heapViewer, agent_util))
|
$(eval $(call SetupBuildJvmtiDemo, versionCheck))
|
||||||
$(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo))
|
|
||||||
$(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo))
|
|
||||||
$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++))
|
|
||||||
$(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
|
|
||||||
|
|
||||||
##################################################################################################
|
$(eval $(call SetupBuildJvmtiDemo, heapTracker, \
|
||||||
|
EXTRA_SRC_SUBDIR := java_crw_demo, \
|
||||||
|
))
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
|
$(eval $(call SetupBuildJvmtiDemo, minst, \
|
||||||
$(call install-file)
|
EXTRA_SRC_SUBDIR := java_crw_demo, \
|
||||||
$(CHMOD) -f ug+w $@
|
))
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
|
$(eval $(call SetupBuildJvmtiDemo, mtrace, \
|
||||||
$(call install-file)
|
EXTRA_SRC_SUBDIR := java_crw_demo, \
|
||||||
$(CHMOD) -f ug+w $@
|
))
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/management/index.html \
|
$(eval $(call SetupBuildJvmtiDemo, waiters, \
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html
|
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||||
|
))
|
||||||
|
|
||||||
##################################################################################################
|
################################################################################
|
||||||
|
# Build the Poller demo (on Solaris only).
|
||||||
# The netbeans project files are copied into the demo directory.
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
||||||
BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
|
|
||||||
$(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
|
|
||||||
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
|
|
||||||
else
|
|
||||||
BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
|
|
||||||
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
|
|
||||||
$(call install-file)
|
|
||||||
$(CHMOD) -f ug+w $@
|
|
||||||
|
|
||||||
##################################################################################################
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/README: $(DEMO_SHARE_SRC)/README
|
|
||||||
$(call install-file)
|
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/README
|
|
||||||
|
|
||||||
##################################################################################################
|
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||||
|
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/%: $(DEMO_SOLARIS_SRC)/jni/Poller/%
|
$(eval $(call SetupJavaCompilation, BUILD_DEMO_JAVA_Poller, \
|
||||||
$(call install-file)
|
|
||||||
$(CHMOD) -f ug+w $@
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt: $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
|
|
||||||
$(call install-file)
|
|
||||||
$(CHMOD) -f ug+w $@
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar: \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/README.txt \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/Poller.c
|
|
||||||
|
|
||||||
$(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
|
|
||||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||||
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
||||||
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
|
||||||
HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
HEADERS := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
|
||||||
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
|
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/Poller.jar, \
|
||||||
MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
|
MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf, \
|
||||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/src.zip, \
|
||||||
COPY := README.txt Poller.c, \
|
COPY := README.txt Poller.c, \
|
||||||
JARMAIN := Client))
|
JARMAIN := Client, \
|
||||||
|
))
|
||||||
|
|
||||||
|
TARGETS += $(BUILD_DEMO_JAVA_Poller)
|
||||||
|
|
||||||
|
$(eval $(call SetupNativeCompilation, BUILD_DEMO_NATIVE_Poller, \
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt
|
|
||||||
|
|
||||||
$(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
|
|
||||||
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
||||||
OPTIMIZATION := LOW, \
|
OPTIMIZATION := LOW, \
|
||||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||||
-I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
-I$(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
|
||||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||||
LIBS_solaris := -lc, \
|
LIBS_solaris := -lc, \
|
||||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller, \
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller, \
|
||||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native, \
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native, \
|
||||||
LIBRARY := Poller))
|
LIBRARY := Poller, \
|
||||||
|
))
|
||||||
|
|
||||||
#
|
TARGETS += $(BUILD_DEMO_NATIVE_Poller)
|
||||||
# We can only compile native code after jar has been build (since we depend on generated .h files)
|
|
||||||
#
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller/Poller.o: $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar
|
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
|
# We can only compile native code after java has been compiled (since we
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/native/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
|
# depend on generated .h files)
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller/Poller.o: \
|
||||||
|
$(BUILD_DEMO_JAVA_POLLER_COMPILE_TARGETS)
|
||||||
|
|
||||||
|
# Copy to image
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt: \
|
||||||
|
$(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
|
||||||
|
$(call install-file)
|
||||||
|
$(CHMOD) -f ug+w $@
|
||||||
|
|
||||||
|
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt
|
||||||
|
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so: \
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/native/libPoller.so
|
||||||
$(call install-file)
|
$(call install-file)
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
|
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################################################################################################
|
################################################################################
|
||||||
|
# Copy html and README files.
|
||||||
|
|
||||||
ifndef OPENJDK
|
$(SUPPORT_OUTPUTDIR)/demos/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
|
||||||
DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)
|
$(call install-file)
|
||||||
DB_DEMO_ZIPFILE := $(wildcard $(DB_ZIP_DIR)/*.zip)
|
$(CHMOD) -f ug+w $@
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
|
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
|
||||||
$(MKDIR) -p $(@D)
|
$(call install-file)
|
||||||
$(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/db $(SUPPORT_OUTPUTDIR)/demo/image/demo
|
$(CHMOD) -f ug+w $@
|
||||||
$(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(UNZIP) -q -o $<
|
|
||||||
$(MV) $(SUPPORT_OUTPUTDIR)/demo/image/db-derby-*-bin/demo $(SUPPORT_OUTPUTDIR)/demo/image/db
|
|
||||||
$(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(RM) -r db-derby-*-bin
|
|
||||||
$(TOUCH) $@
|
|
||||||
|
|
||||||
# Copy this after the unzip above to avoid race with directory creation and mv command.
|
$(SUPPORT_OUTPUTDIR)/demos/image/README: $(DEMO_SHARE_SRC)/README
|
||||||
$(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html: \
|
$(call install-file)
|
||||||
$(DB_ZIP_DIR)/README-JDK-DEMOS.html \
|
|
||||||
| $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped
|
|
||||||
$(MKDIR) -p $(@D)
|
|
||||||
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
|
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped $(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html
|
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/management/index.html \
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html \
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/README
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Copy netbeans project files.
|
||||||
|
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
|
||||||
|
$(call install-file)
|
||||||
|
$(CHMOD) -f ug+w $@
|
||||||
|
|
||||||
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||||
|
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
||||||
|
$(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
|
||||||
|
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
|
||||||
|
else
|
||||||
|
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
||||||
|
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
||||||
|
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################################################################################################
|
################################################################################
|
||||||
|
|
||||||
all: $(BUILD_DEMOS)
|
# Hook to include the corresponding custom file, if present.
|
||||||
|
$(eval $(call IncludeCustomExtension, jdk, CompileDemos.gmk))
|
||||||
|
|
||||||
|
all: $(TARGETS)
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
@ -27,7 +27,7 @@ default: all
|
|||||||
|
|
||||||
include $(SPEC)
|
include $(SPEC)
|
||||||
include MakeBase.gmk
|
include MakeBase.gmk
|
||||||
include JavaCompilation.gmk
|
include JarArchive.gmk
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -57,7 +57,7 @@ ifndef OPENJDK
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# TODO fix so that SetupArchive does not write files into SRCS
|
# TODO fix so that SetupJarArchive does not write files into SRCS
|
||||||
# then we don't need this extra copying
|
# then we don't need this extra copying
|
||||||
#
|
#
|
||||||
# NOTE: We currently do not place restrictions on our limited export
|
# NOTE: We currently do not place restrictions on our limited export
|
||||||
@ -76,13 +76,14 @@ $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
|
|||||||
US_EXPORT_POLICY_JAR_DEPS := \
|
US_EXPORT_POLICY_JAR_DEPS := \
|
||||||
$(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
|
$(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
|
||||||
|
|
||||||
$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
|
$(eval $(call SetupJarArchive, BUILD_US_EXPORT_POLICY_JAR, \
|
||||||
DEPENDENCIES := $(US_EXPORT_POLICY_JAR_DEPS), \
|
DEPENDENCIES := $(US_EXPORT_POLICY_JAR_DEPS), \
|
||||||
SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
|
SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
|
||||||
SUFFIXES := .policy, \
|
SUFFIXES := .policy, \
|
||||||
JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
|
JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
|
||||||
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
|
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
|
||||||
SKIP_METAINF := true))
|
SKIP_METAINF := true, \
|
||||||
|
))
|
||||||
|
|
||||||
$(US_EXPORT_POLICY_JAR_LIMITED): \
|
$(US_EXPORT_POLICY_JAR_LIMITED): \
|
||||||
$(US_EXPORT_POLICY_JAR_UNLIMITED)
|
$(US_EXPORT_POLICY_JAR_UNLIMITED)
|
||||||
@ -122,7 +123,7 @@ LOCAL_POLICY_JAR_UNLIMITED := \
|
|||||||
$(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
|
$(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
|
||||||
|
|
||||||
#
|
#
|
||||||
# TODO fix so that SetupArchive does not write files into SRCS
|
# TODO fix so that SetupJarArchive does not write files into SRCS
|
||||||
# then we don't need this extra copying
|
# then we don't need this extra copying
|
||||||
#
|
#
|
||||||
LOCAL_POLICY_JAR_LIMITED_TMP := \
|
LOCAL_POLICY_JAR_LIMITED_TMP := \
|
||||||
@ -138,22 +139,24 @@ $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
|
|||||||
$(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
|
$(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
|
||||||
$(install-file)
|
$(install-file)
|
||||||
|
|
||||||
$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
|
$(eval $(call SetupJarArchive, BUILD_LOCAL_POLICY_JAR_LIMITED, \
|
||||||
DEPENDENCIES := $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
|
DEPENDENCIES := $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
|
||||||
$(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
|
$(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
|
||||||
SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
|
SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
|
||||||
SUFFIXES := .policy, \
|
SUFFIXES := .policy, \
|
||||||
JAR := $(LOCAL_POLICY_JAR_LIMITED), \
|
JAR := $(LOCAL_POLICY_JAR_LIMITED), \
|
||||||
EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
|
EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
|
||||||
SKIP_METAINF := true))
|
SKIP_METAINF := true, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
|
$(eval $(call SetupJarArchive, BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
|
||||||
DEPENDENCIES := $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
|
DEPENDENCIES := $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
|
||||||
SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
|
SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
|
||||||
SUFFIXES := .policy, \
|
SUFFIXES := .policy, \
|
||||||
JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
|
JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
|
||||||
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
|
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
|
||||||
SKIP_METAINF := true))
|
SKIP_METAINF := true, \
|
||||||
|
))
|
||||||
|
|
||||||
TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
|
TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
|
||||||
|
|
||||||
|
@ -25,32 +25,51 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
|
JAVA_RC_FLAGS += -i $(JDK_TOPDIR)/src/java.base/windows/native/common
|
||||||
|
ifdef OPENJDK
|
||||||
|
JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
|
||||||
|
else
|
||||||
|
JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
|
||||||
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# On windows, the debuginfo files get the same name as for java.dll. Build
|
# On windows, the debuginfo files get the same name as for java.dll. Build
|
||||||
# into another dir and copy selectively so debuginfo for java.dll isn't
|
# into another dir and copy selectively so debuginfo for java.dll isn't
|
||||||
# overwritten.
|
# overwritten.
|
||||||
$(eval $(call SetupLauncher,java, \
|
$(eval $(call SetupBuildLauncher, java, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES,,,user32.lib comctl32.lib, \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
|
||||||
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jli_static.lib, $(JAVA_RC_FLAGS), \
|
LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR), \
|
||||||
$(JAVA_VERSION_INFO_RESOURCE), $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs,true))
|
LIBS_windows := user32.lib comctl32.lib, \
|
||||||
|
RC_FLAGS := $(JAVA_RC_FLAGS), \
|
||||||
|
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
|
||||||
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs, \
|
||||||
|
OPTIMIZATION := HIGH, \
|
||||||
|
WINDOWS_STATIC_LINK := true, \
|
||||||
|
NO_JAVA_MS := true, \
|
||||||
|
))
|
||||||
|
|
||||||
$(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
|
$(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
|
||||||
$(MKDIR) -p $(@D)
|
$(MKDIR) -p $(@D)
|
||||||
$(RM) $@
|
$(RM) $@
|
||||||
$(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX) $@
|
$(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs/java$(EXE_SUFFIX) $@
|
||||||
|
|
||||||
TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX)
|
TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX)
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
$(eval $(call SetupLauncher,javaw, \
|
$(eval $(call SetupBuildLauncher, javaw, \
|
||||||
-DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES,,,user32.lib comctl32.lib, \
|
CFLAGS := -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
|
||||||
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jli_static.lib, $(JAVA_RC_FLAGS), \
|
LIBS_windows := user32.lib comctl32.lib, \
|
||||||
$(JAVA_VERSION_INFO_RESOURCE),,true))
|
RC_FLAGS := $(JAVA_RC_FLAGS), \
|
||||||
|
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
|
||||||
|
WINDOWS_STATIC_LINK := true, \
|
||||||
|
NO_JAVA_MS := true, \
|
||||||
|
))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,keytool, \
|
$(eval $(call SetupBuildLauncher, keytool, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.keytool.Main"$(COMMA) }'))
|
MAIN_CLASS := sun.security.tools.keytool.Main, \
|
||||||
|
))
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,23 +25,26 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,idlj, \
|
$(eval $(call SetupBuildLauncher, idlj, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.corba.se.idl.toJavaPortable.Compile"$(COMMA) }'))
|
MAIN_CLASS := com.sun.tools.corba.se.idl.toJavaPortable.Compile, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,orbd, \
|
$(eval $(call SetupBuildLauncher, orbd, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
|
MAIN_CLASS := com.sun.corba.se.impl.activation.ORBD, \
|
||||||
"-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
|
JAVA_ARGS := \
|
||||||
"-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \
|
-Dcom.sun.CORBA.activation.DbDir=./orb.db \
|
||||||
"-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
|
-Dcom.sun.CORBA.activation.Port=1049 \
|
||||||
"com.sun.corba.se.impl.activation.ORBD"$(COMMA) }'))
|
-Dcom.sun.CORBA.POA.ORBServerId=1, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,servertool, \
|
$(eval $(call SetupBuildLauncher, servertool, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.corba.se.impl.activation.ServerTool"$(COMMA) }'))
|
MAIN_CLASS := com.sun.corba.se.impl.activation.ServerTool, \
|
||||||
|
))
|
||||||
$(eval $(call SetupLauncher,tnameserv, \
|
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
|
|
||||||
"-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
|
|
||||||
"-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \
|
|
||||||
"-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
|
|
||||||
"com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))
|
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildLauncher, tnameserv, \
|
||||||
|
MAIN_CLASS := com.sun.corba.se.impl.naming.cosnaming.TransientNameServer, \
|
||||||
|
JAVA_ARGS := \
|
||||||
|
-Dcom.sun.CORBA.activation.DbDir=./orb.db \
|
||||||
|
-Djava.util.logging.LoggingPermission=contol \
|
||||||
|
-Dcom.sun.CORBA.POA.ORBServerId=1, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -29,8 +29,8 @@ include LauncherCommon.gmk
|
|||||||
$(eval $(call IncludeCustomExtension, jdk, launcher/Launcher-java.desktop.gmk))
|
$(eval $(call IncludeCustomExtension, jdk, launcher/Launcher-java.desktop.gmk))
|
||||||
|
|
||||||
ifndef BUILD_HEADLESS_ONLY
|
ifndef BUILD_HEADLESS_ONLY
|
||||||
$(eval $(call SetupLauncher,appletviewer, \
|
$(eval $(call SetupBuildLauncher, appletviewer, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',, \
|
MAIN_CLASS := sun.applet.Main, \
|
||||||
$(XLIBS)))
|
LIBS_unix := $(X_LIBS), \
|
||||||
|
))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,39 +25,10 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,rmid, \
|
$(eval $(call SetupBuildLauncher, rmid, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }'))
|
MAIN_CLASS := sun.rmi.server.Activation, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,rmiregistry, \
|
$(eval $(call SetupBuildLauncher, rmiregistry, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }'))
|
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
|
||||||
|
))
|
||||||
##########################################################################################
|
|
||||||
|
|
||||||
#
|
|
||||||
# The java-rmi.cgi script in bin/ only gets delivered in certain situations
|
|
||||||
#
|
|
||||||
JAVA_RMI_CGI := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/java-rmi.cgi
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
|
||||||
TARGETS += $(JAVA_RMI_CGI)
|
|
||||||
endif
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
||||||
TARGETS += $(JAVA_RMI_CGI)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all
|
|
||||||
# this time anyway. Since jdk6, it has been built from the wrong source and resulted
|
|
||||||
# in a (almost) copy of the standard java launcher named "java-rmi.exe" ending up in
|
|
||||||
# the final images bin dir. This weird behavior is mimicked here in the converted
|
|
||||||
# makefiles for now. Should probably just be deleted.
|
|
||||||
# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
||||||
$(eval $(call SetupLauncher,java-rmi, , \
|
|
||||||
$(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/make/java/main/java/mapfile-$(OPENJDK_TARGET_CPU)),,,,,,,,,RMI))
|
|
||||||
else
|
|
||||||
$(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/java.rmi/unix/bin/java-rmi.cgi.sh
|
|
||||||
$(call install-file)
|
|
||||||
$(CHMOD) a+x $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
##########################################################################################
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,6 +25,6 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jrunscript, \
|
$(eval $(call SetupBuildLauncher, jrunscript, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }'))
|
MAIN_CLASS := com.sun.tools.script.shell.Main, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -26,13 +26,15 @@
|
|||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
$(eval $(call SetupLauncher,kinit, \
|
$(eval $(call SetupBuildLauncher, kinit, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
|
MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,klist, \
|
$(eval $(call SetupBuildLauncher, klist, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }'))
|
MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,ktab, \
|
$(eval $(call SetupBuildLauncher, ktab, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
|
MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \
|
||||||
|
))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,26 +25,30 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,javac, \
|
$(eval $(call SetupBuildLauncher, javac, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := com.sun.tools.javac.Main, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }'))
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,javah, \
|
$(eval $(call SetupBuildLauncher, javah, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := com.sun.tools.javah.Main, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,serialver, \
|
$(eval $(call SetupBuildLauncher, serialver, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := sun.tools.serialver.SerialVer, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||||
|
))
|
||||||
|
|
||||||
ifeq ($(ENABLE_SJAVAC), yes)
|
ifeq ($(ENABLE_SJAVAC), yes)
|
||||||
# Build sjavac directly to the exploded image so that it does not get included
|
# Build sjavac directly to the exploded image so that it does not get included
|
||||||
# into any real images
|
# into any real images
|
||||||
$(eval $(call SetupLauncher,sjavac, \
|
$(eval $(call SetupBuildLauncher, sjavac, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := com.sun.tools.sjavac.Main, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }',,,,,,, \
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
$(JDK_OUTPUTDIR)/bin))
|
OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
|
||||||
|
))
|
||||||
endif
|
endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,5 +25,6 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jimage,\
|
$(eval $(call SetupBuildLauncher, jimage,\
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.tools.jimage.Main"$(COMMA) }'))
|
MAIN_CLASS := jdk.tools.jimage.Main, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,12 +25,13 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jsadebugd, \
|
$(eval $(call SetupBuildLauncher, jsadebugd, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \
|
MAIN_CLASS := sun.jvm.hotspot.jdi.SADebugServer, \
|
||||||
,,,,,,,,,Info-privileged.plist))
|
MACOSX_SIGNED := true, \
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jhsdb, \
|
$(eval $(call SetupBuildLauncher, jhsdb, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.SALauncher"$(COMMA) }' \
|
MAIN_CLASS := sun.jvm.hotspot.SALauncher, \
|
||||||
,,,,,,,,,Info-privileged.plist))
|
MACOSX_SIGNED := true, \
|
||||||
|
))
|
||||||
|
@ -25,8 +25,10 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jar, \
|
$(eval $(call SetupBuildLauncher, jar, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
|
MAIN_CLASS := sun.tools.jar.Main, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jarsigner, \
|
$(eval $(call SetupBuildLauncher, jarsigner, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
|
MAIN_CLASS := sun.security.tools.jarsigner.Main, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,javadoc, \
|
$(eval $(call SetupBuildLauncher, javadoc, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := com.sun.tools.javadoc.Main, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }'))
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,36 +25,41 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jinfo, \
|
$(eval $(call SetupBuildLauncher, jinfo, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
|
MAIN_CLASS := sun.tools.jinfo.JInfo, \
|
||||||
"-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
|
JAVA_ARGS := \
|
||||||
"-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
|
-Dsun.jvm.hotspot.debugger.useProcDebugger \
|
||||||
"sun.tools.jinfo.JInfo"$(COMMA) }' \
|
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
|
||||||
-DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
|
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
|
||||||
,,,,,,,,,Info-privileged.plist))
|
MACOSX_SIGNED := true, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jmap, \
|
$(eval $(call SetupBuildLauncher, jmap, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
|
MAIN_CLASS := sun.tools.jmap.JMap, \
|
||||||
"-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
|
JAVA_ARGS := \
|
||||||
"-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
|
-Dsun.jvm.hotspot.debugger.useProcDebugger \
|
||||||
"sun.tools.jmap.JMap"$(COMMA) }' \
|
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
|
||||||
-DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
|
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
|
||||||
,,,,,,,,,Info-privileged.plist))
|
MACOSX_SIGNED := true, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jps, \
|
$(eval $(call SetupBuildLauncher, jps, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jps.Jps"$(COMMA) }'))
|
MAIN_CLASS := sun.tools.jps.Jps, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jstack, \
|
$(eval $(call SetupBuildLauncher, jstack, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
|
MAIN_CLASS := sun.tools.jstack.JStack, \
|
||||||
"-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
|
JAVA_ARGS := \
|
||||||
"-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
|
-Dsun.jvm.hotspot.debugger.useProcDebugger \
|
||||||
"sun.tools.jstack.JStack"$(COMMA) }' \
|
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
|
||||||
-DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
|
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
|
||||||
,,,,,,,,,Info-privileged.plist))
|
MACOSX_SIGNED := true, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jstat, \
|
$(eval $(call SetupBuildLauncher, jstat, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstat.Jstat"$(COMMA) }'))
|
MAIN_CLASS := sun.tools.jstat.Jstat, \
|
||||||
|
))
|
||||||
$(eval $(call SetupLauncher,jcmd, \
|
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
|
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildLauncher, jcmd, \
|
||||||
|
MAIN_CLASS := sun.tools.jcmd.JCmd, \
|
||||||
|
))
|
||||||
|
@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
BUILD_LAUNCHER_jconsole_CFLAGS_windows := -DJAVAW
|
$(eval $(call SetupBuildLauncher, jconsole, \
|
||||||
BUILD_LAUNCHER_jconsole_LIBS_windows := user32.lib
|
MAIN_CLASS := sun.tools.jconsole.JConsole, \
|
||||||
|
JAVA_ARGS := -Djconsole.showOutputViewer, \
|
||||||
$(eval $(call SetupLauncher,jconsole, \
|
APP_CLASSPATH := /lib/jconsole.jar /lib/tools.jar /classes, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \
|
CFLAGS_windows := -DJAVAW, \
|
||||||
-DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }'))
|
LIBS_windows := user32.lib, \
|
||||||
|
))
|
||||||
|
@ -25,12 +25,14 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,javap, \
|
$(eval $(call SetupBuildLauncher, javap, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := com.sun.tools.javap.Main, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
|
))
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jdeps, \
|
$(eval $(call SetupBuildLauncher, jdeps, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := com.sun.tools.jdeps.Main, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jdb, \
|
$(eval $(call SetupBuildLauncher, jdb, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \
|
MAIN_CLASS := com.sun.tools.example.debug.tty.TTY, \
|
||||||
-DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))
|
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
|
||||||
|
))
|
||||||
|
@ -25,7 +25,8 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jshell, \
|
$(eval $(call SetupBuildLauncher, jshell, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := jdk.internal.jshell.tool.JShellTool, \
|
||||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.internal.jshell.tool.JShellTool"$(COMMA) }'))
|
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,6 +25,6 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jstatd, \
|
$(eval $(call SetupBuildLauncher, jstatd, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))
|
MAIN_CLASS := sun.tools.jstatd.Jstatd, \
|
||||||
|
))
|
||||||
|
@ -25,8 +25,9 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,pack200, \
|
$(eval $(call SetupBuildLauncher, pack200, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) }'))
|
MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \
|
||||||
|
))
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# The order of the object files on the link command line affects the size of the resulting
|
# The order of the object files on the link command line affects the size of the resulting
|
||||||
@ -92,7 +93,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
|
|||||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||||
LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
|
LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
|
||||||
LIBS_solaris := -lc, \
|
LIBS_solaris := -lc, \
|
||||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \
|
||||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
|
||||||
PROGRAM := unpack200, \
|
PROGRAM := unpack200, \
|
||||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -26,7 +26,8 @@
|
|||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
ifndef BUILD_HEADLESS_ONLY
|
ifndef BUILD_HEADLESS_ONLY
|
||||||
$(eval $(call SetupLauncher,policytool, \
|
$(eval $(call SetupBuildLauncher, policytool, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
|
MAIN_CLASS := sun.security.tools.policytool.PolicyTool, \
|
||||||
$(XLIBS)))
|
LIBS_unix := $(X_LIBS), \
|
||||||
|
))
|
||||||
endif
|
endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,rmic, \
|
$(eval $(call SetupBuildLauncher, rmic, \
|
||||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
MAIN_CLASS := sun.rmi.rmic.Main, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }'))
|
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,jjs, \
|
$(eval $(call SetupBuildLauncher, jjs, \
|
||||||
-DENABLE_ARG_FILES \
|
MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.jjs.Main"$(COMMA) }'))
|
CFLAGS := -DENABLE_ARG_FILES, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,schemagen, \
|
$(eval $(call SetupBuildLauncher, schemagen, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.jxc.SchemaGenerator"$(COMMA) }'))
|
MAIN_CLASS := com.sun.tools.internal.jxc.SchemaGenerator, \
|
||||||
|
))
|
||||||
$(eval $(call SetupLauncher,xjc, \
|
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }'))
|
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildLauncher, xjc, \
|
||||||
|
MAIN_CLASS := com.sun.tools.internal.xjc.Driver, \
|
||||||
|
))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
include LauncherCommon.gmk
|
include LauncherCommon.gmk
|
||||||
|
|
||||||
$(eval $(call SetupLauncher,wsgen, \
|
$(eval $(call SetupBuildLauncher, wsgen, \
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsGen"$(COMMA) }'))
|
MAIN_CLASS := com.sun.tools.internal.ws.WsGen, \
|
||||||
|
))
|
||||||
$(eval $(call SetupLauncher,wsimport, \
|
|
||||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }'))
|
|
||||||
|
|
||||||
|
$(eval $(call SetupBuildLauncher, wsimport, \
|
||||||
|
MAIN_CLASS := com.sun.tools.internal.ws.WsImport, \
|
||||||
|
))
|
||||||
|
@ -28,28 +28,17 @@ include NativeCompilation.gmk
|
|||||||
# Prepare the find cache.
|
# Prepare the find cache.
|
||||||
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
|
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
|
||||||
|
|
||||||
# When building a legacy overlay image (on solaris 64 bit), the launchers
|
|
||||||
# need to be built with a different rpath and a different output dir.
|
|
||||||
ifeq ($(OVERLAY_IMAGES), true)
|
|
||||||
ORIGIN_ROOT := /../..
|
|
||||||
OUTPUT_SUBDIR := $(OPENJDK_TARGET_CPU_ISADIR)
|
|
||||||
else
|
|
||||||
ORIGIN_ROOT := /..
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||||
ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
|
ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
|
||||||
else
|
else
|
||||||
ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
|
ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,/../lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
# Applications expect to be able to link against libjawt without invoking
|
||||||
# Applications expect to be able to link against libjawt without invoking
|
# System.loadLibrary("jawt") first. This was the behaviour described in the
|
||||||
# System.loadLibrary("jawt") first. This was the behaviour described in the
|
# devloper documentation of JAWT and what worked with OpenJDK6.
|
||||||
# devloper documentation of JAWT and what worked with OpenJDK6.
|
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
|
||||||
#
|
ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,/../lib$(OPENJDK_TARGET_CPU_LIBDIR))
|
||||||
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
|
endif
|
||||||
ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher
|
LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher
|
||||||
@ -61,51 +50,78 @@ LAUNCHER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/launcher \
|
|||||||
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||||
JAVA_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.rc
|
JAVA_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.rc
|
||||||
MACOSX_PLIST_DIR := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
|
MACOSX_PLIST_DIR := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
|
||||||
# Until the shuffle is permanent, we can't add this in configure
|
|
||||||
CFLAGS_JDKEXE := $(filter-out %javavm/export, $(CFLAGS_JDKEXE))
|
|
||||||
CFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
|
|
||||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
|
|
||||||
CXXFLAGS_JDKEXE := $(filter-out %javavm/export, $(CXXFLAGS_JDKEXE))
|
|
||||||
CXXFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
|
|
||||||
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
|
|
||||||
JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manifest
|
JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manifest
|
||||||
|
|
||||||
define SetupLauncher
|
################################################################################
|
||||||
# TODO: Fix mapfile on solaris. Won't work with ld as linker.
|
# Build standard launcher.
|
||||||
# Parameter 1 is the name of the launcher (java, javac, jar...)
|
|
||||||
# Parameter 2 is extra CFLAGS
|
|
||||||
# Parameter 3 is extra LDFLAGS
|
|
||||||
# Parameter 4 is extra LIBS_unix
|
|
||||||
# Parameter 5 is extra LIBS_windows
|
|
||||||
# Parameter 6 is optional Windows JLI library (full path)
|
|
||||||
# Parameter 7 is optional Windows resource (RC) flags
|
|
||||||
# Parameter 8 is optional Windows version resource file (.rc)
|
|
||||||
# Parameter 9 is different output dir
|
|
||||||
# Parameter 10 if set, link statically with c runtime on windows.
|
|
||||||
# Parameter 11 if set, override plist file on macosx.
|
|
||||||
$(call LogSetupMacroEntry,SetupLauncher($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11))
|
|
||||||
$(if $(13),$(error Internal makefile error: Too many arguments to SetupLauncher, please update CompileLaunchers.gmk))
|
|
||||||
|
|
||||||
$1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
|
# Setup make rules for building a standard launcher.
|
||||||
ifneq ($6, )
|
#
|
||||||
$1_WINDOWS_JLI_LIB := $6
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||||
endif
|
# and the targets generated are listed in a variable by that name. It is also
|
||||||
$1_VERSION_INFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE)
|
# used as the name of the executable.
|
||||||
ifneq ($8, )
|
#
|
||||||
$1_VERSION_INFO_RESOURCE := $8
|
# Remaining parameters are named arguments. These include:
|
||||||
|
# MAIN_CLASS The Java main class to launch
|
||||||
|
# JAVA_ARGS Processed into a -DJAVA_ARGS C flag
|
||||||
|
# APP_CLASSPATH Processed into a -DAPP_CLASSPATH C flag
|
||||||
|
# CFLAGS Additional CFLAGS
|
||||||
|
# CFLAGS_windows Additional CFLAGS_windows
|
||||||
|
# LIBS_unix Additional LIBS_unix
|
||||||
|
# LIBS_windows Additional LIBS_windows
|
||||||
|
# LDFLAGS_solaris Additional LDFLAGS_solaris
|
||||||
|
# RC_FLAGS Additional RC_FLAGS
|
||||||
|
# MACOSX_SIGNED On macosx, sign this binary
|
||||||
|
# WINDOWS_STATIC_LINK On windows, link statically with C runtime and libjli.
|
||||||
|
# OPTIMIZATION Override default optimization level (LOW)
|
||||||
|
# OUTPUT_DIR Override default output directory
|
||||||
|
# VERSION_INFO_RESOURCE Override default Windows resource file
|
||||||
|
# NO_JAVA_MS Do not add -ms8m to JAVA_ARGS.
|
||||||
|
SetupBuildLauncher = $(NamedParamsMacroTemplate)
|
||||||
|
define SetupBuildLauncherBody
|
||||||
|
# Setup default values (unless overridden)
|
||||||
|
ifeq ($$($1_VERSION_INFO_RESOURCE), )
|
||||||
|
$1_VERSION_INFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($$($1_OUTPUT_DIR), )
|
||||||
|
$1_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($$($1_OPTIMIZATION), )
|
||||||
|
$1_OPTIMIZATION := LOW
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($$($1_NO_JAVA_MS), true)
|
||||||
|
# The norm is to append -ms8m, unless otherwise instructed.
|
||||||
|
$1_JAVA_ARGS += -ms8m
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($$($1_JAVA_ARGS), )
|
||||||
|
$1_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \
|
||||||
|
$$(addprefix -J, $$($1_JAVA_ARGS)) $$($1_MAIN_CLASS), "$$a"$(COMMA) )) }'
|
||||||
|
$1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($$($1_APP_CLASSPATH), )
|
||||||
|
$1_APP_CLASSPATH_STR := '{ $$(strip $$(foreach a, \
|
||||||
|
$$($1_APP_CLASSPATH), "$$a"$(COMMA) )) }'
|
||||||
|
# Remove the trailing comma
|
||||||
|
$1_APP_CLASSPATH_STR := $$(strip $$(subst $$(COMMA) }', }', \
|
||||||
|
$$($1_APP_CLASSPATH_STR)))
|
||||||
|
$1_CFLAGS += -DAPP_CLASSPATH=$$($1_APP_CLASSPATH_STR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$1_LDFLAGS := $3
|
|
||||||
$1_LIBS :=
|
$1_LIBS :=
|
||||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||||
$1_PLIST_FILE := Info-cmdline.plist
|
ifeq ($$($1_MACOSX_SIGNED), true)
|
||||||
ifneq ($(11), )
|
$1_PLIST_FILE := Info-privileged.plist
|
||||||
$1_PLIST_FILE := $(11)
|
|
||||||
ifneq ($$(findstring privileged, $$($1_PLIST_FILE)), )
|
|
||||||
$1_CODESIGN := true
|
$1_CODESIGN := true
|
||||||
endif
|
else
|
||||||
|
$1_PLIST_FILE := Info-cmdline.plist
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$1_CFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
|
||||||
$1_LDFLAGS += -Wl,-all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a \
|
$1_LDFLAGS += -Wl,-all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a \
|
||||||
-sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
|
-sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
|
||||||
$1_LIBS += -framework Cocoa -framework Security \
|
$1_LIBS += -framework Cocoa -framework Security \
|
||||||
@ -121,22 +137,12 @@ define SetupLauncher
|
|||||||
$1_LIBS += -lz
|
$1_LIBS += -lz
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$1_OUTPUT_DIR_ARG := $9
|
ifeq ($$($1_WINDOWS_STATIC_LINK), true)
|
||||||
ifeq (, $$($1_OUTPUT_DIR_ARG))
|
$1_CFLAGS += $(filter-out -MD, $(CFLAGS_JDKEXE))
|
||||||
$1_OUTPUT_DIR_ARG := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)
|
$1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib
|
||||||
endif
|
|
||||||
|
|
||||||
# TODO: maybe it's better to move this if-statement out of this function
|
|
||||||
ifeq ($1, java)
|
|
||||||
$1_OPTIMIZATION_ARG := HIGH
|
|
||||||
$1_LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
|
|
||||||
else
|
else
|
||||||
$1_OPTIMIZATION_ARG := LOW
|
$1_CFLAGS += $(CFLAGS_JDKEXE)
|
||||||
endif
|
$1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
|
||||||
|
|
||||||
$1_CFLAGS := $(CFLAGS_JDKEXE)
|
|
||||||
ifeq ($(10), true)
|
|
||||||
$1_CFLAGS := $(filter-out -MD, $(CFLAGS_JDKEXE))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
|
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
|
||||||
@ -156,22 +162,23 @@ define SetupLauncher
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \
|
$$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \
|
||||||
SRC := $(LAUNCHER_SRC), \
|
SRC := $(LAUNCHER_SRC), \
|
||||||
INCLUDE_FILES := main.c, \
|
INCLUDE_FILES := main.c, \
|
||||||
OPTIMIZATION := $$($1_OPTIMIZATION_ARG), \
|
OPTIMIZATION := $$($1_OPTIMIZATION), \
|
||||||
CFLAGS := $$($1_CFLAGS) \
|
CFLAGS := $$($1_CFLAGS) \
|
||||||
$(LAUNCHER_CFLAGS) \
|
$(LAUNCHER_CFLAGS) \
|
||||||
-DFULL_VERSION='"$(FULL_VERSION)"' \
|
-DFULL_VERSION='"$(FULL_VERSION)"' \
|
||||||
-DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
|
-DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
|
||||||
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
|
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
|
||||||
-DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
|
-DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
|
||||||
-DPROGNAME='"$1"' $(DPACKAGEPATH) \
|
-DPROGNAME='"$1"' \
|
||||||
$2, \
|
$$($1_CFLAGS), \
|
||||||
CFLAGS_linux := -fPIC, \
|
CFLAGS_linux := -fPIC, \
|
||||||
CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
|
CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
|
||||||
|
CFLAGS_windows := $$($1_CFLAGS_windows), \
|
||||||
LDFLAGS := $(LDFLAGS_JDKEXE) \
|
LDFLAGS := $(LDFLAGS_JDKEXE) \
|
||||||
$(ORIGIN_ARG) \
|
$$(ORIGIN_ARG) \
|
||||||
$$($1_LDFLAGS), \
|
$$($1_LDFLAGS), \
|
||||||
LDFLAGS_linux := \
|
LDFLAGS_linux := \
|
||||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
|
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
|
||||||
@ -182,27 +189,29 @@ define SetupLauncher
|
|||||||
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
|
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
|
||||||
MAPFILE := $$($1_MAPFILE), \
|
MAPFILE := $$($1_MAPFILE), \
|
||||||
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|
||||||
LIBS_unix := $4, \
|
LIBS_unix := $$($1_LIBS_unix), \
|
||||||
LIBS_linux := -lpthread -ljli $(LIBDL) -lc, \
|
LIBS_linux := -lpthread -ljli $(LIBDL) -lc, \
|
||||||
LIBS_solaris := -ljli -lthread $(LIBDL) -lc, \
|
LIBS_solaris := -ljli -lthread $(LIBDL) -lc, \
|
||||||
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
|
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
|
||||||
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib $5, \
|
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib \
|
||||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs$(OUTPUT_SUBDIR), \
|
$$($1_LIBS_windows), \
|
||||||
OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \
|
||||||
|
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
|
||||||
PROGRAM := $1, \
|
PROGRAM := $1, \
|
||||||
DEBUG_SYMBOLS := true, \
|
DEBUG_SYMBOLS := true, \
|
||||||
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
|
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
|
||||||
RC_FLAGS := $(RC_FLAGS) \
|
RC_FLAGS := $$(RC_FLAGS) \
|
||||||
-D "JDK_FNAME=$1$(EXE_SUFFIX)" \
|
-D "JDK_FNAME=$1$(EXE_SUFFIX)" \
|
||||||
-D "JDK_INTERNAL_NAME=$1" \
|
-D "JDK_INTERNAL_NAME=$1" \
|
||||||
-D "JDK_FTYPE=0x1L" \
|
-D "JDK_FTYPE=0x1L" \
|
||||||
$7, \
|
$$($1_RC_FLAGS), \
|
||||||
MANIFEST := $(JAVA_MANIFEST), \
|
MANIFEST := $(JAVA_MANIFEST), \
|
||||||
MANIFEST_VERSION := $(JDK_VERSION_FOR_MANIFEST), \
|
MANIFEST_VERSION := $(JDK_VERSION_FOR_MANIFEST), \
|
||||||
CODESIGN := $$($1_CODESIGN), \
|
CODESIGN := $$($1_CODESIGN), \
|
||||||
)
|
))
|
||||||
|
|
||||||
TARGETS += $$(BUILD_LAUNCHER_$1)
|
$1 += $$(BUILD_LAUNCHER_$1)
|
||||||
|
TARGETS += $$($1)
|
||||||
|
|
||||||
ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
|
ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
|
||||||
$$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
|
$$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
|
||||||
@ -213,18 +222,3 @@ define SetupLauncher
|
|||||||
$$($1_WINDOWS_JLI_LIB)
|
$$($1_WINDOWS_JLI_LIB)
|
||||||
endif
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
##########################################################################################
|
|
||||||
|
|
||||||
XLIBS := $(X_LIBS) -lX11
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
||||||
DPACKAGEPATH := -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
|
|
||||||
XLIBS :=
|
|
||||||
endif
|
|
||||||
|
|
||||||
JAVA_RC_FLAGS += -i $(JDK_TOPDIR)/src/java.base/windows/native/common
|
|
||||||
ifdef OPENJDK
|
|
||||||
JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
|
|
||||||
else
|
|
||||||
JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
|
|
||||||
endif
|
|
||||||
|
@ -890,9 +890,9 @@ ifndef BUILD_HEADLESS_ONLY
|
|||||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
|
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
|
||||||
LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
|
LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
|
||||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||||
LIBS := $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \
|
LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \
|
||||||
$(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
|
$(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
|
||||||
LIBS_solaris := -lc, \
|
LIBS_aix := -liconv, \
|
||||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||||
RC_FLAGS := $(RC_FLAGS) \
|
RC_FLAGS := $(RC_FLAGS) \
|
||||||
-D "JDK_FNAME=splashscreen.dll" \
|
-D "JDK_FNAME=splashscreen.dll" \
|
||||||
|
@ -139,6 +139,12 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||||
|
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
|
||||||
|
BUILD_LIBJAVA_Bits.c_CFLAGS := $(C_O_FLAG_NORM)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
|
$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
|
||||||
LIBRARY := java, \
|
LIBRARY := java, \
|
||||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||||
|
@ -68,10 +68,11 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
|
|||||||
LDFLAGS_macosx := -Xlinker -all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
|
LDFLAGS_macosx := -Xlinker -all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
|
||||||
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
|
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
|
||||||
LDFLAGS_windows := -export:Agent_OnAttach, \
|
LDFLAGS_windows := -export:Agent_OnAttach, \
|
||||||
|
LIBS := $(JDKLIB_LIBS), \
|
||||||
LIBS_unix := -ljava $(LIBZ), \
|
LIBS_unix := -ljava $(LIBZ), \
|
||||||
LIBS_linux := -ljli $(LIBDL), \
|
LIBS_linux := -ljli $(LIBDL), \
|
||||||
LIBS_solaris := -ljli $(LIBDL) -lc, \
|
LIBS_solaris := -ljli $(LIBDL), \
|
||||||
LIBS_aix := -ljli_static $(LIBDL),\
|
LIBS_aix := -liconv -ljli_static $(LIBDL), \
|
||||||
LIBS_macosx := -liconv -framework Cocoa -framework Security \
|
LIBS_macosx := -liconv -framework Cocoa -framework Security \
|
||||||
-framework ApplicationServices, \
|
-framework ApplicationServices, \
|
||||||
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \
|
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \
|
||||||
|
@ -84,10 +84,11 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \
|
|||||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdwp/mapfile-vers, \
|
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdwp/mapfile-vers, \
|
||||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||||
|
LIBS := $(JDKLIB_LIBS), \
|
||||||
LIBS_linux := $(LIBDL), \
|
LIBS_linux := $(LIBDL), \
|
||||||
LIBS_solaris := $(LIBDL) -lc, \
|
LIBS_solaris := $(LIBDL), \
|
||||||
LIBS_macosx := -liconv, \
|
LIBS_macosx := -liconv, \
|
||||||
LIBS_windows := $(JDKLIB_LIBS), \
|
LIBS_aix := -liconv, \
|
||||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||||
RC_FLAGS := $(RC_FLAGS) \
|
RC_FLAGS := $(RC_FLAGS) \
|
||||||
-D "JDK_FNAME=jdwp.dll" \
|
-D "JDK_FNAME=jdwp.dll" \
|
||||||
|
@ -462,6 +462,22 @@ public final class Byte extends Number implements Comparable<Byte> {
|
|||||||
return x - y;
|
return x - y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares two {@code byte} values numerically treating the values
|
||||||
|
* as unsigned.
|
||||||
|
*
|
||||||
|
* @param x the first {@code byte} to compare
|
||||||
|
* @param y the second {@code byte} to compare
|
||||||
|
* @return the value {@code 0} if {@code x == y}; a value less
|
||||||
|
* than {@code 0} if {@code x < y} as unsigned values; and
|
||||||
|
* a value greater than {@code 0} if {@code x > y} as
|
||||||
|
* unsigned values
|
||||||
|
* @since 9
|
||||||
|
*/
|
||||||
|
public static int compareUnsigned(byte x, byte y) {
|
||||||
|
return Byte.toUnsignedInt(x) - Byte.toUnsignedInt(y);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the argument to an {@code int} by an unsigned
|
* Converts the argument to an {@code int} by an unsigned
|
||||||
* conversion. In an unsigned conversion to an {@code int}, the
|
* conversion. In an unsigned conversion to an {@code int}, the
|
||||||
|
@ -36,7 +36,7 @@ import static java.lang.annotation.ElementType.*;
|
|||||||
*
|
*
|
||||||
* <p>Use of the @Deprecated annotation on a local variable
|
* <p>Use of the @Deprecated annotation on a local variable
|
||||||
* declaration or on a parameter declaration or a package declaration
|
* declaration or on a parameter declaration or a package declaration
|
||||||
* has no effect.
|
* has no effect on the warnings issued by a compiler.
|
||||||
*
|
*
|
||||||
* @author Neal Gafter
|
* @author Neal Gafter
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
|
@ -467,6 +467,22 @@ public final class Short extends Number implements Comparable<Short> {
|
|||||||
return x - y;
|
return x - y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares two {@code short} values numerically treating the values
|
||||||
|
* as unsigned.
|
||||||
|
*
|
||||||
|
* @param x the first {@code short} to compare
|
||||||
|
* @param y the second {@code short} to compare
|
||||||
|
* @return the value {@code 0} if {@code x == y}; a value less
|
||||||
|
* than {@code 0} if {@code x < y} as unsigned values; and
|
||||||
|
* a value greater than {@code 0} if {@code x > y} as
|
||||||
|
* unsigned values
|
||||||
|
* @since 9
|
||||||
|
*/
|
||||||
|
public static int compareUnsigned(short x, short y) {
|
||||||
|
return Short.toUnsignedInt(x) - Short.toUnsignedInt(y);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of bits used to represent a {@code short} value in two's
|
* The number of bits used to represent a {@code short} value in two's
|
||||||
* complement binary form.
|
* complement binary form.
|
||||||
|
@ -66,15 +66,15 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||||||
private static final String NAME_METHOD_WRITE_REPLACE = "writeReplace";
|
private static final String NAME_METHOD_WRITE_REPLACE = "writeReplace";
|
||||||
private static final String NAME_METHOD_READ_OBJECT = "readObject";
|
private static final String NAME_METHOD_READ_OBJECT = "readObject";
|
||||||
private static final String NAME_METHOD_WRITE_OBJECT = "writeObject";
|
private static final String NAME_METHOD_WRITE_OBJECT = "writeObject";
|
||||||
|
|
||||||
|
private static final String DESCR_CLASS = "Ljava/lang/Class;";
|
||||||
|
private static final String DESCR_STRING = "Ljava/lang/String;";
|
||||||
|
private static final String DESCR_OBJECT = "Ljava/lang/Object;";
|
||||||
private static final String DESCR_CTOR_SERIALIZED_LAMBDA
|
private static final String DESCR_CTOR_SERIALIZED_LAMBDA
|
||||||
= MethodType.methodType(void.class,
|
= "(" + DESCR_CLASS + DESCR_STRING + DESCR_STRING + DESCR_STRING + "I"
|
||||||
Class.class,
|
+ DESCR_STRING + DESCR_STRING + DESCR_STRING + DESCR_STRING + "[" + DESCR_OBJECT + ")V";
|
||||||
String.class, String.class, String.class,
|
|
||||||
int.class, String.class, String.class, String.class,
|
private static final String DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION = "(Ljava/lang/String;)V";
|
||||||
String.class,
|
|
||||||
Object[].class).toMethodDescriptorString();
|
|
||||||
private static final String DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION
|
|
||||||
= MethodType.methodType(void.class, String.class).toMethodDescriptorString();
|
|
||||||
private static final String[] SER_HOSTILE_EXCEPTIONS = new String[] {NAME_NOT_SERIALIZABLE_EXCEPTION};
|
private static final String[] SER_HOSTILE_EXCEPTIONS = new String[] {NAME_NOT_SERIALIZABLE_EXCEPTION};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1187,20 +1187,23 @@ s.writeObject(this.parameterArray());
|
|||||||
// store them into the implementation-specific final fields.
|
// store them into the implementation-specific final fields.
|
||||||
checkRtype(rtype);
|
checkRtype(rtype);
|
||||||
checkPtypes(ptypes);
|
checkPtypes(ptypes);
|
||||||
UNSAFE.putObject(this, rtypeOffset, rtype);
|
UNSAFE.putObject(this, OffsetHolder.rtypeOffset, rtype);
|
||||||
UNSAFE.putObject(this, ptypesOffset, ptypes);
|
UNSAFE.putObject(this, OffsetHolder.ptypesOffset, ptypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support for resetting final fields while deserializing
|
// Support for resetting final fields while deserializing. Implement Holder
|
||||||
private static final long rtypeOffset, ptypesOffset;
|
// pattern to make the rarely needed offset calculation lazy.
|
||||||
static {
|
private static class OffsetHolder {
|
||||||
try {
|
private static final long rtypeOffset, ptypesOffset;
|
||||||
rtypeOffset = UNSAFE.objectFieldOffset
|
static {
|
||||||
(MethodType.class.getDeclaredField("rtype"));
|
try {
|
||||||
ptypesOffset = UNSAFE.objectFieldOffset
|
rtypeOffset = UNSAFE.objectFieldOffset
|
||||||
(MethodType.class.getDeclaredField("ptypes"));
|
(MethodType.class.getDeclaredField("rtype"));
|
||||||
} catch (Exception ex) {
|
ptypesOffset = UNSAFE.objectFieldOffset
|
||||||
throw new Error(ex);
|
(MethodType.class.getDeclaredField("ptypes"));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new Error(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -123,25 +123,27 @@ import java.util.Locale;
|
|||||||
* <ul>
|
* <ul>
|
||||||
* <li> "CLDR": A provider based on Unicode Consortium's
|
* <li> "CLDR": A provider based on Unicode Consortium's
|
||||||
* <a href="http://cldr.unicode.org/">CLDR Project</a>.
|
* <a href="http://cldr.unicode.org/">CLDR Project</a>.
|
||||||
* <li> "JRE": represents the locale sensitive services that is compatible
|
* <li> "COMPAT": represents the locale sensitive services that is compatible
|
||||||
* with the prior JDK releases (same with JDK8's "JRE").
|
* with the prior JDK releases up to JDK8 (same as JDK8's "JRE").
|
||||||
* <li> "SPI": represents the locale sensitive services implementing the subclasses of
|
* <li> "SPI": represents the locale sensitive services implementing the subclasses of
|
||||||
* this {@code LocaleServiceProvider} class.
|
* this {@code LocaleServiceProvider} class.
|
||||||
* <li> "HOST": A provider that reflects the user's custom settings in the
|
* <li> "HOST": A provider that reflects the user's custom settings in the
|
||||||
* underlying operating system. This provider may not be available, depending
|
* underlying operating system. This provider may not be available, depending
|
||||||
* on the Java Runtime Environment implementation.
|
* on the Java Runtime Environment implementation.
|
||||||
|
* <li> "JRE": represents a synonym to "COMPAT". This name
|
||||||
|
* is deprecated and will be removed in the future release of JDK.
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* For example, if the following is specified in the property:
|
* For example, if the following is specified in the property:
|
||||||
* <pre>
|
* <pre>
|
||||||
* java.locale.providers=SPI,CLDR,JRE
|
* java.locale.providers=SPI,CLDR,COMPAT
|
||||||
* </pre>
|
* </pre>
|
||||||
* the locale sensitive services in the SPI providers are looked up first. If the
|
* the locale sensitive services in the SPI providers are looked up first. If the
|
||||||
* desired locale sensitive service is not available, then the runtime looks for CLDR,
|
* desired locale sensitive service is not available, then the runtime looks for CLDR,
|
||||||
* JRE in that order.
|
* COMPAT in that order.
|
||||||
* <p>
|
* <p>
|
||||||
* The default order for looking up the preferred locale providers is "CLDR,JRE",
|
* The default order for looking up the preferred locale providers is "CLDR,COMPAT",
|
||||||
* so specifying "CLDR,JRE" is identical to the default behavior. Applications which
|
* so specifying "CLDR,COMPAT" is identical to the default behavior. Applications which
|
||||||
* require implementations of the locale sensitive services must explicitly specify
|
* require implementations of the locale sensitive services must explicitly specify
|
||||||
* "SPI" in order for the Java runtime to load them from the classpath.
|
* "SPI" in order for the Java runtime to load them from the classpath.
|
||||||
*
|
*
|
||||||
|
@ -124,6 +124,10 @@ public abstract class LocaleProviderAdapter {
|
|||||||
if (order != null && order.length() != 0) {
|
if (order != null && order.length() != 0) {
|
||||||
String[] types = order.split(",");
|
String[] types = order.split(",");
|
||||||
for (String type : types) {
|
for (String type : types) {
|
||||||
|
type = type.trim().toUpperCase(Locale.ROOT);
|
||||||
|
if (type.equals("COMPAT")) {
|
||||||
|
type = "JRE";
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Type aType = Type.valueOf(type.trim().toUpperCase(Locale.ROOT));
|
Type aType = Type.valueOf(type.trim().toUpperCase(Locale.ROOT));
|
||||||
if (!typeList.contains(aType)) {
|
if (!typeList.contains(aType)) {
|
||||||
|
@ -26,8 +26,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
#include "jni_util.h"
|
|
||||||
#include "jdk_util.h"
|
|
||||||
#include "endian.hpp"
|
#include "endian.hpp"
|
||||||
#include "imageDecompressor.hpp"
|
#include "imageDecompressor.hpp"
|
||||||
#include "imageFile.hpp"
|
#include "imageFile.hpp"
|
||||||
@ -39,6 +38,17 @@
|
|||||||
|
|
||||||
extern bool MemoryMapImage;
|
extern bool MemoryMapImage;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Static function for primitive throw since libjimage is not linked with libjava
|
||||||
|
static void JNICALL ThrowByName(JNIEnv *env, const char *name, const char *msg)
|
||||||
|
{
|
||||||
|
jclass cls = (env)->FindClass(name);
|
||||||
|
|
||||||
|
if (cls != 0) /* Otherwise an exception has already been thrown */
|
||||||
|
(env)->ThrowNew(cls, msg);
|
||||||
|
}
|
||||||
|
|
||||||
// jdk.internal.jimage /////////////////////////////////////////////////////////
|
// jdk.internal.jimage /////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Java entry to open an image file for sharing.
|
// Java entry to open an image file for sharing.
|
||||||
@ -446,6 +456,23 @@ JNIEXPORT jlong JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Fi
|
|||||||
jlong size = 0;
|
jlong size = 0;
|
||||||
jlong ret = 0;
|
jlong ret = 0;
|
||||||
|
|
||||||
|
if (moduleName == NULL) {
|
||||||
|
ThrowByName(env, "java/lang/NullPointerException", "moduleName");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (version == NULL) {
|
||||||
|
ThrowByName(env, "java/lang/NullPointerException", "version");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (path == NULL) {
|
||||||
|
ThrowByName(env, "java/lang/NullPointerException", "path");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (output_size == NULL) {
|
||||||
|
ThrowByName(env, "java/lang/NullPointerException", "size");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
native_module = env->GetStringUTFChars(moduleName, NULL);
|
native_module = env->GetStringUTFChars(moduleName, NULL);
|
||||||
if (native_module == NULL)
|
if (native_module == NULL)
|
||||||
@ -529,25 +556,47 @@ static bool resourceVisitor(JImageFile* image,
|
|||||||
// Store if there is room in the array
|
// Store if there is room in the array
|
||||||
// Concatenate to get full path
|
// Concatenate to get full path
|
||||||
char fullpath[IMAGE_MAX_PATH];
|
char fullpath[IMAGE_MAX_PATH];
|
||||||
fullpath[0] = '\0';
|
size_t moduleLen = strlen(module);
|
||||||
if (*module != '\0') {
|
size_t packageLen = strlen(package);
|
||||||
strncpy(fullpath, "/", IMAGE_MAX_PATH - 1);
|
size_t nameLen = strlen(name);
|
||||||
strncat(fullpath, module, IMAGE_MAX_PATH - 1);
|
size_t extLen = strlen(extension);
|
||||||
strncat(fullpath, "/", IMAGE_MAX_PATH - 1);
|
size_t index;
|
||||||
|
|
||||||
|
if (1 + moduleLen + 1 + packageLen + 1 + nameLen + 1 + extLen + 1 > IMAGE_MAX_PATH) {
|
||||||
|
ThrowByName(env, "java/lang/InternalError", "concatenated name too long");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if (*package != '\0') {
|
|
||||||
strncat(fullpath, package, IMAGE_MAX_PATH - 1);
|
index = 0;
|
||||||
strncat(fullpath, "/", IMAGE_MAX_PATH - 1);
|
if (moduleLen > 0) {
|
||||||
|
fullpath[index++] = '/';
|
||||||
|
memcpy(&fullpath[index], module, moduleLen);
|
||||||
|
index += moduleLen;
|
||||||
|
fullpath[index++] = '/';
|
||||||
}
|
}
|
||||||
strncat(fullpath, name, IMAGE_MAX_PATH - 1);
|
if (packageLen > 0) {
|
||||||
if (*extension != '\0') {
|
memcpy(&fullpath[index], package, packageLen);
|
||||||
strncat(fullpath, ".", IMAGE_MAX_PATH - 1);
|
index += packageLen;
|
||||||
strncat(fullpath, extension, IMAGE_MAX_PATH - 1);
|
fullpath[index++] = '/';
|
||||||
}
|
}
|
||||||
|
memcpy(&fullpath[index], name, nameLen);
|
||||||
|
index += nameLen;
|
||||||
|
if (extLen > 0) {
|
||||||
|
fullpath[index++] = '.';
|
||||||
|
memcpy(&fullpath[index], extension, extLen);
|
||||||
|
index += extLen;
|
||||||
|
}
|
||||||
|
fullpath[index++] = '\0';
|
||||||
|
|
||||||
jobject str = env->NewStringUTF(fullpath);
|
jobject str = env->NewStringUTF(fullpath);
|
||||||
JNU_CHECK_EXCEPTION_RETURN(env, true);
|
if (env->ExceptionCheck()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
env->SetObjectArrayElement(vdata->array, vdata->size, str);
|
env->SetObjectArrayElement(vdata->array, vdata->size, str);
|
||||||
JNU_CHECK_EXCEPTION_RETURN(env, true);
|
if (env->ExceptionCheck()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
vdata->size++; // always count so the total size is returned
|
vdata->size++; // always count so the total size is returned
|
||||||
return true;
|
return true;
|
||||||
@ -584,7 +633,10 @@ JNIEXPORT jstring JNICALL Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1
|
|||||||
jstring module = NULL;
|
jstring module = NULL;
|
||||||
|
|
||||||
native_package = env->GetStringUTFChars(package_name, NULL);
|
native_package = env->GetStringUTFChars(package_name, NULL);
|
||||||
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
|
if (env->ExceptionCheck()) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
native_module = JIMAGE_PackageToModule((JImageFile*) jimageHandle, native_package);
|
native_module = JIMAGE_PackageToModule((JImageFile*) jimageHandle, native_package);
|
||||||
if (native_module != NULL) {
|
if (native_module != NULL) {
|
||||||
|
@ -102,14 +102,29 @@ extern "C" const char* JIMAGE_PackageToModule(JImageFile* image, const char* pac
|
|||||||
extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* image,
|
extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* image,
|
||||||
const char* module_name, const char* version, const char* name,
|
const char* module_name, const char* version, const char* name,
|
||||||
jlong* size) {
|
jlong* size) {
|
||||||
ImageLocation location;
|
|
||||||
char fullpath[IMAGE_MAX_PATH];
|
|
||||||
|
|
||||||
// Concatenate to get full path
|
// Concatenate to get full path
|
||||||
strncpy(fullpath, "/", IMAGE_MAX_PATH - 1);
|
char fullpath[IMAGE_MAX_PATH];
|
||||||
strncat(fullpath, module_name, IMAGE_MAX_PATH - 1);
|
size_t moduleNameLen = strlen(module_name);
|
||||||
strncat(fullpath, "/", IMAGE_MAX_PATH - 1);
|
size_t nameLen = strlen(name);
|
||||||
strncat(fullpath, name, IMAGE_MAX_PATH - 1);
|
size_t index;
|
||||||
|
|
||||||
|
// TBD: assert(moduleNameLen > 0 && "module name must be non-empty");
|
||||||
|
assert(nameLen > 0 && "name must non-empty");
|
||||||
|
|
||||||
|
// If the concatenated string is too long for the buffer, return not found
|
||||||
|
if (1 + moduleNameLen + 1 + nameLen + 1 > IMAGE_MAX_PATH) {
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
index = 0;
|
||||||
|
fullpath[index++] = '/';
|
||||||
|
memcpy(&fullpath[index], module_name, moduleNameLen);
|
||||||
|
index += moduleNameLen;
|
||||||
|
fullpath[index++] = '/';
|
||||||
|
memcpy(&fullpath[index], name, nameLen);
|
||||||
|
index += nameLen;
|
||||||
|
fullpath[index++] = '\0';
|
||||||
|
|
||||||
JImageLocationRef loc =
|
JImageLocationRef loc =
|
||||||
(JImageLocationRef) ((ImageFileReader*) image)->find_location_index(fullpath, (u8*) size);
|
(JImageLocationRef) ((ImageFileReader*) image)->find_location_index(fullpath, (u8*) size);
|
||||||
return loc;
|
return loc;
|
||||||
|
@ -72,6 +72,7 @@ JFIF=image/x-java-image;class=java.awt.Image
|
|||||||
TIFF=image/x-java-image;class=java.awt.Image
|
TIFF=image/x-java-image;class=java.awt.Image
|
||||||
RICH_TEXT=text/rtf
|
RICH_TEXT=text/rtf
|
||||||
HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
|
HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
|
||||||
URL=application/x-java-url;class=java.net.URL,\
|
URL=application/x-java-url;class=java.net.URL
|
||||||
text/uri-list;eoln="\r\n";terminators=1
|
FILE_NAME=text/uri-list;eoln="\r\n";terminators=1
|
||||||
|
URL=text/uri-list;eoln="\r\n";terminators=1
|
||||||
XPICT=image/x-pict;class=java.io.InputStream
|
XPICT=image/x-pict;class=java.io.InputStream
|
||||||
|
@ -845,7 +845,7 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI {
|
|||||||
boolean isDefaultFocusReceiver(final JComponent component) {
|
boolean isDefaultFocusReceiver(final JComponent component) {
|
||||||
if (isDefaultFocusReceiver == null) {
|
if (isDefaultFocusReceiver == null) {
|
||||||
Component defaultFocusReceiver = KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy().getDefaultComponent(getTopLevelFocusCycleRootAncestor(component));
|
Component defaultFocusReceiver = KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy().getDefaultComponent(getTopLevelFocusCycleRootAncestor(component));
|
||||||
isDefaultFocusReceiver = new Boolean(defaultFocusReceiver != null && defaultFocusReceiver.equals(component));
|
isDefaultFocusReceiver = defaultFocusReceiver != null && defaultFocusReceiver.equals(component);
|
||||||
}
|
}
|
||||||
return isDefaultFocusReceiver.booleanValue();
|
return isDefaultFocusReceiver.booleanValue();
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class CAccessibility implements PropertyChangeListener {
|
|||||||
final AccessibleSelection as = ac.getAccessibleSelection();
|
final AccessibleSelection as = ac.getAccessibleSelection();
|
||||||
if (as == null) return Boolean.FALSE;
|
if (as == null) return Boolean.FALSE;
|
||||||
|
|
||||||
return new Boolean(as.isAccessibleChildSelected(index));
|
return as.isAccessibleChildSelected(index);
|
||||||
}
|
}
|
||||||
}, c);
|
}, c);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. 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.
|
||||||
@ -28,12 +29,13 @@ package sun.lwawt.macosx;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.text.Normalizer;
|
import java.text.Normalizer;
|
||||||
import java.text.Normalizer.Form;
|
import java.text.Normalizer.Form;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.*;
|
|
||||||
|
|
||||||
import java.awt.datatransfer.*;
|
import java.awt.datatransfer.*;
|
||||||
import sun.awt.datatransfer.*;
|
import sun.awt.datatransfer.*;
|
||||||
@ -127,51 +129,33 @@ public class CDataTransferer extends DataTransferer {
|
|||||||
long format, Transferable transferable) throws IOException {
|
long format, Transferable transferable) throws IOException {
|
||||||
|
|
||||||
if (format == CF_URL && URL.class.equals(flavor.getRepresentationClass())) {
|
if (format == CF_URL && URL.class.equals(flavor.getRepresentationClass())) {
|
||||||
String charset = Charset.defaultCharset().name();
|
String[] strings = dragQueryFile(bytes);
|
||||||
if (transferable != null && transferable.isDataFlavorSupported(javaTextEncodingFlavor)) {
|
if(strings == null || strings.length == 0) {
|
||||||
try {
|
return null;
|
||||||
charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), "UTF-8");
|
|
||||||
} catch (UnsupportedFlavorException cannotHappen) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
String xml = new String(bytes, charset);
|
return new URL(strings[0]);
|
||||||
// macosx pasteboard returns a property list that consists of one URL
|
} else if(isUriListFlavor(flavor)) {
|
||||||
// let's extract it.
|
// dragQueryFile works fine with files and url,
|
||||||
return new URL(extractURL(xml));
|
// it parses and extracts values from property list.
|
||||||
}
|
// maxosx always returns property list for
|
||||||
|
// CF_URL and CF_FILE
|
||||||
if (format == CF_STRING) {
|
String[] strings = dragQueryFile(bytes);
|
||||||
|
if(strings == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
bytes = String.join(System.getProperty("line.separator"),
|
||||||
|
strings).getBytes();
|
||||||
|
// now we extracted uri from xml, now we should treat it as
|
||||||
|
// regular string that allows to translate data to target represantation
|
||||||
|
// class by base method
|
||||||
|
format = CF_STRING;
|
||||||
|
} else if (format == CF_STRING) {
|
||||||
bytes = Normalizer.normalize(new String(bytes, "UTF8"), Form.NFC).getBytes("UTF8");
|
bytes = Normalizer.normalize(new String(bytes, "UTF8"), Form.NFC).getBytes("UTF8");
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.translateBytes(bytes, flavor, format, transferable);
|
return super.translateBytes(bytes, flavor, format, transferable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Macosx pasteboard returns xml document that contains one URL, for exmple:
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* <?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
|
||||||
* <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
|
|
||||||
* <plist version=\"1.0\">
|
|
||||||
* <array>
|
|
||||||
* <string>file:///path_to_file</string>
|
|
||||||
* <string></string>
|
|
||||||
* </array>
|
|
||||||
* </plist>
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
*/
|
|
||||||
private String extractURL(String xml) {
|
|
||||||
Pattern urlExtractorPattern = Pattern.compile("<string>(.*)</string>");
|
|
||||||
Matcher matcher = urlExtractorPattern.matcher(xml);
|
|
||||||
if (matcher.find()) {
|
|
||||||
return matcher.group(1);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected synchronized Long getFormatForNativeAsLong(String str) {
|
protected synchronized Long getFormatForNativeAsLong(String str) {
|
||||||
Long format = predefinedClipboardNameMap.get(str);
|
Long format = predefinedClipboardNameMap.get(str);
|
||||||
@ -247,6 +231,7 @@ public class CDataTransferer extends DataTransferer {
|
|||||||
return nativeDragQueryFile(bytes);
|
return nativeDragQueryFile(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Image platformImageBytesToImage(byte[] bytes, long format) throws IOException {
|
protected Image platformImageBytesToImage(byte[] bytes, long format) throws IOException {
|
||||||
return CImage.getCreator().createImageFromPlatformImageBytes(bytes);
|
return CImage.getCreator().createImageFromPlatformImageBytes(bytes);
|
||||||
@ -271,7 +256,7 @@ public class CDataTransferer extends DataTransferer {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
DataFlavor df = new DataFlavor(nat);
|
DataFlavor df = new DataFlavor(nat);
|
||||||
if (df.getPrimaryType().equals("text") && df.getSubType().equals("uri-list")) {
|
if (isUriListFlavor(df)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -279,4 +264,11 @@ public class CDataTransferer extends DataTransferer {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isUriListFlavor(DataFlavor df) {
|
||||||
|
if (df.getPrimaryType().equals("text") && df.getSubType().equals("uri-list")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ public final class LWCToolkit extends LWToolkit {
|
|||||||
desktopProperties.put("DnD.Autoscroll.interval", new Integer(50));
|
desktopProperties.put("DnD.Autoscroll.interval", new Integer(50));
|
||||||
desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5));
|
desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5));
|
||||||
|
|
||||||
desktopProperties.put("DnD.isDragImageSupported", new Boolean(true));
|
desktopProperties.put("DnD.isDragImageSupported", Boolean.TRUE);
|
||||||
|
|
||||||
// Register DnD cursors
|
// Register DnD cursors
|
||||||
desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop"));
|
desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop"));
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#import "AWT_debug.h"
|
#import "AWT_debug.h"
|
||||||
|
|
||||||
#import "jni_util.h"
|
#import "jni_util.h"
|
||||||
|
#import "ThreadUtilities.h"
|
||||||
|
|
||||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||||
|
|
||||||
@ -114,17 +115,20 @@ static void displaycb_handle
|
|||||||
{
|
{
|
||||||
if (flags == kCGDisplayBeginConfigurationFlag) return;
|
if (flags == kCGDisplayBeginConfigurationFlag) return;
|
||||||
|
|
||||||
JNFPerformEnvBlock(JNFThreadDetachImmediately, ^(JNIEnv *env) {
|
[ThreadUtilities performOnMainThreadWaiting:NO block:^() {
|
||||||
JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)userInfo;
|
|
||||||
|
|
||||||
jobject graphicsEnv = [wrapper jObjectWithEnv:env];
|
JNFPerformEnvBlock(JNFThreadDetachImmediately, ^(JNIEnv *env) {
|
||||||
if (graphicsEnv == NULL) return; // ref already GC'd
|
JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)userInfo;
|
||||||
static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment");
|
|
||||||
static JNF_MEMBER_CACHE(jm_displayReconfiguration, jc_CGraphicsEnvironment, "_displayReconfiguration", "(IZ)V");
|
jobject graphicsEnv = [wrapper jObjectWithEnv:env];
|
||||||
JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration,
|
if (graphicsEnv == NULL) return; // ref already GC'd
|
||||||
(jint) display,
|
static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment");
|
||||||
(jboolean) flags & kCGDisplayRemoveFlag);
|
static JNF_MEMBER_CACHE(jm_displayReconfiguration,
|
||||||
});
|
jc_CGraphicsEnvironment, "_displayReconfiguration","(IZ)V");
|
||||||
|
JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration,
|
||||||
|
(jint) display, (jboolean) flags & kCGDisplayRemoveFlag);
|
||||||
|
});
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -233,6 +233,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSOpenGLPixelFormatAttribute attrs[] = {
|
NSOpenGLPixelFormatAttribute attrs[] = {
|
||||||
|
NSOpenGLPFAAllowOfflineRenderers,
|
||||||
NSOpenGLPFAClosestPolicy,
|
NSOpenGLPFAClosestPolicy,
|
||||||
NSOpenGLPFAWindow,
|
NSOpenGLPFAWindow,
|
||||||
NSOpenGLPFAPixelBuffer,
|
NSOpenGLPFAPixelBuffer,
|
||||||
|
@ -247,11 +247,11 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
|||||||
node.appendChild(subNode);
|
node.appendChild(subNode);
|
||||||
|
|
||||||
subNode = new IIOMetadataNode("HorizontalPhysicalPixelSpacing");
|
subNode = new IIOMetadataNode("HorizontalPhysicalPixelSpacing");
|
||||||
subNode.setAttribute("value", "" + (1 / xPixelsPerMeter * 1000));
|
subNode.setAttribute("value", "" + (1000.0F / xPixelsPerMeter));
|
||||||
node.appendChild(subNode);
|
node.appendChild(subNode);
|
||||||
|
|
||||||
subNode = new IIOMetadataNode("VerticalPhysicalPixelSpacing");
|
subNode = new IIOMetadataNode("VerticalPhysicalPixelSpacing");
|
||||||
subNode.setAttribute("value", "" + (1 / yPixelsPerMeter * 1000));
|
subNode.setAttribute("value", "" + (1000.0F / yPixelsPerMeter));
|
||||||
node.appendChild(subNode);
|
node.appendChild(subNode);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
@ -312,7 +312,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
* @see GraphicsConfiguration
|
* @see GraphicsConfiguration
|
||||||
* @see #getGraphicsConfiguration
|
* @see #getGraphicsConfiguration
|
||||||
*/
|
*/
|
||||||
private transient GraphicsConfiguration graphicsConfig = null;
|
private transient volatile GraphicsConfiguration graphicsConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reference to a <code>BufferStrategy</code> object
|
* A reference to a <code>BufferStrategy</code> object
|
||||||
@ -1143,9 +1143,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
* @since 1.3
|
* @since 1.3
|
||||||
*/
|
*/
|
||||||
public GraphicsConfiguration getGraphicsConfiguration() {
|
public GraphicsConfiguration getGraphicsConfiguration() {
|
||||||
synchronized(getTreeLock()) {
|
return getGraphicsConfiguration_NoClientCode();
|
||||||
return getGraphicsConfiguration_NoClientCode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
|
final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
|
||||||
@ -3622,18 +3620,17 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an off-screen drawable image
|
* Creates an off-screen drawable image to be used for double buffering.
|
||||||
* to be used for double buffering.
|
*
|
||||||
* @param width the specified width
|
* @param width the specified width
|
||||||
* @param height the specified height
|
* @param height the specified height
|
||||||
* @return an off-screen drawable image, which can be used for double
|
* @return an off-screen drawable image, which can be used for double
|
||||||
* buffering. The return value may be <code>null</code> if the
|
* buffering. The {@code null} value if the component is not
|
||||||
* component is not displayable. This will always happen if
|
* displayable or {@code GraphicsEnvironment.isHeadless()} returns
|
||||||
* <code>GraphicsEnvironment.isHeadless()</code> returns
|
* {@code true}.
|
||||||
* <code>true</code>.
|
|
||||||
* @see #isDisplayable
|
* @see #isDisplayable
|
||||||
* @see GraphicsEnvironment#isHeadless
|
* @see GraphicsEnvironment#isHeadless
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public Image createImage(int width, int height) {
|
public Image createImage(int width, int height) {
|
||||||
ComponentPeer peer = this.peer;
|
ComponentPeer peer = this.peer;
|
||||||
@ -3646,19 +3643,19 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a volatile off-screen drawable image
|
* Creates a volatile off-screen drawable image to be used for double
|
||||||
* to be used for double buffering.
|
* buffering.
|
||||||
* @param width the specified width.
|
*
|
||||||
* @param height the specified height.
|
* @param width the specified width
|
||||||
* @return an off-screen drawable image, which can be used for double
|
* @param height the specified height
|
||||||
* buffering. The return value may be <code>null</code> if the
|
* @return an off-screen drawable image, which can be used for double
|
||||||
* component is not displayable. This will always happen if
|
* buffering. The {@code null} value if the component is not
|
||||||
* <code>GraphicsEnvironment.isHeadless()</code> returns
|
* displayable or {@code GraphicsEnvironment.isHeadless()} returns
|
||||||
* <code>true</code>.
|
* {@code true}.
|
||||||
* @see java.awt.image.VolatileImage
|
* @see java.awt.image.VolatileImage
|
||||||
* @see #isDisplayable
|
* @see #isDisplayable
|
||||||
* @see GraphicsEnvironment#isHeadless
|
* @see GraphicsEnvironment#isHeadless
|
||||||
* @since 1.4
|
* @since 1.4
|
||||||
*/
|
*/
|
||||||
public VolatileImage createVolatileImage(int width, int height) {
|
public VolatileImage createVolatileImage(int width, int height) {
|
||||||
ComponentPeer peer = this.peer;
|
ComponentPeer peer = this.peer;
|
||||||
@ -3674,22 +3671,26 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a volatile off-screen drawable image, with the given capabilities.
|
* Creates a volatile off-screen drawable image, with the given
|
||||||
* The contents of this image may be lost at any time due
|
* capabilities. The contents of this image may be lost at any time due to
|
||||||
* to operating system issues, so the image must be managed
|
* operating system issues, so the image must be managed via the
|
||||||
* via the <code>VolatileImage</code> interface.
|
* {@code VolatileImage} interface.
|
||||||
* @param width the specified width.
|
*
|
||||||
* @param height the specified height.
|
* @param width the specified width
|
||||||
* @param caps the image capabilities
|
* @param height the specified height
|
||||||
* @exception AWTException if an image with the specified capabilities cannot
|
* @param caps the image capabilities
|
||||||
* be created
|
* @return a VolatileImage object, which can be used to manage surface
|
||||||
* @return a VolatileImage object, which can be used
|
* contents loss and capabilities. The {@code null} value if the
|
||||||
* to manage surface contents loss and capabilities.
|
* component is not displayable or
|
||||||
|
* {@code GraphicsEnvironment.isHeadless()} returns {@code true}.
|
||||||
|
* @throws AWTException if an image with the specified capabilities cannot
|
||||||
|
* be created
|
||||||
* @see java.awt.image.VolatileImage
|
* @see java.awt.image.VolatileImage
|
||||||
* @since 1.4
|
* @since 1.4
|
||||||
*/
|
*/
|
||||||
public VolatileImage createVolatileImage(int width, int height,
|
public VolatileImage createVolatileImage(int width, int height,
|
||||||
ImageCapabilities caps) throws AWTException {
|
ImageCapabilities caps)
|
||||||
|
throws AWTException {
|
||||||
// REMIND : check caps
|
// REMIND : check caps
|
||||||
return createVolatileImage(width, height);
|
return createVolatileImage(width, height);
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ public class Window extends Container implements Accessible {
|
|||||||
* @see #getOpacity()
|
* @see #getOpacity()
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
private float opacity = 1.0f;
|
private volatile float opacity = 1.0f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The shape assigned to this window. This field is set to {@code null} if
|
* The shape assigned to this window. This field is set to {@code null} if
|
||||||
@ -1040,9 +1040,7 @@ public class Window extends Container implements Accessible {
|
|||||||
closeSplashScreen();
|
closeSplashScreen();
|
||||||
Dialog.checkShouldBeBlocked(this);
|
Dialog.checkShouldBeBlocked(this);
|
||||||
super.show();
|
super.show();
|
||||||
synchronized (getTreeLock()) {
|
locationByPlatform = false;
|
||||||
this.locationByPlatform = false;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < ownedWindowList.size(); i++) {
|
for (int i = 0; i < ownedWindowList.size(); i++) {
|
||||||
Window child = ownedWindowList.elementAt(i).get();
|
Window child = ownedWindowList.elementAt(i).get();
|
||||||
if ((child != null) && child.showWithParent) {
|
if ((child != null) && child.showWithParent) {
|
||||||
@ -1115,9 +1113,7 @@ public class Window extends Container implements Accessible {
|
|||||||
modalBlocker.unblockWindow(this);
|
modalBlocker.unblockWindow(this);
|
||||||
}
|
}
|
||||||
super.hide();
|
super.hide();
|
||||||
synchronized (getTreeLock()) {
|
locationByPlatform = false;
|
||||||
this.locationByPlatform = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final void clearMostRecentFocusOwnerOnHide() {
|
final void clearMostRecentFocusOwnerOnHide() {
|
||||||
@ -3411,7 +3407,7 @@ public class Window extends Container implements Accessible {
|
|||||||
return super.canContainFocusOwner(focusOwnerCandidate) && isFocusableWindow();
|
return super.canContainFocusOwner(focusOwnerCandidate) && isFocusableWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean locationByPlatform = locationByPlatformProp;
|
private volatile boolean locationByPlatform = locationByPlatformProp;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3482,9 +3478,7 @@ public class Window extends Container implements Accessible {
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public boolean isLocationByPlatform() {
|
public boolean isLocationByPlatform() {
|
||||||
synchronized (getTreeLock()) {
|
return locationByPlatform;
|
||||||
return locationByPlatform;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3573,9 +3567,7 @@ public class Window extends Container implements Accessible {
|
|||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
public float getOpacity() {
|
public float getOpacity() {
|
||||||
synchronized (getTreeLock()) {
|
return opacity;
|
||||||
return opacity;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. 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
|
||||||
@ -53,9 +53,7 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public abstract class CachedPainter {
|
public abstract class CachedPainter {
|
||||||
// CacheMap maps from class to ImageCache.
|
// CacheMap maps from class to ImageCache.
|
||||||
private static final Map<Object,ImageCache> cacheMap =
|
private static final Map<Object,ImageCache> cacheMap = new HashMap<>();
|
||||||
new HashMap<Object,ImageCache>();
|
|
||||||
|
|
||||||
|
|
||||||
private static ImageCache getCache(Object key) {
|
private static ImageCache getCache(Object key) {
|
||||||
synchronized(CachedPainter.class) {
|
synchronized(CachedPainter.class) {
|
||||||
@ -96,20 +94,8 @@ public abstract class CachedPainter {
|
|||||||
if (w <= 0 || h <= 0) {
|
if (w <= 0 || h <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c != null) {
|
synchronized (CachedPainter.class) {
|
||||||
synchronized(c.getTreeLock()) {
|
paint0(c, g, x, y, w, h, args);
|
||||||
synchronized(CachedPainter.class) {
|
|
||||||
// If c is non-null, synchronize on the tree lock.
|
|
||||||
// This is necessary because asking for the
|
|
||||||
// GraphicsConfiguration will grab a tree lock.
|
|
||||||
paint0(c, g, x, y, w, h, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
synchronized(CachedPainter.class) {
|
|
||||||
paint0(c, g, x, y, w, h, args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +272,8 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String[] getWMClass() {
|
protected String[] getWMClass() {
|
||||||
return new String[] {XToolkit.getCorrectXIDString(getClass().getName()), XToolkit.getAWTAppClassName()};
|
return new String[] {XToolkit.getAWTAppClassName(),
|
||||||
|
XToolkit.getAWTAppClassName()};
|
||||||
}
|
}
|
||||||
|
|
||||||
void setReparented(boolean newValue) {
|
void setReparented(boolean newValue) {
|
||||||
@ -992,10 +993,13 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
// if ( Check if it's a resize, a move, or a stacking order change )
|
// if ( Check if it's a resize, a move, or a stacking order change )
|
||||||
// {
|
// {
|
||||||
Rectangle bounds = getBounds();
|
Rectangle bounds = getBounds();
|
||||||
|
final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
|
||||||
if (!bounds.getSize().equals(oldBounds.getSize())) {
|
if (!bounds.getSize().equals(oldBounds.getSize())) {
|
||||||
|
acc.setSize(target, bounds.width, bounds.height);
|
||||||
postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED));
|
postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED));
|
||||||
}
|
}
|
||||||
if (!bounds.getLocation().equals(oldBounds.getLocation())) {
|
if (!bounds.getLocation().equals(oldBounds.getLocation())) {
|
||||||
|
acc.setLocation(target, bounds.x, bounds.y);
|
||||||
postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED));
|
postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED));
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
@ -494,24 +494,48 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
*/
|
*/
|
||||||
float fontSize = font.getSize2D();
|
float fontSize = font.getSize2D();
|
||||||
|
|
||||||
|
double devResX = wPrinterJob.getXRes();
|
||||||
|
double devResY = wPrinterJob.getYRes();
|
||||||
|
|
||||||
|
double fontDevScaleY = devResY / DEFAULT_USER_RES;
|
||||||
|
|
||||||
|
int orient = getPageFormat().getOrientation();
|
||||||
|
if (orient == PageFormat.LANDSCAPE ||
|
||||||
|
orient == PageFormat.REVERSE_LANDSCAPE)
|
||||||
|
{
|
||||||
|
double tmp = devResX;
|
||||||
|
devResX = devResY;
|
||||||
|
devResY = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
double devScaleX = devResX / DEFAULT_USER_RES;
|
||||||
|
double devScaleY = devResY / DEFAULT_USER_RES;
|
||||||
|
fontTransform.scale(1.0/devScaleX, 1.0/devScaleY);
|
||||||
|
|
||||||
Point2D.Double pty = new Point2D.Double(0.0, 1.0);
|
Point2D.Double pty = new Point2D.Double(0.0, 1.0);
|
||||||
fontTransform.deltaTransform(pty, pty);
|
fontTransform.deltaTransform(pty, pty);
|
||||||
double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
|
double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
|
||||||
float scaledFontSizeY = (float)(fontSize * scaleFactorY);
|
float scaledFontSizeY = (float)(fontSize * scaleFactorY * fontDevScaleY);
|
||||||
|
|
||||||
Point2D.Double ptx = new Point2D.Double(1.0, 0.0);
|
Point2D.Double ptx = new Point2D.Double(1.0, 0.0);
|
||||||
fontTransform.deltaTransform(ptx, ptx);
|
fontTransform.deltaTransform(ptx, ptx);
|
||||||
double scaleFactorX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y);
|
double scaleFactorX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y);
|
||||||
float scaledFontSizeX = (float)(fontSize * scaleFactorX);
|
|
||||||
|
|
||||||
float awScale = getAwScale(scaleFactorX, scaleFactorY);
|
float awScale = getAwScale(scaleFactorX, scaleFactorY);
|
||||||
int iangle = getAngle(ptx);
|
int iangle = getAngle(ptx);
|
||||||
|
|
||||||
|
ptx = new Point2D.Double(1.0, 0.0);
|
||||||
|
deviceTransform.deltaTransform(ptx, ptx);
|
||||||
|
double advanceScaleX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y);
|
||||||
|
pty = new Point2D.Double(0.0, 1.0);
|
||||||
|
deviceTransform.deltaTransform(pty, pty);
|
||||||
|
double advanceScaleY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
|
||||||
|
|
||||||
Font2D font2D = FontUtilities.getFont2D(font);
|
Font2D font2D = FontUtilities.getFont2D(font);
|
||||||
if (font2D instanceof TrueTypeFont) {
|
if (font2D instanceof TrueTypeFont) {
|
||||||
textOut(str, font, (TrueTypeFont)font2D, frc,
|
textOut(str, font, (TrueTypeFont)font2D, frc,
|
||||||
scaledFontSizeY, iangle, awScale,
|
scaledFontSizeY, iangle, awScale,
|
||||||
deviceTransform, scaleFactorX,
|
advanceScaleX, advanceScaleY,
|
||||||
x, y, devpos.x, devpos.y, targetW);
|
x, y, devpos.x, devpos.y, targetW);
|
||||||
} else if (font2D instanceof CompositeFont) {
|
} else if (font2D instanceof CompositeFont) {
|
||||||
/* Composite fonts are made up of multiple fonts and each
|
/* Composite fonts are made up of multiple fonts and each
|
||||||
@ -542,7 +566,7 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
PhysicalFont slotFont = compFont.getSlotFont(slot);
|
PhysicalFont slotFont = compFont.getSlotFont(slot);
|
||||||
textOut(substr, font, slotFont, frc,
|
textOut(substr, font, slotFont, frc,
|
||||||
scaledFontSizeY, iangle, awScale,
|
scaledFontSizeY, iangle, awScale,
|
||||||
deviceTransform, scaleFactorX,
|
advanceScaleX, advanceScaleY,
|
||||||
userx, usery, devx, devy, 0f);
|
userx, usery, devx, devy, 0f);
|
||||||
Rectangle2D bds = font.getStringBounds(substr, frc);
|
Rectangle2D bds = font.getStringBounds(substr, frc);
|
||||||
float xAdvance = (float)bds.getWidth();
|
float xAdvance = (float)bds.getWidth();
|
||||||
@ -635,18 +659,42 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
*/
|
*/
|
||||||
float fontSize = font.getSize2D();
|
float fontSize = font.getSize2D();
|
||||||
|
|
||||||
|
double devResX = wPrinterJob.getXRes();
|
||||||
|
double devResY = wPrinterJob.getYRes();
|
||||||
|
|
||||||
|
double fontDevScaleY = devResY / DEFAULT_USER_RES;
|
||||||
|
|
||||||
|
int orient = getPageFormat().getOrientation();
|
||||||
|
if (orient == PageFormat.LANDSCAPE ||
|
||||||
|
orient == PageFormat.REVERSE_LANDSCAPE)
|
||||||
|
{
|
||||||
|
double tmp = devResX;
|
||||||
|
devResX = devResY;
|
||||||
|
devResY = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
double devScaleX = devResX / DEFAULT_USER_RES;
|
||||||
|
double devScaleY = devResY / DEFAULT_USER_RES;
|
||||||
|
fontTransform.scale(1.0/devScaleX, 1.0/devScaleY);
|
||||||
|
|
||||||
Point2D.Double pty = new Point2D.Double(0.0, 1.0);
|
Point2D.Double pty = new Point2D.Double(0.0, 1.0);
|
||||||
fontTransform.deltaTransform(pty, pty);
|
fontTransform.deltaTransform(pty, pty);
|
||||||
double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
|
double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
|
||||||
float scaledFontSizeY = (float)(fontSize * scaleFactorY);
|
float scaledFontSizeY = (float)(fontSize * scaleFactorY * fontDevScaleY);
|
||||||
|
|
||||||
Point2D.Double pt = new Point2D.Double(1.0, 0.0);
|
Point2D.Double ptx = new Point2D.Double(1.0, 0.0);
|
||||||
fontTransform.deltaTransform(pt, pt);
|
fontTransform.deltaTransform(ptx, ptx);
|
||||||
double scaleFactorX = Math.sqrt(pt.x*pt.x+pt.y*pt.y);
|
double scaleFactorX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y);
|
||||||
float scaledFontSizeX = (float)(fontSize * scaleFactorX);
|
|
||||||
|
|
||||||
float awScale = getAwScale(scaleFactorX, scaleFactorY);
|
float awScale = getAwScale(scaleFactorX, scaleFactorY);
|
||||||
int iangle = getAngle(pt);
|
int iangle = getAngle(ptx);
|
||||||
|
|
||||||
|
ptx = new Point2D.Double(1.0, 0.0);
|
||||||
|
deviceTransform.deltaTransform(ptx, ptx);
|
||||||
|
double advanceScaleX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y);
|
||||||
|
pty = new Point2D.Double(0.0, 1.0);
|
||||||
|
deviceTransform.deltaTransform(pty, pty);
|
||||||
|
double advanceScaleY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
|
||||||
|
|
||||||
int numGlyphs = gv.getNumGlyphs();
|
int numGlyphs = gv.getNumGlyphs();
|
||||||
int[] glyphCodes = gv.getGlyphCodes(0, numGlyphs, null);
|
int[] glyphCodes = gv.getGlyphCodes(0, numGlyphs, null);
|
||||||
@ -705,8 +753,7 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
* rotation element of the deviceTransform.
|
* rotation element of the deviceTransform.
|
||||||
*/
|
*/
|
||||||
AffineTransform advanceTransform =
|
AffineTransform advanceTransform =
|
||||||
new AffineTransform(deviceTransform);
|
AffineTransform.getScaleInstance(advanceScaleX, advanceScaleY);
|
||||||
advanceTransform.rotate(iangle*Math.PI/1800.0);
|
|
||||||
float[] glyphAdvPos = new float[glyphPos.length];
|
float[] glyphAdvPos = new float[glyphPos.length];
|
||||||
|
|
||||||
advanceTransform.transform(glyphPos, 0, //source
|
advanceTransform.transform(glyphPos, 0, //source
|
||||||
@ -784,8 +831,7 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
Font font, PhysicalFont font2D,
|
Font font, PhysicalFont font2D,
|
||||||
FontRenderContext frc,
|
FontRenderContext frc,
|
||||||
float deviceSize, int rotation, float awScale,
|
float deviceSize, int rotation, float awScale,
|
||||||
AffineTransform deviceTransform,
|
double scaleFactorX, double scaleFactorY,
|
||||||
double scaleFactorX,
|
|
||||||
float userx, float usery,
|
float userx, float usery,
|
||||||
float devx, float devy, float targetW) {
|
float devx, float devy, float targetW) {
|
||||||
|
|
||||||
@ -826,8 +872,7 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
* See earlier comment in printGlyphVector() for details.
|
* See earlier comment in printGlyphVector() for details.
|
||||||
*/
|
*/
|
||||||
AffineTransform advanceTransform =
|
AffineTransform advanceTransform =
|
||||||
new AffineTransform(deviceTransform);
|
AffineTransform.getScaleInstance(scaleFactorX, scaleFactorY);
|
||||||
advanceTransform.rotate(rotation*Math.PI/1800.0);
|
|
||||||
float[] glyphAdvPos = new float[glyphPos.length];
|
float[] glyphAdvPos = new float[glyphPos.length];
|
||||||
|
|
||||||
advanceTransform.transform(glyphPos, 0, //source
|
advanceTransform.transform(glyphPos, 0, //source
|
||||||
@ -841,11 +886,11 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
/* If 2D and GDI agree on the advance of the string we do not
|
/* If 2D and GDI agree on the advance of the string we do not
|
||||||
* need to explicitly assign glyph positions.
|
* need to explicitly assign glyph positions.
|
||||||
* If we are to use the GDI advance, require it to agree with
|
* If we are to use the GDI advance, require it to agree with
|
||||||
* JDK to a precision of <= 0.2% - ie 1 pixel in 500
|
* JDK to a precision of <= 1.0% - ie 1 pixel in 100
|
||||||
* discrepancy after rounding the 2D advance to the
|
* discrepancy after rounding the 2D advance to the
|
||||||
* nearest pixel and is greater than one pixel in total.
|
* nearest pixel and is greater than one pixel in total.
|
||||||
* ie strings < 500 pixels in length will be OK so long
|
* ie strings < 100 pixels in length will be OK so long
|
||||||
* as they differ by only 1 pixel even though that is > 0.02%
|
* as they differ by only 1 pixel even though that is > 1%
|
||||||
* The bounds from 2D are in user space so need to
|
* The bounds from 2D are in user space so need to
|
||||||
* be scaled to device space for comparison with GDI.
|
* be scaled to device space for comparison with GDI.
|
||||||
* scaleX is the scale from user space to device space needed for this.
|
* scaleX is the scale from user space to device space needed for this.
|
||||||
@ -863,7 +908,7 @@ final class WPathGraphics extends PathGraphics {
|
|||||||
if (ratio < 1) {
|
if (ratio < 1) {
|
||||||
ratio = 1/ratio;
|
ratio = 1/ratio;
|
||||||
}
|
}
|
||||||
return diff <= 1 || ratio < 1.002;
|
return diff <= 1 || ratio < 1.01;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* 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
|
||||||
@ -114,8 +114,9 @@ void SetupThreadGraphicsInfo(JNIEnv *env, GDIWinSDOps *wsdo) {
|
|||||||
// which may've been disposed by this time, and we have
|
// which may've been disposed by this time, and we have
|
||||||
// no means of checking against it.
|
// no means of checking against it.
|
||||||
if (oldhDC != NULL) {
|
if (oldhDC != NULL) {
|
||||||
MoveDCToPassiveList(oldhDC);
|
MoveDCToPassiveList(oldhDC, info->hWnd);
|
||||||
info->hDC = NULL;
|
info->hDC = NULL;
|
||||||
|
info->hWnd = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wsdo->window != NULL){
|
if (wsdo->window != NULL){
|
||||||
@ -150,6 +151,7 @@ void SetupThreadGraphicsInfo(JNIEnv *env, GDIWinSDOps *wsdo) {
|
|||||||
|
|
||||||
// Finally, set these new values in the info for this thread
|
// Finally, set these new values in the info for this thread
|
||||||
info->hDC = hDC;
|
info->hDC = hDC;
|
||||||
|
info->hWnd = wsdo->window;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cached brush and pen are not associated with any DC, and can be
|
// cached brush and pen are not associated with any DC, and can be
|
||||||
@ -187,7 +189,7 @@ void DisposeThreadGraphicsInfo(JNIEnv *env, jlong tgi) {
|
|||||||
if (info->hDC != NULL) {
|
if (info->hDC != NULL) {
|
||||||
// move the DC from the active dcs list to
|
// move the DC from the active dcs list to
|
||||||
// the passive dc list to be released later
|
// the passive dc list to be released later
|
||||||
MoveDCToPassiveList(info->hDC);
|
MoveDCToPassiveList(info->hDC, info->hWnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->clip != NULL) {
|
if (info->clip != NULL) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* 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
|
||||||
@ -196,6 +196,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
|
HWND hWnd;
|
||||||
GDIWinSDOps *wsdo;
|
GDIWinSDOps *wsdo;
|
||||||
LONG wsdoTimeStamp; // wsdo creation time stamp.
|
LONG wsdoTimeStamp; // wsdo creation time stamp.
|
||||||
// Other threads may deallocate wsdo
|
// Other threads may deallocate wsdo
|
||||||
|
@ -1382,7 +1382,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
case WM_AWT_RELEASEDC:
|
case WM_AWT_RELEASEDC:
|
||||||
{
|
{
|
||||||
HDC hDC = (HDC)wParam;
|
HDC hDC = (HDC)wParam;
|
||||||
MoveDCToPassiveList(hDC);
|
MoveDCToPassiveList(hDC, GetHWnd());
|
||||||
ReleaseDCList(GetHWnd(), passiveDCList);
|
ReleaseDCList(GetHWnd(), passiveDCList);
|
||||||
mr = mrConsume;
|
mr = mrConsume;
|
||||||
break;
|
break;
|
||||||
@ -7165,8 +7165,8 @@ void DCList::AddDCItem(DCItem *newItem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a DC, remove it from the DC list and return
|
* Given a DC and window handle, remove the DC from the DC list
|
||||||
* TRUE if it exists on the current list. Otherwise
|
* and return TRUE if it exists on the current list. Otherwise
|
||||||
* return FALSE.
|
* return FALSE.
|
||||||
* A DC may not exist on the list because it has already
|
* A DC may not exist on the list because it has already
|
||||||
* been released elsewhere (for example, the window
|
* been released elsewhere (for example, the window
|
||||||
@ -7174,14 +7174,14 @@ void DCList::AddDCItem(DCItem *newItem)
|
|||||||
* thread may also want to release a DC when it notices that
|
* thread may also want to release a DC when it notices that
|
||||||
* its DC is obsolete for the current window).
|
* its DC is obsolete for the current window).
|
||||||
*/
|
*/
|
||||||
DCItem *DCList::RemoveDC(HDC hDC)
|
DCItem *DCList::RemoveDC(HDC hDC, HWND hWnd)
|
||||||
{
|
{
|
||||||
listLock.Enter();
|
listLock.Enter();
|
||||||
DCItem **prevPtrPtr = &head;
|
DCItem **prevPtrPtr = &head;
|
||||||
DCItem *listPtr = head;
|
DCItem *listPtr = head;
|
||||||
while (listPtr) {
|
while (listPtr) {
|
||||||
DCItem *nextPtr = listPtr->next;
|
DCItem *nextPtr = listPtr->next;
|
||||||
if (listPtr->hDC == hDC) {
|
if (listPtr->hDC == hDC && listPtr->hWnd == hWnd) {
|
||||||
*prevPtrPtr = nextPtr;
|
*prevPtrPtr = nextPtr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -7235,9 +7235,9 @@ void DCList::RealizePalettes(int screen)
|
|||||||
listLock.Leave();
|
listLock.Leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveDCToPassiveList(HDC hDC) {
|
void MoveDCToPassiveList(HDC hDC, HWND hWnd) {
|
||||||
DCItem *removedDC;
|
DCItem *removedDC;
|
||||||
if ((removedDC = activeDCList.RemoveDC(hDC)) != NULL) {
|
if ((removedDC = activeDCList.RemoveDC(hDC, hWnd)) != NULL) {
|
||||||
passiveDCList.AddDCItem(removedDC);
|
passiveDCList.AddDCItem(removedDC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. 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
|
||||||
@ -900,13 +900,13 @@ public:
|
|||||||
|
|
||||||
void AddDC(HDC hDC, HWND hWnd);
|
void AddDC(HDC hDC, HWND hWnd);
|
||||||
void AddDCItem(DCItem *newItem);
|
void AddDCItem(DCItem *newItem);
|
||||||
DCItem *RemoveDC(HDC hDC);
|
DCItem *RemoveDC(HDC hDC, HWND hWnd);
|
||||||
DCItem *RemoveAllDCs(HWND hWnd);
|
DCItem *RemoveAllDCs(HWND hWnd);
|
||||||
void RealizePalettes(int screen);
|
void RealizePalettes(int screen);
|
||||||
};
|
};
|
||||||
|
|
||||||
void ReleaseDCList(HWND hwnd, DCList &list);
|
void ReleaseDCList(HWND hwnd, DCList &list);
|
||||||
void MoveDCToPassiveList(HDC hDC);
|
void MoveDCToPassiveList(HDC hDC, HWND hWnd);
|
||||||
|
|
||||||
#include "ObjectList.h"
|
#include "ObjectList.h"
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ import java.util.WeakHashMap;
|
|||||||
|
|
||||||
import javax.management.JMX;
|
import javax.management.JMX;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
|
import javax.management.ConstructorParameters;
|
||||||
import javax.management.openmbean.ArrayType;
|
import javax.management.openmbean.ArrayType;
|
||||||
import javax.management.openmbean.CompositeData;
|
import javax.management.openmbean.CompositeData;
|
||||||
import javax.management.openmbean.CompositeDataInvocationHandler;
|
import javax.management.openmbean.CompositeDataInvocationHandler;
|
||||||
@ -1132,8 +1133,8 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Builder for when the target class has a constructor that is
|
/** Builder for when the target class has a constructor that is
|
||||||
annotated with @ConstructorProperties so we can see the correspondence
|
annotated with {@linkplain ConstructorParameters @ConstructorParameters}
|
||||||
to getters. */
|
or {@code @ConstructorProperties} so we can see the correspondence to getters. */
|
||||||
private static final class CompositeBuilderViaConstructor
|
private static final class CompositeBuilderViaConstructor
|
||||||
extends CompositeBuilder {
|
extends CompositeBuilder {
|
||||||
|
|
||||||
@ -1141,10 +1142,19 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
super(targetClass, itemNames);
|
super(targetClass, itemNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
String applicable(Method[] getters) throws InvalidObjectException {
|
private String[] getConstPropValues(Constructor<?> ctr) {
|
||||||
if (!JavaBeansAccessor.isAvailable())
|
// is constructor annotated by javax.management.ConstructorParameters ?
|
||||||
return "@ConstructorProperties annotation not available";
|
ConstructorParameters ctrProps = ctr.getAnnotation(ConstructorParameters.class);
|
||||||
|
if (ctrProps != null) {
|
||||||
|
return ctrProps.value();
|
||||||
|
} else {
|
||||||
|
// try the legacy java.beans.ConstructorProperties annotation
|
||||||
|
String[] vals = JavaBeansAccessor.getConstructorPropertiesValue(ctr);
|
||||||
|
return vals;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String applicable(Method[] getters) throws InvalidObjectException {
|
||||||
Class<?> targetClass = getTargetClass();
|
Class<?> targetClass = getTargetClass();
|
||||||
Constructor<?>[] constrs = targetClass.getConstructors();
|
Constructor<?>[] constrs = targetClass.getConstructors();
|
||||||
|
|
||||||
@ -1152,12 +1162,13 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
List<Constructor<?>> annotatedConstrList = newList();
|
List<Constructor<?>> annotatedConstrList = newList();
|
||||||
for (Constructor<?> constr : constrs) {
|
for (Constructor<?> constr : constrs) {
|
||||||
if (Modifier.isPublic(constr.getModifiers())
|
if (Modifier.isPublic(constr.getModifiers())
|
||||||
&& JavaBeansAccessor.getConstructorPropertiesValue(constr) != null)
|
&& getConstPropValues(constr) != null)
|
||||||
annotatedConstrList.add(constr);
|
annotatedConstrList.add(constr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (annotatedConstrList.isEmpty())
|
if (annotatedConstrList.isEmpty())
|
||||||
return "no constructor has @ConstructorProperties annotation";
|
return "no constructor has either @ConstructorParameters " +
|
||||||
|
"or @ConstructorProperties annotation";
|
||||||
|
|
||||||
annotatedConstructors = newList();
|
annotatedConstructors = newList();
|
||||||
|
|
||||||
@ -1181,13 +1192,17 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
// so we can test unambiguity.
|
// so we can test unambiguity.
|
||||||
Set<BitSet> getterIndexSets = newSet();
|
Set<BitSet> getterIndexSets = newSet();
|
||||||
for (Constructor<?> constr : annotatedConstrList) {
|
for (Constructor<?> constr : annotatedConstrList) {
|
||||||
String[] propertyNames = JavaBeansAccessor.getConstructorPropertiesValue(constr);
|
String annotationName =
|
||||||
|
constr.isAnnotationPresent(ConstructorParameters.class) ?
|
||||||
|
"@ConstructorParameters" : "@ConstructorProperties";
|
||||||
|
|
||||||
|
String[] propertyNames = getConstPropValues(constr);
|
||||||
|
|
||||||
Type[] paramTypes = constr.getGenericParameterTypes();
|
Type[] paramTypes = constr.getGenericParameterTypes();
|
||||||
if (paramTypes.length != propertyNames.length) {
|
if (paramTypes.length != propertyNames.length) {
|
||||||
final String msg =
|
final String msg =
|
||||||
"Number of constructor params does not match " +
|
"Number of constructor params does not match " +
|
||||||
"@ConstructorProperties annotation: " + constr;
|
annotationName + " annotation: " + constr;
|
||||||
throw new InvalidObjectException(msg);
|
throw new InvalidObjectException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1200,7 +1215,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
String propertyName = propertyNames[i];
|
String propertyName = propertyNames[i];
|
||||||
if (!getterMap.containsKey(propertyName)) {
|
if (!getterMap.containsKey(propertyName)) {
|
||||||
String msg =
|
String msg =
|
||||||
"@ConstructorProperties includes name " + propertyName +
|
annotationName + " includes name " + propertyName +
|
||||||
" which does not correspond to a property";
|
" which does not correspond to a property";
|
||||||
for (String getterName : getterMap.keySet()) {
|
for (String getterName : getterMap.keySet()) {
|
||||||
if (getterName.equalsIgnoreCase(propertyName)) {
|
if (getterName.equalsIgnoreCase(propertyName)) {
|
||||||
@ -1215,7 +1230,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
paramIndexes[getterIndex] = i;
|
paramIndexes[getterIndex] = i;
|
||||||
if (present.get(getterIndex)) {
|
if (present.get(getterIndex)) {
|
||||||
final String msg =
|
final String msg =
|
||||||
"@ConstructorProperties contains property " +
|
annotationName + " contains property " +
|
||||||
propertyName + " more than once: " + constr;
|
propertyName + " more than once: " + constr;
|
||||||
throw new InvalidObjectException(msg);
|
throw new InvalidObjectException(msg);
|
||||||
}
|
}
|
||||||
@ -1224,7 +1239,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
Type propertyType = getter.getGenericReturnType();
|
Type propertyType = getter.getGenericReturnType();
|
||||||
if (!propertyType.equals(paramTypes[i])) {
|
if (!propertyType.equals(paramTypes[i])) {
|
||||||
final String msg =
|
final String msg =
|
||||||
"@ConstructorProperties gives property " + propertyName +
|
annotationName + " gives property " + propertyName +
|
||||||
" of type " + propertyType + " for parameter " +
|
" of type " + propertyType + " for parameter " +
|
||||||
" of type " + paramTypes[i] + ": " + constr;
|
" of type " + paramTypes[i] + ": " + constr;
|
||||||
throw new InvalidObjectException(msg);
|
throw new InvalidObjectException(msg);
|
||||||
@ -1233,7 +1248,8 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
|
|
||||||
if (!getterIndexSets.add(present)) {
|
if (!getterIndexSets.add(present)) {
|
||||||
final String msg =
|
final String msg =
|
||||||
"More than one constructor has a @ConstructorProperties " +
|
"More than one constructor has " +
|
||||||
|
"@ConstructorParameters or @ConstructorProperties " +
|
||||||
"annotation with this set of names: " +
|
"annotation with this set of names: " +
|
||||||
Arrays.toString(propertyNames);
|
Arrays.toString(propertyNames);
|
||||||
throw new InvalidObjectException(msg);
|
throw new InvalidObjectException(msg);
|
||||||
@ -1252,10 +1268,10 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
* just the bigger constructor.
|
* just the bigger constructor.
|
||||||
*
|
*
|
||||||
* The algorithm here is quadratic in the number of constructors
|
* The algorithm here is quadratic in the number of constructors
|
||||||
* with a @ConstructorProperties annotation. Typically this corresponds
|
* with a @ConstructorParameters or @ConstructructorProperties annotation.
|
||||||
* to the number of versions of the class there have been. Ten
|
* Typically this corresponds to the number of versions of the class
|
||||||
* would already be a large number, so although it's probably
|
* there have been. Ten would already be a large number, so although
|
||||||
* possible to have an O(n lg n) algorithm it wouldn't be
|
* it's probably possible to have an O(n lg n) algorithm it wouldn't be
|
||||||
* worth the complexity.
|
* worth the complexity.
|
||||||
*/
|
*/
|
||||||
for (BitSet a : getterIndexSets) {
|
for (BitSet a : getterIndexSets) {
|
||||||
@ -1272,8 +1288,9 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
i = u.nextSetBit(i+1))
|
i = u.nextSetBit(i+1))
|
||||||
names.add(itemNames[i]);
|
names.add(itemNames[i]);
|
||||||
final String msg =
|
final String msg =
|
||||||
"Constructors with @ConstructorProperties annotation " +
|
"Constructors with @ConstructorParameters or " +
|
||||||
" would be ambiguous for these items: " +
|
"@ConstructorProperties annotation " +
|
||||||
|
"would be ambiguous for these items: " +
|
||||||
names;
|
names;
|
||||||
throw new InvalidObjectException(msg);
|
throw new InvalidObjectException(msg);
|
||||||
}
|
}
|
||||||
@ -1310,7 +1327,8 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
|
|||||||
|
|
||||||
if (max == null) {
|
if (max == null) {
|
||||||
final String msg =
|
final String msg =
|
||||||
"No constructor has a @ConstructorProperties for this set of " +
|
"No constructor has either @ConstructorParameters " +
|
||||||
|
"or @ConstructorProperties annotation for this set of " +
|
||||||
"items: " + ct.keySet();
|
"items: " + ct.keySet();
|
||||||
throw new InvalidObjectException(msg);
|
throw new InvalidObjectException(msg);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2006, 2015 Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package javax.management;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
import static java.lang.annotation.ElementType.*;
|
||||||
|
import static java.lang.annotation.RetentionPolicy.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* An annotation on a constructor that shows how the parameters of
|
||||||
|
* that constructor correspond to the constructed object's getter
|
||||||
|
* methods. For example:
|
||||||
|
* </p>
|
||||||
|
* <blockquote>
|
||||||
|
* <pre>
|
||||||
|
* public class MemoryUsage {
|
||||||
|
* // standard JavaBean conventions with getters
|
||||||
|
* <b>@ConstructorParameters({"init", "used", "committed", "max"})</b>
|
||||||
|
* public MemoryUsage(long init, long used,
|
||||||
|
* long committed, long max) {...}
|
||||||
|
* public long getInit() {...}
|
||||||
|
* public long getUsed() {...}
|
||||||
|
* public long getCommitted() {...}
|
||||||
|
* public long getMax() {...}
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
* </blockquote>
|
||||||
|
* <p>
|
||||||
|
* The annotation shows that the first parameter of the constructor
|
||||||
|
* can be retrieved with the {@code getInit()} method, the second one with
|
||||||
|
* the {@code getUsed()} method, and so on. Since parameter names are not in
|
||||||
|
* general available at runtime, without the annotation there would be
|
||||||
|
* no way of knowing which parameter corresponds to which property.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* If a constructor is annotated by the both {@code @java.beans.ConstructorProperties}
|
||||||
|
* and {@code @javax.management.ConstructorParameters} annotations
|
||||||
|
* the JMX introspection will give an absolute precedence to the latter one.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @since 1.9
|
||||||
|
*/
|
||||||
|
@Documented @Target(CONSTRUCTOR) @Retention(RUNTIME)
|
||||||
|
public @interface ConstructorParameters {
|
||||||
|
/**
|
||||||
|
* <p>The getter names.</p>
|
||||||
|
*
|
||||||
|
* @return the getter names corresponding to the parameters in the
|
||||||
|
* annotated constructor.
|
||||||
|
*/
|
||||||
|
String[] value();
|
||||||
|
}
|
@ -153,7 +153,7 @@ public class MemoryUsage <b>implements Serializable</b> {
|
|||||||
<td><pre>
|
<td><pre>
|
||||||
public class MemoryUsage {
|
public class MemoryUsage {
|
||||||
// standard JavaBean conventions with getters
|
// standard JavaBean conventions with getters
|
||||||
<b>@ConstructorProperties({"init", "used", "committed", "max"})</b>
|
<b>@ConstructorParameters({"init", "used", "committed", "max"})</b>
|
||||||
public MemoryUsage(long init, long used,
|
public MemoryUsage(long init, long used,
|
||||||
long committed, long max) {...}
|
long committed, long max) {...}
|
||||||
long getInit() {...}
|
long getInit() {...}
|
||||||
@ -168,8 +168,8 @@ public class MemoryUsage {
|
|||||||
<p>The definitions are the same in the two cases, except
|
<p>The definitions are the same in the two cases, except
|
||||||
that with the MXBean, <code>MemoryUsage</code> no longer needs to
|
that with the MXBean, <code>MemoryUsage</code> no longer needs to
|
||||||
be marked <code>Serializable</code> (though it can be). On
|
be marked <code>Serializable</code> (though it can be). On
|
||||||
the other hand, we have added a {@code @ConstructorProperties} annotation
|
the other hand, we have added a {@link ConstructorParameters @ConstructorParameters}
|
||||||
to link the constructor parameters to the corresponding getters.
|
annotation to link the constructor parameters to the corresponding getters.
|
||||||
We will see more about this below.</p>
|
We will see more about this below.</p>
|
||||||
|
|
||||||
<p><code>MemoryUsage</code> is a <em>model-specific class</em>.
|
<p><code>MemoryUsage</code> is a <em>model-specific class</em>.
|
||||||
@ -850,18 +850,24 @@ public interface ModuleMXBean {
|
|||||||
<em>J</em>.</p></li>
|
<em>J</em>.</p></li>
|
||||||
|
|
||||||
<li><p>Otherwise, if <em>J</em> has at least one public
|
<li><p>Otherwise, if <em>J</em> has at least one public
|
||||||
constructor with a {@link java.beans.ConstructorProperties
|
constructor with either {@link javax.management.ConstructorParameters
|
||||||
ConstructorProperties} annotation, then one
|
@javax.management.ConstructorParameters} or
|
||||||
of those constructors (not necessarily always the same one)
|
{@code @java.beans.ConstructoProperties} annotation, then one of those
|
||||||
will be called to reconstruct an instance of <em>J</em>.
|
constructors (not necessarily always the same one) will be called to
|
||||||
|
reconstruct an instance of <em>J</em>.
|
||||||
|
If a constructor is annotated with both
|
||||||
|
{@code @javax.management.ConstructorParameters} and
|
||||||
|
{@code @java.beans.ConstructorProperties},
|
||||||
|
{@code @javax.management.ConstructorParameters} will be used and
|
||||||
|
{@code @java.beans.ConstructorProperties} will be ignored.
|
||||||
Every such annotation must list as many strings as the
|
Every such annotation must list as many strings as the
|
||||||
constructor has parameters; each string must name a property
|
constructor has parameters; each string must name a property
|
||||||
corresponding to a getter of <em>J</em>; and the type of this
|
corresponding to a getter of <em>J</em>; and the type of this
|
||||||
getter must be the same as the corresponding constructor
|
getter must be the same as the corresponding constructor
|
||||||
parameter. It is not an error for there to be getters that
|
parameter. It is not an error for there to be getters that
|
||||||
are not mentioned in the {@code ConstructorProperties} annotation
|
are not mentioned in the {@code @ConstructorParameters} or
|
||||||
(these may correspond to information that is not needed to
|
{@code @ConstructorProperties} annotations (these may correspond to
|
||||||
reconstruct the object).</p>
|
information that is not needed to reconstruct the object).</p>
|
||||||
|
|
||||||
<p>An instance of <em>J</em> is reconstructed by calling a
|
<p>An instance of <em>J</em> is reconstructed by calling a
|
||||||
constructor with the appropriate reconstructed items from the
|
constructor with the appropriate reconstructed items from the
|
||||||
@ -871,9 +877,10 @@ public interface ModuleMXBean {
|
|||||||
CompositeData} might come from an earlier version of
|
CompositeData} might come from an earlier version of
|
||||||
<em>J</em> where not all the items were present. A
|
<em>J</em> where not all the items were present. A
|
||||||
constructor is <em>applicable</em> if all the properties named
|
constructor is <em>applicable</em> if all the properties named
|
||||||
in its {@code ConstructorProperties} annotation are present as items
|
in its {@code @ConstructorParameters} or {@code @ConstructorProperties}
|
||||||
in the {@code CompositeData}. If no constructor is
|
annotation are present as items in the {@code CompositeData}.
|
||||||
applicable, then the attempt to reconstruct <em>J</em> fails.</p>
|
If no constructor is applicable, then the attempt to reconstruct
|
||||||
|
<em>J</em> fails.</p>
|
||||||
|
|
||||||
<p>For any possible combination of properties, it must be the
|
<p>For any possible combination of properties, it must be the
|
||||||
case that either (a) there are no applicable constructors, or
|
case that either (a) there are no applicable constructors, or
|
||||||
@ -909,8 +916,9 @@ public interface ModuleMXBean {
|
|||||||
<li><p>Otherwise, <em>J</em> is not reconstructible.</p></li>
|
<li><p>Otherwise, <em>J</em> is not reconstructible.</p></li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p>Rule 2 is not applicable to subset Profiles of Java SE that do not
|
<p>When only {@code @java.beans.ConstructorProperties} is present then
|
||||||
include the {@code java.beans} package. When targeting a runtime that does
|
rule 2 is not applicable to subset Profiles of Java SE that do not include
|
||||||
|
the {@code java.beans} package. When targeting a runtime that does
|
||||||
not include the {@code java.beans} package, and where there is a mismatch
|
not include the {@code java.beans} package, and where there is a mismatch
|
||||||
between the compile-time and runtime environment whereby <em>J</em> is
|
between the compile-time and runtime environment whereby <em>J</em> is
|
||||||
compiled with a public constructor and the {@code ConstructorProperties}
|
compiled with a public constructor and the {@code ConstructorProperties}
|
||||||
@ -957,14 +965,14 @@ public class NamedNumber {
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Public constructor with <code>@ConstructorProperties</code> annotation:
|
<li>Public constructor with <code>@ConstructorParameters</code> annotation:
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
public class NamedNumber {
|
public class NamedNumber {
|
||||||
public int getNumber() {return number;}
|
public int getNumber() {return number;}
|
||||||
public String getName() {return name;}
|
public String getName() {return name;}
|
||||||
<b>@ConstructorProperties({"number", "name"})
|
<b>@ConstructorParameters({"number", "name"})
|
||||||
public NamedNumber(int number, String name)</b> {
|
public NamedNumber(int number, String name)</b> {
|
||||||
this.number = number;
|
this.number = number;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
#
|
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU General Public License version 2 only, as
|
|
||||||
# published by the Free Software Foundation. Oracle designates this
|
|
||||||
# particular file as subject to the "Classpath" exception as provided
|
|
||||||
# by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
#
|
|
||||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
# version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
# accompanied this code).
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License version
|
|
||||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
#
|
|
||||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
# or visit www.oracle.com if you need additional information or have any
|
|
||||||
# questions.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# This script executes the Java interpreter, defines properties
|
|
||||||
# that correspond to the CGI 1.0 environment variables, and executes
|
|
||||||
# the class "sun.rmi.transport.proxy.CGIHandler". It should be
|
|
||||||
# installed in the directory to which the HTTP server maps the
|
|
||||||
# URL path "/cgi-bin".
|
|
||||||
#
|
|
||||||
# (Configuration is necessary as noted below.)
|
|
||||||
#
|
|
||||||
# This class will support a QUERY_STRING of the form "forward=<port>"
|
|
||||||
# with a REQUEST_METHOD "POST". The body of the request will be
|
|
||||||
# forwarded (as another POST request) to the server listening on the
|
|
||||||
# specified port (must be >= 1024). The response from this forwarded
|
|
||||||
# request will be the response to the original request.
|
|
||||||
#
|
|
||||||
# CONFIGURATION:
|
|
||||||
#
|
|
||||||
# Fill in correct absolute path to Java interpreter below. For example,
|
|
||||||
# the "PATH=" line might be changed to the follow if the JDK is installed
|
|
||||||
# at the path "/home/peter/java":
|
|
||||||
#
|
|
||||||
# PATH=/home/peter/java/bin:$PATH
|
|
||||||
#
|
|
||||||
PATH=/usr/local/java/bin:$PATH
|
|
||||||
exec java \
|
|
||||||
-DAUTH_TYPE="$AUTH_TYPE" \
|
|
||||||
-DCONTENT_LENGTH="$CONTENT_LENGTH" \
|
|
||||||
-DCONTENT_TYPE="$CONTENT_TYPE" \
|
|
||||||
-DGATEWAY_INTERFACE="$GATEWAY_INTERFACE" \
|
|
||||||
-DHTTP_ACCEPT="$HTTP_ACCEPT" \
|
|
||||||
-DPATH_INFO="$PATH_INFO" \
|
|
||||||
-DPATH_TRANSLATED="$PATH_TRANSLATED" \
|
|
||||||
-DQUERY_STRING="$QUERY_STRING" \
|
|
||||||
-DREMOTE_ADDR="$REMOTE_ADDR" \
|
|
||||||
-DREMOTE_HOST="$REMOTE_HOST" \
|
|
||||||
-DREMOTE_IDENT="$REMOTE_IDENT" \
|
|
||||||
-DREMOTE_USER="$REMOTE_USER" \
|
|
||||||
-DREQUEST_METHOD="$REQUEST_METHOD" \
|
|
||||||
-DSCRIPT_NAME="$SCRIPT_NAME" \
|
|
||||||
-DSERVER_NAME="$SERVER_NAME" \
|
|
||||||
-DSERVER_PORT="$SERVER_PORT" \
|
|
||||||
-DSERVER_PROTOCOL="$SERVER_PROTOCOL" \
|
|
||||||
-DSERVER_SOFTWARE="$SERVER_SOFTWARE" \
|
|
||||||
sun.rmi.transport.proxy.CGIHandler
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. 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
|
||||||
@ -1482,4 +1482,109 @@ throws SQLException;
|
|||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
int getNetworkTimeout() throws SQLException;
|
int getNetworkTimeout() throws SQLException;
|
||||||
|
|
||||||
|
// JDBC 4.3
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hints to the driver that a request, an independent unit of work, is beginning
|
||||||
|
* on this connection. Each request is independent of all other requests
|
||||||
|
* with regard to state local to the connection either on the client or the
|
||||||
|
* server. Work done between {@code beginRequest}, {@code endRequest}
|
||||||
|
* pairs does not depend on any other work done on the connection either as
|
||||||
|
* part of another request or outside of any request. A request may include multiple
|
||||||
|
* transactions. There may be dependencies on committed database state as
|
||||||
|
* that is not local to the connection.
|
||||||
|
* <p>
|
||||||
|
* Local state is defined as any state associated with a Connection that is
|
||||||
|
* local to the current Connection either in the client or the database that
|
||||||
|
* is not transparently reproducible.
|
||||||
|
* <p>
|
||||||
|
* Calls to {@code beginRequest} and {@code endRequest} are not nested.
|
||||||
|
* Multiple calls to {@code beginRequest} without an intervening call
|
||||||
|
* to {@code endRequest} is not an error. The first {@code beginRequest} call
|
||||||
|
* marks the start of the request and subsequent calls are treated as
|
||||||
|
* a no-op
|
||||||
|
* <p>
|
||||||
|
* Use of {@code beginRequest} and {@code endRequest} is optional, vendor
|
||||||
|
* specific and should largely be transparent. In particular
|
||||||
|
* implementations may detect conditions that indicate dependence on
|
||||||
|
* other work such as an open transaction. It is recommended though not
|
||||||
|
* required that implementations throw a {@code SQLException} if there is an active
|
||||||
|
* transaction and {@code beginRequest} is called.
|
||||||
|
* Using these methods may improve performance or provide other benefits.
|
||||||
|
* Consult your vendors documentation for additional information.
|
||||||
|
* <p>
|
||||||
|
* It is recommended to
|
||||||
|
* enclose each unit of work in {@code beginRequest}, {@code endRequest}
|
||||||
|
* pairs such that there is no open transaction at the beginning or end of
|
||||||
|
* the request and no dependency on local state that crosses request
|
||||||
|
* boundaries. Committed database state is not local.
|
||||||
|
*
|
||||||
|
* @implSpec
|
||||||
|
* The default implementation is a no-op.
|
||||||
|
* <p>
|
||||||
|
* @apiNote
|
||||||
|
* This method is to be used by Connection pooling managers.
|
||||||
|
* <p>
|
||||||
|
* The pooling manager should call {@code beginRequest} on the underlying connection
|
||||||
|
* prior to returning a connection to the caller.
|
||||||
|
* <p>
|
||||||
|
* The pooling manager does not need to call {@code beginRequest} if:
|
||||||
|
* <ul>
|
||||||
|
* <li>The connection pool caches {@code PooledConnection} objects</li>
|
||||||
|
* <li>Returns a logical connection handle when {@code getConnection} is
|
||||||
|
* called by the application</li>
|
||||||
|
* <li>The pool manager calls {@code Connection.close} on the logical connection handle
|
||||||
|
* prior to returning the {@code PooledConnection} back to the cache</li>
|
||||||
|
* </ul>
|
||||||
|
* @throws SQLException if an error occurs
|
||||||
|
* @since 1.9
|
||||||
|
* @see endRequest
|
||||||
|
* @see javax.sql.PooledConnection
|
||||||
|
*/
|
||||||
|
default void beginRequest() throws SQLException {
|
||||||
|
// Default method takes no action
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hints to the driver that a request, an independent unit of work,
|
||||||
|
* has completed. Calls to {@code beginRequest}
|
||||||
|
* and {@code endRequest} are not nested. Multiple
|
||||||
|
* calls to {@code endRequest} without an intervening call to {@code beginRequest}
|
||||||
|
* is not an error. The first {@code endRequest} call
|
||||||
|
* marks the request completed and subsequent calls are treated as
|
||||||
|
* a no-op. If {@code endRequest} is called without an initial call to
|
||||||
|
* {@code beginRequest} is a no-op.
|
||||||
|
*<p>
|
||||||
|
* The exact behavior of this method is vendor specific. In particular
|
||||||
|
* implementations may detect conditions that indicate dependence on
|
||||||
|
* other work such as an open transaction. It is recommended though not
|
||||||
|
* required that implementations throw a {@code SQLException} if there is an active
|
||||||
|
* transaction and {@code endRequest} is called.
|
||||||
|
*
|
||||||
|
* @implSpec
|
||||||
|
* The default implementation is a no-op.
|
||||||
|
* @apiNote
|
||||||
|
*
|
||||||
|
* This method is to be used by Connection pooling managers.
|
||||||
|
* <p>
|
||||||
|
* The pooling manager should call {@code endRequest} on the underlying connection
|
||||||
|
* when the applications returns the connection back to the connection pool.
|
||||||
|
* <p>
|
||||||
|
* The pooling manager does not need to call {@code endRequest} if:
|
||||||
|
* <ul>
|
||||||
|
* <li>The connection pool caches {@code PooledConnection} objects</li>
|
||||||
|
* <li>Returns a logical connection handle when {@code getConnection} is
|
||||||
|
* called by the application</li>
|
||||||
|
* <li>The pool manager calls {@code Connection.close} on the logical connection handle
|
||||||
|
* prior to returning the {@code PooledConnection} back to the cache</li>
|
||||||
|
* </ul>
|
||||||
|
* @throws SQLException if an error occurs
|
||||||
|
* @since 1.9
|
||||||
|
* @see beginRequest
|
||||||
|
* @see javax.sql.PooledConnection
|
||||||
|
*/
|
||||||
|
default void endRequest() throws SQLException {
|
||||||
|
// Default method takes no action
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. 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
|
||||||
@ -66,7 +66,16 @@ import java.sql.SQLException;
|
|||||||
* <code>PooledConnection</code> object to the pool of connections so that
|
* <code>PooledConnection</code> object to the pool of connections so that
|
||||||
* it can be used again. Thus, when an application closes its connection,
|
* it can be used again. Thus, when an application closes its connection,
|
||||||
* the underlying physical connection is recycled rather than being closed.
|
* the underlying physical connection is recycled rather than being closed.
|
||||||
* <P>
|
* <p>
|
||||||
|
* If the connection pool manager wraps or provides a proxy to the logical
|
||||||
|
* handle returned from a call to {@code PoolConnection.getConnection}, the pool
|
||||||
|
* manager must do
|
||||||
|
* one of the following when the application calls {@code Connection.close}:
|
||||||
|
* <ul>
|
||||||
|
* <li>call {@code endRequest} on the logical {@code Connection} handle
|
||||||
|
* <li>call {@code close} on the logical {@code Connection} handle
|
||||||
|
* </ul>
|
||||||
|
* <p>
|
||||||
* The physical connection is not closed until the connection pool manager
|
* The physical connection is not closed until the connection pool manager
|
||||||
* calls the <code>PooledConnection</code> method <code>close</code>.
|
* calls the <code>PooledConnection</code> method <code>close</code>.
|
||||||
* This method is generally called to have an orderly shutdown of the server or
|
* This method is generally called to have an orderly shutdown of the server or
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
tier1 = \
|
tier1 = \
|
||||||
:jdk_lang \
|
:jdk_lang \
|
||||||
|
-java/lang/ProcessHandle/TreeTest.java \
|
||||||
:jdk_util \
|
:jdk_util \
|
||||||
sun/nio/cs/ISO8859x.java \
|
sun/nio/cs/ISO8859x.java \
|
||||||
java/nio/Buffer \
|
java/nio/Buffer \
|
||||||
@ -34,6 +35,7 @@ tier1 = \
|
|||||||
:jdk_math
|
:jdk_math
|
||||||
|
|
||||||
tier2 = \
|
tier2 = \
|
||||||
|
java/lang/ProcessHandle/TreeTest.java \
|
||||||
:jdk_io \
|
:jdk_io \
|
||||||
:jdk_nio \
|
:jdk_nio \
|
||||||
-sun/nio/cs/ISO8859x.java \
|
-sun/nio/cs/ISO8859x.java \
|
||||||
|
111
jdk/test/java/awt/Component/CreateImage/CreateImage.java
Normal file
111
jdk/test/java/awt/Component/CreateImage/CreateImage.java
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.awt.AWTException;
|
||||||
|
import java.awt.Button;
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.GraphicsEnvironment;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
* @bug 6815345
|
||||||
|
* @run main CreateImage
|
||||||
|
* @run main/othervm -Djava.awt.headless=true CreateImage
|
||||||
|
*/
|
||||||
|
public final class CreateImage {
|
||||||
|
|
||||||
|
public static void main(final String[] args) throws Exception {
|
||||||
|
EventQueue.invokeAndWait(CreateImage::test);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void test() {
|
||||||
|
final JButton jbutton1 = new JButton();
|
||||||
|
final JButton jbutton2 = new JButton();
|
||||||
|
|
||||||
|
if (GraphicsEnvironment.isHeadless()) {
|
||||||
|
checkCreateImage(jbutton1, true);
|
||||||
|
checkCreateImage(jbutton2, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Frame frame = new Frame();
|
||||||
|
final Button button1 = new Button();
|
||||||
|
final Button button2 = new Button();
|
||||||
|
try {
|
||||||
|
// all components are not displayable
|
||||||
|
checkCreateImage(frame, true);
|
||||||
|
checkCreateImage(button1, true);
|
||||||
|
checkCreateImage(button2, true);
|
||||||
|
checkCreateImage(jbutton1, true);
|
||||||
|
checkCreateImage(jbutton2, true);
|
||||||
|
|
||||||
|
// some components added to the non-displayable frame
|
||||||
|
frame.add(button1);
|
||||||
|
frame.add(jbutton1);
|
||||||
|
checkCreateImage(button1, true);
|
||||||
|
checkCreateImage(jbutton1, true);
|
||||||
|
frame.pack();
|
||||||
|
|
||||||
|
// tests previously added components when the frame is displayable
|
||||||
|
checkCreateImage(frame, false);
|
||||||
|
checkCreateImage(button1, false);
|
||||||
|
checkCreateImage(jbutton1, false);
|
||||||
|
|
||||||
|
// some components added to the displayable frame
|
||||||
|
frame.add(button2);
|
||||||
|
frame.add(jbutton2);
|
||||||
|
checkCreateImage(button2, false);
|
||||||
|
checkCreateImage(jbutton2, false);
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
frame.dispose();
|
||||||
|
}
|
||||||
|
// tests all components after the frame became non-displayable again
|
||||||
|
checkCreateImage(frame, true);
|
||||||
|
checkCreateImage(button1, true);
|
||||||
|
checkCreateImage(button2, true);
|
||||||
|
checkCreateImage(jbutton1, true);
|
||||||
|
checkCreateImage(jbutton2, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkCreateImage(final Component comp,
|
||||||
|
final boolean isNull) {
|
||||||
|
if ((comp.createImage(10, 10) != null) == isNull) {
|
||||||
|
throw new RuntimeException("Image is wrong");
|
||||||
|
}
|
||||||
|
if ((comp.createVolatileImage(10, 10) != null) == isNull) {
|
||||||
|
throw new RuntimeException("Image is wrong");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if ((comp.createVolatileImage(10, 10, null) != null) == isNull) {
|
||||||
|
throw new RuntimeException("Image is wrong");
|
||||||
|
}
|
||||||
|
} catch (final AWTException ignored) {
|
||||||
|
// this check is not applicable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.GraphicsConfiguration;
|
||||||
|
import java.awt.Window;
|
||||||
|
|
||||||
|
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||||
|
import static java.util.concurrent.TimeUnit.NANOSECONDS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
* @bug 8138764
|
||||||
|
*/
|
||||||
|
public final class TreeLockDeadlock extends Frame {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized GraphicsConfiguration getGraphicsConfiguration() {
|
||||||
|
return super.getGraphicsConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void reshape(int x, int y, int width, int height) {
|
||||||
|
super.reshape(x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized float getOpacity() {
|
||||||
|
return super.getOpacity();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(final String[] args) throws Exception {
|
||||||
|
final Window window = new TreeLockDeadlock();
|
||||||
|
window.setSize(300, 300);
|
||||||
|
test(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void test(final Window window) throws Exception {
|
||||||
|
final long start = System.nanoTime();
|
||||||
|
final long end = start + NANOSECONDS.convert(1, MINUTES);
|
||||||
|
|
||||||
|
final Runnable r1 = () -> {
|
||||||
|
while (System.nanoTime() < end) {
|
||||||
|
window.setBounds(window.getBounds());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
final Runnable r2 = () -> {
|
||||||
|
while (System.nanoTime() < end) {
|
||||||
|
window.getGraphicsConfiguration();
|
||||||
|
window.getOpacity();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
final Thread t1 = new Thread(r1);
|
||||||
|
final Thread t2 = new Thread(r1);
|
||||||
|
final Thread t3 = new Thread(r2);
|
||||||
|
final Thread t4 = new Thread(r2);
|
||||||
|
|
||||||
|
t1.start();
|
||||||
|
t2.start();
|
||||||
|
t3.start();
|
||||||
|
t4.start();
|
||||||
|
t1.join();
|
||||||
|
t2.join();
|
||||||
|
t3.join();
|
||||||
|
t4.join();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 6356322
|
||||||
|
* @summary Tests that embedded frame's graphics configuration is updated
|
||||||
|
* correctly when it is moved to another screen in multiscreen system,
|
||||||
|
* XToolkit
|
||||||
|
* @author artem.ananiev@sun.com: area=awt.multiscreen
|
||||||
|
* @requires (os.family == "linux") | (os.family == "solaris")
|
||||||
|
* @modules java.desktop/sun.awt
|
||||||
|
* java.desktop/sun.awt.X11
|
||||||
|
* java.desktop/java.awt.peer
|
||||||
|
* @run main GraphicsConfigTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.peer.*;
|
||||||
|
import java.lang.reflect.*;
|
||||||
|
import java.util.*;
|
||||||
|
import sun.awt.*;
|
||||||
|
|
||||||
|
public class GraphicsConfigTest {
|
||||||
|
|
||||||
|
private static void init()
|
||||||
|
throws InterruptedException, AWTException {
|
||||||
|
if (!isXToolkit()) {
|
||||||
|
System.err.println("The test should be run only on XToolkit");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GraphicsEnvironment ge =
|
||||||
|
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||||
|
GraphicsDevice[] gds = ge.getScreenDevices();
|
||||||
|
if (gds.length < 2) {
|
||||||
|
System.err.println("The test should be run only in"
|
||||||
|
+ " multiscreen configuration");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean xinerama = Arrays.stream(gds)
|
||||||
|
.map((gd) -> gd.getDefaultConfiguration().getBounds())
|
||||||
|
.filter((r) -> r.x != 0 || r.y != 0).findFirst().isPresent();
|
||||||
|
|
||||||
|
if (!xinerama) {
|
||||||
|
System.err.println("The test should be run only with Xinerama ON");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle r0 = gds[0].getDefaultConfiguration().getBounds();
|
||||||
|
Rectangle r1 = gds[1].getDefaultConfiguration().getBounds();
|
||||||
|
|
||||||
|
System.setProperty("sun.awt.xembedserver", "true");
|
||||||
|
Frame f = new Frame("F");
|
||||||
|
try {
|
||||||
|
final Robot robot = new Robot();
|
||||||
|
|
||||||
|
f.setBounds(r0.x + 100, r0.y + 100, 200, 200);
|
||||||
|
f.setVisible(true);
|
||||||
|
robot.waitForIdle();
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
|
Canvas c = new Canvas();
|
||||||
|
f.add(c);
|
||||||
|
AWTAccessor.ComponentAccessor acc =
|
||||||
|
AWTAccessor.getComponentAccessor();
|
||||||
|
WindowIDProvider wip = acc.getPeer(c);
|
||||||
|
long h = wip.getWindow();
|
||||||
|
|
||||||
|
EmbeddedFrame e = createEmbeddedFrame(h);
|
||||||
|
acc.<FramePeer>getPeer(e).setBoundsPrivate(0, 0, 100,
|
||||||
|
100); // triggers XConfigureEvent
|
||||||
|
e.registerListeners();
|
||||||
|
e.setVisible(true);
|
||||||
|
robot.waitForIdle();
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
|
if (!checkGC(f, e)) {
|
||||||
|
throw new RuntimeException("Failed at checkpoint 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
f.setLocation(r1.x + 100, r1.y + 100);
|
||||||
|
Thread.sleep(100);
|
||||||
|
acc.<FramePeer>getPeer(e).setBoundsPrivate(0, 0, 101,
|
||||||
|
101); // triggers XConfigureEvent
|
||||||
|
robot.waitForIdle();
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
|
if (!checkGC(f, e)) {
|
||||||
|
throw new RuntimeException("Failed at checkpoint 2");
|
||||||
|
}
|
||||||
|
|
||||||
|
f.setLocation(r0.x + 100, r0.y + 100);
|
||||||
|
Thread.sleep(100);
|
||||||
|
acc.<FramePeer>getPeer(e).setBoundsPrivate(0, 0, 102,
|
||||||
|
102); // triggers XConfigureEvent
|
||||||
|
robot.waitForIdle();
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
|
if (!checkGC(f, e)) {
|
||||||
|
throw new RuntimeException("Failed at checkpoint 3");
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
f.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isXToolkit() {
|
||||||
|
return Toolkit.getDefaultToolkit().getClass()
|
||||||
|
.getName().equals("sun.awt.X11.XToolkit");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static EmbeddedFrame createEmbeddedFrame(long window) {
|
||||||
|
try {
|
||||||
|
Class cl = Class.forName("sun.awt.X11.XEmbeddedFrame");
|
||||||
|
Constructor cons = cl.getConstructor(
|
||||||
|
new Class[]{Long.TYPE, Boolean.TYPE});
|
||||||
|
return (EmbeddedFrame) cons.newInstance(new Object[]{window, true});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("Can't create embedded frame");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean checkGC(Component c, Component d) {
|
||||||
|
GraphicsConfiguration g1 = c.getGraphicsConfiguration();
|
||||||
|
System.err.println(g1);
|
||||||
|
GraphicsConfiguration g2 = d.getGraphicsConfiguration();
|
||||||
|
System.err.println(g2);
|
||||||
|
|
||||||
|
return g1.equals(g2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String args[]) throws InterruptedException, AWTException {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
|
||||||
|
This code is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License version 2 only, as
|
||||||
|
published by the Free Software Foundation.
|
||||||
|
|
||||||
|
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
accompanied this code).
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License version
|
||||||
|
2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
or visit www.oracle.com if you need additional information or have any
|
||||||
|
questions.
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
@test
|
||||||
|
@bug 6387275
|
||||||
|
@summary List: the focus is at the top of the first item, XAWT
|
||||||
|
@author Dmitry.Cherepanov@SUN.COM area=awt.list
|
||||||
|
@requires (os.family == "linux" | os.family == "solaris")
|
||||||
|
@modules java.desktop/sun.awt
|
||||||
|
java.desktop/java.awt.peer
|
||||||
|
java.desktop/sun.awt.X11
|
||||||
|
@run applet FocusEmptyListTest.html
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<title> FocusEmptyListTest </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>FocusEmptyListTest<br>Bug ID: 6387275 </h1>
|
||||||
|
|
||||||
|
<p> This is an AUTOMATIC test, simply wait for completion </p>
|
||||||
|
|
||||||
|
<APPLET CODE="FocusEmptyListTest.class" WIDTH=200 HEIGHT=200></APPLET>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
test
|
||||||
|
@bug 6387275
|
||||||
|
@summary List: the focus is at the top of the first item, XAWT
|
||||||
|
@author Dmitry.Cherepanov@SUN.COM area=awt.list
|
||||||
|
@run applet FocusEmptyListTest.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.applet.Applet;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.lang.reflect.*;
|
||||||
|
import java.awt.peer.ListPeer;
|
||||||
|
|
||||||
|
import sun.awt.AWTAccessor;
|
||||||
|
|
||||||
|
public class FocusEmptyListTest extends Applet {
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
setLayout(new BorderLayout());
|
||||||
|
}//End init()
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
boolean isXToolkit = Toolkit.getDefaultToolkit()
|
||||||
|
.getClass().getName().equals("sun.awt.X11.XToolkit");
|
||||||
|
if (!isXToolkit) {
|
||||||
|
System.out.println("The test is XAWT-only.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List list = new List();
|
||||||
|
Object isIndexDisplayed = null;
|
||||||
|
setLayout(new FlowLayout());
|
||||||
|
|
||||||
|
getToolkit().addAWTEventListener(System.out::println,
|
||||||
|
AWTEvent.FOCUS_EVENT_MASK | AWTEvent.WINDOW_FOCUS_EVENT_MASK);
|
||||||
|
|
||||||
|
add(list);
|
||||||
|
list.add("item1");
|
||||||
|
|
||||||
|
setSize(200, 200);
|
||||||
|
setVisible(true);
|
||||||
|
validate();
|
||||||
|
|
||||||
|
list.removeAll();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
// peer = List.getPeer()
|
||||||
|
ListPeer peer = AWTAccessor.getComponentAccessor().getPeer(list);
|
||||||
|
System.out.println("peer = " + peer);
|
||||||
|
Class peerClass = peer.getClass();
|
||||||
|
System.out.println("peer's class = " + peerClass);
|
||||||
|
|
||||||
|
// isIndexDisplayed = peer.isIndexDisplayed(-1)
|
||||||
|
Method isIndexDisplayedM
|
||||||
|
= peerClass.getDeclaredMethod("isIndexDisplayed", Integer.TYPE);
|
||||||
|
System.out.println("method = " + isIndexDisplayedM);
|
||||||
|
isIndexDisplayedM.setAccessible(true);
|
||||||
|
isIndexDisplayed = isIndexDisplayedM.invoke(peer, -1);
|
||||||
|
System.out.println("isIndexDisplayed=" + isIndexDisplayed);
|
||||||
|
|
||||||
|
} catch (Throwable thr) {
|
||||||
|
throw new RuntimeException("TEST FAILED: " + thr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Boolean) isIndexDisplayed) {
|
||||||
|
throw new RuntimeException("TEST FAILED: -1 should be"
|
||||||
|
+ " invisible index");
|
||||||
|
}
|
||||||
|
|
||||||
|
}// start()
|
||||||
|
|
||||||
|
}// class AutomaticAppletTest
|
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test @summary After calling frame.toBack() dialog goes to the back on Ubuntu 12.04
|
||||||
|
* @bug 8022334
|
||||||
|
* @author Semyon Sadetsky
|
||||||
|
* @run main MultiWindowAppTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class MultiWindowAppTest {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
Window win1 = new Frame();
|
||||||
|
Window win2 = new Dialog((Frame) null);
|
||||||
|
|
||||||
|
win1.setBounds(100, 100, 200, 200);
|
||||||
|
win1.setBackground(Color.RED);
|
||||||
|
win1.setVisible(true);
|
||||||
|
|
||||||
|
Robot robot = new Robot();
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
|
||||||
|
win2.setBounds(win1.getBounds());
|
||||||
|
win2.setVisible(true);
|
||||||
|
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
|
||||||
|
win1.toFront();
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
|
||||||
|
Point point = win1.getLocationOnScreen();
|
||||||
|
Color color = robot.getPixelColor(point.x + 100, point.y + 100);
|
||||||
|
|
||||||
|
if(!color.equals(Color.RED)) {
|
||||||
|
win1.dispose();
|
||||||
|
win2.dispose();
|
||||||
|
throw new RuntimeException("Window was not sent to front.");
|
||||||
|
}
|
||||||
|
|
||||||
|
win1.toBack();
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
|
||||||
|
color = robot.getPixelColor(point.x + 100, point.y + 100);
|
||||||
|
|
||||||
|
win1.dispose();
|
||||||
|
win2.dispose();
|
||||||
|
|
||||||
|
if(color.equals(Color.RED)) {
|
||||||
|
throw new RuntimeException("Window was not sent to back.");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("ok");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* @test
|
||||||
|
@bug 8011616
|
||||||
|
@summary JWindow.getLocation and JWindow.getLocationOnScreen return different
|
||||||
|
values on Unity
|
||||||
|
@author Semyon Sadetsky
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class ScreenLocationTest {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
testLocation();
|
||||||
|
testSize();
|
||||||
|
System.out.println("ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void testLocation() throws Exception {
|
||||||
|
Window window = new Window((Frame) null);
|
||||||
|
window.setSize(100, 100);
|
||||||
|
window.setLocation(0, 0);
|
||||||
|
window.setVisible(true);
|
||||||
|
|
||||||
|
Robot robot = new Robot();
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
|
||||||
|
Point location1 = window.getLocation();
|
||||||
|
Point location2 = window.getLocationOnScreen();
|
||||||
|
window.setLocation(10000, 10000);
|
||||||
|
|
||||||
|
if (!location1.equals(location2)) {
|
||||||
|
window.dispose();
|
||||||
|
throw new RuntimeException("getLocation is different");
|
||||||
|
}
|
||||||
|
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
location1 = window.getLocation();
|
||||||
|
location2 = window.getLocationOnScreen();
|
||||||
|
|
||||||
|
if (!location1.equals(location2)) {
|
||||||
|
window.dispose();
|
||||||
|
throw new RuntimeException("getLocation is different");
|
||||||
|
}
|
||||||
|
|
||||||
|
window.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void testSize() throws Exception {
|
||||||
|
Window window = new Window((Frame) null);
|
||||||
|
window.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||||
|
window.setVisible(true);
|
||||||
|
|
||||||
|
Robot robot = new Robot();
|
||||||
|
robot.delay(200);
|
||||||
|
robot.waitForIdle();
|
||||||
|
|
||||||
|
Dimension size = window.getSize();
|
||||||
|
if (size.width == Integer.MAX_VALUE ||
|
||||||
|
size.height == Integer.MAX_VALUE) {
|
||||||
|
window.dispose();
|
||||||
|
throw new RuntimeException("size is wrong");
|
||||||
|
}
|
||||||
|
|
||||||
|
window.dispose();
|
||||||
|
}
|
||||||
|
}
|
@ -23,10 +23,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
@test
|
@test
|
||||||
@bug 8081787
|
@bug 8081787 8136763
|
||||||
@summary MalformedURLException is thrown during reading data for application/x-java-url;class=java.net.URL flavor
|
|
||||||
@author Mikhail Cherkasov
|
@author Mikhail Cherkasov
|
||||||
@run main/manual XJavaUrlDataFlavorTest
|
@run main/manual MacOsXFileAndMultipleFileCopingTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@ -36,17 +35,24 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
public class XJavaUrlDataFlavorTest {
|
public class MacOsXFileAndMultipleFileCopingTest {
|
||||||
private static void init() {
|
private static void init() {
|
||||||
String[] instructions =
|
String[] instructions =
|
||||||
{"Test for MacOS X only:",
|
{"Test for MacOS X only:",
|
||||||
"1. The aim is to test that java works fine with \"application/" +
|
"1. The aim is to test that java works fine with \"application/" +
|
||||||
"x-java-url;class=java.net.URL\"falvor.",
|
"x-java-url;class=java.net.URL\"falvor and support coping of multiple files",
|
||||||
"2. Open finder and select any file.",
|
"2. Open finder and select any file.",
|
||||||
"3. Press CMD+C or press \"Copy\" in context menu",
|
"3. Press CMD+C or press \"Copy\" in context menu",
|
||||||
"4. Focus window with \"Test\" Button.",
|
"4. Focus window with \"Test URL\" Button.",
|
||||||
"5. If you see URL for selected file, then test PASSED,",
|
"5. If you see URL for selected file, then test PASSED,",
|
||||||
"otherwise test FAILED."
|
"otherwise test FAILED.",
|
||||||
|
|
||||||
|
"6. Open finder again and select several files.",
|
||||||
|
"7. Press CMD+C or press \"Copy\" in context menu",
|
||||||
|
"8. Focus window with \"Test multiple files coping\" Button.",
|
||||||
|
"9. If you see list of selected files, then test PASSED,",
|
||||||
|
"otherwise test FAILED.",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Sysout.createDialog();
|
Sysout.createDialog();
|
||||||
@ -57,22 +63,36 @@ public class XJavaUrlDataFlavorTest {
|
|||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
||||||
|
|
||||||
frame.add(panel);
|
frame.add(panel);
|
||||||
Button testButton = new Button("Test");
|
Button testUrlBtn = new Button("Test URL");
|
||||||
final TextField textField = new TextField(40);
|
final TextArea textArea = new TextArea(5, 80);
|
||||||
testButton.addActionListener(new AbstractAction() {
|
testUrlBtn.addActionListener(new AbstractAction() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent ae) {
|
public void actionPerformed(ActionEvent ae) {
|
||||||
try {
|
try {
|
||||||
Clipboard board = Toolkit.getDefaultToolkit().getSystemClipboard();
|
Clipboard board = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||||
URL url = (URL)board.getData(new DataFlavor("application/x-java-url;class=java.net.URL"));
|
URL url = (URL) board.getData(new DataFlavor("application/x-java-url;class=java.net.URL"));
|
||||||
textField.setText(url.toString());
|
textArea.setText(url.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(testButton);
|
panel.add(testUrlBtn);
|
||||||
panel.add(textField);
|
Button testUriList = new Button("Test multiple files coping");
|
||||||
|
testUriList.addActionListener(new AbstractAction() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent ae) {
|
||||||
|
try {
|
||||||
|
Clipboard board = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||||
|
String files = (String) board.getData(new DataFlavor("text/uri-list;class=java.lang.String"));
|
||||||
|
textArea.setText(files);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
panel.add(testUriList);
|
||||||
|
panel.add(textArea);
|
||||||
frame.setBounds(200, 200, 400, 400);
|
frame.setBounds(200, 200, 400, 400);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
|
||||||
@ -100,6 +120,9 @@ public class XJavaUrlDataFlavorTest {
|
|||||||
private static int sleepTime = 300000;
|
private static int sleepTime = 300000;
|
||||||
|
|
||||||
public static void main(String args[]) throws InterruptedException {
|
public static void main(String args[]) throws InterruptedException {
|
||||||
|
if (!System.getProperty("os.name").startsWith("Mac")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mainThread = Thread.currentThread();
|
mainThread = Thread.currentThread();
|
||||||
try {
|
try {
|
||||||
init();
|
init();
|
||||||
@ -336,10 +359,10 @@ class TestDialog extends Dialog implements ActionListener {
|
|||||||
//ManualMainTest
|
//ManualMainTest
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (e.getActionCommand() == "pass") {
|
if (e.getActionCommand() == "pass") {
|
||||||
XJavaUrlDataFlavorTest.pass();
|
MacOsXFileAndMultipleFileCopingTest.pass();
|
||||||
} else {
|
} else {
|
||||||
XJavaUrlDataFlavorTest.fail();
|
MacOsXFileAndMultipleFileCopingTest.fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}// TestDialog class
|
}// TestDialog class
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @bug 6425068 7157659
|
* @bug 6425068 7157659 8132890
|
||||||
* @summary Confirm that text prints where we expect to the length we expect.
|
* @summary Confirm that text prints where we expect to the length we expect.
|
||||||
* @run main/manual=yesno PrintTextTest
|
* @run main/manual=yesno PrintTextTest
|
||||||
*/
|
*/
|
||||||
@ -113,6 +113,32 @@ public class PrintTextTest extends Component implements Printable {
|
|||||||
book.append(ptt, portrait);
|
book.append(ptt, portrait);
|
||||||
book.append(ptt, landscape);
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
|
font = new Font("Dialog", Font.PLAIN, 18);
|
||||||
|
AffineTransform scaleTx = AffineTransform.getScaleInstance(1.25, 1.25);
|
||||||
|
name = "Page " + new Integer(page++);
|
||||||
|
ptt = new PrintTextTest(name, font, scaleTx, false);
|
||||||
|
p.add(name, ptt);
|
||||||
|
book.append(ptt, portrait);
|
||||||
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
|
font = new Font("Dialog", Font.PLAIN, 18);
|
||||||
|
scaleTx = AffineTransform.getScaleInstance(-1.25, 1.25);
|
||||||
|
scaleTx.translate(-preferredSize/1.25, 0);
|
||||||
|
name = "Page " + new Integer(page++);
|
||||||
|
ptt = new PrintTextTest(name, font, scaleTx, false);
|
||||||
|
p.add(name, ptt);
|
||||||
|
book.append(ptt, portrait);
|
||||||
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
|
font = new Font("Dialog", Font.PLAIN, 18);
|
||||||
|
scaleTx = AffineTransform.getScaleInstance(1.25, -1.25);
|
||||||
|
scaleTx.translate(0, -preferredSize/1.25);
|
||||||
|
name = "Page " + new Integer(page++);
|
||||||
|
ptt = new PrintTextTest(name, font, scaleTx, false);
|
||||||
|
p.add(name, ptt);
|
||||||
|
book.append(ptt, portrait);
|
||||||
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
font = font.deriveFont(rotTx);
|
font = font.deriveFont(rotTx);
|
||||||
name = "Page " + new Integer(page++);
|
name = "Page " + new Integer(page++);
|
||||||
ptt = new PrintTextTest(name, font, null, false);
|
ptt = new PrintTextTest(name, font, null, false);
|
||||||
@ -121,6 +147,30 @@ public class PrintTextTest extends Component implements Printable {
|
|||||||
book.append(ptt, portrait);
|
book.append(ptt, portrait);
|
||||||
book.append(ptt, landscape);
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
|
font = new Font("Monospaced", Font.PLAIN, 12);
|
||||||
|
name = "Page " + new Integer(page++);
|
||||||
|
ptt = new PrintTextTest(name, font, null, false);
|
||||||
|
p.add(ptt, BorderLayout.CENTER);
|
||||||
|
p.add(name, ptt);
|
||||||
|
book.append(ptt, portrait);
|
||||||
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
|
Font xfont = font.deriveFont(AffineTransform.getScaleInstance(1.5, 1));
|
||||||
|
name = "Page " + new Integer(page++);
|
||||||
|
ptt = new PrintTextTest(name, xfont, null, false);
|
||||||
|
p.add(ptt, BorderLayout.CENTER);
|
||||||
|
p.add(name, ptt);
|
||||||
|
book.append(ptt, portrait);
|
||||||
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
|
Font yfont = font.deriveFont(AffineTransform.getScaleInstance(1, 1.5));
|
||||||
|
name = "Page " + new Integer(page++);
|
||||||
|
ptt = new PrintTextTest(name, yfont, null, false);
|
||||||
|
p.add(ptt, BorderLayout.CENTER);
|
||||||
|
p.add(name, ptt);
|
||||||
|
book.append(ptt, portrait);
|
||||||
|
book.append(ptt, landscape);
|
||||||
|
|
||||||
if (System.getProperty("os.name").startsWith("Windows")) {
|
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||||
font = new Font("MS Gothic", Font.PLAIN, 12);
|
font = new Font("MS Gothic", Font.PLAIN, 12);
|
||||||
name = "Page " + new Integer(page++);
|
name = "Page " + new Integer(page++);
|
||||||
|
@ -32,8 +32,8 @@ import java.lang.annotation.*;
|
|||||||
|
|
||||||
public class IsEnum {
|
public class IsEnum {
|
||||||
|
|
||||||
static int test(Class clazz, boolean expected) {
|
static int test(Class<?> clazz, boolean expected) {
|
||||||
int status = (clazz.isEnum() == expected)?0:1;
|
int status = (clazz.isEnum() == expected) ? 0 : 1;
|
||||||
|
|
||||||
if (status == 1) {
|
if (status == 1) {
|
||||||
System.err.println("Unexpected enum status for " + clazz);
|
System.err.println("Unexpected enum status for " + clazz);
|
||||||
@ -41,23 +41,23 @@ public class IsEnum {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String argv[]) {
|
public static void main(String... argv) {
|
||||||
int failures = 0;
|
int failures = 0;
|
||||||
|
|
||||||
failures += test(IsEnum.class, false);
|
failures += test(IsEnum.class, false);
|
||||||
failures += test(String.class, false);
|
failures += test(String.class, false);
|
||||||
failures += test(Enum.class, false);
|
failures += test(Enum.class, false);
|
||||||
|
failures += test(EnumPoseur.class, false);
|
||||||
failures += test(java.math.RoundingMode.class, true);
|
failures += test(java.math.RoundingMode.class, true);
|
||||||
|
|
||||||
// Classes in java.lang.annoation
|
// Classes in java.lang.annotation
|
||||||
failures += test(Annotation.class, false);
|
failures += test(Annotation.class, false);
|
||||||
failures += test(ElementType.class, true);
|
failures += test(ElementType.class, true);
|
||||||
failures += test(Retention.class, false);
|
failures += test(Retention.class, false);
|
||||||
failures += test(RetentionPolicy.class, true);
|
failures += test(RetentionPolicy.class, true);
|
||||||
failures += test(Target.class, false);
|
failures += test(Target.class, false);
|
||||||
failures += test(EnumPoseur.class, false);
|
|
||||||
|
|
||||||
// Classes for specialized enum constants aren't enum's
|
// A class for a specialized enum constant isn't itself an enum
|
||||||
failures += test(SpecialEnum.class, true);
|
failures += test(SpecialEnum.class, true);
|
||||||
failures += test(SpecialEnum.RED.getClass(), false);
|
failures += test(SpecialEnum.RED.getClass(), false);
|
||||||
failures += test(SpecialEnum.GREEN.getClass(), true);
|
failures += test(SpecialEnum.GREEN.getClass(), true);
|
||||||
|
@ -27,9 +27,11 @@ import java.util.ArrayList;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@ -44,6 +46,7 @@ import org.testng.annotations.Test;
|
|||||||
* @library /lib/testlibrary
|
* @library /lib/testlibrary
|
||||||
* Test counting and JavaChild.spawning and counting of Processes.
|
* Test counting and JavaChild.spawning and counting of Processes.
|
||||||
* @run testng/othervm InfoTest
|
* @run testng/othervm InfoTest
|
||||||
|
* @key intermittent
|
||||||
* @author Roger Riggs
|
* @author Roger Riggs
|
||||||
*/
|
*/
|
||||||
public class TreeTest extends ProcessUtil {
|
public class TreeTest extends ProcessUtil {
|
||||||
@ -195,7 +198,7 @@ public class TreeTest extends ProcessUtil {
|
|||||||
allChildren.stream().map(p -> p.getPid())
|
allChildren.stream().map(p -> p.getPid())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
|
|
||||||
// Verify that all spawned children show up in the allChildrenList
|
// Verify that all spawned children show up in the allChildren List
|
||||||
processes.forEach((p, parent) -> {
|
processes.forEach((p, parent) -> {
|
||||||
Assert.assertEquals(p.isAlive(), true, "Child should be alive: " + p);
|
Assert.assertEquals(p.isAlive(), true, "Child should be alive: " + p);
|
||||||
Assert.assertTrue(allChildren.contains(p), "Spawned child should be listed in allChildren: " + p);
|
Assert.assertTrue(allChildren.contains(p), "Spawned child should be listed in allChildren: " + p);
|
||||||
@ -241,6 +244,7 @@ public class TreeTest extends ProcessUtil {
|
|||||||
printf(" p1: %s%n", p1.getPid());
|
printf(" p1: %s%n", p1.getPid());
|
||||||
|
|
||||||
int newChildren = 3;
|
int newChildren = 3;
|
||||||
|
CountDownLatch spawnCount = new CountDownLatch(newChildren);
|
||||||
// Spawn children and have them wait
|
// Spawn children and have them wait
|
||||||
p1.sendAction("spawn", newChildren, "stdin");
|
p1.sendAction("spawn", newChildren, "stdin");
|
||||||
|
|
||||||
@ -251,11 +255,26 @@ public class TreeTest extends ProcessUtil {
|
|||||||
Long child = Long.valueOf(split[2]);
|
Long child = Long.valueOf(split[2]);
|
||||||
Long parent = Long.valueOf(split[0].split(":")[0]);
|
Long parent = Long.valueOf(split[0].split(":")[0]);
|
||||||
processes.put(ProcessHandle.of(child).get(), ProcessHandle.of(parent).get());
|
processes.put(ProcessHandle.of(child).get(), ProcessHandle.of(parent).get());
|
||||||
|
spawnCount.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wait for the new processes and save the list
|
// Wait for all the subprocesses to be listed as started
|
||||||
List<ProcessHandle> allChildren = waitForAllChildren(p1Handle, newChildren);
|
Assert.assertTrue(spawnCount.await(Utils.adjustTimeout(30L), TimeUnit.SECONDS),
|
||||||
|
"Timeout waiting for processes to start");
|
||||||
|
|
||||||
|
// Debugging; list allChildren that are not expected in processes
|
||||||
|
List<ProcessHandle> allChildren = ProcessUtil.getAllChildren(p1Handle);
|
||||||
|
long count = allChildren.stream()
|
||||||
|
.filter(ph -> !processes.containsKey(ph))
|
||||||
|
.count();
|
||||||
|
if (count > 0) {
|
||||||
|
allChildren.stream()
|
||||||
|
.filter(ph -> !processes.containsKey(ph))
|
||||||
|
.forEach(ph1 -> ProcessUtil.printProcess(ph1, "Extra process: "));
|
||||||
|
ProcessUtil.logTaskList();
|
||||||
|
Assert.assertEquals(0, count, "Extra processes in allChildren");
|
||||||
|
}
|
||||||
|
|
||||||
// Verify that all spawned children are alive, show up in the allChildren list
|
// Verify that all spawned children are alive, show up in the allChildren list
|
||||||
// then destroy them
|
// then destroy them
|
||||||
@ -266,6 +285,7 @@ public class TreeTest extends ProcessUtil {
|
|||||||
});
|
});
|
||||||
Assert.assertEquals(processes.size(), newChildren, "Wrong number of children");
|
Assert.assertEquals(processes.size(), newChildren, "Wrong number of children");
|
||||||
|
|
||||||
|
// Wait for each of the processes to exit
|
||||||
processes.forEach((p, parent) -> {
|
processes.forEach((p, parent) -> {
|
||||||
for (long retries = Utils.adjustTimeout(100L); retries > 0 ; retries--) {
|
for (long retries = Utils.adjustTimeout(100L); retries > 0 ; retries--) {
|
||||||
if (!p.isAlive()) {
|
if (!p.isAlive()) {
|
||||||
@ -285,8 +305,10 @@ public class TreeTest extends ProcessUtil {
|
|||||||
p1.destroyForcibly();
|
p1.destroyForcibly();
|
||||||
p1.waitFor();
|
p1.waitFor();
|
||||||
|
|
||||||
|
// Verify that none of the spawned children are still listed by allChildren
|
||||||
List<ProcessHandle> remaining = getAllChildren(self);
|
List<ProcessHandle> remaining = getAllChildren(self);
|
||||||
remaining = remaining.stream().filter(processes::contains).collect(Collectors.toList());
|
Assert.assertFalse(remaining.remove(p1Handle), "Child p1 should have exited");
|
||||||
|
remaining = remaining.stream().filter(processes::containsKey).collect(Collectors.toList());
|
||||||
Assert.assertEquals(remaining.size(), 0, "Subprocess(es) should have exited: " + remaining);
|
Assert.assertEquals(remaining.size(), 0, "Subprocess(es) should have exited: " + remaining);
|
||||||
|
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
@ -354,6 +376,8 @@ public class TreeTest extends ProcessUtil {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public static void test5() {
|
public static void test5() {
|
||||||
|
ConcurrentHashMap<ProcessHandle, ProcessHandle> processes = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
int factor = 2;
|
int factor = 2;
|
||||||
JavaChild p1 = null;
|
JavaChild p1 = null;
|
||||||
Instant start = Instant.now();
|
Instant start = Instant.now();
|
||||||
@ -374,11 +398,39 @@ public class TreeTest extends ProcessUtil {
|
|||||||
p1.sendAction("child", "child", "spawn", factor, "stdin");
|
p1.sendAction("child", "child", "spawn", factor, "stdin");
|
||||||
|
|
||||||
int newChildren = factor * (1 + factor * (1 + factor));
|
int newChildren = factor * (1 + factor * (1 + factor));
|
||||||
List<ProcessHandle> children = ProcessUtil.waitForAllChildren(p1Handle, newChildren);
|
CountDownLatch spawnCount = new CountDownLatch(newChildren);
|
||||||
|
|
||||||
|
// Gather the PIDs from the output of the spawning process
|
||||||
|
p1.forEachOutputLine((s) -> {
|
||||||
|
String[] split = s.trim().split(" ");
|
||||||
|
if (split.length == 3 && split[1].equals("spawn")) {
|
||||||
|
Long child = Long.valueOf(split[2]);
|
||||||
|
Long parent = Long.valueOf(split[0].split(":")[0]);
|
||||||
|
processes.put(ProcessHandle.of(child).get(), ProcessHandle.of(parent).get());
|
||||||
|
spawnCount.countDown();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Wait for all the subprocesses to be listed as started
|
||||||
|
Assert.assertTrue(spawnCount.await(Utils.adjustTimeout(30L), TimeUnit.SECONDS),
|
||||||
|
"Timeout waiting for processes to start");
|
||||||
|
|
||||||
|
// Debugging; list allChildren that are not expected in processes
|
||||||
|
List<ProcessHandle> allChildren = ProcessUtil.getAllChildren(p1Handle);
|
||||||
|
long count = allChildren.stream()
|
||||||
|
.filter(ph -> !processes.containsKey(ph))
|
||||||
|
.count();
|
||||||
|
if (count > 0) {
|
||||||
|
allChildren.stream()
|
||||||
|
.filter(ph -> !processes.containsKey(ph))
|
||||||
|
.forEach(ph1 -> ProcessUtil.printProcess(ph1, "Extra process: "));
|
||||||
|
ProcessUtil.logTaskList();
|
||||||
|
Assert.assertEquals(0, count, "Extra processes in allChildren");
|
||||||
|
}
|
||||||
|
|
||||||
Assert.assertEquals(getChildren(p1Handle).size(),
|
Assert.assertEquals(getChildren(p1Handle).size(),
|
||||||
factor, "expected direct children");
|
factor, "expected direct children");
|
||||||
long count = getAllChildren(p1Handle).size();
|
count = getAllChildren(p1Handle).size();
|
||||||
long totalChildren = factor * factor * factor + factor * factor + factor;
|
long totalChildren = factor * factor * factor + factor * factor + factor;
|
||||||
Assert.assertTrue(count >= totalChildren,
|
Assert.assertTrue(count >= totalChildren,
|
||||||
"expected at least " + totalChildren + ", actual: " + count);
|
"expected at least " + totalChildren + ", actual: " + count);
|
||||||
@ -397,6 +449,12 @@ public class TreeTest extends ProcessUtil {
|
|||||||
if (p1 != null) {
|
if (p1 != null) {
|
||||||
p1.destroyForcibly();
|
p1.destroyForcibly();
|
||||||
}
|
}
|
||||||
|
processes.forEach((p, parent) -> {
|
||||||
|
if (p.isAlive()) {
|
||||||
|
ProcessUtil.printProcess(p, "Process Cleanup: ");
|
||||||
|
p.destroyForcibly();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test LFSingleThreadCachingTest
|
* @test LFSingleThreadCachingTest
|
||||||
|
* @ignore 8129523
|
||||||
* @bug 8046703
|
* @bug 8046703
|
||||||
* @key randomness
|
* @key randomness
|
||||||
* @summary Test verifies that lambda forms are cached when run with single thread
|
* @summary Test verifies that lambda forms are cached when run with single thread
|
||||||
|
1083
jdk/test/java/util/Arrays/ArraysEqCmpTest.java
Normal file
1083
jdk/test/java/util/Arrays/ArraysEqCmpTest.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# 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
|
||||||
@ -24,7 +24,7 @@
|
|||||||
#
|
#
|
||||||
# @test
|
# @test
|
||||||
# @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
|
# @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
|
||||||
# 8010666 8013086 8013233 8013903 8015960 8028771
|
# 8010666 8013086 8013233 8013903 8015960 8028771 8062006
|
||||||
# @summary tests for "java.locale.providers" system property
|
# @summary tests for "java.locale.providers" system property
|
||||||
# @compile -XDignore.symbol.file LocaleProviders.java
|
# @compile -XDignore.symbol.file LocaleProviders.java
|
||||||
# @run shell/timeout=600 LocaleProviders.sh
|
# @run shell/timeout=600 LocaleProviders.sh
|
||||||
@ -182,7 +182,7 @@ PARAM1=JRE
|
|||||||
if [ "${DEFLANG}" != "en" ] && [ "${DEFFMTLANG}" != "en" ]; then
|
if [ "${DEFLANG}" != "en" ] && [ "${DEFFMTLANG}" != "en" ]; then
|
||||||
PARAM2=en
|
PARAM2=en
|
||||||
PARAM3=US
|
PARAM3=US
|
||||||
elif [ "${DEFLANG}" != "ja" ] && [ "${DEFFMTLANG}" != "ja" ]; then
|
elif [ "${DEFLANG}" != "ja" ] && [ "${DEFFMTLANG}" != "ja" ]; then
|
||||||
PARAM2=ja
|
PARAM2=ja
|
||||||
PARAM3=JP
|
PARAM3=JP
|
||||||
else
|
else
|
||||||
@ -200,6 +200,8 @@ PARAM2=en
|
|||||||
PARAM3=US
|
PARAM3=US
|
||||||
SPICLASSES=
|
SPICLASSES=
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=SPI,COMPAT
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing the order, variaton #1. This assumes en_GB DateFormat data are available both in JRE & CLDR
|
# testing the order, variaton #1. This assumes en_GB DateFormat data are available both in JRE & CLDR
|
||||||
METHODNAME=adapterTest
|
METHODNAME=adapterTest
|
||||||
@ -209,6 +211,8 @@ PARAM2=en
|
|||||||
PARAM3=GB
|
PARAM3=GB
|
||||||
SPICLASSES=
|
SPICLASSES=
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=CLDR,COMPAT
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing the order, variaton #2. This assumes en_GB DateFormat data are available both in JRE & CLDR
|
# testing the order, variaton #2. This assumes en_GB DateFormat data are available both in JRE & CLDR
|
||||||
METHODNAME=adapterTest
|
METHODNAME=adapterTest
|
||||||
@ -218,6 +222,8 @@ PARAM2=en
|
|||||||
PARAM3=GB
|
PARAM3=GB
|
||||||
SPICLASSES=
|
SPICLASSES=
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=COMPAT,CLDR
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing the order, variaton #3 for non-existent locale in JRE assuming "haw" is not in JRE.
|
# testing the order, variaton #3 for non-existent locale in JRE assuming "haw" is not in JRE.
|
||||||
METHODNAME=adapterTest
|
METHODNAME=adapterTest
|
||||||
@ -227,6 +233,8 @@ PARAM2=haw
|
|||||||
PARAM3=
|
PARAM3=
|
||||||
SPICLASSES=
|
SPICLASSES=
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=COMPAT,CLDR
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing the order, variaton #4 for the bug 7196799. CLDR's "zh" data should be used in "zh_CN"
|
# testing the order, variaton #4 for the bug 7196799. CLDR's "zh" data should be used in "zh_CN"
|
||||||
METHODNAME=adapterTest
|
METHODNAME=adapterTest
|
||||||
@ -275,6 +283,8 @@ PARAM2=
|
|||||||
PARAM3=
|
PARAM3=
|
||||||
SPICLASSES=${SPIDIR}
|
SPICLASSES=${SPIDIR}
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=COMPAT
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing 8000615 fix.
|
# testing 8000615 fix.
|
||||||
METHODNAME=tzNameTest
|
METHODNAME=tzNameTest
|
||||||
@ -284,6 +294,8 @@ PARAM2=
|
|||||||
PARAM3=
|
PARAM3=
|
||||||
SPICLASSES=${SPIDIR}
|
SPICLASSES=${SPIDIR}
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=COMPAT
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing 8001440 fix.
|
# testing 8001440 fix.
|
||||||
METHODNAME=bug8001440Test
|
METHODNAME=bug8001440Test
|
||||||
@ -314,6 +326,8 @@ PARAM2=JP
|
|||||||
PARAM3=
|
PARAM3=
|
||||||
SPICLASSES=${SPIDIR}
|
SPICLASSES=${SPIDIR}
|
||||||
runTest
|
runTest
|
||||||
|
PREFLIST=COMPAT,SPI
|
||||||
|
runTest
|
||||||
|
|
||||||
# testing 8013903 fix. (Windows only)
|
# testing 8013903 fix. (Windows only)
|
||||||
METHODNAME=bug8013903Test
|
METHODNAME=bug8013903Test
|
||||||
@ -323,12 +337,9 @@ PARAM2=
|
|||||||
PARAM3=
|
PARAM3=
|
||||||
SPICLASSES=
|
SPICLASSES=
|
||||||
runTest
|
runTest
|
||||||
METHODNAME=bug8013903Test
|
|
||||||
PREFLIST=HOST
|
PREFLIST=HOST
|
||||||
PARAM1=
|
runTest
|
||||||
PARAM2=
|
PREFLIST=HOST,COMPAT
|
||||||
PARAM3=
|
|
||||||
SPICLASSES=
|
|
||||||
runTest
|
runTest
|
||||||
|
|
||||||
# testing 8027289 fix, if the platform format default is zh_CN
|
# testing 8027289 fix, if the platform format default is zh_CN
|
||||||
@ -342,12 +353,10 @@ if [ "${DEFFMTLANG}" = "zh" ] && [ "${DEFFMTCTRY}" = "CN" ]; then
|
|||||||
PARAM3=
|
PARAM3=
|
||||||
SPICLASSES=
|
SPICLASSES=
|
||||||
runTest
|
runTest
|
||||||
METHODNAME=bug8027289Test
|
PREFLIST=COMPAT,HOST
|
||||||
|
runTest
|
||||||
PREFLIST=HOST
|
PREFLIST=HOST
|
||||||
PARAM1=00A5
|
PARAM1=00A5
|
||||||
PARAM2=
|
|
||||||
PARAM3=
|
|
||||||
SPICLASSES=
|
|
||||||
runTest
|
runTest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
115
jdk/test/javax/imageio/plugins/bmp/BMPPixelSpacingTest.java
Normal file
115
jdk/test/javax/imageio/plugins/bmp/BMPPixelSpacingTest.java
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
* @bug 7182758
|
||||||
|
* @summary Test verifies whether we are getting correct Horizontal
|
||||||
|
* & Vertical Physical pixel spacing for active BMP image
|
||||||
|
* through stored metadata or not.
|
||||||
|
* @run main BMPPixelSpacingTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.imageio.ImageReader;
|
||||||
|
import javax.imageio.metadata.IIOMetadata;
|
||||||
|
import javax.imageio.stream.ImageInputStream;
|
||||||
|
import org.w3c.dom.NamedNodeMap;
|
||||||
|
import org.w3c.dom.Node;
|
||||||
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
|
public class BMPPixelSpacingTest {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
// Header contaning X & Y pixels-per-meter more than value 1
|
||||||
|
byte[] bmpHeaderData = { (byte) 0x42, (byte) 0x4d, (byte) 0x7e,
|
||||||
|
(byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0x00, (byte) 0x00, (byte) 0x3e, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0x00, (byte) 0x28, (byte) 0x00, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0x64, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64,
|
||||||
|
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02,
|
||||||
|
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
|
||||||
|
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x00, (byte) 0xff,
|
||||||
|
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
|
||||||
|
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
|
||||||
|
(byte) 0xff };
|
||||||
|
|
||||||
|
ImageInputStream imageInput = ImageIO.
|
||||||
|
createImageInputStream(new ByteArrayInputStream(bmpHeaderData));
|
||||||
|
|
||||||
|
for (Iterator<ImageReader> it = ImageIO.getImageReaders(imageInput);
|
||||||
|
it.hasNext(); ) {
|
||||||
|
ImageReader reader = it.next();
|
||||||
|
reader.setInput(imageInput);
|
||||||
|
IIOMetadata metadata = reader.getImageMetadata(0);
|
||||||
|
|
||||||
|
Node rootNode = metadata.getAsTree("javax_imageio_1.0");
|
||||||
|
NodeList nl = rootNode.getChildNodes();
|
||||||
|
|
||||||
|
//Parse until you get Dimension child node
|
||||||
|
for (int i = 0; i < nl.getLength(); i++) {
|
||||||
|
Node node = nl.item(i);
|
||||||
|
if ((node.getNodeName()).equals("Dimension")) {
|
||||||
|
//get childnode list under Dimension node
|
||||||
|
NodeList cl = node.getChildNodes();
|
||||||
|
//Corresponding node indices under Dimension node
|
||||||
|
int horizontalNodeIndex = 1;
|
||||||
|
int verticalNodeIndex = 2;
|
||||||
|
Node horizontalNode = cl.item(horizontalNodeIndex);
|
||||||
|
Node verticalNode = cl.item(verticalNodeIndex);
|
||||||
|
|
||||||
|
//get attributes for horizontal and vertical nodes
|
||||||
|
NamedNodeMap horizontalAttr = horizontalNode.
|
||||||
|
getAttributes();
|
||||||
|
NamedNodeMap verticalAttr = verticalNode.getAttributes();
|
||||||
|
|
||||||
|
//since they have only one attribute index is 0
|
||||||
|
int attributeIndex = 0;
|
||||||
|
Node horizontalValue = horizontalAttr.item(attributeIndex);
|
||||||
|
Node verticalValue = verticalAttr.item(attributeIndex);
|
||||||
|
float horizontalNodeValue = Float.
|
||||||
|
parseFloat((horizontalValue.getNodeValue()));
|
||||||
|
float verticalNodeValue = Float.
|
||||||
|
parseFloat((verticalValue.getNodeValue()));
|
||||||
|
|
||||||
|
float expectedHorizontalValue, expectedVerticalValue;
|
||||||
|
// in test metadata xPixelsPerMeter & yPixelsPerMeter is 2
|
||||||
|
expectedHorizontalValue = expectedVerticalValue =
|
||||||
|
1000.0F / 2;
|
||||||
|
//expected and returned values should be same
|
||||||
|
if ((Float.compare(horizontalNodeValue,
|
||||||
|
expectedHorizontalValue) != 0) ||
|
||||||
|
(Float.compare(verticalNodeValue,
|
||||||
|
expectedVerticalValue) != 0)) {
|
||||||
|
throw new RuntimeException("Invalid pixel spacing");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -27,8 +27,7 @@
|
|||||||
* @summary Test that having a security manager doesn't trigger a
|
* @summary Test that having a security manager doesn't trigger a
|
||||||
* NotCompliantMBeanException
|
* NotCompliantMBeanException
|
||||||
* @author Daniel Fuchs, Yves Joan
|
* @author Daniel Fuchs, Yves Joan
|
||||||
* @modules java.desktop
|
* @modules java.management
|
||||||
* java.management
|
|
||||||
* @run clean AnnotationSecurityTest Described UnDescribed DescribedMBean
|
* @run clean AnnotationSecurityTest Described UnDescribed DescribedMBean
|
||||||
* UnDescribedMBean SqeDescriptorKey DescribedMX DescribedMXBean
|
* UnDescribedMBean SqeDescriptorKey DescribedMX DescribedMXBean
|
||||||
* @run build AnnotationSecurityTest Described UnDescribed DescribedMBean
|
* @run build AnnotationSecurityTest Described UnDescribed DescribedMBean
|
||||||
@ -40,13 +39,8 @@
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.lang.reflect.AnnotatedElement;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.UndeclaredThrowableException;
|
|
||||||
|
|
||||||
import javax.management.JMException;
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
/**
|
/**
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*
|
*
|
||||||
* Used by AnnotationSecurityTest.java
|
* Used by AnnotationSecurityTest.java
|
||||||
**/
|
**/
|
||||||
import java.beans.ConstructorProperties;
|
import javax.management.ConstructorParameters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An MBean used by AnnotationSecurityTest.java
|
* An MBean used by AnnotationSecurityTest.java
|
||||||
@ -37,7 +37,7 @@ public class Described implements DescribedMBean {
|
|||||||
public Described() {}
|
public Described() {}
|
||||||
|
|
||||||
@SqeDescriptorKey("ONE PARAMETER CONSTRUCTOR Described")
|
@SqeDescriptorKey("ONE PARAMETER CONSTRUCTOR Described")
|
||||||
@ConstructorProperties({"name", "unused"})
|
@ConstructorParameters({"name", "unused"})
|
||||||
public Described(@SqeDescriptorKey("CONSTRUCTOR PARAMETER name")String name,
|
public Described(@SqeDescriptorKey("CONSTRUCTOR PARAMETER name")String name,
|
||||||
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused")String unused) {
|
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused")String unused) {
|
||||||
this.name = name ;
|
this.name = name ;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*
|
*
|
||||||
* Used by AnnotationSecurityTest.java
|
* Used by AnnotationSecurityTest.java
|
||||||
**/
|
**/
|
||||||
import java.beans.ConstructorProperties;
|
import javax.management.ConstructorParameters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An MXBean used by AnnotationSecurityTest.java
|
* An MXBean used by AnnotationSecurityTest.java
|
||||||
@ -37,7 +37,7 @@ public class DescribedMX implements DescribedMXBean {
|
|||||||
public DescribedMX() {}
|
public DescribedMX() {}
|
||||||
|
|
||||||
@SqeDescriptorKey("ONE PARAMETER CONSTRUCTOR DescribedMX")
|
@SqeDescriptorKey("ONE PARAMETER CONSTRUCTOR DescribedMX")
|
||||||
@ConstructorProperties({"name", "unused"})
|
@ConstructorParameters({"name", "unused"})
|
||||||
public DescribedMX(@SqeDescriptorKey("CONSTRUCTOR PARAMETER name")String name,
|
public DescribedMX(@SqeDescriptorKey("CONSTRUCTOR PARAMETER name")String name,
|
||||||
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused")String unused) {
|
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused")String unused) {
|
||||||
this.name = name ;
|
this.name = name ;
|
||||||
|
@ -0,0 +1,106 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.beans.ConstructorProperties;
|
||||||
|
import javax.management.ConstructorParameters;
|
||||||
|
import javax.management.MBeanServer;
|
||||||
|
import javax.management.MBeanServerFactory;
|
||||||
|
import javax.management.ObjectName;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 7199353
|
||||||
|
* @summary Asserts that 'java.beans.ConstructorProperties' annotation is still
|
||||||
|
* recognized and properly handled for custom types mapped to open types.
|
||||||
|
* Also, makes sure that if the same constructor is annotated by both
|
||||||
|
* j.b.ConstructorProperties and j.m.ConstructorProperties annotations
|
||||||
|
* only j.m.ConstructorProperties annotation is considered.
|
||||||
|
* @author Jaroslav Bachorik
|
||||||
|
* @modules java.management
|
||||||
|
* java.desktop
|
||||||
|
* @run main LegacyConstructorPropertiesTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LegacyConstructorPropertiesTest {
|
||||||
|
public static class CustomType {
|
||||||
|
private String name;
|
||||||
|
private int value;
|
||||||
|
@ConstructorProperties({"name", "value"})
|
||||||
|
public CustomType(String name, int value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if @java.beans.ConstructorProperties would be used
|
||||||
|
// the introspector would choke on this
|
||||||
|
@ConstructorProperties("noname")
|
||||||
|
@ConstructorParameters("name")
|
||||||
|
public CustomType(String name) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface CustomMXBean {
|
||||||
|
public CustomType getProp();
|
||||||
|
public void setProp(CustomType prop);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final class Custom implements CustomMXBean {
|
||||||
|
private CustomType prop;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CustomType getProp() {
|
||||||
|
return prop;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setProp(CustomType prop) {
|
||||||
|
this.prop = prop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
MBeanServer mbs = MBeanServerFactory.createMBeanServer();
|
||||||
|
CustomMXBean mbean = new Custom();
|
||||||
|
|
||||||
|
mbs.registerMBean(mbean, ObjectName.getInstance("test:type=Custom"));
|
||||||
|
}
|
||||||
|
}
|
@ -26,15 +26,13 @@
|
|||||||
* @bug 6175517 6278707
|
* @bug 6175517 6278707
|
||||||
* @summary Test that ambiguous ConstructorProperties annotations are detected.
|
* @summary Test that ambiguous ConstructorProperties annotations are detected.
|
||||||
* @author Eamonn McManus
|
* @author Eamonn McManus
|
||||||
* @modules java.desktop
|
* @modules java.management
|
||||||
* java.management
|
|
||||||
* @run clean AmbiguousConstructorTest
|
* @run clean AmbiguousConstructorTest
|
||||||
* @run build AmbiguousConstructorTest
|
* @run build AmbiguousConstructorTest
|
||||||
* @run main AmbiguousConstructorTest
|
* @run main AmbiguousConstructorTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.beans.ConstructorProperties;
|
import javax.management.ConstructorParameters;
|
||||||
import java.io.InvalidObjectException;
|
|
||||||
import javax.management.*;
|
import javax.management.*;
|
||||||
|
|
||||||
public class AmbiguousConstructorTest {
|
public class AmbiguousConstructorTest {
|
||||||
@ -76,13 +74,13 @@ public class AmbiguousConstructorTest {
|
|||||||
public int getC() {return 0;}
|
public int getC() {return 0;}
|
||||||
public long getD() {return 0;}
|
public long getD() {return 0;}
|
||||||
|
|
||||||
@ConstructorProperties({"a", "b"})
|
@ConstructorParameters({"a", "b"})
|
||||||
public Unambiguous(byte a, short b) {}
|
public Unambiguous(byte a, short b) {}
|
||||||
|
|
||||||
@ConstructorProperties({"b", "c"})
|
@ConstructorParameters({"b", "c"})
|
||||||
public Unambiguous(short b, int c) {}
|
public Unambiguous(short b, int c) {}
|
||||||
|
|
||||||
@ConstructorProperties({"a", "b", "c"})
|
@ConstructorParameters({"a", "b", "c"})
|
||||||
public Unambiguous(byte a, short b, int c) {}
|
public Unambiguous(byte a, short b, int c) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,13 +90,13 @@ public class AmbiguousConstructorTest {
|
|||||||
public int getC() {return 0;}
|
public int getC() {return 0;}
|
||||||
public long getD() {return 0;}
|
public long getD() {return 0;}
|
||||||
|
|
||||||
@ConstructorProperties({"a", "b"})
|
@ConstructorParameters({"a", "b"})
|
||||||
public Ambiguous(byte a, short b) {}
|
public Ambiguous(byte a, short b) {}
|
||||||
|
|
||||||
@ConstructorProperties({"b", "c"})
|
@ConstructorParameters({"b", "c"})
|
||||||
public Ambiguous(short b, int c) {}
|
public Ambiguous(short b, int c) {}
|
||||||
|
|
||||||
@ConstructorProperties({"a", "b", "c", "d"})
|
@ConstructorParameters({"a", "b", "c", "d"})
|
||||||
public Ambiguous(byte a, short b, int c, long d) {}
|
public Ambiguous(byte a, short b, int c, long d) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,11 +26,10 @@
|
|||||||
* @bug 6713777
|
* @bug 6713777
|
||||||
* @summary Test that exception messages include all relevant information
|
* @summary Test that exception messages include all relevant information
|
||||||
* @author Eamonn McManus
|
* @author Eamonn McManus
|
||||||
* @modules java.desktop
|
* @modules java.management
|
||||||
* java.management
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.beans.ConstructorProperties;
|
import javax.management.ConstructorParameters;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@ -131,7 +130,7 @@ public class ExceptionDiagnosisTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class CaseProb {
|
public static class CaseProb {
|
||||||
@ConstructorProperties({"urlPath"})
|
@ConstructorParameters({"urlPath"})
|
||||||
public CaseProb(String urlPath) {}
|
public CaseProb(String urlPath) {}
|
||||||
|
|
||||||
public String getURLPath() {return null;}
|
public String getURLPath() {return null;}
|
||||||
|
@ -25,8 +25,7 @@
|
|||||||
* @bug 6482247
|
* @bug 6482247
|
||||||
* @summary Test that creating MXBeans does not introduce memory leaks.
|
* @summary Test that creating MXBeans does not introduce memory leaks.
|
||||||
* @author Eamonn McManus
|
* @author Eamonn McManus
|
||||||
* @modules java.desktop
|
* @modules java.management
|
||||||
* java.management
|
|
||||||
* @run build LeakTest RandomMXBeanTest MerlinMXBean TigerMXBean
|
* @run build LeakTest RandomMXBeanTest MerlinMXBean TigerMXBean
|
||||||
* @run main LeakTest
|
* @run main LeakTest
|
||||||
*/
|
*/
|
||||||
|
@ -27,8 +27,7 @@
|
|||||||
* @summary General MXBean test.
|
* @summary General MXBean test.
|
||||||
* @author Eamonn McManus
|
* @author Eamonn McManus
|
||||||
* @author Jaroslav Bachorik
|
* @author Jaroslav Bachorik
|
||||||
* @modules java.desktop
|
* @modules java.management
|
||||||
* java.management
|
|
||||||
* @run clean MXBeanTest MerlinMXBean TigerMXBean
|
* @run clean MXBeanTest MerlinMXBean TigerMXBean
|
||||||
* @run build MXBeanTest MerlinMXBean TigerMXBean
|
* @run build MXBeanTest MerlinMXBean TigerMXBean
|
||||||
* @run main MXBeanTest
|
* @run main MXBeanTest
|
||||||
|
@ -26,14 +26,13 @@
|
|||||||
* @bug 6175517
|
* @bug 6175517
|
||||||
* @summary Test the PropertyNames annotation with MXBeans
|
* @summary Test the PropertyNames annotation with MXBeans
|
||||||
* @author Eamonn McManus
|
* @author Eamonn McManus
|
||||||
* @modules java.desktop
|
* @modules java.management
|
||||||
* java.management
|
|
||||||
* @run clean PropertyNamesTest
|
* @run clean PropertyNamesTest
|
||||||
* @run build PropertyNamesTest
|
* @run build PropertyNamesTest
|
||||||
* @run main PropertyNamesTest
|
* @run main PropertyNamesTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.beans.ConstructorProperties;
|
import javax.management.ConstructorParameters;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.management.JMX;
|
import javax.management.JMX;
|
||||||
@ -95,7 +94,7 @@ public class PropertyNamesTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Point {
|
public static class Point {
|
||||||
@ConstructorProperties({"x", "y"})
|
@ConstructorParameters({"x", "y"})
|
||||||
public Point(int x, int y) {
|
public Point(int x, int y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
@ -123,17 +122,17 @@ public class PropertyNamesTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Evolve {
|
public static class Evolve {
|
||||||
@ConstructorProperties({"oldInt"})
|
@ConstructorParameters({"oldInt"})
|
||||||
public Evolve(int oldInt) {
|
public Evolve(int oldInt) {
|
||||||
this(oldInt, "defaultString");
|
this(oldInt, "defaultString");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConstructorProperties({"oldInt", "newString"})
|
@ConstructorParameters({"oldInt", "newString"})
|
||||||
public Evolve(int oldInt, String newString) {
|
public Evolve(int oldInt, String newString) {
|
||||||
this(oldInt, newString, Collections.<String>emptyList());
|
this(oldInt, newString, Collections.<String>emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConstructorProperties({"oldInt", "newString", "newerList"})
|
@ConstructorParameters({"oldInt", "newString", "newerList"})
|
||||||
public Evolve(int oldInt, String newString, List<String> newerList) {
|
public Evolve(int oldInt, String newString, List<String> newerList) {
|
||||||
this.oldInt = oldInt;
|
this.oldInt = oldInt;
|
||||||
this.newString = newString;
|
this.newString = newString;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* 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
|
||||||
@ -21,7 +21,7 @@
|
|||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.beans.ConstructorProperties;
|
import javax.management.ConstructorParameters;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -42,7 +42,7 @@ import javax.management.openmbean.TabularType;
|
|||||||
public interface TigerMXBean {
|
public interface TigerMXBean {
|
||||||
|
|
||||||
class Point {
|
class Point {
|
||||||
@ConstructorProperties({"x", "y"})
|
@ConstructorParameters({"x", "y"})
|
||||||
public Point(double x, double y) {
|
public Point(double x, double y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* @test
|
||||||
* @modules java.base/jdk.internal.jimage
|
* @modules java.base/jdk.internal.jimage
|
||||||
|
* @run testng JImageReadTest
|
||||||
* @summary Unit test for libjimage JIMAGE_Open/Read/Close
|
* @summary Unit test for libjimage JIMAGE_Open/Read/Close
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -57,8 +59,7 @@ public class JImageReadTest {
|
|||||||
{"java.base", "java/lang/String.class"},
|
{"java.base", "java/lang/String.class"},
|
||||||
{"java.base", "java/lang/Object.class"},
|
{"java.base", "java/lang/Object.class"},
|
||||||
{"java.base", "sun/reflect/generics/tree/TypeArgument.class"},
|
{"java.base", "sun/reflect/generics/tree/TypeArgument.class"},
|
||||||
{"jdk.jdeps", "com/sun/tools/javap/StackMapWriter$StackMapBuilder.class"},
|
{"java.base", "sun/net/www/content-types.properties"},
|
||||||
{"jdk.hotspot.agent", "sa.properties"},
|
|
||||||
{"java.logging", "java/util/logging/Logger.class"},
|
{"java.logging", "java/util/logging/Logger.class"},
|
||||||
{"java.base", "java/NOSUCHCLASS/yyy.class"}, // non-existent
|
{"java.base", "java/NOSUCHCLASS/yyy.class"}, // non-existent
|
||||||
{"NOSUCHMODULE", "java/lang/Class.class"}, // non-existent
|
{"NOSUCHMODULE", "java/lang/Class.class"}, // non-existent
|
||||||
@ -165,8 +166,10 @@ public class JImageReadTest {
|
|||||||
int count = ImageNativeSubstrate.JIMAGE_Resources(jimageHandle,
|
int count = ImageNativeSubstrate.JIMAGE_Resources(jimageHandle,
|
||||||
names);
|
names);
|
||||||
System.out.printf(" count: %d, a class: %s\n", count, names[0]);
|
System.out.printf(" count: %d, a class: %s\n", count, names[0]);
|
||||||
Assert.assertTrue(max > 31000,
|
int minEntryCount = 16000;
|
||||||
"missing entries, should be more than 31000, reported: " + count);
|
Assert.assertTrue(max > minEntryCount,
|
||||||
|
"missing entries, should be more than " + minEntryCount +
|
||||||
|
", reported: " + count);
|
||||||
Assert.assertTrue(count == max,
|
Assert.assertTrue(count == max,
|
||||||
"unexpected count of entries, count: " + count
|
"unexpected count of entries, count: " + count
|
||||||
+ ", max: " + max);
|
+ ", max: " + max);
|
||||||
@ -310,6 +313,7 @@ public class JImageReadTest {
|
|||||||
static boolean isMetaName(String name) {
|
static boolean isMetaName(String name) {
|
||||||
return name.startsWith("/modules")
|
return name.startsWith("/modules")
|
||||||
|| name.startsWith("/packages")
|
|| name.startsWith("/packages")
|
||||||
|
|| name.startsWith("META-INF/services")
|
||||||
|| name.equals("bootmodules.jdata");
|
|| name.equals("bootmodules.jdata");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,6 +366,24 @@ public class JImageReadTest {
|
|||||||
System.out.printf(" %s: %d names%n", fname, names.length);
|
System.out.printf(" %s: %d names%n", fname, names.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
static void test5_nameTooLong() throws IOException {
|
||||||
|
long[] size = new long[1];
|
||||||
|
String moduleName = "FictiousModuleName";
|
||||||
|
String className = String.format("A%09999d", 1);
|
||||||
|
|
||||||
|
long jimageHandle = ImageNativeSubstrate.JIMAGE_Open(imageFile);
|
||||||
|
Assert.assertTrue(jimageHandle != 0, "JIMAGE_Open failed: id: " + jimageHandle);
|
||||||
|
|
||||||
|
long locationHandle =
|
||||||
|
ImageNativeSubstrate.JIMAGE_FindResource(jimageHandle,
|
||||||
|
moduleName, "9.0", className, size);
|
||||||
|
|
||||||
|
Assert.assertEquals(0, locationHandle, "Too long name should have failed");
|
||||||
|
|
||||||
|
ImageNativeSubstrate.JIMAGE_Close(jimageHandle);
|
||||||
|
}
|
||||||
|
|
||||||
// main method to run standalone from jtreg
|
// main method to run standalone from jtreg
|
||||||
|
|
||||||
@Test(enabled=false)
|
@Test(enabled=false)
|
||||||
|
@ -539,6 +539,7 @@ public abstract class PKCS11Test {
|
|||||||
osMap.put("Linux-amd64-64", new String[]{
|
osMap.put("Linux-amd64-64", new String[]{
|
||||||
"/usr/lib/x86_64-linux-gnu/", "/usr/lib/x86_64-linux-gnu/nss/",
|
"/usr/lib/x86_64-linux-gnu/", "/usr/lib/x86_64-linux-gnu/nss/",
|
||||||
"/usr/lib64/"});
|
"/usr/lib64/"});
|
||||||
|
osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"});
|
||||||
osMap.put("Windows-x86-32", new String[]{
|
osMap.put("Windows-x86-32", new String[]{
|
||||||
PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
|
PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
|
||||||
osMap.put("Windows-amd64-64", new String[]{
|
osMap.put("Windows-amd64-64", new String[]{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user