This commit is contained in:
Phil Race 2017-10-19 10:54:40 -07:00
commit 679360ec5a
302 changed files with 4178 additions and 4235 deletions

View File

@ -69,17 +69,12 @@ $(eval $(call SetupJavaCompilation, BUILD_NASGEN, \
NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
ifeq ($(BOOT_JDK_MODULAR), true)
NASGEN_OPTIONS := \
-cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
#
else
NASGEN_OPTIONS := \
-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes
endif
NASGEN_OPTIONS := \
-cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
#
# Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
$(NASGEN_RUN_FILE): $(BUILD_NASGEN) $(jdk.scripting.nashorn)

View File

@ -30,39 +30,63 @@ include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
include Modules.gmk
################################################################################
# Generate interim versions of the module-info.java files for the interim
# langtools modules. Each interim module has ".interim" added as suffix to the
# original module name.
INTERIM_MODULEINFO_PATTERN := \
$(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g')
$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
$(TOPDIR)/src/%/share/classes/module-info.java
$(call LogInfo, Generating module-info.java for $*.interim)
$(call MakeDir, $(@D))
$(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
$(INTERIM_LANGTOOLS_MODULES))
################################################################################
# Setup the rules to build interim langtools, which is compiled by the boot
# javac and can be run on the boot jdk. This will be used to compile
# the rest of the product. Each module is compiled separately to allow a modular
# boot jdk to override system classes using -Xoverride:.
# javac and can be run on the boot jdk. This will be used to compile the rest of
# the product. Each module is compiled separately because a multi module setup
# would require the source files to be copied into directories named after the
# actual interim modules.
# Param 1 - Name of module to compile
# Param 2 - Name of modules to depend on
define SetupInterimModule
$$(eval $$(call SetupJavaCompilation,BUILD_INTERIM_$(strip $1), \
$$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
SETUP := BOOT_JAVAC, \
DISABLE_SJAVAC := true, \
SRC := $(TOPDIR)/src/$(strip $1)/share/classes \
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)), \
EXCLUDES := sun com/sun/tools/jdeps com/sun/tools/javap \
com/sun/tools/jdeprscan, \
EXCLUDE_FILES := module-info.java JavacToolProvider.java \
JavadocToolProvider.java Standard.java, \
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
$(TOPDIR)/src/$1/share/classes, \
EXCLUDES := sun, \
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
Standard.java, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/$(strip $1), \
ADD_JAVAC_FLAGS := -Xbootclasspath/p:$$(call PathList, \
$$(foreach m, $2, $(BUILDTOOLS_OUTPUTDIR)/override_modules/$$m)), \
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_modules/$1.interim, \
ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_modules \
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
-Xlint:-module, \
))
$$(BUILD_INTERIM_$(strip $1)): $$(foreach m, $2, $$(BUILD_INTERIM_$(strip $$m)))
$1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
$$(INTERIM_LANGTOOLS_BASE_MODULES), $$(call FindTransitiveDepsForModule, $1)))
TARGETS += $$(BUILD_INTERIM_$(strip $1))
$$(BUILD_$1.interim): $$(foreach d, $$($1_DEPS_INTERIM), $$(BUILD_$$d))
TARGETS += $$(BUILD_$1.interim)
endef
$(eval $(call SetupInterimModule, java.compiler))
$(eval $(call SetupInterimModule, jdk.compiler, java.compiler))
$(eval $(call SetupInterimModule, jdk.jdeps, jdk.compiler java.compiler))
$(eval $(call SetupInterimModule, jdk.javadoc, java.compiler jdk.compiler))
$(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), \
$(eval $(call SetupInterimModule,$m)) \
)
################################################################################
all: $(TARGETS)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,25 @@ include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
##########################################################################################
################################################################################
# Generate interim versions of the module-info.java files for the interim
# langtools modules. Each interim module has ".interim" added as suffix to the
# original module name.
INTERIM_MODULEINFO_PATTERN := \
$(foreach m, $(INTERIM_RMIC_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g') \
-e '/ToolProvider[,; ]/d'
$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
$(TOPDIR)/src/%/share/classes/module-info.java
$(call LogInfo, Generating module-info.java for $*.interim)
$(call MakeDir, $(@D))
$(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
$(INTERIM_RMIC_MODULES))
################################################################################
RMIC_PKGS := \
sun/rmi/rmic \
@ -41,14 +59,23 @@ RMIC_PKGS := \
sun/tools/util \
#
$(eval $(call SetupJavaCompilation,BUILD_INTERIM_RMIC, \
$(eval $(call SetupJavaCompilation, BUILD_jdk.rmic.interim, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(TOPDIR)/src/jdk.rmic/share/classes, \
EXCLUDE_FILES := module-info.java, \
EXCLUDE_FILES := $(TOPDIR)/src/jdk.rmic/share/classes/module-info.java, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/jdk.rmic.interim/module-info.java, \
INCLUDES := $(RMIC_PKGS), \
BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.rmic, \
COPY := .properties))
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_modules/jdk.rmic.interim, \
COPY := .properties, \
ADD_JAVAC_FLAGS := \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_modules \
--add-modules java.corba \
--add-exports java.corba/com.sun.corba.se.impl.util=jdk.rmic.interim \
$(INTERIM_RMIC_ADD_EXPORTS), \
))
TARGETS += $(BUILD_jdk.rmic.interim)
##########################################################################################
all: $(BUILD_INTERIM_RMIC)
all: $(TARGETS)

View File

@ -42,13 +42,22 @@ BUILD_TOOLS_SRC_DIRS += \
$(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes \
#
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(BUILD_TOOLS_SRC_DIRS), \
EXCLUDES := build/tools/deps \
build/tools/docs \
build/tools/jigsaw, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes))
EXCLUDES := \
build/tools/deps \
build/tools/docs \
build/tools/jigsaw \
, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
ADD_JAVAC_FLAGS := \
--add-modules java.xml.bind \
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
--add-exports java.xml.bind/javax.xml.bind.annotation=ALL-UNNAMED \
--add-exports java.base/sun.text=ALL-UNNAMED \
, \
))
TARGETS += $(BUILD_TOOLS_JDK)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2017, 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
@ -47,7 +47,7 @@ JIMAGE_PKGS := \
#
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
SETUP := GENERATE_OLDBYTECODE, \
SETUP := GENERATE_8_BYTECODE, \
SRC := $(TOPDIR)/src/java.base/share/classes, \
EXCLUDE_FILES := module-info.java, \
INCLUDES := $(JIMAGE_PKGS), \

View File

@ -122,6 +122,8 @@ ifneq ($(CREATING_BUILDJDK), true)
$(foreach m, $(GENSRC_MODULES), $(eval $m-gensrc: $m-gensrc-src))
LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, $(LANGTOOLS_MODULES)), $(GENSRC_TARGETS))
INTERIM_LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, \
$(INTERIM_LANGTOOLS_BASE_MODULES)), $(GENSRC_TARGETS))
CORBA_GENSRC_TARGETS := $(filter $(addsuffix -%, $(CORBA_MODULES)), $(GENSRC_TARGETS))
HOTSPOT_GENSRC_TARGETS := $(filter $(addsuffix -%, $(HOTSPOT_MODULES)), $(GENSRC_TARGETS))
JDK_GENSRC_TARGETS := $(filter-out $(LANGTOOLS_GENSRC_TARGETS) \
@ -602,7 +604,7 @@ ifneq ($(findstring -only, $(MAKECMDGOALS)), )
else
$(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
interim-langtools: $(INTERIM_LANGTOOLS_GENSRC_TARGETS)
buildtools-jdk: interim-langtools interim-cldrconverter

View File

@ -40,12 +40,8 @@ BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
################################################################################
ifeq ($(BOOT_JDK_MODULAR), true)
COMPILEFONTCONFIG_ADD_EXPORTS := --add-exports java.desktop/sun.awt=ALL-UNNAMED
endif
TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
$(COMPILEFONTCONFIG_ADD_EXPORTS) \
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
build.tools.compilefontconfig.CompileFontConfig
TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
@ -95,13 +91,8 @@ TOOL_CHARSETMAPPING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classe
TOOL_SPP = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.spp.Spp
# Nimbus is used somewhere in the swing build.
ifeq ($(BOOT_JDK_MODULAR), true)
COMPILENIMBUS_ADD_MODS := --add-modules java.xml.bind
endif
TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
$(COMPILENIMBUS_ADD_MODS) \
--add-modules java.xml.bind \
build.tools.generatenimbus.Generator
TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \

View File

@ -77,10 +77,10 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`]
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`]
if test "x$FOUND_CORRECT_VERSION" = x; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Boot JDK must be version 8, 9 or 10)])
AC_MSG_NOTICE([(Your Boot JDK must be version 9 or 10)])
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -301,20 +301,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
# Finally, set some other options...
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
# When compiling code to be executed by the Boot JDK, force compatibility with the
# oldest supported bootjdk.
BOOT_JDK_SOURCETARGET="-source 9 -target 9"
AC_SUBST(BOOT_JDK_SOURCETARGET)
AC_MSG_CHECKING([if Boot JDK supports modules])
if "$JAVA" --list-modules > /dev/null 2>&1; then
AC_MSG_RESULT([yes])
BOOT_JDK_MODULAR="true"
else
AC_MSG_RESULT([no])
BOOT_JDK_MODULAR="false"
fi
AC_SUBST(BOOT_JDK_MODULAR)
AC_SUBST(JAVAC_FLAGS)
# Check if the boot jdk is 32 or 64 bit

View File

@ -25,8 +25,6 @@
# Support for building boot cycle builds
BOOT_JDK_MODULAR := true
# First include the real base spec.gmk file
include @SPEC@

View File

@ -1279,7 +1279,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -xarch=sparc"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok"
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K"
$2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_XLC"
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_XLC"
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.

View File

@ -878,7 +878,6 @@ CREATE_BUILDJDK
JLINK
JMOD
JAVAC_FLAGS
BOOT_JDK_MODULAR
BOOT_JDK_SOURCETARGET
JARSIGNER
JAR
@ -5115,7 +5114,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1508136203
DATE_WHEN_GENERATED=1508415370
###############################################################################
#
@ -25660,12 +25659,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -25862,12 +25861,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -26052,12 +26051,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -26241,12 +26240,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -26430,12 +26429,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -26610,12 +26609,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -26941,12 +26940,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -27272,12 +27271,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -27490,12 +27489,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -27673,12 +27672,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -27884,12 +27883,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -28067,12 +28066,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -28278,12 +28277,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -28461,12 +28460,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -28672,12 +28671,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -28855,12 +28854,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -29053,12 +29052,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -29234,12 +29233,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -29433,12 +29432,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -29614,12 +29613,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -29812,12 +29811,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -29993,12 +29992,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -30192,12 +30191,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -30373,12 +30372,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -30553,12 +30552,12 @@ $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`
FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8, 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8, 9 or 10)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 9 or 10)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 9 or 10)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -31448,21 +31447,9 @@ $as_echo "$tool_specified" >&6; }
# Finally, set some other options...
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Boot JDK supports modules" >&5
$as_echo_n "checking if Boot JDK supports modules... " >&6; }
if "$JAVA" --list-modules > /dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
BOOT_JDK_MODULAR="true"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
BOOT_JDK_MODULAR="false"
fi
# When compiling code to be executed by the Boot JDK, force compatibility with the
# oldest supported bootjdk.
BOOT_JDK_SOURCETARGET="-source 9 -target 9"
@ -52028,7 +52015,7 @@ fi
JVM_LDFLAGS="$JVM_LDFLAGS -xarch=sparc"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok"
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K"
LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC"
JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_XLC"
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
@ -52909,7 +52896,7 @@ fi
OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -xarch=sparc"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok"
LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K"
OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} $LDFLAGS_XLC"
OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_XLC"
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.

View File

@ -561,38 +561,35 @@ JAVAC_FLAGS?=@JAVAC_FLAGS@
BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
# Use ?= as this can be overridden from bootcycle-spec.gmk
BOOT_JDK_MODULAR ?= @BOOT_JDK_MODULAR@
# Interim langtools and rmic modules and arguments
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.jdeps jdk.javadoc
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
INTERIM_LANGTOOLS_ADD_EXPORTS := \
--add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \
--add-exports java.base/jdk.internal.util.jar=jdk.jdeps.interim \
--add-exports java.base/jdk.internal.misc=jdk.jdeps.interim \
#
INTERIM_LANGTOOLS_MODULES_COMMA := $(strip $(subst $(SPACE),$(COMMA),$(strip \
$(INTERIM_LANGTOOLS_MODULES))))
INTERIM_LANGTOOLS_ARGS := \
--limit-modules java.base,jdk.zipfs,$(INTERIM_LANGTOOLS_MODULES_COMMA) \
--add-modules $(INTERIM_LANGTOOLS_MODULES_COMMA) \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_modules \
$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
#
JAVAC_MAIN_CLASS = -m jdk.compiler.interim/com.sun.tools.javac.Main
JAVADOC_MAIN_CLASS = -m jdk.javadoc.interim/jdk.javadoc.internal.tool.Main
INTERIM_RMIC_BASE_MODULES := jdk.rmic
INTERIM_RMIC_MODULES := $(addsuffix .interim, $(INTERIM_RMIC_BASE_MODULES))
INTERIM_RMIC_ADD_EXPORTS := \
--add-exports java.corba/com.sun.corba.se.impl.util=jdk.rmic.interim \
#
INTERIM_RMIC_ARGS := --limit-modules java.base,jdk.compiler,jdk.javadoc,java.corba \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_modules \
$(INTERIM_RMIC_ADD_EXPORTS) \
#
INTERIM_LANGTOOLS_OVERRIDE_MODULES := java.compiler jdk.compiler \
jdk.jdeps jdk.javadoc
INTERIM_RMIC_OVERRIDE_MODULES := jdk.rmic
ifeq ($(BOOT_JDK_MODULAR), true)
INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = $(foreach m, \
$(INTERIM_LANGTOOLS_OVERRIDE_MODULES), \
--patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m)
INTERIM_RMIC_OVERRIDE_MODULES_ARGS = $(foreach m, \
$(INTERIM_LANGTOOLS_OVERRIDE_MODULES) \
$(INTERIM_RMIC_OVERRIDE_MODULES), \
--patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m)
INTERIM_LANGTOOLS_ARGS = $(INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS)
JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main
JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main
else
INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = \
-Xbootclasspath/p:$(call PathList, \
$(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \
$(INTERIM_LANGTOOLS_OVERRIDE_MODULES)))
INTERIM_RMIC_OVERRIDE_MODULES_ARGS = \
-Xbootclasspath/p:$(call PathList, \
$(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \
$(INTERIM_LANGTOOLS_OVERRIDE_MODULES) \
$(INTERIM_RMIC_OVERRIDE_MODULES)))
INTERIM_LANGTOOLS_ARGS = $(INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS) \
-cp $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.compiler
JAVAC_MAIN_CLASS = com.sun.tools.javac.Main
JAVADOC_MAIN_CLASS = jdk.javadoc.internal.tool.Main
endif
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
# Use = assignment to be able to override in bootcycle-spec.gmk
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)

View File

@ -166,6 +166,8 @@ endef
# INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file!
# EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file!
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
# EXTRA_FILES:=List of extra source files to include in compilation. Can be used to
# specify files that need to be generated by other rules first.
# HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependecy
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
@ -203,16 +205,23 @@ define SetupJavaCompilationBody
$1_MODULE_SUBDIR := /$$($1_MODULE)
endif
# Make sure the dirs exist.
$$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<)))
# Make sure the dirs exist, or that one of the EXTRA_FILES, that may not
# exist yet, is in it.
$$(foreach d, $$($1_SRC), \
$$(if $$(wildcard $$d), , \
$$(if $$(filter $$d%, $$($1_EXTRA_FILES)), , \
$$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<) \
) \
) \
)
$$(call MakeDir,$$($1_BIN))
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(eval $$(call FillCacheFind,$$($1_SRC)))
$$(eval $$(call FillCacheFind, $$($1_SRC)))
# Find all files in the source trees. Preserve order of source roots so that
# the first version in case of multiple instances of the same file is selected.
# CacheFind does not preserve order so need to call it for each root.
$1_ALL_SRCS += $$(foreach s, $$($1_SRC), $$(call CacheFind, $$(s)))
$1_ALL_SRCS += $$($1_EXTRA_FILES) $$(foreach s, $$($1_SRC), $$(call CacheFind, $$s))
# Extract the java files.
$1_SRCS := $$(filter %.java, $$($1_ALL_SRCS))
@ -235,7 +244,7 @@ define SetupJavaCompilationBody
$1_SRCS := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_SRCS))
endif
ifneq ($$($1_INCLUDE_PATTERN), )
$1_SRCS := $$(filter $$($1_INCLUDE_PATTERN), $$($1_SRCS))
$1_SRCS := $$(filter $$($1_INCLUDE_PATTERN) $$($1_EXTRA_FILES), $$($1_SRCS))
endif
ifneq ($$($1_KEEP_DUPS), true)

View File

@ -689,8 +689,9 @@ ifneq ($(DISABLE_CACHE_FIND), true)
ifneq ($$(FIND_CACHE_NEW_DIRS), )
# Remove any trailing slash from dirs in the cache dir list
FIND_CACHE_DIRS += $$(patsubst %/,%, $$(FIND_CACHE_NEW_DIRS))
FIND_CACHE := $$(sort $$(FIND_CACHE) $$(shell $(FIND) $$(FIND_CACHE_NEW_DIRS) \
\( -type f -o -type l \) $2 | $(TR) ' ' '?'))
FIND_CACHE := $$(sort $$(FIND_CACHE) \
$$(shell $(FIND) $$(wildcard $$(FIND_CACHE_NEW_DIRS)) \
\( -type f -o -type l \) $2 | $(TR) ' ' '?'))
endif
endef
@ -706,7 +707,7 @@ ifneq ($(DISABLE_CACHE_FIND), true)
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
define CacheFind
$(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
$(if $(wildcard $1), $(shell $(FIND) $1 \( -type f -o -type l \) $2 \
$(if $(wildcard $1), $(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 \
| $(TR) ' ' '?')), \
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
endef
@ -716,7 +717,9 @@ else
# Param 1 - Dirs to find in
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
define CacheFind
$(shell $(FIND) $1 \( -type f -o -type l \) $2 | $(TR) ' ' '?')
$(if $(wildcard $1, \
$(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 | $(TR) ' ' '?') \
)
endef
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -95,4 +95,15 @@ $(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
# Use boot javac to generate JDK 8 compatible class files explicitly
$(eval $(call SetupJavaCompiler,GENERATE_8_BYTECODE, \
JAVAC := $(JAVAC), \
FLAGS := \
$(JAVA_TOOL_FLAGS_SMALL) \
--release 8 \
-XDignore.symbol.file=true -g \
-Xlint:all -Werror, \
DISABLE_SJAVAC := true, \
))
endif # _SETUP_GMK

View File

@ -381,24 +381,10 @@ var getJibProfilesCommon = function (input, data) {
};
};
var boot_jdk_revision = "8";
var boot_jdk_subdirpart = "1.8.0";
// JDK 8 does not work on sparc M7 cpus, need a newer update when building
// on such hardware.
if (input.build_cpu == "sparcv9") {
var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
if (cpu_brand.trim().match('SPARC-.[78]')) {
boot_jdk_revision = "8u20";
boot_jdk_subdirpart = "1.8.0_20";
}
}
common.boot_jdk_revision = boot_jdk_revision;
common.boot_jdk_subdirpart = boot_jdk_subdirpart;
common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk"
+ common.boot_jdk_subdirpart
common.boot_jdk_version = "9";
common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk-"
+ common.boot_jdk_version
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
common.boot_jdk_platform = input.build_os + "-"
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
return common;
};
@ -1027,15 +1013,18 @@ var getJibProfilesDependencies = function (input, common) {
? input.target_os + "_x64"
: input.target_platform);
var boot_jdk_platform = (input.build_os == "macosx" ? "osx" : input.build_os)
+ "-" + input.build_cpu;
var dependencies = {
boot_jdk: {
server: "javare",
module: "jdk",
revision: common.boot_jdk_revision,
checksum_file: common.boot_jdk_platform + "/MD5_VALUES",
file: common.boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
+ "-" + common.boot_jdk_platform + ".tar.gz",
server: "jpg",
product: "jdk",
version: common.boot_jdk_version,
build_number: "181",
file: "bundles/" + boot_jdk_platform + "/jdk-" + common.boot_jdk_version + "_"
+ boot_jdk_platform + "_bin.tar.gz",
configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
environment_path: common.boot_jdk_home + "/bin"
},

View File

@ -41,23 +41,23 @@ CT_MODULESOURCEPATH := $(call GetModuleSrcPath)
CT_DATA_DESCRIPTION ?= $(TOPDIR)/make/data/symbols/symbols
COMPILECREATESYMBOLS_ADD_EXPORTS := \
--add-exports jdk.compiler.interim/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler.interim/com.sun.tools.javac.code=ALL-UNNAMED \
--add-exports jdk.compiler.interim/com.sun.tools.javac.util=ALL-UNNAMED \
--add-exports jdk.compiler.interim/com.sun.tools.javac.jvm=ALL-UNNAMED \
--add-exports jdk.jdeps.interim/com.sun.tools.classfile=ALL-UNNAMED \
#
$(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(TOPDIR)/make/langtools/src/classes, \
INCLUDES := build/tools/symbolgenerator, \
ADD_JAVAC_FLAGS := -Xbootclasspath/p:"$(INTERIM_LANGTOOLS_JAR)", \
BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols, \
ADD_JAVAC_FLAGS := $(INTERIM_LANGTOOLS_ARGS) \
$(COMPILECREATESYMBOLS_ADD_EXPORTS), \
))
ifeq ($(BOOT_JDK_MODULAR), true)
COMPILECREATESYMBOLS_ADD_EXPORTS := \
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
endif
$(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \
$(COMPILE_CREATE_SYMBOLS) \
$(wildcard $(TOPDIR)/make/data/symbols/*) \

View File

@ -60,19 +60,13 @@ $(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_LD, \
$(TEXT_PKG_LD)/BreakIteratorInfo_th.java, \
BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata))
ifeq ($(BOOT_JDK_MODULAR), true)
BREAK_ITERATOR_BOOTCLASSPATH := \
--patch-module java.base=$(BREAK_ITERATOR_CLASSES)/java.base \
--patch-module jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \
--add-exports java.base/sun.text=ALL-UNNAMED \
--add-exports java.base/sun.text.resources=ALL-UNNAMED \
--add-exports jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \
#
else
BREAK_ITERATOR_BOOTCLASSPATH := -Xbootclasspath/p:$(call PathList, \
$(BREAK_ITERATOR_CLASSES)/java.base \
$(BREAK_ITERATOR_CLASSES)/jdk.localedata)
endif
BREAK_ITERATOR_BOOTCLASSPATH := \
--patch-module java.base=$(BREAK_ITERATOR_CLASSES)/java.base \
--patch-module jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \
--add-exports java.base/sun.text=ALL-UNNAMED \
--add-exports java.base/sun.text.resources=ALL-UNNAMED \
--add-exports jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \
#
# Generate data resource files.
# input

View File

@ -39,6 +39,7 @@ import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
import com.sun.tools.javac.api.JavacTaskImpl;
import com.sun.tools.javac.api.JavacTool;
import com.sun.tools.javac.code.Symbol.ModuleSymbol;
/**
@ -56,7 +57,7 @@ public class TransitiveDependencies {
return ;
}
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
JavaCompiler compiler = JavacTool.create();
List<String> options = Arrays.asList("-source", "10",
"-target", "10",
"-proc:only",

View File

@ -31,13 +31,9 @@ include RMICompilation.gmk
################################################################################
ifeq ($(BOOT_JDK_MODULAR), true)
RMIC_MAIN_CLASS := -m jdk.rmic/sun.rmi.rmic.Main
else
RMIC_MAIN_CLASS := sun.rmi.rmic.Main
endif
RMIC_MAIN_CLASS := -m jdk.rmic.interim/sun.rmi.rmic.Main
RMIC := $(JAVA_SMALL) $(INTERIM_RMIC_OVERRIDE_MODULES_ARGS) $(RMIC_MAIN_CLASS)
RMIC := $(JAVA_SMALL) $(INTERIM_RMIC_ARGS) $(RMIC_MAIN_CLASS)
CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
# NOTE: If the smart javac dependency management is reintroduced, these classes

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,10 +27,18 @@ package sun.net.www.http;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.net.URL;
import java.util.List;
import jdk.internal.misc.InnocuousThread;
import sun.security.action.GetIntegerAction;
/**
* A class that implements a cache of idle Http connections for keep-alive
@ -53,14 +61,14 @@ public class KeepAliveCache
static int result = -1;
static int getMaxConnections() {
if (result == -1) {
result = java.security.AccessController.doPrivileged(
new sun.security.action.GetIntegerAction("http.maxConnections",
MAX_CONNECTIONS))
result = AccessController.doPrivileged(
new GetIntegerAction("http.maxConnections", MAX_CONNECTIONS))
.intValue();
if (result <= 0)
if (result <= 0) {
result = MAX_CONNECTIONS;
}
}
return result;
return result;
}
static final int LIFETIME = 5000;
@ -93,8 +101,7 @@ public class KeepAliveCache
* The robustness to get around this is in HttpClient.parseHTTP()
*/
final KeepAliveCache cache = this;
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<>() {
AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
keepAliveTimer = InnocuousThread.newSystemThread("Keep-Alive-Timer", cache);
keepAliveTimer.setDaemon(true);
@ -110,8 +117,8 @@ public class KeepAliveCache
if (v == null) {
int keepAliveTimeout = http.getKeepAliveTimeout();
v = new ClientVector(keepAliveTimeout > 0?
keepAliveTimeout*1000 : LIFETIME);
v = new ClientVector(keepAliveTimeout > 0 ?
keepAliveTimeout * 1000 : LIFETIME);
v.put(http);
super.put(key, v);
} else {
@ -120,12 +127,12 @@ public class KeepAliveCache
}
/* remove an obsolete HttpClient from its VectorCache */
public synchronized void remove (HttpClient h, Object obj) {
public synchronized void remove(HttpClient h, Object obj) {
KeepAliveKey key = new KeepAliveKey(h.url, obj);
ClientVector v = super.get(key);
if (v != null) {
v.remove(h);
if (v.empty()) {
if (v.isEmpty()) {
removeVector(key);
}
}
@ -142,7 +149,6 @@ public class KeepAliveCache
* Check to see if this URL has a cached HttpClient
*/
public synchronized HttpClient get(URL url, Object obj) {
KeepAliveKey key = new KeepAliveKey(url, obj);
ClientVector v = super.get(key);
if (v == null) { // nothing in cache yet
@ -161,39 +167,27 @@ public class KeepAliveCache
try {
Thread.sleep(LIFETIME);
} catch (InterruptedException e) {}
// Remove all outdated HttpClients.
synchronized (this) {
/* Remove all unused HttpClients. Starting from the
* bottom of the stack (the least-recently used first).
* REMIND: It'd be nice to not remove *all* connections
* that aren't presently in use. One could have been added
* a second ago that's still perfectly valid, and we're
* needlessly axing it. But it's not clear how to do this
* cleanly, and doing it right may be more trouble than it's
* worth.
*/
long currentTime = System.currentTimeMillis();
ArrayList<KeepAliveKey> keysToRemove
= new ArrayList<>();
List<KeepAliveKey> keysToRemove = new ArrayList<>();
for (KeepAliveKey key : keySet()) {
ClientVector v = get(key);
synchronized (v) {
int i;
for (i = 0; i < v.size(); i++) {
KeepAliveEntry e = v.elementAt(i);
KeepAliveEntry e = v.peek();
while (e != null) {
if ((currentTime - e.idleStartTime) > v.nap) {
HttpClient h = e.hc;
h.closeServer();
v.poll();
e.hc.closeServer();
} else {
break;
}
e = v.peek();
}
v.subList(0, i).clear();
if (v.size() == 0) {
if (v.isEmpty()) {
keysToRemove.add(key);
}
}
@ -203,21 +197,19 @@ public class KeepAliveCache
removeVector(key);
}
}
} while (size() > 0);
return;
} while (!isEmpty());
}
/*
* Do not serialize this class!
*/
private void writeObject(java.io.ObjectOutputStream stream)
throws IOException {
private void writeObject(ObjectOutputStream stream) throws IOException {
throw new NotSerializableException();
}
private void readObject(java.io.ObjectInputStream stream)
throws IOException, ClassNotFoundException {
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException
{
throw new NotSerializableException();
}
}
@ -225,37 +217,33 @@ public class KeepAliveCache
/* FILO order for recycling HttpClients, should run in a thread
* to time them out. If > maxConns are in use, block.
*/
class ClientVector extends java.util.Stack<KeepAliveEntry> {
class ClientVector extends ArrayDeque<KeepAliveEntry> {
private static final long serialVersionUID = -8680532108106489459L;
// sleep time in milliseconds, before cache clear
int nap;
ClientVector (int nap) {
ClientVector(int nap) {
this.nap = nap;
}
synchronized HttpClient get() {
if (empty()) {
if (isEmpty()) {
return null;
} else {
// Loop until we find a connection that has not timed out
HttpClient hc = null;
long currentTime = System.currentTimeMillis();
do {
KeepAliveEntry e = pop();
if ((currentTime - e.idleStartTime) > nap) {
e.hc.closeServer();
} else {
hc = e.hc;
}
} while ((hc== null) && (!empty()));
return hc;
}
// Loop until we find a connection that has not timed out
HttpClient hc = null;
long currentTime = System.currentTimeMillis();
do {
KeepAliveEntry e = pop();
if ((currentTime - e.idleStartTime) > nap) {
e.hc.closeServer();
} else {
hc = e.hc;
}
} while ((hc == null) && (!isEmpty()));
return hc;
}
/* return a still valid, unused HttpClient */
@ -267,21 +255,30 @@ class ClientVector extends java.util.Stack<KeepAliveEntry> {
}
}
/* remove an HttpClient */
synchronized boolean remove(HttpClient h) {
for (KeepAliveEntry curr : this) {
if (curr.hc == h) {
return super.remove(curr);
}
}
return false;
}
/*
* Do not serialize this class!
*/
private void writeObject(java.io.ObjectOutputStream stream)
throws IOException {
private void writeObject(ObjectOutputStream stream) throws IOException {
throw new NotSerializableException();
}
private void readObject(java.io.ObjectInputStream stream)
throws IOException, ClassNotFoundException {
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException
{
throw new NotSerializableException();
}
}
class KeepAliveKey {
private String protocol = null;
private String host = null;

View File

@ -27,12 +27,14 @@ import javax.xml.transform.TransformerException;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.security.utils.I18n;
import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
import com.sun.org.apache.xml.internal.utils.QName;
import com.sun.org.apache.xpath.internal.NodeSetDTM;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.functions.Function;
import com.sun.org.apache.xpath.internal.objects.XNodeSet;
import com.sun.org.apache.xpath.internal.objects.XObject;
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
import java.util.List;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@ -145,8 +147,7 @@ public class FuncHere extends Function {
* @param vars
* @param globalsSize
*/
@SuppressWarnings("rawtypes")
public void fixupVariables(java.util.Vector vars, int globalsSize) {
public void fixupVariables(List<QName> vars, int globalsSize) {
// do nothing
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2017, 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
@ -272,7 +272,7 @@ public abstract class lr_parser {
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
/** The parse stack itself. */
protected Stack stack = new Stack();
protected Stack<Symbol> stack = new Stack<>();
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
@ -322,7 +322,7 @@ public abstract class lr_parser {
public abstract Symbol do_action(
int act_num,
lr_parser parser,
Stack stack,
Stack<Symbol> stack,
int top)
throws java.lang.Exception;
@ -571,7 +571,7 @@ public abstract class lr_parser {
/* current state is always on the top of the stack */
/* look up action out of the current state with the current input */
act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
act = get_action((stack.peek()).parse_state, cur_token.sym);
/* decode the action -- > 0 encodes shift */
if (act > 0)
@ -603,7 +603,7 @@ public abstract class lr_parser {
}
/* look up the state to go to from the one popped back to */
act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
act = get_reduce((stack.peek()).parse_state, lhs_sym_num);
/* shift to that state */
lhs_sym.parse_state = act;
@ -626,7 +626,7 @@ public abstract class lr_parser {
/* just in case that wasn't fatal enough, end parse */
done_parsing();
} else {
lhs_sym = (Symbol)stack.peek();
lhs_sym = stack.peek();
}
}
}
@ -661,8 +661,8 @@ public abstract class lr_parser {
/* dump the stack */
for (int i=0; i<stack.size(); i++)
{
debug_message("Symbol: " + ((Symbol)stack.elementAt(i)).sym +
" State: " + ((Symbol)stack.elementAt(i)).parse_state);
debug_message("Symbol: " + (stack.get(i)).sym +
" State: " + (stack.get(i)).parse_state);
}
debug_message("==========================================");
}
@ -698,13 +698,13 @@ public abstract class lr_parser {
/** Do debug output for stack state. [CSA]
*/
public void debug_stack() {
StringBuffer sb=new StringBuffer("## STACK:");
StringBuilder sb=new StringBuilder("## STACK:");
for (int i=0; i<stack.size(); i++) {
Symbol s = (Symbol) stack.elementAt(i);
Symbol s = stack.get(i);
sb.append(" <state "+s.parse_state+", sym "+s.sym+">");
if ((i%3)==2 || (i==(stack.size()-1))) {
debug_message(sb.toString());
sb = new StringBuffer(" ");
sb = new StringBuilder(" ");
}
}
}
@ -762,7 +762,7 @@ public abstract class lr_parser {
//debug_stack();
/* look up action out of the current state with the current input */
act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
act = get_action((stack.peek()).parse_state, cur_token.sym);
/* decode the action -- > 0 encodes shift */
if (act > 0)
@ -798,9 +798,9 @@ public abstract class lr_parser {
}
/* look up the state to go to from the one popped back to */
act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
act = get_reduce((stack.peek()).parse_state, lhs_sym_num);
debug_message("# Reduce rule: top state " +
((Symbol)stack.peek()).parse_state +
(stack.peek()).parse_state +
", lhs sym " + lhs_sym_num + " -> state " + act);
/* shift to that state */
@ -826,7 +826,7 @@ public abstract class lr_parser {
/* just in case that wasn't fatal enough, end parse */
done_parsing();
} else {
lhs_sym = (Symbol)stack.peek();
lhs_sym = stack.peek();
}
}
}
@ -916,7 +916,7 @@ public abstract class lr_parser {
protected boolean shift_under_error()
{
/* is there a shift under error Symbol */
return get_action(((Symbol)stack.peek()).parse_state, error_sym()) > 0;
return get_action((stack.peek()).parse_state, error_sym()) > 0;
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
@ -936,8 +936,8 @@ public abstract class lr_parser {
if (debug) debug_message("# Finding recovery state on stack");
/* Remember the right-position of the top symbol on the stack */
int right_pos = ((Symbol)stack.peek()).right;
int left_pos = ((Symbol)stack.peek()).left;
int right_pos = (stack.peek()).right;
int left_pos = (stack.peek()).left;
/* pop down until we can shift under error Symbol */
while (!shift_under_error())
@ -945,7 +945,7 @@ public abstract class lr_parser {
/* pop the stack */
if (debug)
debug_message("# Pop stack by one, state was # " +
((Symbol)stack.peek()).parse_state);
(stack.peek()).parse_state);
left_pos = ((Symbol)stack.pop()).left;
tos--;
@ -958,11 +958,11 @@ public abstract class lr_parser {
}
/* state on top of the stack can shift under error, find the shift */
act = get_action(((Symbol)stack.peek()).parse_state, error_sym());
act = get_action((stack.peek()).parse_state, error_sym());
if (debug)
{
debug_message("# Recover state found (#" +
((Symbol)stack.peek()).parse_state + ")");
(stack.peek()).parse_state + ")");
debug_message("# Shifting on error to state #" + (act-1));
}
@ -1145,7 +1145,7 @@ public abstract class lr_parser {
debug_message("# Reparsing saved input with actions");
debug_message("# Current Symbol is #" + cur_err_token().sym);
debug_message("# Current state is #" +
((Symbol)stack.peek()).parse_state);
(stack.peek()).parse_state);
}
/* continue until we accept or have read all lookahead input */
@ -1155,7 +1155,7 @@ public abstract class lr_parser {
/* look up action out of the current state with the current input */
act =
get_action(((Symbol)stack.peek()).parse_state, cur_err_token().sym);
get_action((stack.peek()).parse_state, cur_err_token().sym);
/* decode the action -- > 0 encodes shift */
if (act > 0)
@ -1205,7 +1205,7 @@ public abstract class lr_parser {
}
/* look up the state to go to from the one popped back to */
act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
act = get_reduce((stack.peek()).parse_state, lhs_sym_num);
/* shift to that state */
lhs_sym.parse_state = act;
@ -1234,7 +1234,7 @@ public abstract class lr_parser {
protected static short[][] unpackFromStrings(String[] sa)
{
// Concatanate initialization strings.
StringBuffer sb = new StringBuffer(sa[0]);
StringBuilder sb = new StringBuilder(sa[0]);
for (int i=1; i<sa.length; i++)
sb.append(sa[i]);
int n=0; // location in initialization string

View File

@ -49,7 +49,7 @@ public class virtual_parse_stack {
/*-----------------------------------------------------------*/
/** Constructor to build a virtual stack out of a real stack. */
public virtual_parse_stack(Stack shadowing_stack) throws java.lang.Exception
public virtual_parse_stack(Stack<Symbol> shadowing_stack) throws java.lang.Exception
{
/* sanity check */
if (shadowing_stack == null)
@ -58,7 +58,7 @@ public class virtual_parse_stack {
/* set up our internals */
real_stack = shadowing_stack;
vstack = new Stack();
vstack = new Stack<>();
real_next = 0;
/* get one element onto the virtual portion of the stack */
@ -73,7 +73,7 @@ public class virtual_parse_stack {
* the bottom of the virtual portion of the stack, but is always left
* unmodified.
*/
protected Stack real_stack;
protected Stack<Symbol> real_stack;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
@ -91,7 +91,7 @@ public class virtual_parse_stack {
* on the virtual stack). When this portion of the stack becomes empty we
* transfer elements from the underlying stack onto this stack.
*/
protected Stack vstack;
protected Stack<Integer> vstack;
/*-----------------------------------------------------------*/
/*--- General Methods ---------------------------------------*/
@ -108,7 +108,7 @@ public class virtual_parse_stack {
if (real_next >= real_stack.size()) return;
/* get a copy of the first Symbol we have not transfered */
stack_sym = (Symbol)real_stack.elementAt(real_stack.size()-1-real_next);
stack_sym = real_stack.get(real_stack.size()-1-real_next);
/* record the transfer */
real_next++;
@ -136,7 +136,7 @@ public class virtual_parse_stack {
throw new Exception(
"Internal parser error: top() called on empty virtual stack");
return ((Integer)vstack.peek()).intValue();
return (vstack.peek());
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -73,8 +73,8 @@ public final class ExceptionConst {
private static final Class<?>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {
NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR
}; // Chapter 5.2
private static final Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
private static final Class<?>[] EXCS_STRING_RESOLUTION = new Class[0];
private static final Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class<?>[0]; // Chapter 5.3 (as below)
private static final Class<?>[] EXCS_STRING_RESOLUTION = new Class<?>[0];
// Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
private static final Class<?>[] EXCS_ARRAY_EXCEPTION = {
NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -43,7 +43,7 @@ public class ARRAYLENGTH extends Instruction
*/
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.NULL_POINTER_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -43,7 +43,7 @@ public class ATHROW extends Instruction implements UnconditionalBranch, Exceptio
*/
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.THROWABLE
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -42,7 +42,7 @@ public class IDIV extends ArithmeticInstruction implements ExceptionThrower {
*/
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.ARITHMETIC_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -42,7 +42,7 @@ public class IREM extends ArithmeticInstruction implements ExceptionThrower {
*/
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.ARITHMETIC_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -39,7 +39,7 @@ public class LDIV extends ArithmeticInstruction implements ExceptionThrower {
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.ARITHMETIC_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -38,7 +38,7 @@ public class LREM extends ArithmeticInstruction implements ExceptionThrower {
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.ARITHMETIC_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -38,7 +38,7 @@ public class MONITORENTER extends Instruction implements ExceptionThrower, Stack
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.NULL_POINTER_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -38,7 +38,7 @@ public class MONITOREXIT extends Instruction implements ExceptionThrower, StackC
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.NULL_POINTER_EXCEPTION
};
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1165,7 +1166,7 @@ public class MethodGen extends FieldGenOrMethodGen {
if (attribute instanceof ParameterAnnotations) {
// Initialize param_annotations
if (!hasParameterAnnotations) {
@SuppressWarnings("unchecked") // OK
@SuppressWarnings({"rawtypes", "unchecked"})
final List<AnnotationEntryGen>[] parmList = new List[arg_types.length];
param_annotations = parmList;
for (int j = 0; j < arg_types.length; j++) {
@ -1213,7 +1214,7 @@ public class MethodGen extends FieldGenOrMethodGen {
final AnnotationEntryGen annotation) {
ensureExistingParameterAnnotationsUnpacked();
if (!hasParameterAnnotations) {
@SuppressWarnings("unchecked") // OK
@SuppressWarnings({"rawtypes", "unchecked"})
final List<AnnotationEntryGen>[] parmList = new List[arg_types.length];
param_annotations = parmList;
hasParameterAnnotations = true;

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,11 +21,10 @@
package com.sun.org.apache.bcel.internal.generic;
import java.io.DataOutputStream;
import java.io.IOException;
import com.sun.org.apache.bcel.internal.ExceptionConst;
import com.sun.org.apache.bcel.internal.util.ByteSequence;
import java.io.DataOutputStream;
import java.io.IOException;
/**
* NEWARRAY - Create new array of basic type (int, short, ...)
@ -107,7 +106,7 @@ public class NEWARRAY extends Instruction implements AllocationInstruction, Exce
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.NEGATIVE_ARRAY_SIZE_EXCEPTION
};
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -71,7 +71,7 @@ public abstract class ReturnInstruction extends Instruction implements Exception
@Override
public Class<?>[] getExceptions() {
return new Class[] {
return new Class<?>[] {
ExceptionConst.ILLEGAL_MONITOR_STATE
};
}

View File

@ -1,9 +1,30 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.bcel.internal.util;
import com.sun.org.apache.bcel.internal.Const;
import com.sun.org.apache.bcel.internal.generic.ClassGenException;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@ -13,11 +34,6 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.sun.org.apache.bcel.internal.Const;
import com.sun.org.apache.bcel.internal.generic.ClassGenException;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
/**
* InstructionFinder is a tool to search for given instructions patterns, i.e.,
* match sequences of instructions in an instruction list via regular

View File

@ -62,7 +62,7 @@ public abstract class FeaturePropertyBase {
* @param state the state of the property
* @param value the value of the property
*/
public void setValue(Enum property, State state, String value) {
public void setValue(Enum<?> property, State state, String value) {
//only update if it shall override
if (state.compareTo(states[property.ordinal()]) >= 0) {
values[property.ordinal()] = value;
@ -128,7 +128,7 @@ public abstract class FeaturePropertyBase {
* @param property the property
* @return the value of the property
*/
public String getValue(Enum property) {
public String getValue(Enum<?> property) {
return values[property.ordinal()];
}
@ -195,7 +195,7 @@ public abstract class FeaturePropertyBase {
* @param property the property
* @param systemProperty the name of the system property
*/
void getSystemProperty(Enum property, String systemProperty) {
void getSystemProperty(Enum<?> property, String systemProperty) {
try {
String value = SecuritySupport.getSystemProperty(systemProperty);
if (value != null) {

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Sep 2017
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -124,7 +124,7 @@ public class ObjectFactory {
{
ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
try{
Class providerClass = findProviderClass(className, cl, doFallback);
Class<?> providerClass = findProviderClass(className, cl, doFallback);
Object instance = providerClass.getConstructor().newInstance();
debugPrintln(()->"created new instance of " + providerClass +
" using ClassLoader: " + cl);

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -43,8 +43,8 @@ public interface Translet {
public void buildKeys(DOM document, DTMAxisIterator iterator,
SerializationHandler handler, int root)
throws TransletException;
public void addAuxiliaryClass(Class auxClass);
public Class getAuxiliaryClass(String className);
public void addAuxiliaryClass(Class<?> auxClass);
public Class<?> getAuxiliaryClass(String className);
public String[] getNamesArray();
public String[] getUrisArray();
public int[] getTypesArray();

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -20,9 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Enumeration;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@ -38,7 +36,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -119,10 +118,10 @@ final class ApplyTemplates extends Instruction {
final int current = methodGen.getLocalIndex("current");
// check if sorting nodes is required
final Vector<Sort> sortObjects = new Vector<>();
final List<Sort> sortObjects = new ArrayList<>();
for (final SyntaxTreeNode child : getContents()) {
if (child instanceof Sort) {
sortObjects.addElement((Sort)child);
sortObjects.add((Sort)child);
}
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -34,10 +35,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
/**

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,11 +24,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Enumeration;
import java.util.Vector;
import java.util.StringTokenizer;
import java.util.NoSuchElementException;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@ -41,6 +37,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
/**
* @author Jacek Ambroziak
@ -86,7 +84,7 @@ final class AttributeValueTemplate extends AttributeValue {
*/
String t = null;
String lookahead = null;
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
int state = OUT_EXPR;
while (tokenizer.hasMoreTokens()) {
@ -220,7 +218,7 @@ final class AttributeValueTemplate extends AttributeValue {
}
public String toString() {
final StringBuffer buffer = new StringBuffer("AVT:[");
final StringBuilder buffer = new StringBuilder("AVT:[");
final int count = elementCount();
for (int i = 0; i < count; i++) {
buffer.append(elementAt(i).toString());
@ -252,7 +250,7 @@ final class AttributeValueTemplate extends AttributeValue {
il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
il.append(DUP);
il.append(new INVOKESPECIAL(initBuffer));
// StringBuffer is on the stack
// StringBuilder is on the stack
final Iterator<SyntaxTreeNode> elements = elements();
while (elements.hasNext()) {
final Expression exp = (Expression)elements.next();

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -83,11 +83,11 @@ final class BinOpExpr extends Expression {
new MethodType(Type.Void,
tleft, tright));
if (ptype != null) {
final Type arg1 = (Type) ptype.argsType().elementAt(0);
final Type arg1 = (Type) ptype.argsType().get(0);
if (!arg1.identicalTo(tleft)) {
_left = new CastExpr(_left, arg1);
}
final Type arg2 = (Type) ptype.argsType().elementAt(1);
final Type arg2 = (Type) ptype.argsType().get(1);
if (!arg2.identicalTo(tright)) {
_right = new CastExpr(_right, arg1);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,12 +21,11 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -36,7 +35,7 @@ final class BooleanCall extends FunctionCall {
private Expression _arg = null;
public BooleanCall(QName fname, Vector arguments) {
public BooleanCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
_arg = argument(0);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -30,8 +31,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
import java.util.Vector;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -205,11 +205,11 @@ final class CallTemplate extends Instruction {
private void buildParameterList() {
// Put the parameters from the called template into the array first.
// This is to ensure the order of the parameters.
Vector<Param> defaultParams = _calleeTemplate.getParameters();
List<Param> defaultParams = _calleeTemplate.getParameters();
int numParams = defaultParams.size();
_parameters = new SyntaxTreeNode[numParams];
for (int i = 0; i < numParams; i++) {
_parameters[i] = defaultParams.elementAt(i);
_parameters[i] = defaultParams.get(i);
}
// Replace a Param with a WithParam if they have the same name.

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,17 +21,16 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Santiago Pericas-Geertsen
@ -52,7 +51,7 @@ final class CastCall extends FunctionCall {
/**
* Constructor.
*/
public CastCall(QName fname, Vector arguments) {
public CastCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,20 +21,19 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class CeilingCall extends FunctionCall {
public CeilingCall(QName fname, Vector arguments) {
public CeilingCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,9 +24,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Enumeration;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.GOTO;
import com.sun.org.apache.bcel.internal.generic.IFEQ;
@ -37,7 +35,11 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -61,7 +63,7 @@ final class Choose extends Instruction {
* <xsl:when> elements and default to the <xsl:otherwise> if present.
*/
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final Vector whenElements = new Vector();
final List<SyntaxTreeNode> whenElements = new ArrayList<>();
Otherwise otherwise = null;
Iterator<SyntaxTreeNode> elements = elements();
@ -74,7 +76,7 @@ final class Choose extends Instruction {
SyntaxTreeNode element = elements.next();
// Add a When child element
if (element instanceof When) {
whenElements.addElement(element);
whenElements.add(element);
}
// Add an Otherwise child element
else if (element instanceof Otherwise) {
@ -108,10 +110,10 @@ final class Choose extends Instruction {
// next element will hold a handle to the beginning of next
// When/Otherwise if test on current When fails
BranchHandle nextElement = null;
Vector exitHandles = new Vector();
List<InstructionHandle> exitHandles = new ArrayList<>();
InstructionHandle exit = null;
Enumeration whens = whenElements.elements();
Enumeration<SyntaxTreeNode> whens = Collections.enumeration(whenElements);
while (whens.hasMoreElements()) {
final When when = (When)whens.nextElement();
final Expression test = when.getTest();
@ -142,7 +144,7 @@ final class Choose extends Instruction {
if (!when.ignore()) when.translateContents(classGen, methodGen);
// goto exit after executing the body of when
exitHandles.addElement(il.append(new GOTO(null)));
exitHandles.add(il.append(new GOTO(null)));
if (whens.hasMoreElements() || otherwise != null) {
nextElement = il.append(new GOTO(null));
test.backPatchFalseList(nextElement);
@ -160,7 +162,7 @@ final class Choose extends Instruction {
}
// now that end is known set targets of exit gotos
Enumeration exitGotos = exitHandles.elements();
Enumeration<InstructionHandle> exitGotos = Collections.enumeration(exitHandles);
while (exitGotos.hasMoreElements()) {
BranchHandle gotoExit = (BranchHandle)exitGotos.nextElement();
gotoExit.setTarget(exit);

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@ -34,13 +32,14 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class ConcatCall extends FunctionCall {
public ConcatCall(QName fname, Vector arguments) {
public ConcatCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.IFLT;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@ -32,6 +30,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -46,7 +45,7 @@ final class ContainsCall extends FunctionCall {
/**
* Create a contains() call - two arguments, both strings
*/
public ContainsCall(QName fname, Vector arguments) {
public ContainsCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,11 +21,8 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GETFIELD;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.PUSH;
@ -34,6 +31,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -48,7 +46,7 @@ final class DocumentCall extends FunctionCall {
/**
* Default function call constructor
*/
public DocumentCall(QName fname, Vector arguments) {
public DocumentCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.PUSH;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
@ -30,6 +28,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -37,7 +36,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
*/
final class ElementAvailableCall extends FunctionCall {
public ElementAvailableCall(QName fname, Vector arguments) {
public ElementAvailableCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GOTO_W;
@ -37,6 +35,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -193,12 +192,12 @@ abstract class Expression extends SyntaxTreeNode {
public MethodType lookupPrimop(SymbolTable stable, String op,
MethodType ctype) {
MethodType result = null;
final Vector primop = stable.lookupPrimop(op);
final List<MethodType> primop = stable.lookupPrimop(op);
if (primop != null) {
final int n = primop.size();
int minDistance = Integer.MAX_VALUE;
for (int i = 0; i < n; i++) {
final MethodType ptype = (MethodType) primop.elementAt(i);
final MethodType ptype = primop.get(i);
// Skip if different arity
if (ptype.argsCount() != ctype.argsCount()) {
continue;

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,17 +21,13 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.ILOAD;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.ISTORE;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
@ -41,6 +37,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -57,9 +54,9 @@ class FilterExpr extends Expression {
/**
* Array of predicates in '(e)[p1]...[pn]'.
*/
private final Vector _predicates;
private final List<Expression> _predicates;
public FilterExpr(Expression primary, Vector predicates) {
public FilterExpr(Expression primary, List<Expression> predicates) {
_primary = primary;
_predicates = predicates;
primary.setParent(this);
@ -78,7 +75,7 @@ class FilterExpr extends Expression {
if (_predicates != null) {
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Expression exp = (Expression)_predicates.elementAt(i);
final Expression exp = (Expression)_predicates.get(i);
exp.setParser(parser);
exp.setParent(this);
}
@ -112,7 +109,7 @@ class FilterExpr extends Expression {
// Type check predicates and turn all optimizations off if appropriate
int n = _predicates.size();
for (int i = 0; i < n; i++) {
Predicate pred = (Predicate) _predicates.elementAt(i);
Predicate pred = (Predicate) _predicates.get(i);
if (!canOptimize) {
pred.dontOptimize();

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,18 +21,17 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class FloorCall extends FunctionCall {
public FloorCall(QName fname, Vector arguments) {
public FloorCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,27 +21,27 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Iterator;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
public final class FlowList {
private Vector _elements;
private List<InstructionHandle> _elements;
public FlowList() {
_elements = null;
}
public FlowList(InstructionHandle bh) {
_elements = new Vector();
_elements.addElement(bh);
_elements = new ArrayList<>();
_elements.add(bh);
}
public FlowList(FlowList list) {
@ -50,9 +50,9 @@ public final class FlowList {
public FlowList add(InstructionHandle bh) {
if (_elements == null) {
_elements = new Vector();
_elements = new ArrayList<>();
}
_elements.addElement(bh);
_elements.add(bh);
return this;
}
@ -61,11 +61,11 @@ public final class FlowList {
_elements = right._elements;
}
else {
final Vector temp = right._elements;
final List<InstructionHandle> temp = right._elements;
if (temp != null) {
final int n = temp.size();
for (int i = 0; i < n; i++) {
_elements.addElement(temp.elementAt(i));
_elements.add(temp.get(i));
}
}
}
@ -79,7 +79,7 @@ public final class FlowList {
if (_elements != null) {
final int n = _elements.size();
for (int i = 0; i < n; i++) {
BranchHandle bh = (BranchHandle)_elements.elementAt(i);
BranchHandle bh = (BranchHandle)_elements.get(i);
bh.setTarget(target);
}
_elements.clear(); // avoid backpatching more than once
@ -99,15 +99,15 @@ public final class FlowList {
}
final int n = _elements.size();
final Iterator oldIter = oldList.iterator();
final Iterator newIter = newList.iterator();
final Iterator<InstructionHandle> oldIter = oldList.iterator();
final Iterator<InstructionHandle> newIter = newList.iterator();
while (oldIter.hasNext()) {
final InstructionHandle oldIh = (InstructionHandle) oldIter.next();
final InstructionHandle newIh = (InstructionHandle) newIter.next();
final InstructionHandle oldIh = oldIter.next();
final InstructionHandle newIh = newIter.next();
for (int i = 0; i < n; i++) {
if (_elements.elementAt(i) == oldIh) {
if (_elements.get(i) == oldIh) {
result.add(newIh);
}
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,9 +24,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Enumeration;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GOTO;
@ -42,7 +40,9 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -97,12 +97,12 @@ final class ForEach extends Instruction {
il.append(methodGen.loadIterator());
// Collect sort objects associated with this instruction
final Vector sortObjects = new Vector();
final List<Sort> sortObjects = new ArrayList<>();
Iterator<SyntaxTreeNode> children = elements();
while (children.hasNext()) {
final Object child = children.next();
final SyntaxTreeNode child = children.next();
if (child instanceof Sort) {
sortObjects.addElement(child);
sortObjects.add((Sort)child);
}
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@ -34,6 +32,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -46,7 +45,7 @@ final class FormatNumberCall extends FunctionCall {
private Expression _name;
private QName _resolvedQName = null;
public FormatNumberCall(QName fname, Vector arguments) {
public FormatNumberCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
_value = argument(0);
_format = argument(1);

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,19 +21,18 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.PUSH;
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.List;
/**
* @author G. Todd Miller
@ -52,9 +51,9 @@ final class FunctionAvailableCall extends FunctionCall {
* a list of arguments where the arguments must be instances of
* LiteralExpression.
*/
public FunctionAvailableCall(QName fname, Vector arguments) {
public FunctionAvailableCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
_arg = (Expression)arguments.elementAt(0);
_arg = (Expression)arguments.get(0);
_type = null;
if (_arg instanceof LiteralExpr) {
@ -131,7 +130,7 @@ final class FunctionAvailableCall extends FunctionCall {
methodName = replaceDash(methodName);
try {
final Class clazz = ObjectFactory.findProviderClass(className, true);
final Class<?> clazz = ObjectFactory.findProviderClass(className, true);
if (clazz == null) {
return false;

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -48,12 +49,12 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Vector;
import jdk.xml.internal.JdkXmlFeatures;
/**
@ -68,9 +69,9 @@ class FunctionCall extends Expression {
// Name of this function call
private QName _fname;
// Arguments to this function call (might not be any)
private final Vector _arguments;
private final List<Expression> _arguments;
// Empty argument list, used for certain functions
private final static Vector EMPTY_ARG_LIST = new Vector(0);
private final static List<Expression> EMPTY_ARG_LIST = new ArrayList<>(0);
// Valid namespaces for Java function-call extension
protected final static String EXT_XSLTC =
@ -122,9 +123,9 @@ class FunctionCall extends Expression {
// External Java function's class/method/signature
private String _className;
private Class _clazz;
private Class<?> _clazz;
private Method _chosenMethod;
private Constructor _chosenConstructor;
private Constructor<?> _chosenConstructor;
private MethodType _chosenMethodType;
// Encapsulates all unsupported external function calls
@ -156,7 +157,7 @@ class FunctionCall extends Expression {
public Class<?> type;
public int distance;
public JavaType(Class type, int distance){
public JavaType(Class<?> type, int distance){
this.type = type;
this.distance = distance;
}
@ -294,7 +295,7 @@ class FunctionCall extends Expression {
}
public FunctionCall(QName fname, Vector arguments) {
public FunctionCall(QName fname, List<Expression> arguments) {
_fname = fname;
_arguments = arguments;
_type = null;
@ -314,7 +315,7 @@ class FunctionCall extends Expression {
if (_arguments != null) {
final int n = _arguments.size();
for (int i = 0; i < n; i++) {
final Expression exp = (Expression)_arguments.elementAt(i);
final Expression exp = _arguments.get(i);
exp.setParser(parser);
exp.setParent(this);
}
@ -435,18 +436,18 @@ class FunctionCall extends Expression {
_fname.clearNamespace(); // HACK!!!
final int n = _arguments.size();
final Vector argsType = typeCheckArgs(stable);
final List<Type> argsType = typeCheckArgs(stable);
final MethodType args = new MethodType(Type.Void, argsType);
final MethodType ptype =
lookupPrimop(stable, _fname.getLocalPart(), args);
if (ptype != null) {
for (int i = 0; i < n; i++) {
final Type argType = (Type) ptype.argsType().elementAt(i);
final Expression exp = (Expression)_arguments.elementAt(i);
final Type argType = (Type) ptype.argsType().get(i);
final Expression exp = _arguments.get(i);
if (!argType.identicalTo(exp.getType())) {
try {
_arguments.setElementAt(new CastExpr(exp, argType), i);
_arguments.set(i, new CastExpr(exp, argType));
}
catch (TypeCheckError e) {
throw new TypeCheckError(this); // invalid conversion
@ -462,7 +463,7 @@ class FunctionCall extends Expression {
public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{
final Vector constructors = findConstructors();
final List<Constructor<?>> constructors = findConstructors();
if (constructors == null) {
// Constructor not found in this class
throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND,
@ -472,23 +473,22 @@ class FunctionCall extends Expression {
final int nConstructors = constructors.size();
final int nArgs = _arguments.size();
final Vector argsType = typeCheckArgs(stable);
final List<Type> argsType = typeCheckArgs(stable);
// Try all constructors
int bestConstrDistance = Integer.MAX_VALUE;
_type = null; // reset
for (int j, i = 0; i < nConstructors; i++) {
// Check if all parameters to this constructor can be converted
final Constructor constructor =
(Constructor)constructors.elementAt(i);
final Class[] paramTypes = constructor.getParameterTypes();
final Constructor<?> constructor = constructors.get(i);
final Class<?>[] paramTypes = constructor.getParameterTypes();
Class<?> extType;
int currConstrDistance = 0;
for (j = 0; j < nArgs; j++) {
// Convert from internal (translet) type to external (Java) type
extType = paramTypes[j];
final Type intType = (Type)argsType.elementAt(j);
final Type intType = argsType.get(j);
JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
if (match != null) {
currConstrDistance += match.distance;
@ -556,7 +556,7 @@ class FunctionCall extends Expression {
|| _namespace_format == NAMESPACE_FORMAT_PACKAGE)
hasThisArgument = true;
Expression firstArg = (Expression)_arguments.elementAt(0);
Expression firstArg = _arguments.get(0);
Type firstArgType = (Type)firstArg.typeCheck(stable);
if (_namespace_format == NAMESPACE_FORMAT_CLASS
@ -566,7 +566,7 @@ class FunctionCall extends Expression {
hasThisArgument = true;
if (hasThisArgument) {
_thisArgument = (Expression) _arguments.elementAt(0);
_thisArgument = _arguments.get(0);
_arguments.remove(0); nArgs--;
if (firstArgType instanceof ObjectType) {
_className = ((ObjectType) firstArgType).getJavaClassName();
@ -592,30 +592,30 @@ class FunctionCall extends Expression {
}
}
final Vector methods = findMethods();
final List<Method> methods = findMethods();
if (methods == null) {
// Method not found in this class
throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name);
}
Class extType = null;
Class<?> extType = null;
final int nMethods = methods.size();
final Vector argsType = typeCheckArgs(stable);
final List<Type> argsType = typeCheckArgs(stable);
// Try all methods to identify the best fit
int bestMethodDistance = Integer.MAX_VALUE;
_type = null; // reset internal type
for (int j, i = 0; i < nMethods; i++) {
// Check if all paramteters to this method can be converted
final Method method = (Method)methods.elementAt(i);
final Class[] paramTypes = method.getParameterTypes();
final Method method = (Method)methods.get(i);
final Class<?>[] paramTypes = method.getParameterTypes();
int currMethodDistance = 0;
for (j = 0; j < nArgs; j++) {
// Convert from internal (translet) type to external (Java) type
extType = paramTypes[j];
final Type intType = (Type)argsType.elementAt(j);
final Type intType = argsType.get(j);
JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
if (match != null) {
currMethodDistance += match.distance;
@ -683,18 +683,16 @@ class FunctionCall extends Expression {
/**
* Type check the actual arguments of this function call.
*/
public Vector typeCheckArgs(SymbolTable stable) throws TypeCheckError {
final Vector result = new Vector();
final Enumeration e = _arguments.elements();
while (e.hasMoreElements()) {
final Expression exp = (Expression)e.nextElement();
result.addElement(exp.typeCheck(stable));
public List<Type> typeCheckArgs(SymbolTable stable) throws TypeCheckError {
final List<Type> result = new ArrayList<>();
for (Expression exp : _arguments) {
result.add(exp.typeCheck(stable));
}
return result;
}
protected final Expression argument(int i) {
return (Expression)_arguments.elementAt(i);
return _arguments.get(i);
}
protected final Expression argument() {
@ -706,7 +704,7 @@ class FunctionCall extends Expression {
}
protected final void setArgument(int i, Expression exp) {
_arguments.setElementAt(exp, i);
_arguments.set(i, exp);
}
/**
@ -795,7 +793,7 @@ class FunctionCall extends Expression {
// <TransletClass>.class.getModule().addReads(
generateAddReads(classGen, methodGen, clazz);
Class[] paramTypes = _chosenConstructor.getParameterTypes();
Class<?>[] paramTypes = _chosenConstructor.getParameterTypes();
LocalVariableGen[] paramTemp = new LocalVariableGen[n];
// Backwards branches are prohibited if an uninitialized object is
@ -856,7 +854,7 @@ class FunctionCall extends Expression {
translateUnallowedExtension(cpg, il);
final String clazz = _chosenMethod.getDeclaringClass().getName();
Class[] paramTypes = _chosenMethod.getParameterTypes();
Class<?>[] paramTypes = _chosenMethod.getParameterTypes();
// Generate call to Module.addReads:
@ -960,9 +958,9 @@ class FunctionCall extends Expression {
* after stripping its namespace or <code>null</code>
* if no such methods exist.
*/
private Vector findMethods() {
private List<Method> findMethods() {
Vector result = null;
List<Method> result = null;
final String namespace = _fname.getNamespace();
if (_className != null && _className.length() > 0) {
@ -1003,9 +1001,9 @@ class FunctionCall extends Expression {
&& methods[i].getParameterTypes().length == nArgs)
{
if (result == null) {
result = new Vector();
result = new ArrayList<>();
}
result.addElement(methods[i]);
result.add(methods[i]);
}
}
}
@ -1022,9 +1020,8 @@ class FunctionCall extends Expression {
* after stripping its namespace or <code>null</code>
* if no such methods exist.
*/
private Vector findConstructors() {
Vector result = null;
final String namespace = _fname.getNamespace();
private List<Constructor<?>> findConstructors() {
List<Constructor<?>> result = null;
final int nArgs = _arguments.size();
try {
@ -1037,20 +1034,17 @@ class FunctionCall extends Expression {
}
}
final Constructor[] constructors = _clazz.getConstructors();
final Constructor<?>[] constructors = _clazz.getConstructors();
for (int i = 0; i < constructors.length; i++) {
final int mods = constructors[i].getModifiers();
// Is it public, static and same number of args ?
if (Modifier.isPublic(mods) &&
constructors[i].getParameterTypes().length == nArgs)
{
if (result == null) {
result = new Vector();
for (Constructor<?> constructor : constructors) {
final int mods = constructor.getModifiers();
// Is it public, static and same number of args ?
if (Modifier.isPublic(mods) && constructor.getParameterTypes().length == nArgs) {
if (result == null) {
result = new ArrayList<>();
} result.add(constructor);
}
result.addElement(constructors[i]);
}
}
}
}
catch (ClassNotFoundException e) {
final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
@ -1064,10 +1058,10 @@ class FunctionCall extends Expression {
/**
* Compute the JVM signature for the class.
*/
static final String getSignature(Class clazz) {
static final String getSignature(Class<?> clazz) {
if (clazz.isArray()) {
final StringBuffer sb = new StringBuffer();
Class cl = clazz;
Class<?> cl = clazz;
while (cl.isArray()) {
sb.append("[");
cl = cl.getComponentType();
@ -1120,7 +1114,7 @@ class FunctionCall extends Expression {
static final String getSignature(Method meth) {
final StringBuffer sb = new StringBuffer();
sb.append('(');
final Class[] params = meth.getParameterTypes(); // avoid clone
final Class<?>[] params = meth.getParameterTypes(); // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(getSignature(params[j]));
}
@ -1131,10 +1125,10 @@ class FunctionCall extends Expression {
/**
* Compute the JVM constructor descriptor for the constructor.
*/
static final String getSignature(Constructor cons) {
static final String getSignature(Constructor<?> cons) {
final StringBuffer sb = new StringBuffer();
sb.append('(');
final Class[] params = cons.getParameterTypes(); // avoid clone
final Class<?>[] params = cons.getParameterTypes(); // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(getSignature(params[j]));
}
@ -1144,13 +1138,13 @@ class FunctionCall extends Expression {
/**
* Return the signature of the current method
*/
private String getMethodSignature(Vector argsType) {
private String getMethodSignature(List<Type> argsType) {
final StringBuffer buf = new StringBuffer(_className);
buf.append('.').append(_fname.getLocalPart()).append('(');
int nArgs = argsType.size();
for (int i = 0; i < nArgs; i++) {
final Type intType = (Type)argsType.elementAt(i);
final Type intType = argsType.get(i);
buf.append(intType.toString());
if (i < nArgs - 1) buf.append(", ");
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,20 +21,19 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class GenerateIdCall extends FunctionCall {
public GenerateIdCall(QName fname, Vector arguments) {
public GenerateIdCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,8 +24,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GOTO;

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,28 +21,16 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GOTO;
import com.sun.org.apache.bcel.internal.generic.IFGT;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.generic.PUSH;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.List;
/**
* @author Morten Jorgensen
@ -82,7 +70,7 @@ final class KeyCall extends FunctionCall {
* @param fname The function name (should be 'key' or 'id')
* @param arguments A vector containing the arguments the the function
*/
public KeyCall(QName fname, Vector arguments) {
public KeyCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
switch(argumentCount()) {
case 1:

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.ILOAD;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
@ -33,6 +31,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Morten Jorgensen
@ -45,7 +44,7 @@ final class LangCall extends FunctionCall {
* Get the parameters passed to function:
* lang(string)
*/
public LangCall(QName fname, Vector arguments) {
public LangCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
_lang = argument(0);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -102,6 +103,7 @@ final class LiteralElement extends Instruction {
// Check if we have any declared namespaces
if (_accessedPrefixes == null) {
// use Hashtable for behavior compatibility
_accessedPrefixes = new Hashtable<>();
}
else {

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,14 +21,13 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Morten Jorgensen
@ -45,7 +44,7 @@ final class LocalNameCall extends NameBase {
/**
* Handles calls with one parameter (either node or node-set).
*/
public LocalNameCall(QName fname, Vector arguments) {
public LocalNameCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -137,11 +137,11 @@ final class LogicalExpr extends Expression {
// Yes, the operation is supported
if (haveType != null) {
// Check if left-hand side operand must be type casted
Type arg1 = (Type)haveType.argsType().elementAt(0);
Type arg1 = (Type)haveType.argsType().get(0);
if (!arg1.identicalTo(tleft))
_left = new CastExpr(_left, arg1);
// Check if right-hand side operand must be type casted
Type arg2 = (Type) haveType.argsType().elementAt(1);
Type arg2 = (Type) haveType.argsType().get(1);
if (!arg2.identicalTo(tright))
_right = new CastExpr(_right, arg1);
// Return the result type for the operator we will use

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -46,12 +47,12 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NamedMethodGenerato
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.dtm.Axis;
import com.sun.org.apache.xml.internal.dtm.DTM;
import java.util.Enumeration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
/**
* Mode gathers all the templates belonging to a given mode;
@ -83,12 +84,12 @@ final class Mode implements Constants {
/**
* A vector of all the templates in this mode.
*/
private Vector _templates;
private List<Template> _templates;
/**
* Group for patterns with node()-type kernel and child axis.
*/
private Vector _childNodeGroup = null;
private List<LocationPathPattern> _childNodeGroup = null;
/**
* Test sequence for patterns with node()-type kernel and child axis.
@ -98,7 +99,7 @@ final class Mode implements Constants {
/**
* Group for patterns with node()-type kernel and attribute axis.
*/
private Vector _attribNodeGroup = null;
private List<LocationPathPattern> _attribNodeGroup = null;
/**
* Test sequence for patterns with node()-type kernel and attribute axis.
@ -108,7 +109,7 @@ final class Mode implements Constants {
/**
* Group for patterns with id() or key()-type kernel.
*/
private Vector _idxGroup = null;
private List<LocationPathPattern> _idxGroup = null;
/**
* Test sequence for patterns with id() or key()-type kernel.
@ -118,7 +119,7 @@ final class Mode implements Constants {
/**
* Group for patterns with any other kernel type.
*/
private Vector[] _patternGroups;
private List<LocationPathPattern>[] _patternGroups;
/**
* Test sequence for patterns with any other kernel type.
@ -175,12 +176,13 @@ final class Mode implements Constants {
* @param suffix A suffix to append to the method name for this mode
* (normally a sequence number - still in a String).
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public Mode(QName name, Stylesheet stylesheet, String suffix) {
_name = name;
_stylesheet = stylesheet;
_methodName = APPLY_TEMPLATES + suffix;
_templates = new Vector();
_patternGroups = new Vector[32];
_templates = new ArrayList<>();
_patternGroups = (List<LocationPathPattern>[])new ArrayList[32];
}
/**
@ -214,10 +216,10 @@ final class Mode implements Constants {
}
public void addTemplate(Template template) {
_templates.addElement(template);
_templates.add(template);
}
private Vector quicksort(Vector templates, int p, int r) {
private List<Template> quicksort(List<Template> templates, int p, int r) {
if (p < r) {
final int q = partition(templates, p, r);
quicksort(templates, p, q);
@ -226,15 +228,15 @@ final class Mode implements Constants {
return templates;
}
private int partition(Vector templates, int p, int r) {
final Template x = (Template)templates.elementAt(p);
private int partition(List<Template> templates, int p, int r) {
final Template x = (Template)templates.get(p);
int i = p - 1;
int j = r + 1;
while (true) {
while (x.compareTo((Template)templates.elementAt(--j)) > 0);
while (x.compareTo((Template)templates.elementAt(++i)) < 0);
while (x.compareTo((Template)templates.get(--j)) > 0);
while (x.compareTo((Template)templates.get(++i)) < 0);
if (i < j) {
templates.set(j, templates.set(i, templates.elementAt(j)));
templates.set(j, templates.set(i, templates.get(j)));
}
else {
return j;
@ -247,35 +249,10 @@ final class Mode implements Constants {
*/
public void processPatterns(Map<String, Key> keys) {
_keys = keys;
/*
System.out.println("Before Sort " + _name);
for (int i = 0; i < _templates.size(); i++) {
System.out.println("name = " + ((Template)_templates.elementAt(i)).getName());
System.out.println("pattern = " + ((Template)_templates.elementAt(i)).getPattern());
System.out.println("priority = " + ((Template)_templates.elementAt(i)).getPriority());
System.out.println("position = " + ((Template)_templates.elementAt(i)).getPosition());
}
*/
_templates = quicksort(_templates, 0, _templates.size() - 1);
/*
System.out.println("\n After Sort " + _name);
for (int i = 0; i < _templates.size(); i++) {
System.out.println("name = " + ((Template)_templates.elementAt(i)).getName());
System.out.println("pattern = " + ((Template)_templates.elementAt(i)).getPattern());
System.out.println("priority = " + ((Template)_templates.elementAt(i)).getPriority());
System.out.println("position = " + ((Template)_templates.elementAt(i)).getPosition());
}
*/
// Traverse all templates
final Enumeration templates = _templates.elements();
while (templates.hasMoreElements()) {
// Get the next template
final Template template = (Template)templates.nextElement();
for (Template template : _templates) {
/*
* Add this template to a table of named templates if it has a name.
* If there are multiple templates with the same name, all but one
@ -308,8 +285,8 @@ for (int i = 0; i < _templates.size(); i++) {
if (pattern instanceof IdKeyPattern) {
final IdKeyPattern idkey = (IdKeyPattern)pattern;
idkey.setTemplate(template);
if (_idxGroup == null) _idxGroup = new Vector();
_idxGroup.add(pattern);
if (_idxGroup == null) _idxGroup = new ArrayList<>();
_idxGroup.add((IdKeyPattern)pattern);
}
// Alternative patterns are broken up and re-processed recursively
else if (pattern instanceof AlternativePattern) {
@ -355,47 +332,50 @@ for (int i = 0; i < _templates.size(); i++) {
// Make sure the array of pattern groups is long enough
final int oldLength = _patternGroups.length;
if (kernelType >= oldLength) {
Vector[] newGroups = new Vector[kernelType * 2];
@SuppressWarnings({"rawtypes", "unchecked"})
List<LocationPathPattern>[] newGroups =
(List<LocationPathPattern>[])new ArrayList[kernelType * 2];
System.arraycopy(_patternGroups, 0, newGroups, 0, oldLength);
_patternGroups = newGroups;
}
// Find the vector to put this pattern into
Vector patterns;
List<LocationPathPattern> patterns;
if (kernelType == DOM.NO_TYPE) {
if (pattern.getAxis() == Axis.ATTRIBUTE) {
patterns = (_attribNodeGroup == null) ?
(_attribNodeGroup = new Vector(2)) : _attribNodeGroup;
(_attribNodeGroup = new ArrayList<>(2)) : _attribNodeGroup;
}
else {
patterns = (_childNodeGroup == null) ?
(_childNodeGroup = new Vector(2)) : _childNodeGroup;
(_childNodeGroup = new ArrayList<>(2)) : _childNodeGroup;
}
}
else {
patterns = (_patternGroups[kernelType] == null) ?
(_patternGroups[kernelType] = new Vector(2)) :
(_patternGroups[kernelType] = new ArrayList<>(2)) :
_patternGroups[kernelType];
}
if (patterns.size() == 0) {
patterns.addElement(pattern);
patterns.add(pattern);
}
else {
boolean inserted = false;
for (int i = 0; i < patterns.size(); i++) {
final LocationPathPattern lppToCompare =
(LocationPathPattern)patterns.elementAt(i);
(LocationPathPattern)patterns.get(i);
if (pattern.noSmallerThan(lppToCompare)) {
inserted = true;
patterns.insertElementAt(pattern, i);
patterns.add(i, pattern);
break;
}
}
if (inserted == false) {
patterns.addElement(pattern);
patterns.add(pattern);
}
}
}
@ -404,7 +384,7 @@ for (int i = 0; i < _templates.size(); i++) {
* Complete test sequences of a given type by adding all patterns
* from a given group.
*/
private void completeTestSequences(int nodeType, Vector patterns) {
private void completeTestSequences(int nodeType, List<LocationPathPattern> patterns) {
if (patterns != null) {
if (_patternGroups[nodeType] == null) {
_patternGroups[nodeType] = patterns;
@ -412,8 +392,7 @@ for (int i = 0; i < _templates.size(); i++) {
else {
final int m = patterns.size();
for (int j = 0; j < m; j++) {
addPattern(nodeType,
(LocationPathPattern) patterns.elementAt(j));
addPattern(nodeType, patterns.get(j));
}
}
}
@ -425,8 +404,8 @@ for (int i = 0; i < _templates.size(); i++) {
* sequences, and of "@*" to all attribute test sequences.
*/
private void prepareTestSequences() {
final Vector starGroup = _patternGroups[DTM.ELEMENT_NODE];
final Vector atStarGroup = _patternGroups[DTM.ATTRIBUTE_NODE];
final List<LocationPathPattern> starGroup = _patternGroups[DTM.ELEMENT_NODE];
final List<LocationPathPattern> atStarGroup = _patternGroups[DTM.ATTRIBUTE_NODE];
// Complete test sequence for "text()" with "child::node()"
completeTestSequences(DTM.TEXT_NODE, _childNodeGroup);
@ -443,7 +422,7 @@ for (int i = 0; i < _templates.size(); i++) {
// Complete test sequence for "@*" with "attribute::node()"
completeTestSequences(DTM.ATTRIBUTE_NODE, _attribNodeGroup);
final Vector names = _stylesheet.getXSLTC().getNamesIndex();
final List<String> names = _stylesheet.getXSLTC().getNamesIndex();
if (starGroup != null || atStarGroup != null ||
_childNodeGroup != null || _attribNodeGroup != null)
{
@ -453,7 +432,7 @@ for (int i = 0; i < _templates.size(); i++) {
for (int i = DTM.NTYPES; i < n; i++) {
if (_patternGroups[i] == null) continue;
final String name = (String) names.elementAt(i - DTM.NTYPES);
final String name = names.get(i - DTM.NTYPES);
if (isAttributeName(name)) {
// If an attribute then copy "@*" to its test sequence
@ -476,7 +455,7 @@ for (int i = 0; i < _templates.size(); i++) {
final int n = _patternGroups.length;
for (int i = 0; i < n; i++) {
final Vector patterns = _patternGroups[i];
final List<LocationPathPattern> patterns = _patternGroups[i];
if (patterns != null) {
final TestSeq testSeq = new TestSeq(patterns, i, this);
// System.out.println("testSeq[" + i + "] = " + testSeq);
@ -520,7 +499,7 @@ for (int i = 0; i < _templates.size(); i++) {
int numParams = 0;
if (template.isSimpleNamedTemplate()) {
Vector parameters = template.getParameters();
List<Param> parameters = template.getParameters();
numParams = parameters.size();
}
@ -676,8 +655,8 @@ for (int i = 0; i < _templates.size(); i++) {
final ConstantPoolGen cpg = classGen.getConstantPool();
// Append switch() statement - namespace test dispatch loop
final Vector namespaces = xsltc.getNamespaceIndex();
final Vector names = xsltc.getNamesIndex();
final List<String> namespaces = xsltc.getNamespaceIndex();
final List<String> names = xsltc.getNamesIndex();
final int namespaceCount = namespaces.size() + 1;
final int namesCount = names.size();
@ -697,7 +676,7 @@ for (int i = 0; i < _templates.size(); i++) {
// Add test sequences for known namespace types
for (int i = DTM.NTYPES; i < (DTM.NTYPES+namesCount); i++) {
if ((isNamespace[i]) && (isAttribute[i] == attrFlag)) {
String name = (String)names.elementAt(i-DTM.NTYPES);
String name = names.get(i-DTM.NTYPES);
String namespace = name.substring(0,name.lastIndexOf(':'));
final int type = xsltc.registerNamespace(namespace);
@ -737,7 +716,7 @@ for (int i = 0; i < _templates.size(); i++) {
public void compileApplyTemplates(ClassGenerator classGen) {
final XSLTC xsltc = classGen.getParser().getXSLTC();
final ConstantPoolGen cpg = classGen.getConstantPool();
final Vector names = xsltc.getNamesIndex();
final List<String> names = xsltc.getNamesIndex();
// Create the applyTemplates() method
final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
@ -816,7 +795,7 @@ for (int i = 0; i < _templates.size(); i++) {
final boolean[] isAttribute = new boolean[types.length];
final boolean[] isNamespace = new boolean[types.length];
for (int i = 0; i < names.size(); i++) {
final String name = (String)names.elementAt(i);
final String name = names.get(i);
isAttribute[i + DTM.NTYPES] = isAttributeName(name);
isNamespace[i + DTM.NTYPES] = isNamespaceName(name);
}
@ -1067,28 +1046,26 @@ for (int i = 0; i < _templates.size(); i++) {
});
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void compileApplyImports(ClassGenerator classGen, int min, int max) {
final XSLTC xsltc = classGen.getParser().getXSLTC();
final ConstantPoolGen cpg = classGen.getConstantPool();
final Vector names = xsltc.getNamesIndex();
final List<String> names = xsltc.getNamesIndex();
// Clear some datastructures
_namedTemplates = new HashMap<>();
_neededTemplates = new HashMap<>();
_templateIHs = new HashMap<>();
_templateILs = new HashMap<>();
_patternGroups = new Vector[32];
_patternGroups = (List<LocationPathPattern>[])new ArrayList[32];
_rootPattern = null;
// IMPORTANT: Save orignal & complete set of templates!!!!
Vector oldTemplates = _templates;
List<Template> oldTemplates = _templates;
// Gather templates that are within the scope of this import
_templates = new Vector();
final Enumeration templates = oldTemplates.elements();
while (templates.hasMoreElements()) {
final Template template = (Template)templates.nextElement();
_templates = new ArrayList<>();
for (Template template : oldTemplates) {
final int prec = template.getImportPrecedence();
if ((prec >= min) && (prec < max)) addTemplate(template);
}
@ -1159,7 +1136,7 @@ for (int i = 0; i < _templates.size(); i++) {
final boolean[] isAttribute = new boolean[types.length];
final boolean[] isNamespace = new boolean[types.length];
for (int i = 0; i < names.size(); i++) {
final String name = (String)names.elementAt(i);
final String name = (String)names.get(i);
isAttribute[i+DTM.NTYPES] = isAttributeName(name);
isNamespace[i+DTM.NTYPES] = isNamespaceName(name);
}
@ -1406,8 +1383,8 @@ for (int i = 0; i < _templates.size(); i++) {
// is creating a problem in the Turkish locale
pattern = "loadinstruction pop";
for (Iterator iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = (InstructionHandle[]) iter.next();
for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = iter.next();
try {
if (!match[0].hasTargeters() && !match[1].hasTargeters()) {
il.delete(match[0], match[1]);
@ -1423,8 +1400,8 @@ for (int i = 0; i < _templates.size(); i++) {
// changed to lower case - changing to all lower case although only the instruction with capital I
// is creating a problem in the Turkish locale
pattern = "iload iload swap istore";
for (Iterator iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = (InstructionHandle[]) iter.next();
for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = iter.next();
try {
com.sun.org.apache.bcel.internal.generic.ILOAD iload1 =
(com.sun.org.apache.bcel.internal.generic.ILOAD) match[0].getInstruction();
@ -1452,8 +1429,8 @@ for (int i = 0; i < _templates.size(); i++) {
// changed to lower case - changing to all lower case although only the instruction with capital I
// is creating a problem in the Turkish locale
pattern = "loadinstruction loadinstruction swap";
for (Iterator iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = (InstructionHandle[])iter.next();
for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = iter.next();
try {
if (!match[0].hasTargeters() &&
!match[1].hasTargeters() &&
@ -1474,8 +1451,8 @@ for (int i = 0; i < _templates.size(); i++) {
// changed to lower case - changing to all lower case although only the instruction with capital I
// is creating a problem in the Turkish locale
pattern = "aload aload";
for (Iterator iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = (InstructionHandle[])iter.next();
for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
InstructionHandle[] match = iter.next();
try {
if (!match[1].hasTargeters()) {
com.sun.org.apache.bcel.internal.generic.ALOAD aload1 =

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
@ -30,6 +28,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Morten Jorgensen
@ -50,7 +49,7 @@ class NameBase extends FunctionCall {
/**
* Handles calls with one parameter (either node or node-set).
*/
public NameBase(QName fname, Vector arguments) {
public NameBase(QName fname, List<Expression> arguments) {
super(fname, arguments);
_param = argument(0);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,13 +21,12 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -46,7 +45,7 @@ final class NameCall extends NameBase {
/**
* Handles calls with one parameter (either node or node-set).
*/
public NameCall(QName fname, Vector arguments) {
public NameCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,13 +21,12 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Morten Jorgensen
@ -44,7 +43,7 @@ final class NamespaceUriCall extends NameBase {
/**
* Handles calls with one parameter (either node or node-set).
*/
public NamespaceUriCall(QName fname, Vector arguments) {
public NamespaceUriCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,20 +21,19 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.GOTO;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class NotCall extends FunctionCall {
public NotCall(QName fname, Vector arguments) {
public NotCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,23 +21,21 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.ArrayList;
import com.sun.org.apache.bcel.internal.classfile.Field;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ILOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.D2I;
import com.sun.org.apache.bcel.internal.generic.GETFIELD;
import com.sun.org.apache.bcel.internal.generic.GOTO;
import com.sun.org.apache.bcel.internal.generic.IFNONNULL;
import com.sun.org.apache.bcel.internal.generic.ILOAD;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.D2I;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.generic.PUSH;
@ -50,6 +48,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.ArrayList;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -86,7 +86,7 @@ final class Number extends Instruction implements Closure {
private boolean _formatNeeded = false;
private String _className = null;
private ArrayList _closureVars = null;
private List<VariableRefBase> _closureVars = null;
// -- Begin Closure interface --------------------
@ -118,7 +118,7 @@ final class Number extends Instruction implements Closure {
*/
public void addVariable(VariableRefBase variableRef) {
if (_closureVars == null) {
_closureVars = new ArrayList();
_closureVars = new ArrayList<>();
}
// Only one reference per variable
@ -395,8 +395,7 @@ final class Number extends Instruction implements Closure {
_closureVars.size();
for (int i = 0; i < closureLen; i++) {
VariableBase var =
((VariableRefBase) _closureVars.get(i)).getVariable();
VariableBase var = (_closureVars.get(i)).getVariable();
nodeCounterGen.addField(new Field(ACC_PUBLIC,
cpg.addUtf8(var.getEscapedName()),

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,13 +21,12 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -35,7 +34,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
*/
final class NumberCall extends FunctionCall {
public NumberCall(QName fname, Vector arguments) {
public NumberCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.ArrayList;
import com.sun.org.apache.bcel.internal.classfile.Field;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
@ -47,6 +45,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
import java.util.ArrayList;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -92,7 +92,7 @@ final class Predicate extends Expression implements Closure {
/**
* List of variables in closure.
*/
private ArrayList _closureVars = null;
private List<VariableRefBase> _closureVars = null;
/**
* Reference to parent closure.
@ -208,7 +208,7 @@ final class Predicate extends Expression implements Closure {
*/
public void addVariable(VariableRefBase variableRef) {
if (_closureVars == null) {
_closureVars = new ArrayList();
_closureVars = new ArrayList<>();
}
// Only one reference per variable
@ -372,7 +372,7 @@ final class Predicate extends Expression implements Closure {
// Add a new instance variable for each var in closure
for (int i = 0; i < length; i++) {
VariableBase var = ((VariableRefBase) _closureVars.get(i)).getVariable();
VariableBase var = (_closureVars.get(i)).getVariable();
filterGen.addField(new Field(ACC_PUBLIC,
cpg.addUtf8(var.getEscapedName()),
@ -559,7 +559,7 @@ final class Predicate extends Expression implements Closure {
final int length = (_closureVars == null) ? 0 : _closureVars.size();
for (int i = 0; i < length; i++) {
VariableRefBase varRef = (VariableRefBase) _closureVars.get(i);
VariableRefBase varRef = _closureVars.get(i);
VariableBase var = varRef.getVariable();
Type varType = var.getType();

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -81,7 +81,7 @@ final class ProcessingInstructionPattern extends StepPattern {
// Type check all the predicates (e -> position() = e)
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Predicate pred = (Predicate)_predicates.elementAt(i);
final Predicate pred = _predicates.get(i);
pred.typeCheck(stable);
}
}
@ -133,7 +133,7 @@ final class ProcessingInstructionPattern extends StepPattern {
if (hasPredicates()) {
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
Predicate pred = (Predicate)_predicates.elementAt(i);
Predicate pred = _predicates.get(i);
Expression exp = pred.getExpr();
exp.translateDesynthesized(classGen, methodGen);
_trueList.append(exp._trueList);

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -183,11 +183,11 @@ final class RelationalExpr extends Expression {
new MethodType(Type.Void, tleft, tright));
if (ptype != null) {
Type arg1 = (Type) ptype.argsType().elementAt(0);
Type arg1 = ptype.argsType().get(0);
if (!arg1.identicalTo(tleft)) {
_left = new CastExpr(_left, arg1);
}
Type arg2 = (Type) ptype.argsType().elementAt(1);
Type arg2 = ptype.argsType().get(1);
if (!arg2.identicalTo(tright)) {
_right = new CastExpr(_right, arg1);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,13 +21,12 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -35,7 +34,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
*/
final class RoundCall extends FunctionCall {
public RoundCall(QName fname, Vector arguments) {
public RoundCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -20,9 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.ArrayList;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.classfile.Field;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
@ -53,6 +51,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.dtm.Axis;
import java.util.ArrayList;
import java.util.List;
/**
@ -69,7 +69,7 @@ final class Sort extends Instruction implements Closure {
private String _lang; // bug! see 26869
private String _className = null;
private ArrayList<VariableRefBase> _closureVars = null;
private List<VariableRefBase> _closureVars = null;
private boolean _needsSortRecordFactory = false;
// -- Begin Closure interface --------------------
@ -233,7 +233,7 @@ final class Sort extends Instruction implements Closure {
public static void translateSortIterator(ClassGenerator classGen,
MethodGenerator methodGen,
Expression nodeSet,
Vector<Sort> sortObjects)
List<Sort> sortObjects)
{
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
@ -299,7 +299,7 @@ final class Sort extends Instruction implements Closure {
* Compiles code that instantiates a NodeSortRecordFactory object which
* will produce NodeSortRecord objects of a specific type.
*/
public static void compileSortRecordFactory(Vector<Sort> sortObjects,
public static void compileSortRecordFactory(List<Sort> sortObjects,
ClassGenerator classGen, MethodGenerator methodGen)
{
String sortRecordClass =
@ -308,7 +308,7 @@ final class Sort extends Instruction implements Closure {
boolean needsSortRecordFactory = false;
final int nsorts = sortObjects.size();
for (int i = 0; i < nsorts; i++) {
final Sort sort = sortObjects.elementAt(i);
final Sort sort = sortObjects.get(i);
needsSortRecordFactory |= sort._needsSortRecordFactory;
}
@ -339,7 +339,7 @@ final class Sort extends Instruction implements Closure {
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
final Sort sort = sortObjects.get(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateSortOrder(classGen, methodGen);
@ -354,7 +354,7 @@ final class Sort extends Instruction implements Closure {
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
final Sort sort = sortObjects.get(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateSortType(classGen, methodGen);
@ -369,7 +369,7 @@ final class Sort extends Instruction implements Closure {
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
final Sort sort = sortObjects.get(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateLang(classGen, methodGen);
@ -384,7 +384,7 @@ final class Sort extends Instruction implements Closure {
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
final Sort sort = sortObjects.get(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateCaseOrder(classGen, methodGen);
@ -416,7 +416,7 @@ final class Sort extends Instruction implements Closure {
+ "[" + STRING_SIG + ")V")));
// Initialize closure variables in sortRecordFactory
final ArrayList<VariableRefBase> dups = new ArrayList<>();
final List<VariableRefBase> dups = new ArrayList<>();
for (int j = 0; j < nsorts; j++) {
final Sort sort = (Sort) sortObjects.get(j);
@ -442,11 +442,11 @@ final class Sort extends Instruction implements Closure {
}
}
public static String compileSortRecordFactory(Vector<Sort> sortObjects,
public static String compileSortRecordFactory(List<Sort> sortObjects,
ClassGenerator classGen, MethodGenerator methodGen,
String sortRecordClass)
{
final XSLTC xsltc = (sortObjects.firstElement()).getXSLTC();
final XSLTC xsltc = (sortObjects.get(0)).getXSLTC();
final String className = xsltc.getHelperClassName();
final NodeSortRecordFactGenerator sortRecordFactory =
@ -461,7 +461,7 @@ final class Sort extends Instruction implements Closure {
// Add a new instance variable for each var in closure
final int nsorts = sortObjects.size();
final ArrayList<VariableRefBase> dups = new ArrayList<>();
final List<VariableRefBase> dups = new ArrayList<>();
for (int j = 0; j < nsorts; j++) {
final Sort sort = sortObjects.get(j);
@ -587,10 +587,10 @@ final class Sort extends Instruction implements Closure {
/**
* Create a new auxillary class extending NodeSortRecord.
*/
private static String compileSortRecord(Vector<Sort> sortObjects,
private static String compileSortRecord(List<Sort> sortObjects,
ClassGenerator classGen,
MethodGenerator methodGen) {
final XSLTC xsltc = sortObjects.firstElement().getXSLTC();
final XSLTC xsltc = sortObjects.get(0).getXSLTC();
final String className = xsltc.getHelperClassName();
// This generates a new class for handling this specific sort
@ -606,7 +606,7 @@ final class Sort extends Instruction implements Closure {
// Add a new instance variable for each var in closure
final int nsorts = sortObjects.size();
final ArrayList<VariableRefBase> dups = new ArrayList<>();
final List<VariableRefBase> dups = new ArrayList<>();
for (int j = 0; j < nsorts; j++) {
final Sort sort = sortObjects.get(j);
@ -673,7 +673,7 @@ final class Sort extends Instruction implements Closure {
/**
* Compiles a method that overloads NodeSortRecord.extractValueFromDOM()
*/
private static MethodGenerator compileExtract(Vector<Sort> sortObjects,
private static MethodGenerator compileExtract(List<Sort> sortObjects,
NodeSortRecordGenerator sortRecord,
ConstantPoolGen cpg,
String className) {
@ -715,7 +715,7 @@ final class Sort extends Instruction implements Closure {
// Append all the cases for the switch statment
for (int level = 0; level < levels; level++) {
match[level] = level;
final Sort sort = sortObjects.elementAt(level);
final Sort sort = sortObjects.get(level);
target[level] = il.append(NOP);
sort.translateSelect(sortRecord, extractMethod);
il.append(ARETURN);

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
@ -31,6 +29,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -45,7 +44,7 @@ final class StartsWithCall extends FunctionCall {
/**
* Create a starts-with() call - two arguments, both strings
*/
public StartsWithCall(QName fname, Vector arguments) {
public StartsWithCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,17 +21,15 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.ICONST;
import com.sun.org.apache.bcel.internal.generic.ILOAD;
import com.sun.org.apache.bcel.internal.generic.ISTORE;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.ISTORE;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
import com.sun.org.apache.bcel.internal.generic.NEW;
@ -44,6 +42,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.dtm.Axis;
import com.sun.org.apache.xml.internal.dtm.DTM;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -60,7 +59,7 @@ final class Step extends RelativeLocationPath {
/**
* A vector of predicates (filters) defined on this step - may be null
*/
private Vector _predicates;
private List<Predicate> _predicates;
/**
* Some simple predicates can be handled by this class (and not by the
@ -74,7 +73,7 @@ final class Step extends RelativeLocationPath {
*/
private int _nodeType;
public Step(int axis, int nodeType, Vector predicates) {
public Step(int axis, int nodeType, List<Predicate> predicates) {
_axis = axis;
_nodeType = nodeType;
_predicates = predicates;
@ -88,7 +87,7 @@ final class Step extends RelativeLocationPath {
if (_predicates != null) {
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Predicate exp = (Predicate)_predicates.elementAt(i);
final Predicate exp = _predicates.get(i);
exp.setParser(parser);
exp.setParent(this);
}
@ -119,14 +118,14 @@ final class Step extends RelativeLocationPath {
/**
* Returns the vector containing all predicates for this step.
*/
public Vector getPredicates() {
public List<Predicate> getPredicates() {
return _predicates;
}
/**
* Returns the vector containing all predicates for this step.
*/
public void addPredicates(Vector predicates) {
public void addPredicates(List<Predicate> predicates) {
if (_predicates == null) {
_predicates = predicates;
}
@ -213,9 +212,7 @@ final class Step extends RelativeLocationPath {
// Type check all predicates (expressions applied to the step)
if (_predicates != null) {
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Expression pred = (Expression)_predicates.elementAt(i);
for (Expression pred : _predicates) {
pred.typeCheck(stable);
}
}
@ -249,9 +246,9 @@ final class Step extends RelativeLocationPath {
final XSLTC xsltc = getParser().getXSLTC();
if (_nodeType >= DTM.NTYPES) {
final Vector ni = xsltc.getNamesIndex();
final List<String> ni = xsltc.getNamesIndex();
name = (String)ni.elementAt(_nodeType-DTM.NTYPES);
name = ni.get(_nodeType-DTM.NTYPES);
star = name.lastIndexOf('*');
}
@ -375,7 +372,7 @@ final class Step extends RelativeLocationPath {
translateStep(classGen, methodGen, predicateIndex);
}
else {
final Predicate predicate = (Predicate) _predicates.get(predicateIndex--);
final Predicate predicate = _predicates.get(predicateIndex--);
// Special case for predicates that can use the NodeValueIterator
// instead of an auxiliary class. Certain path/predicates pairs
@ -525,9 +522,7 @@ final class Step extends RelativeLocationPath {
final StringBuffer buffer = new StringBuffer("step(\"");
buffer.append(Axis.getNames(_axis)).append("\", ").append(_nodeType);
if (_predicates != null) {
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Predicate pred = (Predicate)_predicates.elementAt(i);
for (Expression pred : _predicates) {
buffer.append(", ").append(pred.toString());
}
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.classfile.Field;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
@ -54,6 +52,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.dtm.Axis;
import com.sun.org.apache.xml.internal.dtm.DTM;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -68,7 +67,7 @@ class StepPattern extends RelativePathPattern {
protected final int _axis;
protected final int _nodeType;
protected Vector _predicates;
protected List<Predicate> _predicates;
private Step _step = null;
private boolean _isEpsilon = false;
@ -76,7 +75,7 @@ class StepPattern extends RelativePathPattern {
private double _priority = Double.MAX_VALUE;
public StepPattern(int axis, int nodeType, Vector predicates) {
public StepPattern(int axis, int nodeType, List<Predicate> predicates) {
_axis = axis;
_nodeType = nodeType;
_predicates = predicates;
@ -85,9 +84,7 @@ class StepPattern extends RelativePathPattern {
public void setParser(Parser parser) {
super.setParser(parser);
if (_predicates != null) {
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Predicate exp = (Predicate)_predicates.elementAt(i);
for (Predicate exp : _predicates) {
exp.setParser(parser);
exp.setParent(this);
}
@ -110,7 +107,7 @@ class StepPattern extends RelativePathPattern {
return _isEpsilon && hasPredicates() == false;
}
public StepPattern setPredicates(Vector predicates) {
public StepPattern setPredicates(List<Predicate> predicates) {
_predicates = predicates;
return(this);
}
@ -149,7 +146,7 @@ class StepPattern extends RelativePathPattern {
public String toString() {
final StringBuffer buffer = new StringBuffer("stepPattern(\"");
buffer.append(Axis.getNames(_axis))
buffer.append(Axis.getNames(_axis))
.append("\", ")
.append(_isEpsilon ?
("epsilon{" + Integer.toString(_nodeType) + "}") :
@ -164,7 +161,7 @@ class StepPattern extends RelativePathPattern {
final int n = _predicates.size();
for (int i = 0; i < n && noContext; i++) {
Predicate pred = (Predicate) _predicates.elementAt(i);
Predicate pred = _predicates.get(i);
if (pred.isNthPositionFilter() ||
pred.hasPositionCall() ||
pred.hasLastCall())
@ -189,9 +186,7 @@ class StepPattern extends RelativePathPattern {
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
if (hasPredicates()) {
// Type check all the predicates (e -> position() = e)
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
final Predicate pred = (Predicate)_predicates.elementAt(i);
for (Predicate pred : _predicates) {
pred.typeCheck(stable);
}
@ -202,7 +197,7 @@ class StepPattern extends RelativePathPattern {
// Create an instance of Step to do the translation
if (_contextCase == SIMPLE_CONTEXT) {
Predicate pred = (Predicate)_predicates.elementAt(0);
Predicate pred = _predicates.get(0);
if (pred.isNthPositionFilter()) {
_contextCase = GENERAL_CONTEXT;
step = new Step(_axis, _nodeType, _predicates);
@ -210,9 +205,8 @@ class StepPattern extends RelativePathPattern {
step = new Step(_axis, _nodeType, null);
}
} else if (_contextCase == GENERAL_CONTEXT) {
final int len = _predicates.size();
for (int i = 0; i < len; i++) {
((Predicate)_predicates.elementAt(i)).dontOptimize();
for (Predicate pred : _predicates) {
pred.dontOptimize();
}
step = new Step(_axis, _nodeType, _predicates);
@ -292,9 +286,7 @@ class StepPattern extends RelativePathPattern {
}
// Compile the expressions within the predicates
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
Predicate pred = (Predicate)_predicates.elementAt(i);
for (Predicate pred : _predicates) {
Expression exp = pred.getExpr();
exp.translateDesynthesized(classGen, methodGen);
_trueList.append(exp._trueList);
@ -382,7 +374,7 @@ class StepPattern extends RelativePathPattern {
il.append(methodGen.storeCurrentNode());
// Translate the expression of the predicate
Predicate pred = (Predicate) _predicates.elementAt(0);
Predicate pred = _predicates.get(0);
Expression exp = pred.getExpr();
exp.translateDesynthesized(classGen, methodGen);

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,21 +21,20 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class StringCall extends FunctionCall {
public StringCall(QName fname, Vector arguments) {
public StringCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,21 +21,20 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import java.util.List;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
final class StringLengthCall extends FunctionCall {
public StringLengthCall(QName fname, Vector arguments) {
public StringLengthCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -53,13 +54,13 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Vector;
/**
* @author Jacek Ambroziak
@ -91,7 +92,7 @@ public final class Stylesheet extends SyntaxTreeNode {
/**
* Contains global variables and parameters defined in the stylesheet.
*/
private Vector _globals = new Vector();
private List<VariableBase> _globals = new ArrayList<>();
/**
* Used to cache the result returned by <code>hasLocalParams()</code>.
@ -106,13 +107,13 @@ public final class Stylesheet extends SyntaxTreeNode {
/**
* Contains all templates defined in this stylesheet
*/
private final Vector _templates = new Vector();
private final List<Template> _templates = new ArrayList<>();
/**
* Used to cache result of <code>getAllValidTemplates()</code>. Only
* set in top-level stylesheets that include/import other stylesheets.
*/
private Vector _allValidTemplates = null;
private List<Template> _allValidTemplates = null;
/**
* Counter to generate unique mode suffixes.
@ -149,7 +150,7 @@ public final class Stylesheet extends SyntaxTreeNode {
/**
* Array of all the stylesheets imported or included from this one.
*/
private Vector _includedStylesheets = null;
private List<Stylesheet> _includedStylesheets = null;
/**
* Import precendence for this stylesheet.
@ -370,8 +371,7 @@ public final class Stylesheet extends SyntaxTreeNode {
: 0;
for (int i = 0; i < inclImpCount; i++) {
int prec = ((Stylesheet)_includedStylesheets.elementAt(i))
.getMinimumDescendantPrecedence();
int prec = (_includedStylesheets.get(i)).getMinimumDescendantPrecedence();
if (prec < min) {
min = prec;
@ -420,9 +420,9 @@ public final class Stylesheet extends SyntaxTreeNode {
public void addIncludedStylesheet(Stylesheet child) {
if (_includedStylesheets == null) {
_includedStylesheets = new Vector();
_includedStylesheets = new ArrayList<>();
}
_includedStylesheets.addElement(child);
_includedStylesheets.add(child);
}
public void setSystemId(String systemId) {
@ -461,10 +461,10 @@ public final class Stylesheet extends SyntaxTreeNode {
*/
public boolean hasLocalParams() {
if (_hasLocalParams == null) {
Vector templates = getAllValidTemplates();
List<Template> templates = getAllValidTemplates();
final int n = templates.size();
for (int i = 0; i < n; i++) {
final Template template = (Template)templates.elementAt(i);
final Template template = templates.get(i);
if (template.hasParams()) {
_hasLocalParams = Boolean.TRUE;
return true;
@ -648,7 +648,7 @@ public final class Stylesheet extends SyntaxTreeNode {
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
final int count = _globals.size();
for (int i = 0; i < count; i++) {
final VariableBase var = (VariableBase)_globals.elementAt(i);
final VariableBase var = _globals.get(i);
var.typeCheck(stable);
}
return typeCheckContents(stable);
@ -711,7 +711,7 @@ public final class Stylesheet extends SyntaxTreeNode {
if (element instanceof Template) {
// Separate templates by modes
final Template template = (Template)element;
//_templates.addElement(template);
//_templates.add(template);
getMode(template.getModeName()).addTemplate(template);
}
// xsl:attribute-set
@ -770,7 +770,7 @@ public final class Stylesheet extends SyntaxTreeNode {
}
// Put the names array into the translet - used for dom/translet mapping
final Vector namesIndex = getXSLTC().getNamesIndex();
final List<String> namesIndex = getXSLTC().getNamesIndex();
int size = namesIndex.size();
String[] namesArray = new String[size];
String[] urisArray = new String[size];
@ -778,7 +778,7 @@ public final class Stylesheet extends SyntaxTreeNode {
int index;
for (int i = 0; i < size; i++) {
String encodedName = (String)namesIndex.elementAt(i);
String encodedName = namesIndex.get(i);
if ((index = encodedName.lastIndexOf(':')) > -1) {
urisArray[i] = encodedName.substring(0, index);
}
@ -859,7 +859,7 @@ public final class Stylesheet extends SyntaxTreeNode {
}
// Put the namespace names array into the translet
final Vector namespaces = getXSLTC().getNamespaceIndex();
final List<String> namespaces = getXSLTC().getNamespaceIndex();
staticConst.markChunkStart();
il.append(new PUSH(cpg, namespaces.size()));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
@ -870,7 +870,7 @@ public final class Stylesheet extends SyntaxTreeNode {
staticConst.markChunkEnd();
for (int i = 0; i < namespaces.size(); i++) {
final String ns = (String)namespaces.elementAt(i);
final String ns = namespaces.get(i);
staticConst.markChunkStart();
il.append(new GETSTATIC(namespaceArrayRef));
il.append(new PUSH(cpg, i));
@ -1050,7 +1050,7 @@ public final class Stylesheet extends SyntaxTreeNode {
current.setStart(il.append(new ISTORE(current.getIndex())));
// Create a new list containing variables/params + keys
Vector varDepElements = new Vector(_globals);
List<SyntaxTreeNode> varDepElements = new ArrayList<>(_globals);
Iterator<SyntaxTreeNode> elements = elements();
while (elements.hasNext()) {
SyntaxTreeNode element = elements.next();
@ -1065,7 +1065,7 @@ public final class Stylesheet extends SyntaxTreeNode {
// Translate vars/params and keys in the right order
final int count = varDepElements.size();
for (int i = 0; i < count; i++) {
final TopLevelElement tle = (TopLevelElement) varDepElements.elementAt(i);
final TopLevelElement tle = (TopLevelElement) varDepElements.get(i);
tle.translate(classGen, toplevel);
if (tle instanceof Key) {
final Key key = (Key) tle;
@ -1074,7 +1074,7 @@ public final class Stylesheet extends SyntaxTreeNode {
}
// Compile code for other top-level elements
Vector whitespaceRules = new Vector();
List<Whitespace.WhitespaceRule> whitespaceRules = new ArrayList<>();
elements = elements();
while (elements.hasNext()) {
SyntaxTreeNode element = elements.next();
@ -1115,27 +1115,15 @@ public final class Stylesheet extends SyntaxTreeNode {
* compatibility with Xalan interpretive, that type of dependency is
* allowed and, therefore, consider to determine the partial order.
*/
private Vector resolveDependencies(Vector input) {
/* DEBUG CODE - INGORE
for (int i = 0; i < input.size(); i++) {
final TopLevelElement e = (TopLevelElement) input.elementAt(i);
System.out.println("e = " + e + " depends on:");
Vector dep = e.getDependencies();
for (int j = 0; j < (dep != null ? dep.size() : 0); j++) {
System.out.println("\t" + dep.elementAt(j));
}
}
System.out.println("=================================");
*/
Vector result = new Vector();
private List<SyntaxTreeNode> resolveDependencies(List<SyntaxTreeNode> input) {
List<SyntaxTreeNode> result = new ArrayList<>();
while (input.size() > 0) {
boolean changed = false;
for (int i = 0; i < input.size(); ) {
final TopLevelElement vde = (TopLevelElement) input.elementAt(i);
final Vector dep = vde.getDependencies();
final TopLevelElement vde = (TopLevelElement) input.get(i);
final List<SyntaxTreeNode> dep = vde.getDependencies();
if (dep == null || result.containsAll(dep)) {
result.addElement(vde);
result.add(vde);
input.remove(i);
changed = true;
}
@ -1153,14 +1141,6 @@ public final class Stylesheet extends SyntaxTreeNode {
}
}
/* DEBUG CODE - INGORE
System.out.println("=================================");
for (int i = 0; i < result.size(); i++) {
final TopLevelElement e = (TopLevelElement) result.elementAt(i);
System.out.println("e = " + e);
}
*/
return result;
}
@ -1374,8 +1354,8 @@ public final class Stylesheet extends SyntaxTreeNode {
final String pattern = "`aload'`pop'`instruction'";
final InstructionList il = methodGen.getInstructionList();
final InstructionFinder find = new InstructionFinder(il);
for(Iterator iter=find.search(pattern); iter.hasNext(); ) {
InstructionHandle[] match = (InstructionHandle[])iter.next();
for(Iterator<InstructionHandle[]> iter=find.search(pattern); iter.hasNext(); ) {
InstructionHandle[] match = iter.next();
try {
il.delete(match[0], match[1]);
}
@ -1386,12 +1366,12 @@ public final class Stylesheet extends SyntaxTreeNode {
}
public int addParam(Param param) {
_globals.addElement(param);
_globals.add(param);
return _globals.size() - 1;
}
public int addVariable(Variable global) {
_globals.addElement(global);
_globals.add(global);
return _globals.size() - 1;
}
@ -1410,11 +1390,11 @@ public final class Stylesheet extends SyntaxTreeNode {
return _className;
}
public Vector getTemplates() {
public List<Template> getTemplates() {
return _templates;
}
public Vector getAllValidTemplates() {
public List<Template> getAllValidTemplates() {
// Return templates if no imported/included stylesheets
if (_includedStylesheets == null) {
return _templates;
@ -1422,11 +1402,9 @@ public final class Stylesheet extends SyntaxTreeNode {
// Is returned value cached?
if (_allValidTemplates == null) {
Vector templates = new Vector();
templates.addAll(_templates);
int size = _includedStylesheets.size();
for (int i = 0; i < size; i++) {
Stylesheet included =(Stylesheet)_includedStylesheets.elementAt(i);
List<Template> templates = new ArrayList<>();
templates.addAll(_templates);
for (Stylesheet included : _includedStylesheets) {
templates.addAll(included.getAllValidTemplates());
}
//templates.addAll(_templates);
@ -1442,6 +1420,6 @@ public final class Stylesheet extends SyntaxTreeNode {
}
protected void addTemplate(Template template) {
_templates.addElement(template);
_templates.add(template);
}
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -24,11 +25,12 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.Vector;
/**
* @author Jacek Ambroziak
@ -39,7 +41,7 @@ final class SymbolTable {
// These maps are used for all stylesheets
private final Map<String, Stylesheet> _stylesheets = new HashMap<>();
private final Map<String, Vector> _primops = new HashMap<>();
private final Map<String, List<MethodType>> _primops = new HashMap<>();
// These maps are used for some stylesheets
private Map<String, VariableBase> _variables = null;
@ -138,18 +140,18 @@ final class SymbolTable {
* is prepended.
*/
public void addPrimop(String name, MethodType mtype) {
Vector methods = _primops.get(name);
List<MethodType> methods = _primops.get(name);
if (methods == null) {
_primops.put(name, methods = new Vector());
_primops.put(name, methods = new ArrayList<>());
}
methods.addElement(mtype);
methods.add(mtype);
}
/**
* Lookup a primitive operator or function in the symbol table by
* prepending the prefix <tt>PrimopPrefix</tt>.
*/
public Vector lookupPrimop(String name) {
public List<MethodType> lookupPrimop(String name) {
return _primops.get(name);
}
@ -272,7 +274,7 @@ final class SymbolTable {
*/
public void pushExcludedNamespacesContext() {
if (_excludedURIStack == null) {
_excludedURIStack = new Stack();
_excludedURIStack = new Stack<>();
}
_excludedURIStack.push(_excludedURI);
_excludedURI = null;

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -20,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
@ -34,6 +33,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
import java.util.ArrayList;
import java.util.List;
@ -60,7 +60,7 @@ public final class Template extends TopLevelElement {
// The list of parameters in this template. This is only used
// for simple named templates.
private Vector<Param> _parameters = new Vector<>();
private List<Param> _parameters = new ArrayList<>();
public boolean hasParams() {
return _parameters.size() > 0;
@ -79,10 +79,10 @@ public final class Template extends TopLevelElement {
}
public void addParameter(Param param) {
_parameters.addElement(param);
_parameters.add(param);
}
public Vector<Param> getParameters() {
public List<Param> getParameters() {
return _parameters;
}
@ -328,7 +328,7 @@ public final class Template extends TopLevelElement {
// Update load/store instructions to access Params from the stack
for (int i = 0; i < numParams; i++) {
Param param = (Param)_parameters.elementAt(i);
Param param = _parameters.get(i);
param.setLoadInstruction(namedMethodGen.loadParameter(i));
param.setStoreInstruction(namedMethodGen.storeParameter(i));
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -28,9 +29,9 @@ import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import java.util.Dictionary;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Vector;
/**
* A test sequence is a sequence of patterns that
@ -56,10 +57,10 @@ final class TestSeq {
private int _kernelType;
/**
* Vector of all patterns in the test sequence. May include
* ArrayList of all patterns in the test sequence. May include
* patterns with "*", "@*" or "node()" kernel.
*/
private Vector _patterns = null;
private List<LocationPathPattern> _patterns = null;
/**
* A reference to the Mode object.
@ -84,11 +85,11 @@ final class TestSeq {
/**
* Creates a new test sequence given a set of patterns and a mode.
*/
public TestSeq(Vector patterns, Mode mode) {
public TestSeq(List<LocationPathPattern> patterns, Mode mode) {
this(patterns, -2, mode);
}
public TestSeq(Vector patterns, int kernelType, Mode mode) {
public TestSeq(List<LocationPathPattern> patterns, int kernelType, Mode mode) {
_patterns = patterns;
_kernelType = kernelType;
_mode = mode;
@ -104,8 +105,7 @@ final class TestSeq {
final StringBuffer result = new StringBuffer();
for (int i = 0; i < count; i++) {
final LocationPathPattern pattern =
(LocationPathPattern) _patterns.elementAt(i);
final LocationPathPattern pattern = _patterns.get(i);
if (i == 0) {
result.append("Testseq for kernel ").append(_kernelType)
@ -131,8 +131,8 @@ final class TestSeq {
* of the default pattern.
*/
public double getPriority() {
final Template template = (_patterns.size() == 0) ? _default
: ((Pattern) _patterns.elementAt(0)).getTemplate();
final Template template = (_patterns.isEmpty()) ? _default
: ((Pattern) _patterns.get(0)).getTemplate();
return template.getPriority();
}
@ -141,8 +141,8 @@ final class TestSeq {
* this test sequence.
*/
public int getPosition() {
final Template template = (_patterns.size() == 0) ? _default
: ((Pattern) _patterns.elementAt(0)).getTemplate();
final Template template = (_patterns.isEmpty()) ? _default
: ((Pattern) _patterns.get(0)).getTemplate();
return template.getPosition();
}
@ -152,13 +152,9 @@ final class TestSeq {
* finds a patterns that is fully reduced.
*/
public void reduce() {
final Vector newPatterns = new Vector();
final int count = _patterns.size();
for (int i = 0; i < count; i++) {
final LocationPathPattern pattern =
(LocationPathPattern)_patterns.elementAt(i);
final List<LocationPathPattern> newPatterns = new ArrayList<>();
for (LocationPathPattern pattern : _patterns) {
// Reduce this pattern
pattern.reduceKernelPattern();
@ -168,7 +164,7 @@ final class TestSeq {
break; // Ignore following patterns
}
else {
newPatterns.addElement(pattern);
newPatterns.add(pattern);
}
}
_patterns = newPatterns;
@ -183,9 +179,7 @@ final class TestSeq {
if (_default != null) {
templates.put(_default, this);
}
for (int i = 0; i < _patterns.size(); i++) {
final LocationPathPattern pattern =
(LocationPathPattern)_patterns.elementAt(i);
for (LocationPathPattern pattern : _patterns) {
templates.put(pattern.getTemplate(), this);
}
}
@ -204,7 +198,7 @@ final class TestSeq {
* Returns pattern n in this test sequence
*/
private LocationPathPattern getPattern(int n) {
return (LocationPathPattern)_patterns.elementAt(n);
return _patterns.get(n);
}
/**

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@ -30,6 +28,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.ArrayList;
import java.util.List;
class TopLevelElement extends SyntaxTreeNode {
@ -37,7 +37,7 @@ class TopLevelElement extends SyntaxTreeNode {
* List of dependencies with other variables, parameters or
* keys defined at the top level.
*/
protected Vector _dependencies = null;
protected List<SyntaxTreeNode> _dependencies = null;
/**
* Type check all the children of this node.
@ -80,10 +80,10 @@ class TopLevelElement extends SyntaxTreeNode {
*/
public void addDependency(TopLevelElement other) {
if (_dependencies == null) {
_dependencies = new Vector();
_dependencies = new ArrayList<>();
}
if (!_dependencies.contains(other)) {
_dependencies.addElement(other);
_dependencies.add(other);
}
}
@ -91,7 +91,7 @@ class TopLevelElement extends SyntaxTreeNode {
* Get the list of dependencies with other top-level elements
* like variables, parameteres or keys.
*/
public Vector getDependencies() {
public List<SyntaxTreeNode> getDependencies() {
return _dependencies;
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -66,7 +66,7 @@ final class UnaryOpExpr extends Expression {
tleft));
if (ptype != null) {
final Type arg1 = (Type) ptype.argsType().elementAt(0);
final Type arg1 = ptype.argsType().get(0);
if (!arg1.identicalTo(tleft)) {
_left = new CastExpr(_left, arg1);
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
@ -35,6 +33,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xml.internal.dtm.Axis;
import com.sun.org.apache.xml.internal.dtm.DTM;
import java.util.ArrayList;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -57,7 +57,7 @@ final class UnionPathExpr extends Expression {
public void setParser(Parser parser) {
super.setParser(parser);
// find all expressions in this Union
final Vector components = new Vector();
final List<Expression> components = new ArrayList<>();
flatten(components);
final int size = components.size();
_components = (Expression[])components.toArray(new Expression[size]);
@ -95,14 +95,14 @@ final class UnionPathExpr extends Expression {
return "union(" + _pathExpr + ", " + _rest + ')';
}
private void flatten(Vector components) {
components.addElement(_pathExpr);
private void flatten(List<Expression> components) {
components.add(_pathExpr);
if (_rest != null) {
if (_rest instanceof UnionPathExpr) {
((UnionPathExpr)_rest).flatten(components);
}
else {
components.addElement(_rest);
components.add(_rest);
}
}
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,8 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
@ -31,6 +29,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -40,7 +39,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
final class UnparsedEntityUriCall extends FunctionCall {
private Expression _entity;
public UnparsedEntityUriCall(QName fname, Vector arguments) {
public UnparsedEntityUriCall(QName fname, List<Expression> arguments) {
super(fname, arguments);
_entity = argument();
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,19 +24,17 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.PUSH;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.ArrayList;
import java.util.List;
/**
@ -43,7 +42,7 @@ import java.util.List;
*/
final class UnsupportedElement extends SyntaxTreeNode {
private Vector _fallbacks = null;
private List<SyntaxTreeNode> _fallbacks = null;
private ErrorMsg _message = null;
private boolean _isExtension = false;
@ -94,9 +93,9 @@ final class UnsupportedElement extends SyntaxTreeNode {
fallback.activate();
fallback.parseContents(parser);
if (_fallbacks == null) {
_fallbacks = new Vector();
_fallbacks = new ArrayList<>();
}
_fallbacks.addElement(child);
_fallbacks.add(child);
}
}
}
@ -116,7 +115,7 @@ final class UnsupportedElement extends SyntaxTreeNode {
if (_fallbacks != null) {
int count = _fallbacks.size();
for (int i = 0; i < count; i++) {
Fallback fallback = (Fallback)_fallbacks.elementAt(i);
Fallback fallback = (Fallback)_fallbacks.get(i);
fallback.typeCheck(stable);
}
}
@ -130,7 +129,7 @@ final class UnsupportedElement extends SyntaxTreeNode {
if (_fallbacks != null) {
int count = _fallbacks.size();
for (int i = 0; i < count; i++) {
Fallback fallback = (Fallback)_fallbacks.elementAt(i);
Fallback fallback = (Fallback)_fallbacks.get(i);
fallback.translate(classGen, methodGen);
}
}

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,9 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.StringTokenizer;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
@ -32,6 +29,9 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* @author Jacek Ambroziak
@ -45,7 +45,7 @@ final class UseAttributeSets extends Instruction {
"";
// Contains the names of all references attribute sets
private final Vector _sets = new Vector(2);
private final List<QName> _sets = new ArrayList<>(2);
/**
* Constructur - define initial attribute sets to use
@ -87,10 +87,7 @@ final class UseAttributeSets extends Instruction {
final InstructionList il = methodGen.getInstructionList();
final SymbolTable symbolTable = getParser().getSymbolTable();
// Go through each attribute set and generate a method call
for (int i=0; i<_sets.size(); i++) {
// Get the attribute set name
final QName name = (QName)_sets.elementAt(i);
for (QName name : _sets) {
// Get the AttributeSet reference from the symbol table
final AttributeSet attrs = symbolTable.lookupAttributeSet(name);
// Compile the call to the set's method if the set exists
@ -102,7 +99,7 @@ final class UseAttributeSets extends Instruction {
il.append(methodGen.loadHandler());
il.append(methodGen.loadCurrentNode());
final int method = cpg.addMethodref(classGen.getClassName(),
methodName, ATTR_SET_SIG);
methodName, ATTR_SET_SIG);
il.append(new INVOKESPECIAL(method));
}
// Generate an error if the attribute set does not exist

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -20,15 +21,13 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.Instruction;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.Instruction;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.generic.PUSH;
@ -40,6 +39,8 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
import java.util.ArrayList;
import java.util.List;
/**
* @author Jacek Ambroziak
@ -61,7 +62,7 @@ class VariableBase extends TopLevelElement {
protected String select; // Textual repr. of variable expr.
// References to this variable (when local)
protected Vector<VariableRefBase> _refs = new Vector<>(2);
protected List<VariableRefBase> _refs = new ArrayList<>(2);
// Used to make sure parameter field is not added twice
protected boolean _ignore = false;
@ -78,7 +79,7 @@ class VariableBase extends TopLevelElement {
* expression contains a reference to this variable.
*/
public void addReference(VariableRefBase vref) {
_refs.addElement(vref);
_refs.add(vref);
}
/**

View File

@ -1,6 +1,6 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -21,9 +21,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.StringTokenizer;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@ -40,6 +37,9 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* @author Morten Jorgensen
@ -63,7 +63,7 @@ final class Whitespace extends TopLevelElement {
/**
* Auxillary class for encapsulating a single strip/preserve rule
*/
private final static class WhitespaceRule {
final static class WhitespaceRule {
private final int _action;
private String _namespace; // Should be replaced by NS type (int)
private String _element; // Should be replaced by node type (int)
@ -174,8 +174,8 @@ final class Whitespace extends TopLevelElement {
* De-tokenize the elements listed in the 'elements' attribute and
* instanciate a set of strip/preserve rules.
*/
public Vector getRules() {
final Vector rules = new Vector();
public List<WhitespaceRule> getRules() {
final List<WhitespaceRule> rules = new ArrayList<>();
// Go through each element and instanciate strip/preserve-object
final StringTokenizer list = new StringTokenizer(_elementList);
while (list.hasMoreElements()) {
@ -191,35 +191,33 @@ final class Whitespace extends TopLevelElement {
* Scans through the rules vector and looks for a rule of higher
* priority that contradicts the current rule.
*/
private static WhitespaceRule findContradictingRule(Vector rules,
private static WhitespaceRule findContradictingRule(List<WhitespaceRule> rules,
WhitespaceRule rule) {
for (int i = 0; i < rules.size(); i++) {
// Get the next rule in the prioritized list
WhitespaceRule currentRule = (WhitespaceRule)rules.elementAt(i);
for (WhitespaceRule currentRule : rules) {
// We only consider rules with higher priority
if (currentRule == rule) {
return null;
}
/*
* See if there is a contradicting rule with higher priority.
* If the rules has the same action then this rule is redundant,
* if they have different action then this rule will never win.
*/
* See if there is a contradicting rule with higher priority.
* If the rules has the same action then this rule is redundant,
* if they have different action then this rule will never win.
*/
switch (currentRule.getStrength()) {
case RULE_ALL:
return currentRule;
case RULE_ELEMENT:
if (!rule.getElement().equals(currentRule.getElement())) {
break;
}
// intentional fall-through
case RULE_NAMESPACE:
if (rule.getNamespace().equals(currentRule.getNamespace())) {
case RULE_ALL:
return currentRule;
}
break;
case RULE_ELEMENT:
if (!rule.getElement().equals(currentRule.getElement())) {
break;
}
// intentional fall-through
case RULE_NAMESPACE:
if (rule.getNamespace().equals(currentRule.getNamespace())) {
return currentRule;
}
break;
}
}
return null;
@ -230,7 +228,7 @@ final class Whitespace extends TopLevelElement {
* Orders a set or rules by priority, removes redundant rules and rules
* that are shadowed by stronger, contradicting rules.
*/
private static int prioritizeRules(Vector rules) {
private static int prioritizeRules(List<WhitespaceRule> rules) {
WhitespaceRule currentRule;
int defaultAction = PRESERVE_SPACE;
@ -242,20 +240,20 @@ final class Whitespace extends TopLevelElement {
// elements and signal that all whitespaces should be preserved
boolean strip = false;
for (int i = 0; i < rules.size(); i++) {
currentRule = (WhitespaceRule)rules.elementAt(i);
currentRule = rules.get(i);
if (currentRule.getAction() == STRIP_SPACE) {
strip = true;
}
}
// Return with default action: PRESERVE_SPACE
if (!strip) {
rules.removeAllElements();
rules.clear();
return PRESERVE_SPACE;
}
// Remove all rules that are contradicted by rules with higher priority
for (int idx = 0; idx < rules.size(); ) {
currentRule = (WhitespaceRule)rules.elementAt(idx);
currentRule = rules.get(idx);
// Remove this single rule if it has no purpose
if (findContradictingRule(rules,currentRule) != null) {
@ -266,7 +264,7 @@ final class Whitespace extends TopLevelElement {
if (currentRule.getStrength() == RULE_ALL) {
defaultAction = currentRule.getAction();
for (int i = idx; i < rules.size(); i++) {
rules.removeElementAt(i);
rules.remove(i);
}
}
// Skip to next rule (there might not be any)...
@ -275,16 +273,16 @@ final class Whitespace extends TopLevelElement {
}
// The rules vector could be empty if first rule has strength RULE_ALL
if (rules.size() == 0) {
if (rules.isEmpty()) {
return defaultAction;
}
// Now work backwards and strip away all rules that have the same
// action as the default rule (no reason the check them at the end).
do {
currentRule = (WhitespaceRule)rules.lastElement();
currentRule = rules.get(rules.size() - 1);
if (currentRule.getAction() == defaultAction) {
rules.removeElementAt(rules.size() - 1);
rules.remove(rules.size() - 1);
}
else {
break;
@ -330,7 +328,7 @@ final class Whitespace extends TopLevelElement {
/**
* Compiles the predicate method
*/
private static void compilePredicate(Vector rules,
private static void compilePredicate(List<WhitespaceRule> rules,
int defaultAction,
ClassGenerator classGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
@ -363,7 +361,7 @@ final class Whitespace extends TopLevelElement {
// Traverse all strip/preserve rules
for (int i = 0; i<rules.size(); i++) {
// Get the next rule in the prioritised list
WhitespaceRule rule = (WhitespaceRule)rules.elementAt(i);
WhitespaceRule rule = rules.get(i);
// Returns the namespace for a node in the DOM
final int gns = cpg.addInterfaceMethodref(DOM_INTF,
@ -467,7 +465,7 @@ final class Whitespace extends TopLevelElement {
* - STRIP_SPACE (always strip whitespace text-nodes)
* - PRESERVE_SPACE (always preserve whitespace text-nodes)
*/
public static int translateRules(Vector rules,
public static int translateRules(List<WhitespaceRule> rules,
ClassGenerator classGen) {
// Get the core rules in prioritized order
final int defaultAction = prioritizeRules(rules);
@ -485,7 +483,7 @@ final class Whitespace extends TopLevelElement {
/**
* Sorts a range of rules with regard to PRIORITY only
*/
private static void quicksort(Vector rules, int p, int r) {
private static void quicksort(List<WhitespaceRule> rules, int p, int r) {
while (p < r) {
final int q = partition(rules, p, r);
quicksort(rules, p, q);
@ -496,18 +494,18 @@ final class Whitespace extends TopLevelElement {
/**
* Used with quicksort method above
*/
private static int partition(Vector rules, int p, int r) {
final WhitespaceRule x = (WhitespaceRule)rules.elementAt((p+r) >>> 1);
private static int partition(List<WhitespaceRule> rules, int p, int r) {
final WhitespaceRule x = rules.get((p+r) >>> 1);
int i = p - 1, j = r + 1;
while (true) {
while (x.compareTo((WhitespaceRule)rules.elementAt(--j)) < 0) {
while (x.compareTo(rules.get(--j)) < 0) {
}
while (x.compareTo((WhitespaceRule)rules.elementAt(++i)) > 0) {
while (x.compareTo(rules.get(++i)) > 0) {
}
if (i < j) {
final WhitespaceRule tmp = (WhitespaceRule)rules.elementAt(i);
rules.setElementAt(rules.elementAt(j), i);
rules.setElementAt(tmp, j);
final WhitespaceRule tmp = rules.get(i);
rules.set(i, rules.get(j));
rules.set(j, tmp);
}
else {
return j;

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Sep 2017
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -36,12 +36,11 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Vector;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
@ -87,19 +86,19 @@ public final class XSLTC {
// Name index tables
private int _nextGType; // Next available element type
private Vector _namesIndex; // Index of all registered QNames
private List<String> _namesIndex; // Index of all registered QNames
private Map<String, Integer> _elements; // Map of all registered elements
private Map<String, Integer> _attributes; // Map of all registered attributes
// Namespace index tables
private int _nextNSType; // Next available namespace type
private Vector _namespaceIndex; // Index of all registered namespaces
private List<String> _namespaceIndex; // Index of all registered namespaces
private Map<String, Integer> _namespaces; // Map of all registered namespaces
private Map<String, Integer> _namespacePrefixes;// Map of all registered namespace prefixes
// All literal text in the stylesheet
private ArrayList<StringBuilder> m_characterData;
private List<StringBuilder> m_characterData;
// These define the various methods for outputting the translet
public static final int JAR_OUTPUT = 1;
@ -117,8 +116,8 @@ public final class XSLTC {
private File _destDir = null; // -d <directory-name>
private int _outputType = BYTEARRAY_OUTPUT; // by default
private ArrayList<ByteArrayOutputStream> _classes;
private ArrayList<JavaClass> _bcelClasses;
private List<ByteArrayOutputStream> _classes;
private List<JavaClass> _bcelClasses;
private boolean _callsNodeset = false;
private boolean _multiDocument = false;
private boolean _hasIdCall = false;
@ -309,8 +308,8 @@ public final class XSLTC {
* The filtering of function types (external,internal) takes place in FunctionCall class
*
*/
Class loadExternalFunction(String name) throws ClassNotFoundException {
Class loaded = null;
Class<?> loadExternalFunction(String name) throws ClassNotFoundException {
Class<?> loaded = null;
//Check if the function is not loaded already
if (_externalExtensionFunctions.containsKey(name)) {
loaded = _externalExtensionFunctions.get(name);
@ -322,7 +321,7 @@ public final class XSLTC {
throw new ClassNotFoundException(name);
}
//Return loaded class
return (Class) loaded;
return loaded;
}
/*
@ -342,8 +341,8 @@ public final class XSLTC {
_attributes = new HashMap<>();
_namespaces = new HashMap<>();
_namespaces.put("", _nextNSType);
_namesIndex = new Vector(128);
_namespaceIndex = new Vector(32);
_namesIndex = new ArrayList<>(128);
_namespaceIndex = new ArrayList<>(32);
_namespacePrefixes = new HashMap<>();
_stylesheet = null;
_parser.init();
@ -458,7 +457,7 @@ public final class XSLTC {
*/
public boolean compile(InputSource input, String name) {
try {
// Reset globals in case we're called by compile(Vector v);
// Reset globals in case we're called by compile(ArrayList v);
reset();
// The systemId may not be set, so we'll have to check the URL
@ -531,11 +530,11 @@ public final class XSLTC {
}
/**
* Compiles a set of stylesheets pointed to by a Vector of URLs
* @param stylesheets A Vector containing URLs pointing to the stylesheets
* Compiles a set of stylesheets pointed to by a List of URLs
* @param stylesheets A List containing URLs pointing to the stylesheets
* @return 'true' if the compilation was successful
*/
public boolean compile(Vector stylesheets) {
public boolean compile(List<URL> stylesheets) {
// Get the number of stylesheets (ie. URLs) in the vector
final int count = stylesheets.size();
@ -545,21 +544,13 @@ public final class XSLTC {
// Special handling needed if the URL count is one, becuase the
// _className global must not be reset if it was set explicitly
if (count == 1) {
final Object url = stylesheets.firstElement();
if (url instanceof URL)
return compile((URL)url);
else
return false;
return compile(stylesheets.get(0));
}
else {
// Traverse all elements in the vector and compile
final Enumeration urls = stylesheets.elements();
while (urls.hasMoreElements()) {
for (URL url : stylesheets) {
_className = null; // reset, so that new name will be computed
final Object url = urls.nextElement();
if (url instanceof URL) {
if (!compile((URL)url)) return false;
}
if (!compile(url)) return false;
}
}
return true;
@ -623,7 +614,7 @@ public final class XSLTC {
* Get a list of all compile error messages
* @return A List containing all compile error messages
*/
public ArrayList<ErrorMsg> getErrors() {
public List<ErrorMsg> getErrors() {
return _parser.getErrors();
}
@ -631,7 +622,7 @@ public final class XSLTC {
* Get a list of all compile warning messages
* @return A List containing all compile error messages
*/
public ArrayList<ErrorMsg> getWarnings() {
public List<ErrorMsg> getWarnings() {
return _parser.getWarnings();
}
@ -685,7 +676,7 @@ public final class XSLTC {
/**
* Set the class name for the generated translet. This class name is
* overridden if multiple stylesheets are compiled in one go using the
* compile(Vector urls) method.
* compile(List urls) method.
* @param className The name to assign to the translet class
*/
public void setClassName(String className) {
@ -791,9 +782,9 @@ public final class XSLTC {
final String uri = name.getNamespace();
final String local = "@"+name.getLocalPart();
if ((uri != null) && (!uri.equals("")))
_namesIndex.addElement(uri+":"+local);
_namesIndex.add(uri+":"+local);
else
_namesIndex.addElement(local);
_namesIndex.add(local);
if (name.getLocalPart().equals("*")) {
registerNamespace(name.getNamespace());
}
@ -810,7 +801,7 @@ public final class XSLTC {
Integer code = _elements.get(name.toString());
if (code == null) {
_elements.put(name.toString(), code = _nextGType++);
_namesIndex.addElement(name.toString());
_namesIndex.add(name.toString());
}
if (name.getLocalPart().equals("*")) {
registerNamespace(name.getNamespace());
@ -832,9 +823,9 @@ public final class XSLTC {
final String uri = name.getNamespace();
if ((uri != null) && (!uri.equals(""))){
// namespace::ext2:ped2 will be made empty in TypedNamespaceIterator
_namesIndex.addElement("?");
_namesIndex.add("?");
} else{
_namesIndex.addElement("?"+name.getLocalPart());
_namesIndex.add("?"+name.getLocalPart());
}
}
return code.intValue();
@ -849,7 +840,7 @@ public final class XSLTC {
if (code == null) {
code = _nextNSType++;
_namespaces.put(namespaceURI,code);
_namespaceIndex.addElement(namespaceURI);
_namespaceIndex.add(namespaceURI);
}
return code;
}
@ -878,11 +869,11 @@ public final class XSLTC {
return _attributeSetSerial++;
}
public Vector getNamesIndex() {
public List<String> getNamesIndex() {
return _namesIndex;
}
public Vector getNamespaceIndex() {
public List<String> getNamespaceIndex() {
return _namespaceIndex;
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,8 +24,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
import java.util.Vector;
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@ -40,7 +39,6 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.serializer.ElemDesc;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xml.internal.utils.XML11Char;

Some files were not shown because too many files have changed in this diff Show More