diff --git a/.hgtags b/.hgtags index 001205086b5..8f0fcecb739 100644 --- a/.hgtags +++ b/.hgtags @@ -1,3 +1,13 @@ +d3e973f1809606c67412361041ad197e50fe8cec jdk-9+166 +3965b747cfe1e6cbd66b8739da5a1ea6ec6985e9 jdk-9+165 +d16aebbb56d37f12e0c0b0a4fb427db65e1fb1a8 jdk-9+162 +18c41483a082e097ac2f5f983c1226ed94aa4215 jdk-9+163 +32db52c675e7d5bc413605d2e89b68b608b19be0 jdk-9+164 +fd1497902bbe3aa24b21f270ecdcb8de5f7aa9ac jdk-9+159 +6aa8be0c4e054fe8b3ab016ae00d16d680f92145 jdk-9+160 +f6883b1a5a6478437cd4181c4bd45328ab24feaf jdk-9+161 +fa3e76b477829afc4476f0b725cfaa440a6fd917 jdk-9+157 +b5015f742ba648184bb7fc547197bd33ebfde30d jdk-9+158 1cc8dd79fd1cd13d36b385196271a29632c67c3b jdk7-b24 bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25 5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26 @@ -399,3 +409,9 @@ d7034ff7f8e257e81c9f95c7785dd4eaaa3c2afc jdk-9+153 8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0 45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154 f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155 +06bce0388880b5ff8e040e4a9d72a3ea11dac321 jdk-9+156 +74116beae88a8f17a80301aa6c83865c82f10ece jdk-10+1 +4a79ad46e578112fce68f1af9dd931025cc235cb jdk-10+2 +d1cab6c7e608479be4ebfad48a25b0ed48600f62 jdk-10+3 +02253db2ace1422f576f58502fc7831ead77424b jdk-10+4 +f113ce12fe24fbd24acf02711372d9f1e1c12426 jdk-10+5 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 3d81f131af0..b5a82c4e32a 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -396,5 +396,17 @@ b119012d1c2ab2570fe8718633840d0c1f1f441d jdk-9+149 71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151 ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152 816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153 +8d22611ffb6540bc1ace64a00c048c8b82d8c69a jdk-10+0 8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154 688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155 +783ec7542cf7154e5d2b87f55bb97d28f81e9ada jdk-9+156 +4eb77fb98952dc477a4229575c81d2263a9ce711 jdk-9+157 +a4087bc10a88a43ea3ad0919b5b4af1c86977221 jdk-9+158 +fe8466adaef8178dba94be53c789a0aaa87d13bb jdk-9+159 +4d29ee32d926ebc960072d51a3bc558f95c1cbad jdk-9+160 +cda60babd152d889aba4d8f20a8f643ab151d3de jdk-9+161 +21b063d75b3edbffb9bebc8872d990920c4ae1e5 jdk-9+162 +c38c6b270ccc8e2b86d1631bcf42248241b54d2c jdk-9+163 +7810f75d016a52e32295c4233009de5ca90e31af jdk-9+164 +aff4f339acd40942d3dab499846b52acd87b3af1 jdk-9+165 +ba5b16c9c6d80632b61959a33d424b1c3398ce62 jdk-9+166 diff --git a/.jcheck/conf b/.jcheck/conf index 5c6f62dc12c..b2581358014 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1 +1 @@ -project=jdk9 +project=jdk10 diff --git a/README b/README index 477b38887fc..537dea30aec 100644 --- a/README +++ b/README @@ -1,40 +1,10 @@ -README: - This file should be located at the top of the OpenJDK Mercurial root - repository. A full OpenJDK repository set (forest) should also include - the following 7 nested repositories: - "jdk", "hotspot", "langtools", "nashorn", "corba", "jaxws" and "jaxp". +Welcome to OpenJDK! +=================== - The root repository can be obtained with something like: - hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9 +For information about building OpenJDK, including how to fully retrieve all +source code, please see either of these: - You can run the get_source.sh script located in the root repository to get - the other needed repositories: - cd openjdk9 && sh ./get_source.sh + * common/doc/building.html (html version) + * common/doc/building.md (markdown version) - People unfamiliar with Mercurial should read the first few chapters of - the Mercurial book: http://hgbook.red-bean.com/read/ - - See http://openjdk.java.net/ for more information about OpenJDK. - -Simple Build Instructions: - - 0. Get the necessary system software/packages installed on your system, see - http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html - - 1. If you don't have a jdk8 or newer jdk, download and install it from - http://java.sun.com/javase/downloads/index.jsp - Add the /bin directory of this installation to your PATH environment - variable. - - 2. Configure the build: - bash ./configure - - 3. Build the OpenJDK: - make all - The resulting JDK image should be found in build/*/images/jdk - -where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually -is 3.81 or newer. Note that on Solaris, GNU make is called "gmake". - -Complete details are available in the file: - http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html +See http://openjdk.java.net/ for more information about OpenJDK. diff --git a/README-builds.html b/README-builds.html deleted file mode 100644 index 6d7d5b52461..00000000000 --- a/README-builds.html +++ /dev/null @@ -1,1406 +0,0 @@ - -
-
This README file contains build instructions for the -OpenJDK. Building the source code for the OpenJDK -requires a certain degree of technical expertise.
- -Some Headlines:
- -configure && make" style buildvsvars*.bat and vcvars*.bat files are run
-automaticallyThe OpenJDK sources are maintained with the revision control system -Mercurial. If you are new to -Mercurial, please see the Beginner Guides or refer to the Mercurial Book. -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works.
- -For using Mercurial with the OpenJDK refer to the Developer Guide: Installing -and Configuring Mercurial section for more information.
- - - -To get the entire set of OpenJDK Mercurial repositories use the script
-get_source.sh located in the root repository:
hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
- cd YourOpenJDK
- bash ./get_source.sh
-
-
-Once you have all the repositories, keep in mind that each repository is its
-own independent repository. You can also re-run ./get_source.sh anytime to
-pull over all the latest changesets in all the repositories. This set of
-nested repositories has been given the term "forest" and there are various
-ways to apply the same hg command to each of the repositories. For
-example, the script make/scripts/hgforest.sh can be used to repeat the
-same hg command on every repository, e.g.
cd YourOpenJDK
- bash ./make/scripts/hgforest.sh status
-
-
-
-
-The set of repositories and what they contain:
- -There are some very basic guidelines:
- -build/ directory..hgignore file in each repository must exist and should include
-^build/, ^dist/ and optionally any nbproject/private directories. It
-should NEVER include anything in the src/ or test/ or any managed
-directory area of a repository.javah output). There are some exceptions to this rule, in
-particular with some of the generated configure scripts.The very first step in building the OpenJDK is making sure the system itself -has everything it needs to do OpenJDK builds. Once a system is setup, it -generally doesn't need to be done again.
- -Building the OpenJDK is now done with running a configure script which will
-try and find and verify you have everything you need, followed by running
-make, e.g.
-- --
bash ./configure
-make all
Where possible the configure script will attempt to located the various
-components in the default locations or via component specific variable
-settings. When the normal defaults fail or components cannot be found,
-additional configure options may be necessary to help configure find the
-necessary tools for the build, or you may need to re-visit the setup of your
-system due to missing software packages.
NOTE: The configure script file does not have execute permissions and
-will need to be explicitly run with bash, see the source guidelines.
Before even attempting to use a system to build the OpenJDK there are some very -basic system setups needed. For all systems:
- -Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g.
-run "make -version"
Install a Bootstrap JDK. All OpenJDK builds require access to a previously -released JDK called the bootstrap JDK or boot JDK. The general rule is -that the bootstrap JDK must be an instance of the previous major release of -the JDK. In addition, there may be a requirement to use a release at or -beyond a particular update level.
- -Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as -the boot JDK, to ensure that JDK 9 dependencies are not introduced into the -parts of the system that are built with JDK 8.
- -The JDK 8 binaries can be downloaded from Oracle's JDK 8 download
-site.
-For build performance reasons it is very important that this bootstrap JDK
-be made available on the local disk of the machine doing the build. You
-should add its bin directory to the PATH environment variable. If
-configure has any issues finding this JDK, you may need to use the
-configure option --with-boot-jdk.
Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your -PATH environment variable.
And for specific systems:
- -Linux
- -Install all the software development packages needed including -alsa, freetype, cups, and -xrender. See specific system packages.
Solaris
- -Install all the software development packages needed including Studio -Compilers, freetype, cups, and -xrender. See specific system packages.
Windows
- -Mac OS X
- -Install XCode 6.3
With Linux, try and favor the system packages over building your own or getting -packages from other areas. Most Linux builds should be possible with the -system's available packages.
- -Note that some Linux systems have a habit of pre-populating your environment
-variables for you, for example JAVA_HOME might get pre-defined for you to
-refer to the JDK installed on your Linux system. You will need to unset
-JAVA_HOME. It's a good idea to run env and verify the environment variables
-you are getting from the default system settings make sense for building the
-OpenJDK.
At a minimum, the Studio 12 Update 4 Compilers (containing -version 5.13 of the C and C++ compilers) is required, including specific -patches.
- -The Solaris Studio installation should contain at least these packages:
- --- -- -
-- - - -Package -Version -- -developer/solarisstudio-124/backend -12.4-1.0.6.0 -- -developer/solarisstudio-124/c++ -12.4-1.0.10.0 -- -developer/solarisstudio-124/cc -12.4-1.0.4.0 -- -developer/solarisstudio-124/library/c++-libs -12.4-1.0.10.0 -- -developer/solarisstudio-124/library/math-libs -12.4-1.0.0.1 -- -developer/solarisstudio-124/library/studio-gccrt -12.4-1.0.0.1 -- -developer/solarisstudio-124/studio-common -12.4-1.0.0.1 -- -developer/solarisstudio-124/studio-ja -12.4-1.0.0.1 -- -developer/solarisstudio-124/studio-legal -12.4-1.0.0.1 -- - -developer/solarisstudio-124/studio-zhCN -12.4-1.0.0.1 -
In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc -version.
- -Place the bin directory in PATH.
The Oracle Solaris Studio Express compilers at: Oracle Solaris Studio Express -Download site are also an option, although these compilers -have not been extensively used yet.
- - - -Building on Windows requires a Unix-like environment, notably a Unix-like -shell. There are several such environments available of which -Cygwin and -MinGW/MSYS are currently supported for the -OpenJDK build. One of the differences of these systems from standard Windows -tools is the way they handle Windows path names, particularly path names which -contain spaces, backslashes as path separators and possibly drive letters. -Depending on the use case and the specifics of each environment these path -problems can be solved by a combination of quoting whole paths, translating -backslashes to forward slashes, escaping backslashes with additional -backslashes and translating the path names to their "8.3" -version.
- - - -CYGWIN is an open source, Linux-like environment which tries to emulate a
-complete POSIX layer on Windows. It tries to be smart about path names and can
-usually handle all kinds of paths if they are correctly quoted or escaped
-although internally it maps drive letters <drive>: to a virtual directory
-/cygdrive/<drive>.
You can always use the cygpath utility to map pathnames with spaces or the
-backslash character into the C:/ style of pathname (called 'mixed'), e.g.
-cygpath -s -m "<path>".
Note that the use of CYGWIN creates a unique problem with regards to setting
-PATH. Normally on Windows the PATH variable contains directories
-separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it
-uses ":", but that means that paths like "C:/path" cannot be placed in the
-CYGWIN version of PATH and instead CYGWIN uses something like
-/cygdrive/c/path which CYGWIN understands, but only CYGWIN understands.
The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about -CYGWIN can be obtained from the CYGWIN website at -www.cygwin.com.
- -By default CYGWIN doesn't install all the tools required for building the -OpenJDK. Along with the default installation, you need to install the following -tools.
- --- -- -
-- - - -Binary Name -Category -Package -Description -- -ar.exe -Devel -binutils -The GNU assembler, linker and binary utilities -- -make.exe -Devel -make -The GNU version of the 'make' utility built for CYGWIN -- -m4.exe -Interpreters -m4 -GNU implementation of the traditional Unix macro processor -- -cpio.exe -Utils -cpio -A program to manage archives of files -- -gawk.exe -Utils -awk -Pattern-directed scanning and processing language -- -file.exe -Utils -file -Determines file type using 'magic' numbers -- -zip.exe -Archive -zip -Package and compress (archive) files -- -unzip.exe -Archive -unzip -Extract compressed files in a ZIP archive -- - -free.exe -System -procps -Display amount of free and used memory in the system -
Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the -section on BLODA (applications that interfere with -CYGWIN).
- - - -MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific
-header files and import libraries combined with GNU toolsets that allow one to
-produce native Windows programs that do not rely on any 3rd-party C runtime
-DLLs. MSYS is a supplement to MinGW which allows building applications and
-programs which rely on traditional UNIX tools to be present. Among others this
-includes tools like bash and make. See MinGW/MSYS for more information.
Like Cygwin, MinGW/MSYS can handle different types of path formats. They are
-internally converted to paths with forward slashes and drive letters
-<drive>: replaced by a virtual directory /<drive>. Additionally, MSYS
-automatically detects binaries compiled for the MSYS environment and feeds them
-with the internal, Unix-style path names. If native Windows applications are
-called from within MSYS programs their path arguments are automatically
-converted back to Windows style path names with drive letters and backslashes
-as path separators. This may cause problems for Windows applications which use
-forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may
-wrongly replace such parameters by drive letters.
In addition to the tools which will be installed by default, you have to
-manually install the msys-zip and msys-unzip packages. This can be easily
-done with the MinGW command line installer:
mingw-get.exe install msys-zip
- mingw-get.exe install msys-unzip
-
-
-
-
-The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio
-C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and
-other tools are expected to reside in the location defined by the variable
-VS120COMNTOOLS which is set by the Microsoft Visual Studio installer.
Only the C++ part of VS2013 is needed. Try to let the installation go to the -default install directory. Always reboot your system after installing VS2013. -The system environment variable VS120COMNTOOLS should be set in your -environment.
- -Make sure that TMP and TEMP are also set in the environment and refer to
-Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp,
-and not C:/temp. C:\temp is just an example, it is assumed that this area
-is private to the user, so by default after installs you should see a unique
-user path in these variables.
Make sure you get the right XCode version.
- -The basic invocation of the configure script looks like:
-- --
bash ./configure [options]
This will create an output directory containing the "configuration" and setup -an area for the build result. This directory typically looks like:
- --- --
build/linux-x64-normal-server-release
configure will try to figure out what system you are running on and where all
-necessary build components are. If you have all prerequisites for building
-installed, it should find everything. If it fails to detect any component
-automatically, it will exit and inform you about the problem. When this
-happens, read more below in the configure options.
Some examples:
- --- - - -Windows 32bit build with freetype specified:
- -
-bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32Debug 64bit Build:
-
-bash ./configure --enable-debug --with-target-bits=64
Complete details on all the OpenJDK configure options can be seen with:
-- --
bash ./configure --help=short
Use -help to see all the configure options available. You can generate any
-number of different configurations, e.g. debug, release, 32, 64, etc.
Some of the more commonly used configure options are:
-- - - --
--enable-debug
- set the debug level to fastdebug (this is a shorthand for--with-debug- - level=fastdebug)
-- - - -- -
--with-alsa=path
- select the location of the Advanced Linux Sound Architecture (ALSA)Version 0.9.1 or newer of the ALSA files are required for building the - OpenJDK on Linux. These Linux files are usually available from an "alsa" of - "libasound" development package, and it's highly recommended that you try - and use the package provided by the particular version of Linux that you are - using.
- -- -
--with-boot-jdk=path
- select the Bootstrap JDK- -
--with-boot-jdk-jvmargs="args"
- provide the JVM options to be used to run the Bootstrap JDK- -
--with-cacerts=path
- select the path to the cacerts file.See Certificate Authority on Wikipedia for a better understanding of the Certificate - Authority (CA). A certificates file named "cacerts" represents a system-wide - keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers.
-
-- - - -- -
--with-cups=path
- select the CUPS install locationThe Common UNIX Printing System (CUPS) Headers are required for building the - OpenJDK on Solaris and Linux. The Solaris header files can be obtained by - installing the package print/cups.
- -The CUPS header files can always be downloaded from - www.cups.org.
- -- -
--with-cups-include=path
- select the CUPS include directory location- -
--with-debug-level=level
- select the debug information level of release, fastdebug, or slowdebug-
--with-dev-kit=path
- select location of the compiler install or developer install location
-- - - -- -
--with-freetype=path
- select the freetype files to use.Expecting the freetype libraries under
- -lib/and the headers under -include/.Version 2.3 or newer of FreeType is required. On Unix systems required files - can be available as part of your distribution (while you still may need to - upgrade them). Note that you need development version of package that - includes both the FreeType library and header files.
- -You can always download latest FreeType version from the FreeType - website. Building the freetype 2 libraries from - scratch is also possible, however on Windows refer to the Windows FreeType - DLL build instructions.
- -Note that by default FreeType is built with byte code hinting support - disabled due to licensing restrictions. In this case, text appearance and - metrics are expected to differ from Sun's official JDK build. See the - SourceForge FreeType2 Home Page - for more information.
- -- -
--with-import-hotspot=path
- select the location to find hotspot binaries from a previous build to avoid - building hotspot- -
--with-target-bits=arg
- select 32 or 64 bit build- -
--with-jvm-variants=variants
- select the JVM variants to build from, comma separated list that can - include: server, client, kernel, zero and zeroshark- -
--with-memory-size=size
- select the RAM size that GNU make will think this system has- -
--with-msvcr-dll=path
- select themsvcr100.dllfile to include in the Windows builds (C/C++ - runtime library for Visual Studio).This is usually picked up automatically from the redist directories of - Visual Studio 2013.
- --
--with-num-cores=cores
- select the number of cores to use (processor count or CPU count)
-- -- -
--with-x=path
- select the location of the X11 and xrender files.The XRender Extension Headers are required for building the OpenJDK on - Solaris and Linux. The Linux header files are usually available from a - "Xrender" development package, it's recommended that you try and use the - package provided by the particular distribution of Linux that you are using. - The Solaris XRender header files is included with the other X11 header files - in the package SFWxwinc on new enough versions of Solaris and will be - installed in
-/usr/X11/include/X11/extensions/Xrender.hor -/usr/openwin/share/include/X11/extensions/Xrender.h
The basic invocation of the make utility looks like:
-- --
make all
This will start the build to the output directory containing the
-"configuration" that was created by the configure script. Run make help for
-more information on the available targets.
There are some of the make targets that are of general interest:
- --- -empty
- -
- build everything but no images- -
all
- build everything including images- -
all-conf
- build all configurations- -
images
- create complete j2sdk and j2re images- -
install
- install the generated images locally, typically in/usr/local- -
clean
- remove all files generated by make, but not those generated byconfigure- -
dist-clean
- remove all files generated by both andconfigure(basically killing the - configuration)-
help
- give some help on usingmake, including some interesting make targets
When the build is completed, you should see the generated binaries and
-associated files in the j2sdk-image directory in the output directory. In
-particular, the build/*/images/j2sdk-image/bin directory should contain
-executables for the OpenJDK tools and utilities for that configuration. The
-testing tool jtreg will be needed and can be found at: the jtreg
-site. The provided regression tests in the
-repositories can be run with the command:
-- --
cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all
Q: The generated-configure.sh file looks horrible! How are you going to
-edit it?
-A: The generated-configure.sh file is generated (think "compiled") by the
-autoconf tools. The source code is in configure.ac and various .m4 files in
-common/autoconf, which are much more readable.
Q: Why is the generated-configure.sh file checked in, if it is
-generated?
-A: If it was not generated, every user would need to have the autoconf
-tools installed, and re-generate the configure file as the first step. Our
-goal is to minimize the work needed to be done by the user to start building
-OpenJDK, and to minimize the number of external dependencies required.
Q: Do you require a specific version of autoconf for regenerating
-generated-configure.sh?
-A: Yes, version 2.69 is required and should be easy enough to aquire on all
-supported operating systems. The reason for this is to avoid large spurious
-changes in generated-configure.sh.
Q: How do you regenerate generated-configure.sh after making changes to
-the input files?
-A: Regnerating generated-configure.sh should always be done using the
-script common/autoconf/autogen.sh to ensure that the correct files get
-updated. This script should also be run after mercurial tries to merge
-generated-configure.sh as a merge of the generated file is not guaranteed to
-be correct.
Q: What are the files in common/makefiles/support/* for? They look like
-gibberish.
-A: They are a somewhat ugly hack to compensate for command line length
-limitations on certain platforms (Windows, Solaris). Due to a combination of
-limitations in make and the shell, command lines containing too many files will
-not work properly. These helper files are part of an elaborate hack that will
-compress the command line in the makefile and then uncompress it safely. We're
-not proud of it, but it does fix the problem. If you have any better
-suggestions, we're all ears! :-)
Q: I want to see the output of the commands that make runs, like in the old
-build. How do I do that?
-A: You specify the LOG variable to make. There are several log levels:
warn -- Default and very quiet.info -- Shows more progress information than warn.debug -- Echos all command lines and prints all macro calls for
-compilation definitions.trace -- Echos all $(shell) command lines as well.Q: When do I have to re-run configure?
-A: Normally you will run configure only once for creating a
-configuration. You need to re-run configuration only if you want to change any
-configuration options, or if you pull down changes to the configure script.
Q: I have added a new source file. Do I need to modify the makefiles?
-A: Normally, no. If you want to create e.g. a new native library, you will
-need to modify the makefiles. But for normal file additions or removals, no
-changes are needed. There are certan exceptions for some native libraries where
-the source files are spread over many directories which also contain sources
-for other libraries. In these cases it was simply easier to create include
-lists rather than excludes.
Q: When I run configure --help, I see many strange options, like
---dvidir. What is this?
-A: Configure provides a slew of options by default, to all projects that
-use autoconf. Most of them are not used in OpenJDK, so you can safely ignore
-them. To list only OpenJDK specific features, use configure --help=short
-instead.
Q: configure provides OpenJDK-specific features such as --with-
-builddeps-server that are not described in this document. What about those?
-A: Try them out if you like! But be aware that most of these are
-experimental features. Many of them don't do anything at all at the moment; the
-option is just a placeholder. Others depend on pieces of code or infrastructure
-that is currently not ready for prime time.
Q: How will you make sure you don't break anything?
-A: We have a script that compares the result of the new build system with
-the result of the old. For most part, we aim for (and achieve) byte-by-byte
-identical output. There are however technical issues with e.g. native binaries,
-which might differ in a byte-by-byte comparison, even when building twice with
-the old build system. For these, we compare relevant aspects (e.g. the symbol
-table and file size). Note that we still don't have 100% equivalence, but we're
-close.
Q: I noticed this thing X in the build that looks very broken by design.
-Why don't you fix it?
-A: Our goal is to produce a build output that is as close as technically
-possible to the old build output. If things were weird in the old build, they
-will be weird in the new build. Often, things were weird before due to
-obscurity, but in the new build system the weird stuff comes up to the surface.
-The plan is to attack these things at a later stage, after the new build system
-is established.
Q: The code in the new build system is not that well-structured. Will you
-fix this?
-A: Yes! The new build system has grown bit by bit as we converted the old
-system. When all of the old build system is converted, we can take a step back
-and clean up the structure of the new build system. Some of this we plan to do
-before replacing the old build system and some will need to wait until after.
Q: Is anything able to use the results of the new build's default make
-target?
-A: Yes, this is the minimal (or roughly minimal) set of compiled output
-needed for a developer to actually execute the newly built JDK. The idea is
-that in an incremental development fashion, when doing a normal make, you
-should only spend time recompiling what's changed (making it purely
-incremental) and only do the work that's needed to actually run and test your
-code. The packaging stuff that is part of the images target is not needed for
-a normal developer who wants to test his new code. Even if it's quite fast,
-it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-)
-(Or, well, at least single-digit seconds...)
Q: I usually set a specific environment variable when building, but I can't
-find the equivalent in the new build. What should I do?
-A: It might very well be that we have neglected to add support for an
-option that was actually used from outside the build system. Email us and we
-will add support for it!
Building OpenJDK requires a lot of horsepower. Some of the build tools can be
-adjusted to utilize more or less of resources such as parallel threads and
-memory. The configure script analyzes your system and selects reasonable
-values for such options based on your hardware. If you encounter resource
-problems, such as out of memory conditions, you can modify the detected values
-with:
--with-num-cores -- number of cores in the build system, e.g.
---with-num-cores=8--with-memory-size -- memory (in MB) available in the build system,
-e.g. --with-memory-size=1024It might also be necessary to specify the JVM arguments passed to the Bootstrap
-JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing
-this will override the default JVM arguments passed to the Bootstrap JDK.
One of the top goals of the new build system is to improve the build -performance and decrease the time needed to build. This will soon also apply to -the java compilation when the Smart Javac wrapper is fully supported.
- -At the end of a successful execution of configure, you will get a performance
-summary, indicating how well the build will perform. Here you will also get
-performance hints. If you want to build fast, pay attention to those!
The OpenJDK build supports building with ccache when using gcc or clang. Using
-ccache can radically speed up compilation of native code if you often rebuild
-the same sources. Your milage may vary however so we recommend evaluating it
-for yourself. To enable it, make sure it's on the path and configure with
---enable-ccache.
If you are using network shares, e.g. via NFS, for your source code, make sure -the build directory is situated on local disk. The performance penalty is -extremely high for building on a network share, close to unusable.
- -The old build builds multiple JVMs on 32-bit systems (client and server; and on
-Windows kernel as well). In the new build we have changed this default to only
-build server when it's available. This improves build times for those not
-interested in multiple JVMs. To mimic the old behavior on platforms that
-support it, use --with-jvm-variants=client,server.
By default, configure will analyze your machine and run the make process in
-parallel with as many threads as you have cores. This behavior can be
-overridden, either "permanently" (on a configure basis) using
---with-num-cores=N or for a single build only (on a make basis), using
-make JOBS=N.
If you want to make a slower build just this time, to save some CPU power for
-other processes, you can run e.g. make JOBS=2. This will force the makefiles
-to only run 2 parallel processes, or even make JOBS=1 which will disable
-parallelism.
If you want to have it the other way round, namely having slow builds default
-and override with fast if you're impatient, you should call configure with
---with-num-cores=2, making 2 the default. If you want to run with more cores,
-run make JOBS=8
If the build fails (and it's not due to a compilation error in a source file
-you've changed), the first thing you should do is to re-run the build with more
-verbosity. Do this by adding LOG=debug to your make command line.
The build log (with both stdout and stderr intermingled, basically the same as
-you see on your console) can be found as build.log in your build directory.
You can ask for help on build problems with the new build system on either the -build-dev or the -build-infra-dev -mailing lists. Please include the relevant parts of the build log.
- -A build can fail for any number of reasons. Most failures are a result of
-trying to build in an environment in which all the pre-build requirements have
-not been met. The first step in troubleshooting a build failure is to recheck
-that you have satisfied all the pre-build requirements for your platform.
-Scanning the configure log is a good first step, making sure that what it
-found makes sense for your system. Look for strange error messages or any
-difficulties that configure had in finding things.
Some of the more common problems with builds are briefly described below, with -suggestions for remedies.
- -Corrupted Bundles on Windows:
-Some virus scanning software has been known to corrupt the downloading of
-zip bundles. It may be necessary to disable the 'on access' or 'real time'
-virus scanning features to prevent this corruption. This type of 'real time'
-virus scanning can also slow down the build process significantly.
-Temporarily disabling the feature, or excluding the build output directory
-may be necessary to get correct and faster builds.
Slow Builds:
-If your build machine seems to be overloaded from too many simultaneous C++
-compiles, try setting the JOBS=1 on the make command line. Then try
-increasing the count slowly to an acceptable level for your system. Also:
Creating the javadocs can be very slow, if you are running javadoc, consider -skipping that step.
- -Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends -to be CPU intensive (many C++ compiles), and the rest of the JDK will often -be disk intensive.
- -Faster compiles are possible using a tool called -ccache.
File time issues:
-If you see warnings that refer to file time stamps, e.g.
-- -Warning message:
-File 'xxx' has modification time in the future.
-Warning message:Clock skew detected. Your build may be incomplete.
These warnings can occur when the clock on the build machine is out of sync -with the timestamps on the source files. Other errors, apparently unrelated -but in fact caused by the clock skew, can occur along with the clock skew -warnings. These secondary errors may tend to obscure the fact that the true -root cause of the problem is an out-of-sync clock.
- -If you see these warnings, reset the clock on the build machine, run
-"gmake clobber" or delete the directory containing the build output, and
-restart the build from the beginning.
Error message: Trouble writing out table to disk
-Increase the amount of swap space on your build machine. This could be
-caused by overloading the system and it may be necessary to use:
-- --
make JOBS=1
to reduce the load on the system.
Error Message: libstdc++ not found:
-This is caused by a missing libstdc++.a library. This is installed as part
-of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit
-Linux versions (e.g. Fedora) only install the 64-bit version of the
-libstdc++ package. Various parts of the JDK build require a static link of
-the C++ runtime libraries to allow for maximum portability of the built
-images.
Linux Error Message: cannot restore segment prot after reloc
-This is probably an issue with SELinux (See SELinux on
-Wikipedia). Parts of the VM is built
-without the -fPIC for performance reasons.
To completely disable SELinux:
- -$ su root# system-config-securitylevelIn the window that appears, select the SELinux tabDisable SELinuxAlternatively, instead of completely disabling it you could disable just -this one check.
- -Windows Error Messages:
-*** fatal error - couldn't allocate heap, ...
-rm fails with "Directory not empty"
-unzip fails with "cannot create ... Permission denied"
-unzip fails with "cannot create ... Error 50"
The CYGWIN software can conflict with other non-CYGWIN software. See the -CYGWIN FAQ section on BLODA (applications that interfere with -CYGWIN).
Windows Error Message: spawn failed
-Try rebooting the system, or there could be some kind of issue with the disk
-or disk partition being used. Sometimes it comes with a "Permission Denied"
-message.
The Makefiles in the OpenJDK are only valid when used with the GNU version of
-the utility command make (usually called gmake on Solaris). A few notes
-about using GNU make:
PATH./usr/bin/make on Solaris. If your Solaris system
-has the software from the Solaris Developer Companion CD installed, you
-should try and use /usr/bin/gmake or /usr/gnu/bin/make.Information on GNU make, and access to ftp download sites, are available on the -GNU make web site . The latest -source to GNU make is available at -ftp.gnu.org/pub/gnu/make/.
- - - -First step is to get the GNU make 3.81 or newer source from -ftp.gnu.org/pub/gnu/make/. Building is a -little different depending on the OS but is basically done with:
- - bash ./configure
- make
-
-
-This file often describes specific requirements for what we call the "minimum -build environments" (MBE) for this specific release of the JDK. What is listed -below is what the Oracle Release Engineering Team will use to build the Oracle -JDK product. Building with the MBE will hopefully generate the most compatible -bits that install on, and run correctly on, the most variations of the same -base OS and hardware architecture. In some cases, these represent what is often -called the least common denominator, but each Operating System has different -aspects to it.
- -In all cases, the Bootstrap JDK version minimum is critical, we cannot -guarantee builds will work with older Bootstrap JDK's. Also in all cases, more -RAM and more processors is better, the minimums listed below are simply -recommendations.
- -With Solaris and Mac OS X, the version listed below is the oldest release we -can guarantee builds and works, and the specific version of the compilers used -could be critical.
- -With Windows the critical aspect is the Visual Studio compiler used, which due -to it's runtime, generally dictates what Windows systems can do the builds and -where the resulting bits can be used.
- -NOTE: We expect a change here off these older Windows OS releases and to a -'less older' one, probably Windows 2008R2 X64.
- -With Linux, it was just a matter of picking a stable distribution that is a -good representative for Linux in general.
- -It is understood that most developers will NOT be using these specific -versions, and in fact creating these specific versions may be difficult due to -the age of some of this software. It is expected that developers are more often -using the more recent releases and distributions of these operating systems.
- -Compilation problems with newer or different C/C++ compilers is a common
-problem. Similarly, compilation problems related to changes to the
-/usr/include or system header files is also a common problem with older,
-newer, or unreleased OS versions. Please report these types of problems as bugs
-so that they can be dealt with accordingly.
-- -- -
-- - - -Base OS and Architecture -OS -C/C++ Compiler -Bootstrap JDK -Processors -RAM Minimum -DISK Needs -- -Linux X86 (32-bit) and X64 (64-bit) -Oracle Enterprise Linux 6.4 -gcc 4.9.2 -JDK 8 -2 or more -1 GB -6 GB -- -Solaris SPARCV9 (64-bit) -Solaris 11 Update 1 -Studio 12 Update 4 + patches -JDK 8 -4 or more -4 GB -8 GB -- -Solaris X64 (64-bit) -Solaris 11 Update 1 -Studio 12 Update 4 + patches -JDK 8 -4 or more -4 GB -8 GB -- -Windows X86 (32-bit) -Windows Server 2012 R2 x64 -Microsoft Visual Studio C++ 2013 Professional Edition -JDK 8 -2 or more -2 GB -6 GB -- -Windows X64 (64-bit) -Windows Server 2012 R2 x64 -Microsoft Visual Studio C++ 2013 Professional Edition -JDK 8 -2 or more -2 GB -6 GB -- - -Mac OS X X64 (64-bit) -Mac OS X 10.9 "Mavericks" -Xcode 6.3 or newer -JDK 8 -2 or more -4 GB -6 GB -
We won't be listing all the possible environments, but we will try to provide -what information we have available to us.
- -NOTE: The community can help out by updating this part of the document.
- -After installing the latest Fedora you need to
-install several build dependencies. The simplest way to do it is to execute the
-following commands as user root:
yum-builddep java-1.7.0-openjdk
- yum install gcc gcc-c++
-
-
-In addition, it's necessary to set a few environment variables for the build:
- - export LANG=C
- export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
-
-
-After installing CentOS 5.5 you need to make sure you -have the following Development bundles installed:
- -Plus the following packages:
- -The freetype 2.3 packages don't seem to be available, but the freetype 2.3 -sources can be downloaded, built, and installed easily enough from the -freetype site. Build and install -with something like:
- - bash ./configure
- make
- sudo -u root make install
-
-
-Mercurial packages could not be found easily, but a Google search should find -ones, and they usually include Python if it's needed.
- -After installing Debian 5 you need to install several
-build dependencies. The simplest way to install the build dependencies is to
-execute the following commands as user root:
aptitude build-dep openjdk-7
- aptitude install openjdk-7-jdk libmotif-dev
-
-
-In addition, it's necessary to set a few environment variables for the build:
- - export LANG=C
- export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
-
-After installing Ubuntu 12.04 you need to install several -build dependencies. The simplest way to do it is to execute the following -commands:
- - sudo aptitude build-dep openjdk-7
- sudo aptitude install openjdk-7-jdk
-
-
-In addition, it's necessary to set a few environment variables for the build:
- - export LANG=C
- export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
-
-After installing OpenSUSE 11.1 you need to install -several build dependencies. The simplest way to install the build dependencies -is to execute the following commands:
- - sudo zypper source-install -d java-1_7_0-openjdk
- sudo zypper install make
-
-
-In addition, it is necessary to set a few environment variables for the build:
- - export LANG=C
- export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
-
-
-Finally, you need to unset the JAVA_HOME environment variable:
export -n JAVA_HOME`
-
-
-After installing Mandriva Linux One 2009 Spring you need
-to install several build dependencies. The simplest way to install the build
-dependencies is to execute the following commands as user root:
urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
- libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
- libxtst6-devel libxi-devel
-
-
-In addition, it is necessary to set a few environment variables for the build:
- - export LANG=C
- export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
-
-
-After installing OpenSolaris 2009.06 you need to -install several build dependencies. The simplest way to install the build -dependencies is to execute the following commands:
- - pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
- SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
-
-
-In addition, it is necessary to set a few environment variables for the build:
- - export LANG=C
- export PATH="/opt/SunStudioExpress/bin:${PATH}"
-
-
-End of the OpenJDK build README document.
- -Please come again!
- - diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 35e835c3994..1337cde237b 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -530,6 +530,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], BASIC_PATH_PROGS(DF, df) BASIC_PATH_PROGS(CPIO, [cpio bsdcpio]) BASIC_PATH_PROGS(NICE, nice) + BASIC_PATH_PROGS(PANDOC, pandoc) ]) # Setup basic configuration paths, and platform-specific stuff related to PATHs. @@ -1097,6 +1098,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], BASIC_PATH_PROGS(HG, hg) BASIC_PATH_PROGS(STAT, stat) BASIC_PATH_PROGS(TIME, time) + BASIC_PATH_PROGS(FLOCK, flock) # Dtrace is usually found in /usr/sbin on Solaris, but that directory may not # be in the user path. BASIC_PATH_PROGS(DTRACE, dtrace, $PATH:/usr/sbin) @@ -1202,6 +1204,18 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], # Check for support for specific options in bash AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS], [ + # Check bash version + # Extra [ ] to stop m4 mangling + [ BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ] + AC_MSG_CHECKING([bash version]) + AC_MSG_RESULT([$BASH_VER]) + + BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` + BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` + if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then + AC_MSG_ERROR([bash version 3.2 or better is required]) + fi + # Test if bash supports pipefail. AC_MSG_CHECKING([if bash supports pipefail]) if ${BASH} -c 'set -o pipefail'; then diff --git a/common/autoconf/basics_windows.m4 b/common/autoconf/basics_windows.m4 index 1a79bf8fc86..2ae6e34a556 100644 --- a/common/autoconf/basics_windows.m4 +++ b/common/autoconf/basics_windows.m4 @@ -329,8 +329,8 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) fi AC_MSG_CHECKING([cygwin root directory as unix-style path]) - # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away - cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"` + # The cmd output ends with Windows line endings (CR/LF) + cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'` # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` AC_MSG_RESULT([$CYGWIN_ROOT_PATH]) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index ca7f625664c..a96b74be793 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -355,7 +355,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" fi - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' @@ -375,7 +375,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], # Linking is different on MacOSX PICFLAG='' SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 917181abf10..8bd0cf8a0ff 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -932,6 +932,7 @@ DSYMUTIL IS_GNU_TIME PATCH DTRACE +FLOCK TIME STAT HG @@ -994,6 +995,7 @@ OPENJDK_TARGET_CPU_ISADIR OPENJDK_TARGET_CPU_LEGACY_LIB OPENJDK_TARGET_CPU_LEGACY REQUIRED_OS_VERSION +REQUIRED_OS_ARCH REQUIRED_OS_NAME COMPILE_TYPE OPENJDK_TARGET_CPU_ENDIAN @@ -1024,6 +1026,7 @@ build_os build_vendor build_cpu build +PANDOC NICE CPIO DF @@ -1281,6 +1284,7 @@ READLINK DF CPIO NICE +PANDOC MAKE UNZIP ZIPEXE @@ -1290,6 +1294,7 @@ READELF HG STAT TIME +FLOCK DTRACE PATCH DSYMUTIL @@ -2244,6 +2249,7 @@ Some influential environment variables: DF Override default value for DF CPIO Override default value for CPIO NICE Override default value for NICE + PANDOC Override default value for PANDOC MAKE Override default value for MAKE UNZIP Override default value for UNZIP ZIPEXE Override default value for ZIPEXE @@ -2253,6 +2259,7 @@ Some influential environment variables: HG Override default value for HG STAT Override default value for STAT TIME Override default value for TIME + FLOCK Override default value for FLOCK DTRACE Override default value for DTRACE PATCH Override default value for PATCH DSYMUTIL Override default value for DSYMUTIL @@ -5043,7 +5050,7 @@ TOOLCHAIN_MINIMUM_VERSION_xlc="" # # $1 = compiler to test (CC or CXX) # $2 = human readable name of compiler (C or C++) -# $3 = list of compiler names to search for +# $3 = compiler name to search for # Detect the core components of the toolchain, i.e. the compilers (CC and CXX), @@ -5170,7 +5177,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=1486175373 +DATE_WHEN_GENERATED=1490900744 ############################################################################### # @@ -15358,6 +15365,203 @@ $as_echo "$tool_specified" >&6; } + # Publish this variable in the help. + + + if [ -z "${PANDOC+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !PANDOC! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PANDOC!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xPANDOC" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$PANDOC" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool PANDOC= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool PANDOC= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 +$as_echo_n "checking for PANDOC... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$PANDOC" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PANDOC=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool PANDOC=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$PANDOC" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PANDOC=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool PANDOC=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 +$as_echo_n "checking for PANDOC... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool PANDOC=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + + + # Now we can determine OpenJDK build and target platforms. This is required to # have early on. # Make sure we can run config.sub. @@ -15838,13 +16042,15 @@ $as_echo "$COMPILE_TYPE" >&6; } fi fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin + REQUIRED_OS_NAME="Mac OS X" REQUIRED_OS_VERSION=11.2 fi if test "x$OPENJDK_TARGET_OS" = "xaix"; then REQUIRED_OS_NAME=AIX REQUIRED_OS_VERSION=7.1 fi + REQUIRED_OS_ARCH=${OPENJDK_TARGET_CPU} + @@ -16200,8 +16406,8 @@ $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but a fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5 $as_echo_n "checking cygwin root directory as unix-style path... " >&6; } - # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away - cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"` + # The cmd output ends with Windows line endings (CR/LF) + cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'` # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5 @@ -22856,6 +23062,203 @@ $as_echo "$tool_specified" >&6; } fi + + + # Publish this variable in the help. + + + if [ -z "${FLOCK+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in flock +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_FLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $FLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +FLOCK=$ac_cv_path_FLOCK +if test -n "$FLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 +$as_echo "$FLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$FLOCK" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !FLOCK! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!FLOCK!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xFLOCK" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of FLOCK from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of FLOCK from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in flock +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_FLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $FLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +FLOCK=$ac_cv_path_FLOCK +if test -n "$FLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 +$as_echo "$FLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$FLOCK" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$FLOCK" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool FLOCK= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool FLOCK= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLOCK" >&5 +$as_echo_n "checking for FLOCK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$FLOCK" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool FLOCK=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool FLOCK=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_FLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $FLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +FLOCK=$ac_cv_path_FLOCK +if test -n "$FLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 +$as_echo "$FLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$FLOCK" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool FLOCK=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool FLOCK=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLOCK" >&5 +$as_echo_n "checking for FLOCK... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool FLOCK=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + # Dtrace is usually found in /usr/sbin on Solaris, but that directory may not # be in the user path. @@ -24092,6 +24495,20 @@ $as_echo "$tool_specified" >&6; } fi + # Check bash version + # Extra [ ] to stop m4 mangling + BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5 +$as_echo_n "checking bash version... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5 +$as_echo "$BASH_VER" >&6; } + + BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` + BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` + if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then + as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5 + fi + # Test if bash supports pipefail. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5 $as_echo_n "checking if bash supports pipefail... " >&6; } @@ -33124,10 +33541,9 @@ done if test -n "$TOOLCHAIN_PATH"; then PATH_save="$PATH" PATH="$TOOLCHAIN_PATH" - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_TOOLCHAIN_PATH_CC+:} false; then : @@ -33166,20 +33582,73 @@ $as_echo "no" >&6; } fi - test -n "$TOOLCHAIN_PATH_CC" && break +fi +if test -z "$ac_cv_path_TOOLCHAIN_PATH_CC"; then + ac_pt_TOOLCHAIN_PATH_CC=$TOOLCHAIN_PATH_CC + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_TOOLCHAIN_PATH_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$ac_pt_TOOLCHAIN_PATH_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_TOOLCHAIN_PATH_CC=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC +if test -n "$ac_pt_TOOLCHAIN_PATH_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CC" >&5 +$as_echo "$ac_pt_TOOLCHAIN_PATH_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_TOOLCHAIN_PATH_CC" = x; then + TOOLCHAIN_PATH_CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + TOOLCHAIN_PATH_CC=$ac_pt_TOOLCHAIN_PATH_CC + fi +else + TOOLCHAIN_PATH_CC="$ac_cv_path_TOOLCHAIN_PATH_CC" +fi CC=$TOOLCHAIN_PATH_CC PATH="$PATH_save" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, + # AC_PATH_TOOL can't be run multiple times with the same variable, # so create a new name for this run. if test "x$CC" = x; then - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_POTENTIAL_CC+:} false; then : @@ -33218,8 +33687,62 @@ $as_echo "no" >&6; } fi - test -n "$POTENTIAL_CC" && break +fi +if test -z "$ac_cv_path_POTENTIAL_CC"; then + ac_pt_POTENTIAL_CC=$POTENTIAL_CC + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_POTENTIAL_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_POTENTIAL_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_POTENTIAL_CC="$ac_pt_POTENTIAL_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_POTENTIAL_CC=$ac_cv_path_ac_pt_POTENTIAL_CC +if test -n "$ac_pt_POTENTIAL_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CC" >&5 +$as_echo "$ac_pt_POTENTIAL_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_POTENTIAL_CC" = x; then + POTENTIAL_CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + POTENTIAL_CC=$ac_pt_POTENTIAL_CC + fi +else + POTENTIAL_CC="$ac_cv_path_POTENTIAL_CC" +fi CC=$POTENTIAL_CC fi @@ -34425,10 +34948,9 @@ done if test -n "$TOOLCHAIN_PATH"; then PATH_save="$PATH" PATH="$TOOLCHAIN_PATH" - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_TOOLCHAIN_PATH_CXX+:} false; then : @@ -34467,20 +34989,73 @@ $as_echo "no" >&6; } fi - test -n "$TOOLCHAIN_PATH_CXX" && break +fi +if test -z "$ac_cv_path_TOOLCHAIN_PATH_CXX"; then + ac_pt_TOOLCHAIN_PATH_CXX=$TOOLCHAIN_PATH_CXX + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_TOOLCHAIN_PATH_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$ac_pt_TOOLCHAIN_PATH_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_TOOLCHAIN_PATH_CXX=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX +if test -n "$ac_pt_TOOLCHAIN_PATH_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CXX" >&5 +$as_echo "$ac_pt_TOOLCHAIN_PATH_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_TOOLCHAIN_PATH_CXX" = x; then + TOOLCHAIN_PATH_CXX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + TOOLCHAIN_PATH_CXX=$ac_pt_TOOLCHAIN_PATH_CXX + fi +else + TOOLCHAIN_PATH_CXX="$ac_cv_path_TOOLCHAIN_PATH_CXX" +fi CXX=$TOOLCHAIN_PATH_CXX PATH="$PATH_save" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, + # AC_PATH_TOOL can't be run multiple times with the same variable, # so create a new name for this run. if test "x$CXX" = x; then - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_POTENTIAL_CXX+:} false; then : @@ -34519,8 +35094,62 @@ $as_echo "no" >&6; } fi - test -n "$POTENTIAL_CXX" && break +fi +if test -z "$ac_cv_path_POTENTIAL_CXX"; then + ac_pt_POTENTIAL_CXX=$POTENTIAL_CXX + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_POTENTIAL_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_POTENTIAL_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_POTENTIAL_CXX="$ac_pt_POTENTIAL_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_POTENTIAL_CXX=$ac_cv_path_ac_pt_POTENTIAL_CXX +if test -n "$ac_pt_POTENTIAL_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CXX" >&5 +$as_echo "$ac_pt_POTENTIAL_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_POTENTIAL_CXX" = x; then + POTENTIAL_CXX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + POTENTIAL_CXX=$ac_pt_POTENTIAL_CXX + fi +else + POTENTIAL_CXX="$ac_cv_path_POTENTIAL_CXX" +fi CXX=$POTENTIAL_CXX fi @@ -49060,7 +49689,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" fi - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1' @@ -49080,7 +49709,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # Linking is different on MacOSX PICFLAG='' SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1' @@ -52629,12 +53258,12 @@ $as_echo "no, forced" >&6; } # Only enable AOT on linux-X64. if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then - if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then + if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then ENABLE_AOT="true" else ENABLE_AOT="false" if test "x$enable_aot" = "xyes"; then - as_fn_error $? "Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot." "$LINENO" 5 + as_fn_error $? "Cannot build AOT without hotspot/src/jdk.internal.vm.compiler sources. Remove --enable-aot." "$LINENO" 5 fi fi else @@ -64365,8 +64994,8 @@ $as_echo "$JVM_FEATURES" >&6; } JVM_FEATURES_jvmci="" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.vm.compiler should be built" >&5 -$as_echo_n "checking if jdk.vm.compiler should be built... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.internal.vm.compiler should be built" >&5 +$as_echo_n "checking if jdk.internal.vm.compiler should be built... " >&6; } if [[ " $JVM_FEATURES " =~ " graal " ]] ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 $as_echo "yes, forced" >&6; } diff --git a/common/autoconf/hotspot.m4 b/common/autoconf/hotspot.m4 index b295b015a9f..acf2a5fe185 100644 --- a/common/autoconf/hotspot.m4 +++ b/common/autoconf/hotspot.m4 @@ -215,12 +215,12 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT], # Only enable AOT on linux-X64. if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then - if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then + if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then ENABLE_AOT="true" else ENABLE_AOT="false" if test "x$enable_aot" = "xyes"; then - AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot.]) + AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.internal.vm.compiler sources. Remove --enable-aot.]) fi fi else @@ -327,7 +327,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES], JVM_FEATURES_jvmci="" fi - AC_MSG_CHECKING([if jdk.vm.compiler should be built]) + AC_MSG_CHECKING([if jdk.internal.vm.compiler should be built]) if HOTSPOT_CHECK_JVM_FEATURE(graal); then AC_MSG_RESULT([yes, forced]) if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 61010279a0e..80d1656609b 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -452,15 +452,17 @@ AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], fi fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin + REQUIRED_OS_NAME="Mac OS X" REQUIRED_OS_VERSION=11.2 fi if test "x$OPENJDK_TARGET_OS" = "xaix"; then REQUIRED_OS_NAME=AIX REQUIRED_OS_VERSION=7.1 fi + REQUIRED_OS_ARCH=${OPENJDK_TARGET_CPU} AC_SUBST(REQUIRED_OS_NAME) + AC_SUBST(REQUIRED_OS_ARCH) AC_SUBST(REQUIRED_OS_VERSION) ]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index bb6d2209c41..f59b6a51dca 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -48,7 +48,7 @@ MAKE := @MAKE@ # The default make arguments MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \ - MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" LOG_LEVEL=$(LOG_LEVEL) + MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" $(MAKE_LOG_VARS) OUTPUT_SYNC_SUPPORTED:=@OUTPUT_SYNC_SUPPORTED@ OUTPUT_SYNC:=@OUTPUT_SYNC@ @@ -101,8 +101,9 @@ OPENJDK_BUILD_CPU_ARCH:=@OPENJDK_BUILD_CPU_ARCH@ OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@ -# Legacy OS values for use in release file. +# OS values for use in release file. REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@ +REQUIRED_OS_ARCH:=@REQUIRED_OS_ARCH@ REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@ LIBM:=@LIBM@ @@ -574,20 +575,31 @@ 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_OVERRIDE_MODULES := java.compiler jdk.compiler \ - jdk.jdeps jdk.javadoc jdk.rmic +INTERIM_LANGTOOLS_OVERRIDE_MODULES := java.compiler jdk.compiler \ + jdk.jdeps jdk.javadoc +INTERIM_RMIC_OVERRIDE_MODULES := jdk.rmic ifeq ($(BOOT_JDK_MODULAR), true) - INTERIM_OVERRIDE_MODULES_ARGS = $(foreach m, $(INTERIM_OVERRIDE_MODULES), \ + INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = $(foreach m, \ + $(INTERIM_LANGTOOLS_OVERRIDE_MODULES), \ --patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m) - INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) + 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_OVERRIDE_MODULES_ARGS = \ + INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = \ -Xbootclasspath/p:$(call PathList, \ $(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \ - $(INTERIM_OVERRIDE_MODULES))) - INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) \ + $(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 @@ -625,6 +637,7 @@ DIRNAME:=@DIRNAME@ DSYMUTIL:=@DSYMUTIL@ FIND:=@FIND@ FIND_DELETE:=@FIND_DELETE@ +FLOCK:=@FLOCK@ ECHO:=@ECHO@ EGREP:=@EGREP@ FGREP:=@FGREP@ @@ -637,6 +650,7 @@ MKDIR:=@MKDIR@ MV:=@MV@ NAWK:=@NAWK@ NICE:=@NICE@ +PANDOC:=@PANDOC@ PATCH:=@PATCH@ PRINTF:=@PRINTF@ RM:=@RM@ diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 16b0df04b4f..29ebea9ccac 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -440,7 +440,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION], # # $1 = compiler to test (CC or CXX) # $2 = human readable name of compiler (C or C++) -# $3 = list of compiler names to search for +# $3 = compiler name to search for AC_DEFUN([TOOLCHAIN_FIND_COMPILER], [ COMPILER_NAME=$2 @@ -482,15 +482,15 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER], if test -n "$TOOLCHAIN_PATH"; then PATH_save="$PATH" PATH="$TOOLCHAIN_PATH" - AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST) + AC_PATH_TOOL(TOOLCHAIN_PATH_$1, $SEARCH_LIST) $1=$TOOLCHAIN_PATH_$1 PATH="$PATH_save" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, + # AC_PATH_TOOL can't be run multiple times with the same variable, # so create a new name for this run. if test "x[$]$1" = x; then - AC_PATH_PROGS(POTENTIAL_$1, $SEARCH_LIST) + AC_PATH_TOOL(POTENTIAL_$1, $SEARCH_LIST) $1=$POTENTIAL_$1 fi diff --git a/common/autoconf/version-numbers b/common/autoconf/version-numbers index 4cb54671183..dc6e06253d7 100644 --- a/common/autoconf/version-numbers +++ b/common/autoconf/version-numbers @@ -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 @@ -25,7 +25,7 @@ # Default version numbers to use unless overridden by configure -DEFAULT_VERSION_MAJOR=9 +DEFAULT_VERSION_MAJOR=10 DEFAULT_VERSION_MINOR=0 DEFAULT_VERSION_SECURITY=0 DEFAULT_VERSION_PATCH=0 diff --git a/common/bin/shell-tracer.sh b/common/bin/shell-profiler.sh similarity index 52% rename from common/bin/shell-tracer.sh rename to common/bin/shell-profiler.sh index 5c7cc449f9c..d4a39dd8d1b 100644 --- a/common/bin/shell-tracer.sh +++ b/common/bin/shell-profiler.sh @@ -22,26 +22,48 @@ # questions. # -# Usage: sh shell-tracer.sh
+OpenJDK
+This README file contains build instructions for the OpenJDK. Building the source code for the OpenJDK requires a certain degree of technical expertise.
+Some Headlines:
+configure && make" style buildvsvars*.bat and vcvars*.bat files are run automaticallyThe OpenJDK sources are maintained with the revision control system Mercurial. If you are new to Mercurial, please see the Beginner Guides or refer to the Mercurial Book. The first few chapters of the book provide an excellent overview of Mercurial, what it is and how it works.
+For using Mercurial with the OpenJDK refer to the Developer Guide: Installing and Configuring Mercurial section for more information.
+To get the entire set of OpenJDK Mercurial repositories use the script get_source.sh located in the root repository:
hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
+ cd YourOpenJDK
+ bash ./get_source.sh
+Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run ./get_source.sh anytime to pull over all the latest changesets in all the repositories. This set of nested repositories has been given the term "forest" and there are various ways to apply the same hg command to each of the repositories. For example, the script make/scripts/hgforest.sh can be used to repeat the same hg command on every repository, e.g.
cd YourOpenJDK
+ bash ./make/scripts/hgforest.sh status
+The set of repositories and what they contain:
+There are some very basic guidelines:
+build/ directory..hgignore file in each repository must exist and should include ^build/, ^dist/ and optionally any nbproject/private directories. It should NEVER include anything in the src/ or test/ or any managed directory area of a repository.javah output). There are some exceptions to this rule, in particular with some of the generated configure scripts.The very first step in building the OpenJDK is making sure the system itself has everything it needs to do OpenJDK builds. Once a system is setup, it generally doesn't need to be done again.
+Building the OpenJDK is now done with running a configure script which will try and find and verify you have everything you need, followed by running make, e.g.
+++
bash ./configure
+make all
Where possible the configure script will attempt to located the various components in the default locations or via component specific variable settings. When the normal defaults fail or components cannot be found, additional configure options may be necessary to help configure find the necessary tools for the build, or you may need to re-visit the setup of your system due to missing software packages.
NOTE: The configure script file does not have execute permissions and will need to be explicitly run with bash, see the source guidelines.
Before even attempting to use a system to build the OpenJDK there are some very basic system setups needed. For all systems:
+make -version"* Install a Bootstrap JDK. All OpenJDK builds require access to a previously released JDK called the bootstrap JDK or boot JDK. The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level.
+Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as the boot JDK, to ensure that JDK 9 dependencies are not introduced into the parts of the system that are built with JDK 8.
+The JDK 8 binaries can be downloaded from Oracle's JDK 8 download site. For build performance reasons it is very important that this bootstrap JDK be made available on the local disk of the machine doing the build. You should add its bin directory to the PATH environment variable. If configure has any issues finding this JDK, you may need to use the configure option --with-boot-jdk.
And for specific systems:
+Install all the software development packages needed including alsa, freetype, cups, and xrender. See specific system packages.
+Install all the software development packages needed including Studio Compilers, freetype, cups, and xrender. See specific system packages.
+Windows
Install Visual Studio 2013
Mac OS X
Install XCode 6.3
+With Linux, try and favor the system packages over building your own or getting packages from other areas. Most Linux builds should be possible with the system's available packages.
+Note that some Linux systems have a habit of pre-populating your environment variables for you, for example JAVA_HOME might get pre-defined for you to refer to the JDK installed on your Linux system. You will need to unset JAVA_HOME. It's a good idea to run env and verify the environment variables you are getting from the default system settings make sense for building the OpenJDK.
At a minimum, the Studio 12 Update 4 Compilers (containing version 5.13 of the C and C++ compilers) is required, including specific patches.
+The Solaris Studio installation should contain at least these packages:
+| Package | +Version | +
|---|---|
| developer/solarisstudio-124/backend | +12.4-1.0.6.0 | +
| developer/solarisstudio-124/c++ | +12.4-1.0.10.0 | +
| developer/solarisstudio-124/cc | +12.4-1.0.4.0 | +
| developer/solarisstudio-124/library/c++-libs | +12.4-1.0.10.0 | +
| developer/solarisstudio-124/library/math-libs | +12.4-1.0.0.1 | +
| developer/solarisstudio-124/library/studio-gccrt | +12.4-1.0.0.1 | +
| developer/solarisstudio-124/studio-common | +12.4-1.0.0.1 | +
| developer/solarisstudio-124/studio-ja | +12.4-1.0.0.1 | +
| developer/solarisstudio-124/studio-legal | +12.4-1.0.0.1 | +
| developer/solarisstudio-124/studio-zhCN | +12.4-1.0.0.1 | +
In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc version.
+Place the bin directory in PATH.
The Oracle Solaris Studio Express compilers at: Oracle Solaris Studio Express Download site are also an option, although these compilers have not been extensively used yet.
+Building on Windows requires a Unix-like environment, notably a Unix-like shell. There are several such environments available of which Cygwin and MinGW/MSYS are currently supported for the OpenJDK build. One of the differences of these systems from standard Windows tools is the way they handle Windows path names, particularly path names which contain spaces, backslashes as path separators and possibly drive letters. Depending on the use case and the specifics of each environment these path problems can be solved by a combination of quoting whole paths, translating backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their "8.3" version.
+CYGWIN is an open source, Linux-like environment which tries to emulate a complete POSIX layer on Windows. It tries to be smart about path names and can usually handle all kinds of paths if they are correctly quoted or escaped although internally it maps drive letters <drive>: to a virtual directory /cygdrive/<drive>.
You can always use the cygpath utility to map pathnames with spaces or the backslash character into the C:/ style of pathname (called 'mixed'), e.g. cygpath -s -m "<path>".
Note that the use of CYGWIN creates a unique problem with regards to setting PATH. Normally on Windows the PATH variable contains directories separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it uses ":", but that means that paths like "C:/path" cannot be placed in the CYGWIN version of PATH and instead CYGWIN uses something like /cygdrive/c/path which CYGWIN understands, but only CYGWIN understands.
The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about CYGWIN can be obtained from the CYGWIN website at www.cygwin.com.
+By default CYGWIN doesn't install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools.
+| Binary Name | +Category | +Package | +Description | +
|---|---|---|---|
| ar.exe | +Devel | +binutils | +The GNU assembler, linker and binary utilities | +
| make.exe | +Devel | +make | +The GNU version of the 'make' utility built for CYGWIN | +
| m4.exe | +Interpreters | +m4 | +GNU implementation of the traditional Unix macro processor | +
| cpio.exe | +Utils | +cpio | +A program to manage archives of files | +
| gawk.exe | +Utils | +awk | +Pattern-directed scanning and processing language | +
| file.exe | +Utils | +file | +Determines file type using 'magic' numbers | +
| zip.exe | +Archive | +zip | +Package and compress (archive) files | +
| unzip.exe | +Archive | +unzip | +Extract compressed files in a ZIP archive | +
| free.exe | +System | +procps | +Display amount of free and used memory in the system | +
Note that the CYGWIN software can conflict with other non-CYGWIN software on your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the section on BLODA (applications that interfere with CYGWIN).
+MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this includes tools like bash and make. See MinGW/MSYS for more information.
Like Cygwin, MinGW/MSYS can handle different types of path formats. They are internally converted to paths with forward slashes and drive letters <drive>: replaced by a virtual directory /<drive>. Additionally, MSYS automatically detects binaries compiled for the MSYS environment and feeds them with the internal, Unix-style path names. If native Windows applications are called from within MSYS programs their path arguments are automatically converted back to Windows style path names with drive letters and backslashes as path separators. This may cause problems for Windows applications which use forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may wrongly replace such parameters by drive letters.
In addition to the tools which will be installed by default, you have to manually install the msys-zip and msys-unzip packages. This can be easily done with the MinGW command line installer:
mingw-get.exe install msys-zip
+ mingw-get.exe install msys-unzip
+The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and other tools are expected to reside in the location defined by the variable VS120COMNTOOLS which is set by the Microsoft Visual Studio installer.
Only the C++ part of VS2013 is needed. Try to let the installation go to the default install directory. Always reboot your system after installing VS2013. The system environment variable VS120COMNTOOLS should be set in your environment.
+Make sure that TMP and TEMP are also set in the environment and refer to Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, and not C:/temp. C:\temp is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables.
Make sure you get the right XCode version.
+The basic invocation of the configure script looks like:
+++
bash ./configure [options]
This will create an output directory containing the "configuration" and setup an area for the build result. This directory typically looks like:
++++
build/linux-x64-normal-server-release
configure will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem. When this happens, read more below in the configure options.
Some examples:
+++Windows 32bit build with freetype specified:
+
+bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32
++Debug 64bit Build:
+
+bash ./configure --enable-debug --with-target-bits=64
Complete details on all the OpenJDK configure options can be seen with:
+++
bash ./configure --help=short
Use -help to see all the configure options available. You can generate any number of different configurations, e.g. debug, release, 32, 64, etc.
Some of the more commonly used configure options are:
++ ++
--enable-debug
+set the debug level to fastdebug (this is a shorthand for--with-debug-level=fastdebug)
+++
--with-alsa=path
+select the location of the Advanced Linux Sound Architecture (ALSA)
++Version 0.9.1 or newer of the ALSA files are required for building the OpenJDK on Linux. These Linux files are usually available from an "alsa" of "libasound" development package, and it's highly recommended that you try and use the package provided by the particular version of Linux that you are using.
+
+++
--with-boot-jdk=path
+select the Bootstrap JDK
+++
--with-boot-jdk-jvmargs="args"
+provide the JVM options to be used to run the Bootstrap JDK
+++
--with-cacerts=path
+select the path to the cacerts file.
++ +See Certificate Authority on Wikipedia for a better understanding of the Certificate Authority (CA). A certificates file named "cacerts" represents a system-wide keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" file contains root CA certificates from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source contain a cacerts file without CA root certificates. Formal JDK builders will need to secure permission from each public CA and include the certificates into their own custom cacerts file. Failure to provide a populated cacerts file will result in verification errors of a certificate chain during runtime. By default an empty cacerts file is provided and that should be fine for most JDK developers.
+
+++
--with-cups=path
+select the CUPS install location
++The Common UNIX Printing System (CUPS) Headers are required for building the OpenJDK on Solaris and Linux. The Solaris header files can be obtained by installing the package print/cups.
+
++The CUPS header files can always be downloaded from www.cups.org.
+
+++
--with-cups-include=path
+select the CUPS include directory location
+++
--with-debug-level=level
+select the debug information level of release, fastdebug, or slowdebug
++ ++
--with-dev-kit=path
+select location of the compiler install or developer install location
+++
--with-freetype=path
+select the freetype files to use.
++Expecting the freetype libraries under
+lib/and the headers underinclude/.
++Version 2.3 or newer of FreeType is required. On Unix systems required files can be available as part of your distribution (while you still may need to upgrade them). Note that you need development version of package that includes both the FreeType library and header files.
+
++You can always download latest FreeType version from the FreeType website. Building the freetype 2 libraries from scratch is also possible, however on Windows refer to the Windows FreeType DLL build instructions.
+
++Note that by default FreeType is built with byte code hinting support disabled due to licensing restrictions. In this case, text appearance and metrics are expected to differ from Sun's official JDK build. See the SourceForge FreeType2 Home Page for more information.
+
+++
--with-import-hotspot=path
+select the location to find hotspot binaries from a previous build to avoid building hotspot
+++
--with-target-bits=arg
+select 32 or 64 bit build
+++
--with-jvm-variants=variants
+select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark
+++
--with-memory-size=size
+select the RAM size that GNU make will think this system has
+++
--with-msvcr-dll=path
+select themsvcr100.dllfile to include in the Windows builds (C/C++ runtime library for Visual Studio).
++This is usually picked up automatically from the redist directories of Visual Studio 2013.
+
++ ++
--with-num-cores=cores
+select the number of cores to use (processor count or CPU count)
+++
--with-x=path
+select the location of the X11 and xrender files.
++The XRender Extension Headers are required for building the OpenJDK on Solaris and Linux. The Linux header files are usually available from a "Xrender" development package, it's recommended that you try and use the package provided by the particular distribution of Linux that you are using. The Solaris XRender header files is included with the other X11 header files in the package SFWxwinc on new enough versions of Solaris and will be installed in
+/usr/X11/include/X11/extensions/Xrender.hor/usr/openwin/share/include/X11/extensions/Xrender.h
The basic invocation of the make utility looks like:
+++
make all
This will start the build to the output directory containing the "configuration" that was created by the configure script. Run make help for more information on the available targets.
There are some of the make targets that are of general interest:
+++empty
+
+build everything but no images
+++
all
+build everything including images
+++
all-conf
+build all configurations
+++
images
+create complete j2sdk and j2re images
+++
install
+install the generated images locally, typically in/usr/local
+++
clean
+remove all files generated by make, but not those generated byconfigure
+++
dist-clean
+remove all files generated by both andconfigure(basically killing the configuration)
+++
help
+give some help on usingmake, including some interesting make targets
When the build is completed, you should see the generated binaries and associated files in the j2sdk-image directory in the output directory. In particular, the build/*/images/j2sdk-image/bin directory should contain executables for the OpenJDK tools and utilities for that configuration. The testing tool jtreg will be needed and can be found at: the jtreg site. The provided regression tests in the repositories can be run with the command:
+++
cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all
Q: The generated-configure.sh file looks horrible! How are you going to edit it?
+A: The generated-configure.sh file is generated (think "compiled") by the autoconf tools. The source code is in configure.ac and various .m4 files in common/autoconf, which are much more readable.
Q: Why is the generated-configure.sh file checked in, if it is generated?
+A: If it was not generated, every user would need to have the autoconf tools installed, and re-generate the configure file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required.
Q: Do you require a specific version of autoconf for regenerating generated-configure.sh?
+A: Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in generated-configure.sh.
Q: How do you regenerate generated-configure.sh after making changes to the input files?
+A: Regnerating generated-configure.sh should always be done using the script common/autoconf/autogen.sh to ensure that the correct files get updated. This script should also be run after mercurial tries to merge generated-configure.sh as a merge of the generated file is not guaranteed to be correct.
Q: What are the files in common/makefiles/support/* for? They look like gibberish.
+A: They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will not work properly. These helper files are part of an elaborate hack that will compress the command line in the makefile and then uncompress it safely. We're not proud of it, but it does fix the problem. If you have any better suggestions, we're all ears! :-)
Q: I want to see the output of the commands that make runs, like in the old build. How do I do that?
+A: You specify the LOG variable to make. There are several log levels:
warn -- Default and very quiet.info -- Shows more progress information than warn.debug -- Echos all command lines and prints all macro calls for compilation definitions.trace -- Echos all $(shell) command lines as well.Q: When do I have to re-run configure?
+A: Normally you will run configure only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the configure script.
Q: I have added a new source file. Do I need to modify the makefiles?
+A: Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where the source files are spread over many directories which also contain sources for other libraries. In these cases it was simply easier to create include lists rather than excludes.
Q: When I run configure --help, I see many strange options, like --dvidir. What is this?
+A: Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use configure --help=short instead.
Q: configure provides OpenJDK-specific features such as --with-builddeps-server that are not described in this document. What about those?
+A: Try them out if you like! But be aware that most of these are experimental features. Many of them don't do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time.
Q: How will you make sure you don't break anything?
+A: We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, which might differ in a byte-by-byte comparison, even when building twice with the old build system. For these, we compare relevant aspects (e.g. the symbol table and file size). Note that we still don't have 100% equivalence, but we're close.
Q: I noticed this thing X in the build that looks very broken by design. Why don't you fix it?
+A: Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to obscurity, but in the new build system the weird stuff comes up to the surface. The plan is to attack these things at a later stage, after the new build system is established.
Q: The code in the new build system is not that well-structured. Will you fix this?
+A: Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after.
Q: Is anything able to use the results of the new build's default make target?
+A: Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you should only spend time recompiling what's changed (making it purely incremental) and only do the work that's needed to actually run and test your code. The packaging stuff that is part of the images target is not needed for a normal developer who wants to test his new code. Even if it's quite fast, it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds...)
Q: I usually set a specific environment variable when building, but I can't find the equivalent in the new build. What should I do?
+A: It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it!
Building OpenJDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as parallel threads and memory. The configure script analyzes your system and selects reasonable values for such options based on your hardware. If you encounter resource problems, such as out of memory conditions, you can modify the detected values with:
--with-num-cores -- number of cores in the build system, e.g. --with-num-cores=8--with-memory-size -- memory (in MB) available in the build system, e.g. --with-memory-size=1024It might also be necessary to specify the JVM arguments passed to the Bootstrap JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing this will override the default JVM arguments passed to the Bootstrap JDK.
One of the top goals of the new build system is to improve the build performance and decrease the time needed to build. This will soon also apply to the java compilation when the Smart Javac wrapper is fully supported.
+At the end of a successful execution of configure, you will get a performance summary, indicating how well the build will perform. Here you will also get performance hints. If you want to build fast, pay attention to those!
The OpenJDK build supports building with ccache when using gcc or clang. Using ccache can radically speed up compilation of native code if you often rebuild the same sources. Your milage may vary however so we recommend evaluating it for yourself. To enable it, make sure it's on the path and configure with --enable-ccache.
If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk. The performance penalty is extremely high for building on a network share, close to unusable.
+The old build builds multiple JVMs on 32-bit systems (client and server; and on Windows kernel as well). In the new build we have changed this default to only build server when it's available. This improves build times for those not interested in multiple JVMs. To mimic the old behavior on platforms that support it, use --with-jvm-variants=client,server.
By default, configure will analyze your machine and run the make process in parallel with as many threads as you have cores. This behavior can be overridden, either "permanently" (on a configure basis) using --with-num-cores=N or for a single build only (on a make basis), using make JOBS=N.
If you want to make a slower build just this time, to save some CPU power for other processes, you can run e.g. make JOBS=2. This will force the makefiles to only run 2 parallel processes, or even make JOBS=1 which will disable parallelism.
If you want to have it the other way round, namely having slow builds default and override with fast if you're impatient, you should call configure with --with-num-cores=2, making 2 the default. If you want to run with more cores, run make JOBS=8
If the build fails (and it's not due to a compilation error in a source file you've changed), the first thing you should do is to re-run the build with more verbosity. Do this by adding LOG=debug to your make command line.
The build log (with both stdout and stderr intermingled, basically the same as you see on your console) can be found as build.log in your build directory.
You can ask for help on build problems with the new build system on either the build-dev or the build-infra-dev mailing lists. Please include the relevant parts of the build log.
+A build can fail for any number of reasons. Most failures are a result of trying to build in an environment in which all the pre-build requirements have not been met. The first step in troubleshooting a build failure is to recheck that you have satisfied all the pre-build requirements for your platform. Scanning the configure log is a good first step, making sure that what it found makes sense for your system. Look for strange error messages or any difficulties that configure had in finding things.
Some of the more common problems with builds are briefly described below, with suggestions for remedies.
+Corrupted Bundles on Windows:
+Some virus scanning software has been known to corrupt the downloading of zip bundles. It may be necessary to disable the 'on access' or 'real time' virus scanning features to prevent this corruption. This type of 'real time' virus scanning can also slow down the build process significantly. Temporarily disabling the feature, or excluding the build output directory may be necessary to get correct and faster builds.
Slow Builds:
+If your build machine seems to be overloaded from too many simultaneous C++ compiles, try setting the JOBS=1 on the make command line. Then try increasing the count slowly to an acceptable level for your system. Also:
Creating the javadocs can be very slow, if you are running javadoc, consider skipping that step.
+Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends to be CPU intensive (many C++ compiles), and the rest of the JDK will often be disk intensive.
+Faster compiles are possible using a tool called ccache.
+++Warning message:
+File 'xxx' has modification time in the future.
+Warning message:Clock skew detected. Your build may be incomplete.
These warnings can occur when the clock on the build machine is out of sync with the timestamps on the source files. Other errors, apparently unrelated but in fact caused by the clock skew, can occur along with the clock skew warnings. These secondary errors may tend to obscure the fact that the true root cause of the problem is an out-of-sync clock.
+If you see these warnings, reset the clock on the build machine, run "gmake clobber" or delete the directory containing the build output, and restart the build from the beginning.
Trouble writing out table to disk+++
make JOBS=1
to reduce the load on the system.
+Error Message: libstdc++ not found:
+This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the libstdc++ package. Various parts of the JDK build require a static link of the C++ runtime libraries to allow for maximum portability of the built images.
Linux Error Message: cannot restore segment prot after reloc
+This is probably an issue with SELinux (See SELinux on Wikipedia). Parts of the VM is built without the -fPIC for performance reasons.
To completely disable SELinux:
+$ su root# system-config-securitylevelIn the window that appears, select the SELinux tabDisable SELinuxAlternatively, instead of completely disabling it you could disable just this one check.
+*** fatal error - couldn't allocate heap, ...rm fails with "Directory not empty"unzip fails with "cannot create ... Permission denied"unzip fails with "cannot create ... Error 50"The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on BLODA (applications that interfere with CYGWIN).
+spawn failedThe Makefiles in the OpenJDK are only valid when used with the GNU version of the utility command make (usually called gmake on Solaris). A few notes about using GNU make:
PATH./usr/bin/make on Solaris. If your Solaris system has the software from the Solaris Developer Companion CD installed, you should try and use /usr/bin/gmake or /usr/gnu/bin/make.Information on GNU make, and access to ftp download sites, are available on the GNU make web site. The latest source to GNU make is available at ftp.gnu.org/pub/gnu/make/.
+First step is to get the GNU make 3.81 or newer source from ftp.gnu.org/pub/gnu/make/. Building is a little different depending on the OS but is basically done with:
+ bash ./configure
+ make
+This file often describes specific requirements for what we call the "minimum build environments" (MBE) for this specific release of the JDK. What is listed below is what the Oracle Release Engineering Team will use to build the Oracle JDK product. Building with the MBE will hopefully generate the most compatible bits that install on, and run correctly on, the most variations of the same base OS and hardware architecture. In some cases, these represent what is often called the least common denominator, but each Operating System has different aspects to it.
+In all cases, the Bootstrap JDK version minimum is critical, we cannot guarantee builds will work with older Bootstrap JDK's. Also in all cases, more RAM and more processors is better, the minimums listed below are simply recommendations.
+With Solaris and Mac OS X, the version listed below is the oldest release we can guarantee builds and works, and the specific version of the compilers used could be critical.
+With Windows the critical aspect is the Visual Studio compiler used, which due to it's runtime, generally dictates what Windows systems can do the builds and where the resulting bits can be used.
+NOTE: We expect a change here off these older Windows OS releases and to a 'less older' one, probably Windows 2008R2 X64.
+With Linux, it was just a matter of picking a stable distribution that is a good representative for Linux in general.
+It is understood that most developers will NOT be using these specific versions, and in fact creating these specific versions may be difficult due to the age of some of this software. It is expected that developers are more often using the more recent releases and distributions of these operating systems.
+Compilation problems with newer or different C/C++ compilers is a common problem. Similarly, compilation problems related to changes to the /usr/include or system header files is also a common problem with older, newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly.
Bootstrap JDK: JDK 8
+| Base OS and Architecture | +OS | +C/C++ Compiler | +Processors | +RAM Minimum | +DISK Needs | +
|---|---|---|---|---|---|
| Linux X86 (32-bit) and X64 (64-bit) | +Oracle Enterprise Linux 6.4 | +gcc 4.9.2 | +2 or more | +1 GB | +6 GB | +
| Solaris SPARCV9 (64-bit) | +Solaris 11 Update 1 | +Studio 12 Update 4 + patches | +4 or more | +4 GB | +8 GB | +
| Solaris X64 (64-bit) | +Solaris 11 Update 1 | +Studio 12 Update 4 + patches | +4 or more | +4 GB | +8 GB | +
| Windows X86 (32-bit) | +Windows Server 2012 R2 x64 | +Microsoft Visual Studio C++ 2013 Professional Edition | +2 or more | +2 GB | +6 GB | +
| Windows X64 (64-bit) | +Windows Server 2012 R2 x64 | +Microsoft Visual Studio C++ 2013 Professional Edition | +2 or more | +2 GB | +6 GB | +
| Mac OS X X64 (64-bit) | +Mac OS X 10.9 "Mavericks" | +Xcode 6.3 or newer | +2 or more | +4 GB | +6 GB | +
We won't be listing all the possible environments, but we will try to provide what information we have available to us.
+NOTE: The community can help out by updating this part of the document.
+After installing the latest Fedora you need to install several build dependencies. The simplest way to do it is to execute the following commands as user root:
yum-builddep java-1.7.0-openjdk
+ yum install gcc gcc-c++
+In addition, it's necessary to set a few environment variables for the build:
+ export LANG=C
+ export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
+After installing CentOS 5.5 you need to make sure you have the following Development bundles installed:
+Plus the following packages:
+The freetype 2.3 packages don't seem to be available, but the freetype 2.3 sources can be downloaded, built, and installed easily enough from the freetype site. Build and install with something like:
+ bash ./configure
+ make
+ sudo -u root make install
+Mercurial packages could not be found easily, but a Google search should find ones, and they usually include Python if it's needed.
+After installing Debian 5 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root:
aptitude build-dep openjdk-7
+ aptitude install openjdk-7-jdk libmotif-dev
+In addition, it's necessary to set a few environment variables for the build:
+ export LANG=C
+ export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+After installing Ubuntu 12.04 you need to install several build dependencies. The simplest way to do it is to execute the following commands:
+ sudo aptitude build-dep openjdk-7
+ sudo aptitude install openjdk-7-jdk
+In addition, it's necessary to set a few environment variables for the build:
+ export LANG=C
+ export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+After installing OpenSUSE 11.1 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:
+ sudo zypper source-install -d java-1_7_0-openjdk
+ sudo zypper install make
+In addition, it is necessary to set a few environment variables for the build:
+ export LANG=C
+ export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
+Finally, you need to unset the JAVA_HOME environment variable:
export -n JAVA_HOME`
+After installing Mandriva Linux One 2009 Spring you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root:
urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
+ libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
+ libxtst6-devel libxi-devel
+In addition, it is necessary to set a few environment variables for the build:
+ export LANG=C
+ export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
+After installing OpenSolaris 2009.06 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:
+ pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
+ SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
+In addition, it is necessary to set a few environment variables for the build:
+ export LANG=C
+ export PATH="/opt/SunStudioExpress/bin:${PATH}"
+End of the OpenJDK build README document.
+Please come again!
+ + diff --git a/README-builds.md b/common/doc/building.md similarity index 77% rename from README-builds.md rename to common/doc/building.md index c6907cd7ab2..3eb96dfd6e1 100644 --- a/README-builds.md +++ b/common/doc/building.md @@ -1,9 +1,9 @@ +% OpenJDK Build README +  -# OpenJDK Build README -***** +-------------------------------------------------------------------------------- - ## Introduction This README file contains build instructions for the @@ -19,34 +19,34 @@ Some Headlines: is recommended. * The build should scale, i.e. more processors should cause the build to be done in less wall-clock time - * Nested or recursive make invocations have been significantly reduced, - as has the total fork/exec or spawning of sub processes during the build + * Nested or recursive make invocations have been significantly reduced, as + has the total fork/exec or spawning of sub processes during the build * Windows MKS usage is no longer supported * Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run automatically * Ant is no longer used when building the OpenJDK - * Use of ALT_* environment variables for configuring the build is no longer + * Use of ALT\_\* environment variables for configuring the build is no longer supported -***** +------------------------------------------------------------------------------- ## Contents * [Introduction](#introduction) * [Use of Mercurial](#hg) - * [Getting the Source](#get_source) - * [Repositories](#repositories) + * [Getting the Source](#get_source) + * [Repositories](#repositories) * [Building](#building) - * [System Setup](#setup) - * [Linux](#linux) - * [Solaris](#solaris) - * [Mac OS X](#macosx) - * [Windows](#windows) - * [Configure](#configure) - * [Make](#make) + * [System Setup](#setup) + * [Linux](#linux) + * [Solaris](#solaris) + * [Mac OS X](#macosx) + * [Windows](#windows) + * [Configure](#configure) + * [Make](#make) * [Testing](#testing) -***** +------------------------------------------------------------------------------- * [Appendix A: Hints and Tips](#hints) * [FAQ](#faq) @@ -55,23 +55,22 @@ Some Headlines: * [Appendix B: GNU Make Information](#gmake) * [Appendix C: Build Environments](#buildenvironments) -***** +------------------------------------------------------------------------------- - ## Use of Mercurial The OpenJDK sources are maintained with the revision control system [Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to -Mercurial, please see the [Beginner Guides](http://mercurial.selenic.com/wiki/ -BeginnersGuides) or refer to the [Mercurial Book](http://hgbook.red-bean.com/). -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works. +Mercurial, please see the [Beginner +Guides](http://mercurial.selenic.com/wiki/BeginnersGuides) or refer to the +[Mercurial Book](http://hgbook.red-bean.com/). The first few chapters of the +book provide an excellent overview of Mercurial, what it is and how it works. For using Mercurial with the OpenJDK refer to the [Developer Guide: Installing -and Configuring Mercurial](http://openjdk.java.net/guide/ -repositories.html#installConfig) section for more information. +and Configuring +Mercurial](http://openjdk.java.net/guide/repositories.html#installConfig) +section for more information. - ### Getting the Source To get the entire set of OpenJDK Mercurial repositories use the script @@ -83,16 +82,15 @@ To get the entire set of OpenJDK Mercurial repositories use the script Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run `./get_source.sh` anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same `hg` command to each of the repositories. For -example, the script `make/scripts/hgforest.sh` can be used to repeat the -same `hg` command on every repository, e.g. +pull over all the latest changesets in all the repositories. This set of nested +repositories has been given the term "forest" and there are various ways to +apply the same `hg` command to each of the repositories. For example, the +script `make/scripts/hgforest.sh` can be used to repeat the same `hg` command +on every repository, e.g. cd YourOpenJDK bash ./make/scripts/hgforest.sh status - ### Repositories The set of repositories and what they contain: @@ -135,9 +133,8 @@ There are some very basic guidelines: * Files not needed for typical building or testing of the repository should not be added to the repository. -***** +------------------------------------------------------------------------------- - ## Building The very first step in building the OpenJDK is making sure the system itself @@ -148,7 +145,7 @@ Building the OpenJDK is now done with running a `configure` script which will try and find and verify you have everything you need, followed by running `make`, e.g. -> **`bash ./configure`** +> **`bash ./configure`** \ > **`make all`** Where possible the `configure` script will attempt to located the various @@ -161,9 +158,8 @@ system due to missing software packages. **NOTE:** The `configure` script file does not have execute permissions and will need to be explicitly run with `bash`, see the source guidelines. -***** +------------------------------------------------------------------------------- - ### System Setup Before even attempting to use a system to build the OpenJDK there are some very @@ -174,14 +170,14 @@ basic system setups needed. For all systems: * Install a Bootstrap JDK. All OpenJDK builds require access to a previously - released JDK called the _bootstrap JDK_ or _boot JDK._ The general rule is + released JDK called the *bootstrap JDK* or *boot JDK.* The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level. - **_Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as + ***Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as the boot JDK, to ensure that JDK 9 dependencies are not introduced into the - parts of the system that are built with JDK 8._** + parts of the system that are built with JDK 8.*** The JDK 8 binaries can be downloaded from Oracle's [JDK 8 download site](http://www.oracle.com/technetwork/java/javase/downloads/index.html). @@ -217,7 +213,6 @@ And for specific systems: Install [XCode 6.3](https://developer.apple.com/xcode/) - #### Linux With Linux, try and favor the system packages over building your own or getting @@ -231,69 +226,29 @@ refer to the JDK installed on your Linux system. You will need to unset you are getting from the default system settings make sense for building the OpenJDK. - #### Solaris - ##### Studio Compilers -At a minimum, the [Studio 12 Update 4 Compilers](http://www.oracle.com/ -technetwork/server-storage/solarisstudio/downloads/index.htm) (containing -version 5.13 of the C and C++ compilers) is required, including specific -patches. +At a minimum, the [Studio 12 Update 4 +Compilers](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm) +(containing version 5.13 of the C and C++ compilers) is required, including +specific patches. The Solaris Studio installation should contain at least these packages: ->| **Package** | -**Version** | -
| developer/solarisstudio-124/backend | -12.4-1.0.6.0 | -
| developer/solarisstudio-124/c++ | -12.4-1.0.10.0 | -
| developer/solarisstudio-124/cc | -12.4-1.0.4.0 | -
| developer/solarisstudio-124/library/c++-libs | -12.4-1.0.10.0 | -
| developer/solarisstudio-124/library/math-libs | -12.4-1.0.0.1 | -
| developer/solarisstudio-124/library/studio-gccrt | -12.4-1.0.0.1 | -
| developer/solarisstudio-124/studio-common | -12.4-1.0.0.1 | -
| developer/solarisstudio-124/studio-ja | -12.4-1.0.0.1 | -
| developer/solarisstudio-124/studio-legal | -12.4-1.0.0.1 | -
| developer/solarisstudio-124/studio-zhCN | -12.4-1.0.0.1 | -
| Binary Name | -Category | -Package | -Description | -
| ar.exe | -Devel | -binutils | -The GNU assembler, linker and binary utilities | -
| make.exe | -Devel | -make | -The GNU version of the 'make' utility built for CYGWIN | -
| m4.exe | -Interpreters | -m4 | -GNU implementation of the traditional Unix macro processor | -
| cpio.exe | -Utils | -cpio | -A program to manage archives of files | -
| gawk.exe | -Utils | -awk | -Pattern-directed scanning and processing language | -
| file.exe | -Utils | -file | -Determines file type using 'magic' numbers | -
| zip.exe | -Archive | -zip | -Package and compress (archive) files | -
| unzip.exe | -Archive | -unzip | -Extract compressed files in a ZIP archive | -
| free.exe | -System | -procps | -Display amount of free and used memory in the system | -
| Base OS and Architecture | -OS | -C/C++ Compiler | -Bootstrap JDK | -Processors | -RAM Minimum | -DISK Needs | -
|---|---|---|---|---|---|---|
| Linux X86 (32-bit) and X64 (64-bit) | -Oracle Enterprise Linux 6.4 | -gcc 4.9.2 | -JDK 8 | -2 or more | -1 GB | -6 GB | -
| Solaris SPARCV9 (64-bit) | -Solaris 11 Update 1 | -Studio 12 Update 4 + patches | -JDK 8 | -4 or more | -4 GB | -8 GB | -
| Solaris X64 (64-bit) | -Solaris 11 Update 1 | -Studio 12 Update 4 + patches | -JDK 8 | -4 or more | -4 GB | -8 GB | -
| Windows X86 (32-bit) | -Windows Server 2012 R2 x64 | -Microsoft Visual Studio C++ 2013 Professional Edition | -JDK 8 | -2 or more | -2 GB | -6 GB | -
| Windows X64 (64-bit) | -Windows Server 2012 R2 x64 | -Microsoft Visual Studio C++ 2013 Professional Edition | -JDK 8 | -2 or more | -2 GB | -6 GB | -
| Mac OS X X64 (64-bit) | -Mac OS X 10.9 "Mavericks" | -Xcode 6.3 or newer | -JDK 8 | -2 or more | -4 GB | -6 GB | -
This new way of running tests is developer-centric. It assumes that you have built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.
+Some example command-lines:
+$ make run-test-tier1
+$ make run-test-jdk_lang JTREG="JOBS=8"
+$ make run-test TEST=jdk_lang
+$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
+$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
+$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
+All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the TEST variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.
For some common top-level tests, direct make targets have been generated. This includes all JTreg test groups, the hotspot gtest, and custom tests (if present). This means that make run-test-tier1 is equivalent to make run-test TEST="tier1", but the latter is more tab-completion friendly. For more complex test runs, the run-test TEST="x" solution needs to be used.
The test specifications given in TEST is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, :tier1 will expand to jtreg:jdk/test:tier1 jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1. You can always submit a list of fully qualified test descriptors in the TEST variable if you want to shortcut the parser.
JTreg test groups can be specified either without a test root, e.g. :tier1 (or tier1, the initial colon is optional), or with, e.g. hotspot/test:tier1, jdk/test:jdk_util.
When specified without a test root, all matching groups from all tests roots will be added. Otherwise, only the group from the specified test root will be added.
+Individual JTreg tests or directories containing JTreg tests can also be specified, like hotspot/test/native_sanity/JniVersion.java or hotspot/test/native_sanity. You can also specify an absolute path, to point to a JTreg test outside the source tree.
As long as the test groups or test paths can be uniquely resolved, you do not need to enter the jtreg: prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add jtreg:, e.g. jtreg:hotspot/test/native_sanity.
Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just gtest, or as a fully qualified test descriptor gtest:all.
If you want, you can single out an individual test or a group of tests, for instance gtest:LogDecorations or gtest:LogDecorations.level_test_vm. This can be particularly useful if you want to run a shaky test repeatedly.
At the end of the test run, a summary of all tests run will be presented. This will have a consistent look, regardless of what test suites were used. This is a sample summary:
+==============================
+Test summary
+==============================
+ TEST TOTAL PASS FAIL ERROR
+>> jtreg:jdk/test:tier1 1867 1865 2 0 <<
+ jtreg:langtools/test:tier1 4711 4711 0 0
+ jtreg:nashorn/test:tier1 133 133 0 0
+==============================
+TEST FAILURE
+Tests where the number of TOTAL tests does not equal the number of PASSed tests will be considered a test failure. These are marked with the >> ... << marker for easy identification.
The classification of non-passed tests differs a bit between test suites. In the summary, ERROR is used as a catch-all for tests that neither passed nor are classified as failed by the framework. This might indicate test framework error, timeout or other problems.
+In case of test failures, make run-test will exit with a non-zero exit value.
All tests have their result stored in build/$BUILD/test-result/$TEST_ID, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for jtreg:jdk/test:tier1 the TEST_ID is jtreg_jdk_test_tier1. This path is also printed in the log at the end of the test run.
Additional work data is stored in build/$BUILD/test-support/$TEST_ID. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.
It is possible to control various aspects of the test suites using make control variables.
+These variables use a keyword=value approach to allow multiple values to be set. So, for instance, JTREG="JOBS=1;TIMEOUT=8" will set the JTreg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting JTREG_JOBS=1 JTREG_TIMEOUT=8, but using the keyword format means that the JTREG variable is parsed and verified for correctness, so JTREG="TMIEOUT=8" would give an error, while JTREG_TMIEOUT=8 would just pass unnoticed.
To separate multiple keyword=value pairs, use ; (semicolon). Since the shell normally eats ;, the recommended usage is to write the assignment inside qoutes, e.g. JTREG="...;...". This will also make sure spaces are preserved, as in JTREG="VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug".
(Other ways are possible, e.g. using backslash: JTREG=JOBS=1\;TIMEOUT=8. Also, as a special technique, the string %20 will be replaced with space for certain options, e.g. JTREG=VM_OTIONS=-XshowSettings%20-Xlog:gc+ref=debug. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)
As far as possible, the names of the keywords have been standardized between test suites.
+The test concurrency (-concurrency).
Defaults to TEST_JOBS (if set by --with-test-jobs=), otherwise it defaults to JOBS, except for Hotspot, where the default is number of CPU cores/2, but never more than 12.
The timeout factor (-timeoutFactor).
Defaults to 4.
+The test mode (-agentvm, -samevm or -othervm).
Defaults to -agentvm.
Enable asserts (-ea -esa, or none).
Set to true or false. If true, adds -ea -esa. Defaults to true, except for hotspot.
The verbosity level (-verbose).
Defaults to fail,error,summary.
What test data to retain (-retain).
Defaults to fail,error.
Limit memory consumption (-Xmx and -vmoption:-Xmx, or none).
Limit memory consumption for JTreg test framework and VM under test. Set to 0 to disable the limits.
+Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
+Additional options to the JTreg test framework.
+Use JTREG="OPTIONS=--help all" to see all available JTreg options.
Additional Java options to JTreg (-javaoption).
Additional VM options to JTreg (-vmoption).
The number of times to repeat the tests (--gtest_repeat).
Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with OPTIONS=--gtest_break_on_failure to reproduce an intermittent problem.
Additional options to the Gtest test framework.
+Use GTEST="OPTIONS=--help" to see all available Gtest options.
* When a per-application ORB is created via the 2-arg init methods, * then it will be located using the thread context class loader. + *
+ * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, + * in the Java run-time image, to search for orb.properties. + * This location is not intended for user editable configuration files. + * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, + * and thereafter the ${java.home}/lib directory. * * @since JDK1.2 */ @@ -271,14 +277,25 @@ abstract public class ORB { } String javaHome = System.getProperty("java.home"); - fileName = javaHome + File.separator - + "lib" + File.separator + "orb.properties"; - props = getFileProperties( fileName ) ; + + fileName = javaHome + File.separator + "conf" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); + + if (props != null) { + String value = props.getProperty(name); + if (value != null) + return value; + } + + fileName = javaHome + File.separator + "lib" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); if (props == null) - return null ; + return null; else - return props.getProperty( name ) ; + return props.getProperty(name); } } ); diff --git a/corba/src/java.corba/share/classes/sun/corba/Bridge.java b/corba/src/java.corba/share/classes/sun/corba/Bridge.java index 1b3a086c088..e22240e2a9f 100644 --- a/corba/src/java.corba/share/classes/sun/corba/Bridge.java +++ b/corba/src/java.corba/share/classes/sun/corba/Bridge.java @@ -59,10 +59,10 @@ import sun.reflect.ReflectionFactory; * * The code that calls Bridge.get() must have the following Permissions: *
* All of these permissions are required to obtain and correctly initialize @@ -105,10 +105,10 @@ public final class Bridge /** Fetch the Bridge singleton. This requires the following * permissions: *
=========================================================================
diff --git a/jaxp/src/java.xml/share/legal/dom.md b/jaxp/src/java.xml/share/legal/dom.md
index de63edd485c..b0fb1ae76d4 100644
--- a/jaxp/src/java.xml/share/legal/dom.md
+++ b/jaxp/src/java.xml/share/legal/dom.md
@@ -1,6 +1,6 @@
-## DOM Level 3 core specification, v1.0
+## DOM Level 3 Core Specification v1.0
-## W3C License
+### W3C License
W3C SOFTWARE NOTICE AND LICENSE
diff --git a/jaxp/src/java.xml/share/legal/xalan.md b/jaxp/src/java.xml/share/legal/xalan.md
index 5c1749b3721..94b293164df 100644
--- a/jaxp/src/java.xml/share/legal/xalan.md
+++ b/jaxp/src/java.xml/share/legal/xalan.md
@@ -1,6 +1,6 @@
## Apache Xalan v2.7.1
-### Notice
+### Apache Xalan Notice
======================================================================================
diff --git a/jaxp/src/java.xml/share/legal/xerces.md b/jaxp/src/java.xml/share/legal/xerces.md
index 438419b13c9..ff0167bc835 100644
--- a/jaxp/src/java.xml/share/legal/xerces.md
+++ b/jaxp/src/java.xml/share/legal/xerces.md
@@ -1,7 +1,7 @@
## Apache Xerces v2.11.0
-### Notice
-
+### Apache Xerces Notice
+
=========================================================================
== NOTICE file corresponding to section 4(d) of the Apache License, ==
== Version 2.0, in this case for the Apache Xerces Java distribution. ==
@@ -17,6 +17,7 @@
- voluntary contributions made by Paul Eng on behalf of the
Apache Software Foundation that were originally developed at iClick, Inc.,
software copyright (c) 1999.
+
### Apache 2.0 License
diff --git a/jaxp/src/java.xml/share/legal/xmlresolver.md b/jaxp/src/java.xml/share/legal/xmlresolver.md
index cf18bb439b3..696f8d3e148 100644
--- a/jaxp/src/java.xml/share/legal/xmlresolver.md
+++ b/jaxp/src/java.xml/share/legal/xmlresolver.md
@@ -1,6 +1,6 @@
## Apache XML Resolver Library v1.2
-### Notice
+### Apache XML Resolver Notice
Apache XML Commons Resolver
diff --git a/jaxp/src/jdk.xml.dom/share/classes/module-info.java b/jaxp/src/jdk.xml.dom/share/classes/module-info.java
index 6828629b489..24b90c723f5 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/module-info.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/module-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -23,6 +23,13 @@
* questions.
*/
+/**
+ * Defines the subset of the W3C Document Object Model (DOM) API that is not part
+ * of the Java SE API.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.xml.dom {
requires transitive java.xml;
exports org.w3c.dom.css;
diff --git a/jaxp/test/TEST.ROOT b/jaxp/test/TEST.ROOT
index 5f7295efea1..d0b691366eb 100644
--- a/jaxp/test/TEST.ROOT
+++ b/jaxp/test/TEST.ROOT
@@ -23,7 +23,7 @@ modules=java.xml
groups=TEST.groups
# Minimum jtreg version
-requiredVersion=4.2 b04
+requiredVersion=4.2 b07
# Use new module options
useNewOptions=true
diff --git a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java
index f9e25de8bd6..2ee5dafa901 100644
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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,14 +27,16 @@ import static catalog.CatalogTestUtils.DEFER_FALSE;
import static catalog.CatalogTestUtils.DEFER_TRUE;
import static catalog.CatalogTestUtils.getCatalogPath;
import static javax.xml.catalog.CatalogFeatures.Feature.DEFER;
-import static javax.xml.catalog.CatalogManager.catalog;
import static jaxp.library.JAXPTestUtilities.runWithAllPerm;
import static jaxp.library.JAXPTestUtilities.tryRunWithAllPerm;
import java.lang.reflect.Method;
import javax.xml.catalog.Catalog;
+import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogFeatures;
+import javax.xml.catalog.CatalogManager;
+import javax.xml.catalog.CatalogResolver;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
@@ -43,7 +45,7 @@ import org.testng.annotations.Test;
/*
* @test
- * @bug 8077931
+ * @bug 8077931 8176405
* @library /javax/xml/jaxp/libs
* @modules java.xml/javax.xml.catalog:open
* @run testng/othervm -DrunSecMngr=true catalog.DeferFeatureTest
@@ -61,6 +63,18 @@ public class DeferFeatureTest {
Assert.assertEquals(loadedCatalogCount(catalog), catalogCount);
}
+ @Test(dataProvider = "testDeferFeatureByResolve")
+ public void testDeferFeatureByResolve(Catalog catalog, int catalogCount)
+ throws Exception {
+ CatalogResolver cr = createResolver(catalog);
+ // trigger loading alternative catalogs
+ try {
+ cr.resolveEntity("-//REMOTE//DTD ALICE DOCALICE", "http://remote/dtd/alice/");
+ } catch (CatalogException ce) {}
+
+ Assert.assertEquals(loadedCatalogCount(catalog), catalogCount);
+ }
+
@DataProvider(name = "catalog-countOfLoadedCatalogFile")
public Object[][] data() {
return new Object[][]{
@@ -73,12 +87,23 @@ public class DeferFeatureTest {
{createCatalog(createDeferFeature(DEFER_FALSE)), 4}};
}
+ @DataProvider(name = "testDeferFeatureByResolve")
+ public Object[][] getData() {
+ return new Object[][]{
+ {createCatalog(createDeferFeature(DEFER_TRUE)), 4}
+ };
+ }
+
private CatalogFeatures createDeferFeature(String defer) {
return CatalogFeatures.builder().with(DEFER, defer).build();
}
private Catalog createCatalog(CatalogFeatures feature) {
- return catalog(feature, getCatalogPath("deferFeature.xml"));
+ return CatalogManager.catalog(feature, getCatalogPath("deferFeature.xml"));
+ }
+
+ private CatalogResolver createResolver(Catalog catalog) {
+ return CatalogManager.catalogResolver(catalog);
}
private int loadedCatalogCount(Catalog catalog) throws Exception {
diff --git a/jaxp/test/javax/xml/jaxp/functional/org/w3c/dom/ptests/NodeTest.java b/jaxp/test/javax/xml/jaxp/functional/org/w3c/dom/ptests/NodeTest.java
index bb4d6b3574a..264ad06a95f 100644
--- a/jaxp/test/javax/xml/jaxp/functional/org/w3c/dom/ptests/NodeTest.java
+++ b/jaxp/test/javax/xml/jaxp/functional/org/w3c/dom/ptests/NodeTest.java
@@ -22,6 +22,7 @@
*/
package org.w3c.dom.ptests;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static jaxp.library.JAXPTestUtilities.tryRunWithTmpPermission;
import static org.testng.Assert.assertEquals;
@@ -157,7 +158,7 @@ public class NodeTest {
Element element = (Element) document.getElementsByTagName("sender").item(0);
parentElement.insertBefore(createTestDocumentFragment(document), element);
- String outputfile = "InsertBefore.out";
+ String outputfile = USER_DIR + "InsertBefore.out";
String goldfile = GOLDEN_DIR + "InsertBeforeGF.out";
tryRunWithTmpPermission(() -> outputXml(document, outputfile), new PropertyPermission("user.dir", "read"));
assertTrue(compareWithGold(goldfile, outputfile));
@@ -175,7 +176,7 @@ public class NodeTest {
Element element = (Element) document.getElementsByTagName("sender").item(0);
parentElement.replaceChild(createTestDocumentFragment(document), element);
- String outputfile = "ReplaceChild3.out";
+ String outputfile = USER_DIR + "ReplaceChild3.out";
String goldfile = GOLDEN_DIR + "ReplaceChild3GF.out";
tryRunWithTmpPermission(() -> outputXml(document, outputfile), new PropertyPermission("user.dir", "read"));
assertTrue(compareWithGold(goldfile, outputfile));
diff --git a/jaxp/test/javax/xml/jaxp/functional/test/astro/DocumentLSTest.java b/jaxp/test/javax/xml/jaxp/functional/test/astro/DocumentLSTest.java
index acfe988c13a..673674b9e65 100644
--- a/jaxp/test/javax/xml/jaxp/functional/test/astro/DocumentLSTest.java
+++ b/jaxp/test/javax/xml/jaxp/functional/test/astro/DocumentLSTest.java
@@ -22,6 +22,7 @@
*/
package test.astro;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.filenameToURL;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -130,7 +131,7 @@ public class DocumentLSTest {
impl = (DOMImplementationLS) db.getDOMImplementation();
LSSerializer domSerializer = impl.createLSSerializer();
MyDOMOutput mydomoutput = new MyDOMOutput();
- try (OutputStream os = new FileOutputStream("test.out")) {
+ try (OutputStream os = new FileOutputStream(USER_DIR + "test.out")) {
mydomoutput.setByteStream(os);
mydomoutput.setEncoding("UTF-8");
assertTrue(domSerializer.write(doc, mydomoutput));
diff --git a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java
index 777e8cf5336..a535e631bce 100644
--- a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java
+++ b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java
@@ -24,7 +24,6 @@
package jdk.testlibrary;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
/**
@@ -60,7 +59,6 @@ public class JDKToolLauncher {
} else {
executable = JDKToolFinder.getTestJDKTool(tool);
}
- vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs()));
}
/**
diff --git a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java
index 35cffc1c994..1580dc6a521 100644
--- a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java
+++ b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -256,24 +256,7 @@ public final class ProcessTools {
* @return Process id
*/
public static long getProcessId() {
- return ProcessHandle.current().getPid();
- }
-
- /**
- * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
- *
- * @return String[] with platform specific arguments, empty if there are
- * none
- */
- public static String[] getPlatformSpecificVMArgs() {
- String osName = System.getProperty("os.name");
- String dataModel = System.getProperty("sun.arch.data.model");
-
- if (osName.equals("SunOS") && dataModel.equals("64")) {
- return new String[] { "-d64" };
- }
-
- return new String[] {};
+ return ProcessHandle.current().pid();
}
/**
@@ -283,8 +266,7 @@ public final class ProcessTools {
* @param command Arguments to pass to the java command.
* @return The ProcessBuilder instance representing the java command.
*/
- public static ProcessBuilder createJavaProcessBuilder(String... command)
- throws Exception {
+ public static ProcessBuilder createJavaProcessBuilder(String... command) {
return createJavaProcessBuilder(false, command);
}
@@ -297,12 +279,11 @@ public final class ProcessTools {
* @param command Arguments to pass to the java command.
* @return The ProcessBuilder instance representing the java command.
*/
- public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) throws Exception {
+ public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) {
String javapath = JDKToolFinder.getJDKTool("java");
ArrayList args = new ArrayList<>();
args.add(javapath);
- Collections.addAll(args, getPlatformSpecificVMArgs());
if (addTestVmAndJavaOptions) {
// -cp is needed to make sure the same classpath is used whether the test is
@@ -542,8 +523,8 @@ public final class ProcessTools {
}
@Override
- public long getPid() {
- return p.getPid();
+ public long pid() {
+ return p.pid();
}
@Override
diff --git a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/DefaultFactoryWrapperTest.java b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/DefaultFactoryWrapperTest.java
index 0e16d9b5db3..18e4e76cee8 100644
--- a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/DefaultFactoryWrapperTest.java
+++ b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/DefaultFactoryWrapperTest.java
@@ -27,8 +27,6 @@ import static org.testng.Assert.assertSame;
import java.io.StringReader;
import java.io.StringWriter;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -52,7 +50,7 @@ import org.testng.annotations.Test;
* @summary test customized provider wraps the built-in system-default implementation of JAXP factories
*/
public class DefaultFactoryWrapperTest {
- private static final Module XML_MODULE = Layer.boot().findModule("java.xml").get();
+ private static final Module XML_MODULE = ModuleLayer.boot().findModule("java.xml").get();
private static final String PROVIDER_PACKAGE = "xwp";
diff --git a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
index 74f051ac04d..306b9ee973a 100644
--- a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
+++ b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
@@ -29,9 +29,7 @@ import java.lang.String;
import java.lang.System;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.Collections;
@@ -95,23 +93,23 @@ public class LayerModularXMLParserTest {
*/
public void testOneLayer() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1);
- Configuration cf1 = Layer.boot().configuration()
- .resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
+ Configuration cf1 = ModuleLayer.boot().configuration()
+ .resolveAndBind(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, scl);
ClassLoader cl1 = layer1.findLoader("test");
Method m = cl1.loadClass("test.XMLFactoryHelper").getMethod("instantiateXMLService", String.class);
for (String service : services1) {
Object o = m.invoke(null, service);
- Layer providerLayer = o.getClass().getModule().getLayer();
+ ModuleLayer providerLayer = o.getClass().getModule().getLayer();
assertSame(providerLayer, layer1);
}
for (String service : services2) {
Object o = m.invoke(null, service);
- Layer providerLayer = o.getClass().getModule().getLayer();
- assertSame(providerLayer, Layer.boot());
+ ModuleLayer providerLayer = o.getClass().getModule().getLayer();
+ assertSame(providerLayer, ModuleLayer.boot());
}
}
@@ -125,26 +123,26 @@ public class LayerModularXMLParserTest {
*/
public void testTwoLayer() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1);
- Configuration cf1 = Layer.boot().configuration()
- .resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
+ Configuration cf1 = ModuleLayer.boot().configuration()
+ .resolveAndBind(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, scl);
ModuleFinder finder2 = ModuleFinder.of(MOD_DIR2);
- Configuration cf2 = cf1.resolveRequiresAndUses(finder2, ModuleFinder.of(), Set.of("test"));
- Layer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
+ Configuration cf2 = cf1.resolveAndBind(finder2, ModuleFinder.of(), Set.of("test"));
+ ModuleLayer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
ClassLoader cl2 = layer2.findLoader("test");
Method m = cl2.loadClass("test.XMLFactoryHelper").getMethod("instantiateXMLService", String.class);
for (String service : services1) {
Object o = m.invoke(null, service);
- Layer providerLayer = o.getClass().getModule().getLayer();
+ ModuleLayer providerLayer = o.getClass().getModule().getLayer();
assertSame(providerLayer, layer1);
}
for (String service : services2) {
Object o = m.invoke(null, service);
- Layer providerLayer = o.getClass().getModule().getLayer();
+ ModuleLayer providerLayer = o.getClass().getModule().getLayer();
assertSame(providerLayer, layer2);
}
@@ -159,26 +157,26 @@ public class LayerModularXMLParserTest {
*/
public void testTwoLayerWithDuplicate() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1, MOD_DIR2);
- Configuration cf1 = Layer.boot().configuration()
- .resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
+ Configuration cf1 = ModuleLayer.boot().configuration()
+ .resolveAndBind(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, scl);
ModuleFinder finder2 = ModuleFinder.of(MOD_DIR2);
- Configuration cf2 = cf1.resolveRequiresAndUses(finder2, ModuleFinder.of(), Set.of("test"));
- Layer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
+ Configuration cf2 = cf1.resolveAndBind(finder2, ModuleFinder.of(), Set.of("test"));
+ ModuleLayer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
ClassLoader cl2 = layer2.findLoader("test");
Method m = cl2.loadClass("test.XMLFactoryHelper").getMethod("instantiateXMLService", String.class);
for (String service : services1) {
Object o = m.invoke(null, service);
- Layer providerLayer = o.getClass().getModule().getLayer();
+ ModuleLayer providerLayer = o.getClass().getModule().getLayer();
assertSame(providerLayer, layer1);
}
for (String service : services2) {
Object o = m.invoke(null, service);
- Layer providerLayer = o.getClass().getModule().getLayer();
+ ModuleLayer providerLayer = o.getClass().getModule().getLayer();
assertSame(providerLayer, layer2);
}
diff --git a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/src/unnamed/Main.java b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/src/unnamed/Main.java
index 35d210369b2..971b5f350bf 100644
--- a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/src/unnamed/Main.java
+++ b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/src/unnamed/Main.java
@@ -24,8 +24,6 @@
import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI;
import java.lang.module.ModuleDescriptor.Provides;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -38,7 +36,7 @@ public class Main {
* @param args, the names of provider modules, which have been loaded
*/
public static void main(String[] args) throws Exception {
- Module xml = Layer.boot().findModule("java.xml").get();
+ Module xml = ModuleLayer.boot().findModule("java.xml").get();
Set allServices = new HashSet<>(Arrays.asList(expectedAllServices));
if (!allServices.equals(xml.getDescriptor().uses()))
@@ -46,7 +44,7 @@ public class Main {
+ xml.getDescriptor().uses());
long violationCount = Stream.of(args)
- .map(xmlProviderName -> Layer.boot().findModule(xmlProviderName).get())
+ .map(xmlProviderName -> ModuleLayer.boot().findModule(xmlProviderName).get())
.mapToLong(
// services provided by the implementation in provider module
provider -> provider.getDescriptor().provides().stream()
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
index 937de0ba0e1..9972328e102 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
@@ -87,35 +87,6 @@ public class CatalogTest extends CatalogSupportBase {
super.setUp();
}
- /*
- * @bug 8162431
- * Verifies that circular references are caught and
- * CatalogException is thrown.
- */
- @Test(dataProvider = "getFeatures", expectedExceptions = CatalogException.class)
- public void testCircularRef(CatalogFeatures cf, String xml) throws Exception {
- CatalogResolver catalogResolver = CatalogManager.catalogResolver(
- cf,
- getClass().getResource(xml).toURI());
- catalogResolver.resolve("anyuri", "");
- }
-
- /*
- DataProvider: used to verify circular reference
- Data columns: CatalogFeatures, catalog
- */
- @DataProvider(name = "getFeatures")
- public Object[][] getFeatures() {
- String self = "catalogReferCircle-itself.xml";
- String left = "catalogReferCircle-left.xml";
- return new Object[][]{
- {CatalogFeatures.builder().with(CatalogFeatures.Feature.DEFER, "false").build(), self},
- {CatalogFeatures.defaults(), self},
- {CatalogFeatures.builder().with(CatalogFeatures.Feature.DEFER, "false").build(), left},
- {CatalogFeatures.defaults(), left}
- };
- }
-
/*
* @bug 8163232
* Verifies that the CatalogResolver supports the following XML Resolvers:
@@ -437,7 +408,10 @@ public class CatalogTest extends CatalogSupportBase {
public void resolveWithPrefer(String prefer, String cfile, String publicId,
String systemId, String expected) throws Exception {
URI catalogFile = getClass().getResource(cfile).toURI();
- CatalogFeatures f = CatalogFeatures.builder().with(CatalogFeatures.Feature.PREFER, prefer).with(CatalogFeatures.Feature.RESOLVE, "ignore").build();
+ CatalogFeatures f = CatalogFeatures.builder()
+ .with(CatalogFeatures.Feature.PREFER, prefer)
+ .with(CatalogFeatures.Feature.RESOLVE, "ignore")
+ .build();
CatalogResolver catalogResolver = CatalogManager.catalogResolver(f, catalogFile);
String result = catalogResolver.resolveEntity(publicId, systemId).getSystemId();
Assert.assertEquals(expected, result);
@@ -452,7 +426,9 @@ public class CatalogTest extends CatalogSupportBase {
@Test(dataProvider = "invalidAltCatalogs", expectedExceptions = CatalogException.class)
public void testDeferAltCatalogs(String file) throws Exception {
URI catalogFile = getClass().getResource(file).toURI();
- CatalogFeatures features = CatalogFeatures.builder().with(CatalogFeatures.Feature.DEFER, "true").build();
+ CatalogFeatures features = CatalogFeatures.builder().
+ with(CatalogFeatures.Feature.DEFER, "true")
+ .build();
/*
Since the defer attribute is set to false in the specified catalog file,
the parent catalog will try to load the alt catalog, which will fail
@@ -471,11 +447,17 @@ public class CatalogTest extends CatalogSupportBase {
URI catalogFile = getClass().getResource("JDK8146237_catalog.xml").toURI();
try {
- CatalogFeatures features = CatalogFeatures.builder().with(CatalogFeatures.Feature.PREFER, "system").build();
+ CatalogFeatures features = CatalogFeatures.builder()
+ .with(CatalogFeatures.Feature.PREFER, "system")
+ .build();
Catalog catalog = CatalogManager.catalog(features, catalogFile);
CatalogResolver catalogResolver = CatalogManager.catalogResolver(catalog);
- String actualSystemId = catalogResolver.resolveEntity("-//FOO//DTD XML Dummy V0.0//EN", "http://www.oracle.com/alt1sys.dtd").getSystemId();
- Assert.assertTrue(actualSystemId.contains("dummy.dtd"), "Resulting id should contain dummy.dtd, indicating a match by publicId");
+ String actualSystemId = catalogResolver.resolveEntity(
+ "-//FOO//DTD XML Dummy V0.0//EN",
+ "http://www.oracle.com/alt1sys.dtd")
+ .getSystemId();
+ Assert.assertTrue(actualSystemId.contains("dummy.dtd"),
+ "Resulting id should contain dummy.dtd, indicating a match by publicId");
} catch (Exception e) {
Assert.fail(e.getMessage());
@@ -572,20 +554,21 @@ public class CatalogTest extends CatalogSupportBase {
*/
@Test
public void testInvalidCatalog() throws Exception {
+ String expectedMsgId = "JAXP09040001";
URI catalog = getClass().getResource("catalog_invalid.xml").toURI();
- String test = "testInvalidCatalog";
try {
- CatalogResolver resolver = CatalogManager.catalogResolver(CatalogFeatures.defaults(), catalog);
- String actualSystemId = resolver.resolveEntity(null, "http://remote/xml/dtd/sys/alice/docAlice.dtd").getSystemId();
+ CatalogResolver resolver = CatalogManager.catalogResolver(
+ CatalogFeatures.defaults(), catalog);
+ String actualSystemId = resolver.resolveEntity(
+ null,
+ "http://remote/xml/dtd/sys/alice/docAlice.dtd")
+ .getSystemId();
} catch (Exception e) {
String msg = e.getMessage();
if (msg != null) {
- if (msg.contains("No match found for publicId")) {
- Assert.assertEquals(msg, "No match found for publicId 'null' and systemId 'http://remote/xml/dtd/sys/alice/docAlice.dtd'.");
- System.out.println(test + ": expected [No match found for publicId 'null' and systemId 'http://remote/xml/dtd/sys/alice/docAlice.dtd'.]");
- System.out.println("actual [" + msg + "]");
- }
+ Assert.assertTrue(msg.contains(expectedMsgId),
+ "Message shall contain the corrent message ID " + expectedMsgId);
}
}
}
@@ -607,7 +590,10 @@ public class CatalogTest extends CatalogSupportBase {
String test = "testInvalidCatalog";
try {
CatalogResolver resolver = CatalogManager.catalogResolver(f);
- String actualSystemId = resolver.resolveEntity(null, "http://remote/xml/dtd/sys/alice/docAlice.dtd").getSystemId();
+ String actualSystemId = resolver.resolveEntity(
+ null,
+ "http://remote/xml/dtd/sys/alice/docAlice.dtd")
+ .getSystemId();
System.out.println("testIgnoreInvalidCatalog: expected [null]");
System.out.println("testIgnoreInvalidCatalog: expected [null]");
System.out.println("actual [" + actualSystemId + "]");
@@ -628,7 +614,11 @@ public class CatalogTest extends CatalogSupportBase {
@DataProvider(name = "resolveUri")
public Object[][] getDataForUriResolver() {
return new Object[][]{
- {"uri.xml", "urn:publicid:-:Acme,+Inc.:DTD+Book+Version+1.0", null, "http://local/base/dtd/book.dtd", "Uri in publicId namespace is incorrectly unwrapped"},
+ {"uri.xml",
+ "urn:publicid:-:Acme,+Inc.:DTD+Book+Version+1.0",
+ null,
+ "http://local/base/dtd/book.dtd",
+ "Uri in publicId namespace is incorrectly unwrapped"},
};
}
@@ -654,7 +644,13 @@ public class CatalogTest extends CatalogSupportBase {
public Object[][] getDataForMatchingBothIds() {
String expected = "http://www.groupxmlbase.com/dtds/rewrite.dtd";
return new Object[][]{
- {"rewriteSystem_id.xml", "system", "http://www.sys00test.com/rewrite.dtd", "PUB-404", expected, expected, "Relative rewriteSystem with xml:base at group level failed"},
+ {"rewriteSystem_id.xml",
+ "system",
+ "http://www.sys00test.com/rewrite.dtd",
+ "PUB-404",
+ expected,
+ expected,
+ "Relative rewriteSystem with xml:base at group level failed"},
};
}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml
deleted file mode 100644
index c3cfaa66443..00000000000
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml
deleted file mode 100644
index 852b1a56ac3..00000000000
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml
deleted file mode 100644
index 0c556a4b123..00000000000
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java
index be54c6c2e05..da4ff787589 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java
@@ -60,7 +60,7 @@ import org.xml.sax.SAXException;
/*
* @test
- * @bug 6439439 8087303
+ * @bug 6439439 8087303 8174025
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
* @run testng/othervm -DrunSecMngr=true common.prettyprint.PrettyPrintTest
* @run testng/othervm common.prettyprint.PrettyPrintTest
@@ -69,29 +69,30 @@ import org.xml.sax.SAXException;
@Listeners({jaxp.library.FilePolicy.class})
public class PrettyPrintTest {
/*
- * test CDATA, elements only, text and element, whitespace and element,
- * xml:space property and nested xml:space property, mixed node types.
+ * test CDATA, elements only, text and element, xml:space property, mixed
+ * node types.
*/
@DataProvider(name = "xml-data")
public Object[][] xmlData() throws Exception {
return new Object[][] {
- { read("xmltest1.xml"), read("xmltest1.out") },
- { read("xmltest2.xml"), read("xmltest2.out") },
- { read("xmltest3.xml"), read("xmltest3.out") },
- { read("xmltest4.xml"), read("xmltest4.out") },
- { read("xmltest5.xml"), read("xmltest5.out") },
- { read("xmltest6.xml"), read("xmltest6.out") },
- { read("xmltest7.xml"), read("xmltest7.out") },
- { read("xmltest8.xml"), read("xmltest8.out") } };
+ { "xmltest1.xml", "xmltest1.out" },
+ { "xmltest2.xml", "xmltest2.out" },
+ { "xmltest3.xml", "xmltest3.out" },
+ { "xmltest4.xml", "xmltest4.out" },
+ { "xmltest6.xml", "xmltest6.out" },
+ { "xmltest8.xml", "xmltest8.out" } };
}
/*
* @bug 8087303
- * Test the whitespace text nodes are serialized with pretty-print by LSSerializer and transformer correctly
+ * Test the xml document are serialized with pretty-print by
+ * LSSerializer and transformer correctly
*
*/
@Test(dataProvider = "xml-data")
- public void testXMLPrettyPrint(String source, String expected) throws Exception {
+ public void testXMLPrettyPrint(String sourceFile, String expectedFile) throws Exception {
+ String source = read(sourceFile);
+ String expected = read(expectedFile);
// test it's no change if no pretty-print
String result = serializerWrite(toXmlDocument(source), false);
assertTrue(toXmlDocument(source).isEqualNode(toXmlDocument(result)), "The actual is: " + result);
@@ -104,40 +105,116 @@ public class PrettyPrintTest {
assertEquals(transform(toXmlDocument(source), true).replaceAll("\r\n", "\n"), expected);
}
+
/*
- * test pure text content, and sequent Text nodes.
+ * @bug 8087303
+ * Test a single text node is serialized with pretty-print by
+ * LSSerializer and transformer correctly
+ *
*/
- @DataProvider(name = "xml-node-data")
- public Object[][] xmlNodeData() throws Exception {
- return new Object[][] {
- { newTextNode(read("nodetest1.txt")), read("nodetest1.out") },
- { createDocWithSequentTextNodes(), read("nodetest2.out") } };
+ @Test
+ public void testSingleTextNode() throws Exception {
+ Node xml = newTextNode(read("nodetest1.txt"));
+ String expected = read("nodetest1.out");
+ assertEquals(serializerWrite(xml, true), expected);
+ assertEquals(transform(xml, true).replaceAll("\r\n", "\n"), expected);
}
/*
* @bug 8087303
- * Test the whitespace text nodes are serialized with pretty-print by LSSerializer and transformer correctly,
- * doesn't compare with the source because the test data is Node object
+ * Test the transformer shall keep all whitespace text node in
+ * sequent text nodes
*
*/
- @Test(dataProvider = "xml-node-data")
- public void testXMLNodePrettyPrint(Node xml, String expected) throws Exception {
- assertEquals(serializerWrite(xml, true), expected);
+ @Test
+ public void testSequentTextNodesWithTransformer() throws Exception {
+ Node xml = createDocWithSequentTextNodes();
+ String expected = read("nodetest2.out");
assertEquals(transform(xml, true).replaceAll("\r\n", "\n"), expected);
}
+ /*
+ * @bug 8087303
+ * Test LSSerializer shall eliminate the whitespace text node
+ * in sequent text nodes
+ *
+ */
+ @Test
+ public void testSequentTextNodesWithLSSerializer() throws Exception {
+ Node xml = createDocWithSequentTextNodes();
+ String expected = read("nodetest2ls.out");
+ assertEquals(serializerWrite(xml, true), expected);
+ }
+
+
+ /*
+ * test whitespace and element, nested xml:space property.
+ */
+ @DataProvider(name = "xml-data-whitespace-ls")
+ public Object[][] whitespaceLS() throws Exception {
+ return new Object[][] {
+ { "xmltest5.xml", "xmltest5ls.out" },
+ { "xmltest7.xml", "xmltest7ls.out" } };
+ }
+
+ /*
+ * @bug 8087303
+ * Test LSSerializer shall eliminate the whitespace text node
+ * unless xml:space="preserve"
+ *
+ */
+ @Test(dataProvider = "xml-data-whitespace-ls")
+ public void testWhitespaceWithLSSerializer(String sourceFile, String expectedFile) throws Exception {
+ String source = read(sourceFile);
+ String expected = read(expectedFile);
+ // test it's no change if no pretty-print
+ String result = serializerWrite(toXmlDocument(source), false);
+ assertTrue(toXmlDocument(source).isEqualNode(toXmlDocument(result)), "The actual is: " + result);
+ // test pretty-print
+ assertEquals(serializerWrite(toXmlDocument(source), true), expected);
+ }
+
+ /*
+ * test whitespace and element, nested xml:space property.
+ */
+ @DataProvider(name = "xml-data-whitespace-xslt")
+ public Object[][] whitespaceXSLT() throws Exception {
+ return new Object[][] {
+ { "xmltest5.xml", "xmltest5xslt.out" },
+ { "xmltest7.xml", "xmltest7xslt.out" } };
+ }
+
+ /*
+ * @bug 8087303
+ * Test the transformer shall format the output but keep all
+ * whitespace text node even if xml:space="preserve"
+ *
+ */
+ @Test(dataProvider = "xml-data-whitespace-xslt")
+ public void testWhitespaceWithTransformer(String sourceFile, String expectedFile) throws Exception {
+ String source = read(sourceFile);
+ String expected = read(expectedFile);
+ // test it's no change if no pretty-print
+ String result = transform(toXmlDocument(source), false);
+ assertTrue(toXmlDocument(source).isEqualNode(toXmlDocument(result)), "The actual is: " + result);
+ // test pretty-print
+ assertEquals(transform(toXmlDocument(source), true).replaceAll("\r\n", "\n"), expected);
+ }
+
/*
* test block element, inline element, text, and mixed elements.
*/
@DataProvider(name = "html-data")
public Object[][] htmlData() throws Exception {
return new Object[][] {
- { read("htmltest1.xml"), read("htmltest1.out") },
- { read("htmltest2.xml"), read("htmltest2.out") },
- { read("htmltest3.xml"), read("htmltest3.out") },
- { read("htmltest4.xml"), read("htmltest4.out") },
- { read("htmltest5.xml"), read("htmltest5.out") },
- { read("htmltest6.xml"), read("htmltest6.out") } };
+ { "htmltest1.xml", "htmltest1.out" },
+ { "htmltest2.xml", "htmltest2.out" },
+ { "htmltest3.xml", "htmltest3.out" },
+ { "htmltest4.xml", "htmltest4.out" },
+ { "htmltest5.xml", "htmltest5.out" },
+ { "htmltest6.xml", "htmltest6.out" },
+ /* @bug 8174025, test whitespace between inline elements */
+ { "htmltest7.xml", "htmltest7.out" } };
}
/*
@@ -146,7 +223,9 @@ public class PrettyPrintTest {
*
*/
@Test(dataProvider = "html-data")
- public void testTransformToHTML(String source, String expected) throws Exception {
+ public void testTransformToHTML(String sourceFile, String expectedFile) throws Exception {
+ String source = read(sourceFile);
+ String expected = read(expectedFile);
// test it's no change if no pretty-print
StringWriter writer = new StringWriter();
getTransformer(true, false).transform(new StreamSource(new StringReader(source)), new StreamResult(writer));
@@ -158,6 +237,27 @@ public class PrettyPrintTest {
assertEquals(writer.toString().replaceAll("\r\n", "\n"), expected);
}
+ /*
+ * @bug 8174025
+ * Test the serializer can handle correctly.
+ *
+ */
+ @Test
+ public void testDisableOutputEscaping() throws Exception {
+ final String xsl ="generate-catalog.xsl";
+ final String xml ="simple-entity-resolver-config.xml";
+ final String expectedOutput ="simple-entity-resolver-config-transformed.xml";
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTemplates(new StreamSource(new StringReader(read(xsl)))).newTransformer();
+
+ String key = "schemaBase";
+ String value = "schemas";
+ transformer.setParameter(key, value);
+ StringWriter writer = new StringWriter();
+ transformer.transform(new StreamSource(new StringReader(read(xml))), new StreamResult(writer));
+ assertEquals(writer.toString().replaceAll("\r\n", "\n"), read(expectedOutput));
+ }
+
@Test
public void testLSSerializerFormatPrettyPrint() {
@@ -298,6 +398,9 @@ public class PrettyPrintTest {
Document doc = db.newDocument();
Node root = doc.createElement("root");
doc.appendChild(root);
+ root.appendChild(doc.createTextNode("\n"));
+ root.appendChild(doc.createTextNode("\n"));
+ root.appendChild(doc.createTextNode("\n"));
root.appendChild(doc.createTextNode(" "));
root.appendChild(doc.createTextNode("t"));
root.appendChild(doc.createTextNode("\n"));
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/generate-catalog.xsl b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/generate-catalog.xsl
new file mode 100644
index 00000000000..e1b8e75171a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/generate-catalog.xsl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ <system systemId="
+
+ " uri="
+
+ " />
+
+
+
+
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest1.xml b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest1.xml
index 50460626a7b..c0959b46dc8 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest1.xml
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest1.xml
@@ -1 +1 @@
-Java Tutorials and Examples 1 en-us
\ No newline at end of file
+Java Tutorials and Examples 1 en-us
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest7.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest7.out
new file mode 100644
index 00000000000..2ce8445a6dc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest7.out
@@ -0,0 +1,7 @@
+
+
+
+ this is a whitespace inline element test
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest7.xml b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest7.xml
new file mode 100644
index 00000000000..f1480607ef8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/htmltest7.xml
@@ -0,0 +1 @@
+ this is a whitespace inline element test
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2.out
index a0d94368a3d..8a7d8fb0d18 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2.out
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2.out
@@ -1,19 +1,30 @@
t
t
-
+
+
t
-
-
-
+
+
+
+
+
+
t
+
t
+
t
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2ls.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2ls.out
new file mode 100644
index 00000000000..92e2d1f41e0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/nodetest2ls.out
@@ -0,0 +1,18 @@
+
+ tt
+
+ t
+
+
+
+
+ t
+
+ t
+
+ t
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/simple-entity-resolver-config-transformed.xml b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/simple-entity-resolver-config-transformed.xml
new file mode 100644
index 00000000000..238b5e2a2ac
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/simple-entity-resolver-config-transformed.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/simple-entity-resolver-config.xml b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/simple-entity-resolver-config.xml
new file mode 100644
index 00000000000..9156728e13d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/simple-entity-resolver-config.xml
@@ -0,0 +1,20 @@
+
+
+
+
+ Example 1 Schema Type library 10.0
+ >-//Oracle//Example 1 Schema Type library 10.0//EN
+ http://www.example.test/oracle/schema/example1.xsd
+ META-INF/example1.xsd
+
+
+ Example 2 Schema Type library 10.0
+ >-//Oracle//Example 2 Schema Type library 10.0//EN
+ http://www.example.test/oracle/schema/example2.xsd
+ META-INF/example2.xsd
+
+
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5ls.out
similarity index 100%
rename from jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5.out
rename to jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5ls.out
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5xslt.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5xslt.out
new file mode 100644
index 00000000000..4178e8ea9c2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5xslt.out
@@ -0,0 +1,15 @@
+
+
+
+ Java Tutorials and Examples 1
+
+ en-us
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7ls.out
similarity index 100%
rename from jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7.out
rename to jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7ls.out
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7xslt.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7xslt.out
new file mode 100644
index 00000000000..06296cddd1d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7xslt.out
@@ -0,0 +1,17 @@
+
+ Java
+
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.out b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.out
index 621263fbe19..b62fff27a78 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.out
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.out
@@ -1,25 +1,20 @@
-
- t
+ t
-
-t
+ t
-
- t
+ t
-
- t
+ t
t
-
- t
+ t
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.xml b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.xml
index e9c1c477d3a..6b9c54af8ed 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.xml
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest8.xml
@@ -2,14 +2,7 @@
t
t
- t
-
-
- t
-
- t
-
+ t
+ tt
t
-
-
-
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/dom/ls/LSSerializerTest.java b/jaxp/test/javax/xml/jaxp/unittest/dom/ls/LSSerializerTest.java
index 9068969b318..50c79a962a6 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/dom/ls/LSSerializerTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/dom/ls/LSSerializerTest.java
@@ -279,11 +279,11 @@ public class LSSerializerTest {
"\n" +
" &name1;Jo Smith\n" +
" b &name2;Jo Smith &name1;Jo Smith b\n" +
- " &name;Jo Smith \n" +
+ " &name;Jo Smith \n" +
" &ele1;d \n" +
- " &ele2;eee \n" +
+ " &ele2;eee \n" +
" <att> \n" +
- " &ele; g \n" +
+ " &ele; g \n" +
" &ele2; \n" +
" \n");
@@ -301,7 +301,7 @@ public class LSSerializerTest {
"\n" +
" &name;Jo Smith\n" +
" b &name;Jo Smith &name;Jo Smith b\n" +
- " &name;Jo Smith \n" +
+ " &name;Jo Smith \n" +
" \n" +
" \n" +
" text \n" +
diff --git a/jaxp/test/javax/xml/jaxp/unittest/parsers/BaseParsingTest.java b/jaxp/test/javax/xml/jaxp/unittest/parsers/BaseParsingTest.java
new file mode 100644
index 00000000000..2d15fda1b0e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/parsers/BaseParsingTest.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package parsers;
+
+import java.io.StringReader;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+
+/**
+ * @test
+ * @bug 8169450
+ * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
+ * @run testng/othervm -DrunSecMngr=true parsers.BaseParsingTest
+ * @run testng/othervm parsers.BaseParsingTest
+ * @summary Tests that verify base parsing
+ */
+@Listeners({jaxp.library.BasePolicy.class})
+public class BaseParsingTest {
+
+ @DataProvider(name = "xmlDeclarations")
+ public static Object[][] xmlDeclarations() {
+ return new Object[][]{
+ {"t "},
+ {"t "},
+ {"t "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"t "},
+ {"t "},
+ {"t "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "},
+ {"\n"
+ + "\n"
+ + " t \n"
+ + " "}
+ };
+ }
+
+ /**
+ * @bug 8169450
+ * Verifies that the parser successfully parses the declarations provided in
+ * xmlDeclarations. Exception would otherwise be thrown as reported in 8169450.
+ *
+ * XML Declaration according to https://www.w3.org/TR/REC-xml/#NT-XMLDecl
+ * [23] XMLDecl ::= ''
+ * [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
+ * [25] Eq ::= S? '=' S? [26] VersionNum ::= '1.' [0-9]+
+ *
+ * @param xml the test xml
+ * @throws Exception if the parser fails to parse the xml
+ */
+ @Test(dataProvider = "xmlDeclarations")
+ public void test(String xml) throws Exception {
+ XMLInputFactory xif = XMLInputFactory.newDefaultFactory();
+ XMLStreamReader xsr = xif.createXMLStreamReader(new StringReader(xml));
+ while (xsr.hasNext()) {
+ xsr.next();
+ }
+ }
+
+ /**
+ * @bug 8169450
+ * This particular issue does not appear in DOM parsing since the spaces are
+ * normalized during version detection. This test case then serves as a guard
+ * against such an issue from occuring in the version detection.
+ *
+ * @param xml the test xml
+ * @throws Exception if the parser fails to parse the xml
+ */
+ @Test(dataProvider = "xmlDeclarations")
+ public void testWithDOM(String xml) throws Exception {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.parse(new InputSource(new StringReader(xml)));
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/parsers/Bug6341770.java b/jaxp/test/javax/xml/jaxp/unittest/parsers/Bug6341770.java
index 942e7ffaed8..1bf27aa09a0 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/parsers/Bug6341770.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/parsers/Bug6341770.java
@@ -23,6 +23,7 @@
package parsers;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.tryRunWithTmpPermission;
import java.io.File;
@@ -61,7 +62,7 @@ public class Bug6341770 {
return;
}
try {
- File dir = new File(ALPHA);
+ File dir = new File(USER_DIR + ALPHA);
dir.delete();
dir.mkdir();
File main = new File(dir, "main.xml");
diff --git a/jaxp/test/javax/xml/jaxp/unittest/sax/Bug7057778Test.java b/jaxp/test/javax/xml/jaxp/unittest/sax/Bug7057778Test.java
index 4bd69f09765..be6dbc986f8 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/sax/Bug7057778Test.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/sax/Bug7057778Test.java
@@ -23,6 +23,7 @@
package sax;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.getSystemProperty;
import static jaxp.library.JAXPTestUtilities.tryRunWithTmpPermission;
@@ -69,7 +70,7 @@ public class Bug7057778Test {
@Test
public void testParse() {
File src = new File(getClass().getResource(xml).getFile());
- File dst = new File(xml1);
+ File dst = new File(USER_DIR + xml1);
try {
copyFile(src, dst);
SAXParserFactory spf = SAXParserFactory.newInstance();
diff --git a/jaxp/test/javax/xml/jaxp/unittest/sax/SymbolTableResetTest.java b/jaxp/test/javax/xml/jaxp/unittest/sax/SymbolTableResetTest.java
new file mode 100644
index 00000000000..d54086361eb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/sax/SymbolTableResetTest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sax;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @test
+ * @bug 8173390
+ * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
+ * @run testng/othervm -DrunSecMngr=true sax.SymbolTableResetTest
+ * @run testng/othervm sax.SymbolTableResetTest
+ * @summary Test that SAXParser reallocates symbol table during
+ * subsequent parse operations
+ */
+@Listeners({jaxp.library.BasePolicy.class})
+public class SymbolTableResetTest {
+
+ /*
+ * Test mimics the SAXParser usage in SAAJ-RI that reuses the
+ * parsers from the internal pool. To avoid memory leaks, symbol
+ * table associated with the parser should be reallocated during each
+ * parse() operation.
+ */
+ @Test
+ public void testReset() throws Exception {
+ // Dummy xml input for parser
+ String input = "Test ";
+ // Create SAXParser
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser p = spf.newSAXParser();
+ // First parse iteration
+ p.parse(new InputSource(new StringReader(input)), new DefaultHandler());
+ // Get first symbol table reference
+ Object symTable1 = p.getProperty(SYMBOL_TABLE_PROPERTY);
+ p.reset();
+ // Second parse iteration
+ p.parse(new InputSource(new StringReader(input)), new DefaultHandler());
+ // Get second symbol table reference
+ Object symTable2 = p.getProperty(SYMBOL_TABLE_PROPERTY);
+ // Symbol table references should be different
+ Assert.assertNotSame(symTable1, symTable2, "Symbol table references");
+ }
+
+ // Symbol table property
+ private static final String SYMBOL_TABLE_PROPERTY = "http://apache.org/xml/properties/internal/symbol-table";
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/stream/Bug6688002Test.java b/jaxp/test/javax/xml/jaxp/unittest/stream/Bug6688002Test.java
index 1c4ac758575..1d1f728009d 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/stream/Bug6688002Test.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/stream/Bug6688002Test.java
@@ -23,6 +23,8 @@
package stream;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
@@ -67,15 +69,15 @@ public class Bug6688002Test {
}
public class MyRunnable implements Runnable {
- final int no;
+ final String no;
MyRunnable(int no) {
- this.no = no;
+ this.no = String.valueOf(no);
}
public void run() {
try {
- FileOutputStream fos = new FileOutputStream("" + no);
+ FileOutputStream fos = new FileOutputStream(USER_DIR + no);
XMLStreamWriter w = getWriter(fos);
// System.out.println("Writer="+w+" Thread="+Thread.currentThread());
w.writeStartDocument();
@@ -89,7 +91,7 @@ public class Bug6688002Test {
w.close();
fos.close();
- FileInputStream fis = new FileInputStream("" + no);
+ FileInputStream fis = new FileInputStream(USER_DIR + no);
XMLStreamReader r = getReader(fis);
while (r.hasNext()) {
r.next();
diff --git a/jaxp/test/javax/xml/jaxp/unittest/stream/XMLEventWriterTest/ReaderToWriterTest.java b/jaxp/test/javax/xml/jaxp/unittest/stream/XMLEventWriterTest/ReaderToWriterTest.java
index 3bd3ca25296..28b871afcd9 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/stream/XMLEventWriterTest/ReaderToWriterTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/stream/XMLEventWriterTest/ReaderToWriterTest.java
@@ -23,6 +23,8 @@
package stream.XMLEventWriterTest;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -58,7 +60,7 @@ public class ReaderToWriterTest {
private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance();
private static final String INPUT_FILE = "W2JDLR4002TestService.wsdl.data";
- private static final String OUTPUT_FILE = "Encoded.wsdl";
+ private static final String OUTPUT_FILE = USER_DIR + "Encoded.wsdl";
/**
* Unit test for writing namespaces when namespaceURI == null.
@@ -126,7 +128,7 @@ public class ReaderToWriterTest {
try {
InputStream in = getClass().getResourceAsStream("ReaderToWriterTest.wsdl");
- OutputStream out = new FileOutputStream("ReaderToWriterTest-out.xml");
+ OutputStream out = new FileOutputStream(USER_DIR + "ReaderToWriterTest-out.xml");
XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out, "UTF-8");
diff --git a/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/WriterTest.java b/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/WriterTest.java
index 7e681e343c4..abb9957a256 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/WriterTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/WriterTest.java
@@ -23,6 +23,8 @@
package stream.XMLStreamWriterTest;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -84,7 +86,7 @@ public class WriterTest {
System.out.println("Test StreamWriter with out any namespace functionality");
try {
- String outputFile = files[0] + ".out";
+ String outputFile = USER_DIR + files[0] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -98,7 +100,7 @@ public class WriterTest {
xtw.flush();
xtw.close();
- Assert.assertTrue(checkResults(files[0] + ".out", files[0] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[0] + ".org"));
} catch (Exception ex) {
Assert.fail("testOne Failed " + ex);
@@ -113,7 +115,7 @@ public class WriterTest {
System.out.println("Test StreamWriter's Namespace Context");
try {
- String outputFile = files[1] + ".out";
+ String outputFile = USER_DIR + files[1] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(System.out);
@@ -157,7 +159,7 @@ public class WriterTest {
System.out.println("Test StreamWriter for proper element sequence.");
try {
- String outputFile = files[2] + ".out";
+ String outputFile = USER_DIR + files[2] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -172,7 +174,7 @@ public class WriterTest {
xtw.flush();
xtw.close();
- Assert.assertTrue(checkResults(files[2] + ".out", files[2] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[2] + ".org"));
} catch (Exception ex) {
Assert.fail("testThree Failed " + ex);
@@ -188,7 +190,7 @@ public class WriterTest {
try {
- String outputFile = files[3] + ".out";
+ String outputFile = USER_DIR + files[3] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -205,7 +207,7 @@ public class WriterTest {
xtw.flush();
xtw.close();
- Assert.assertTrue(checkResults(files[3] + ".out", files[3] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[3] + ".org"));
} catch (Exception ex) {
Assert.fail("testFour Failed " + ex);
@@ -221,7 +223,7 @@ public class WriterTest {
try {
- String outputFile = files[4] + ".out";
+ String outputFile = USER_DIR + files[4] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(System.out);
@@ -265,7 +267,7 @@ public class WriterTest {
xtw.writeEndDocument();
xtw.flush();
xtw.close();
- Assert.assertTrue(checkResults(files[4] + ".out", files[4] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[4] + ".org"));
System.out.println("Done");
} catch (Exception ex) {
Assert.fail("testFive Failed " + ex);
@@ -281,7 +283,7 @@ public class WriterTest {
try {
- String outputFile = files[5] + ".out";
+ String outputFile = USER_DIR + files[5] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(System.out);
@@ -325,7 +327,7 @@ public class WriterTest {
xtw.writeEndDocument();
xtw.flush();
xtw.close();
- Assert.assertTrue(checkResults(files[5] + ".out", files[5] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[5] + ".org"));
System.out.println("Done");
} catch (Exception ex) {
Assert.fail("testSix Failed " + ex);
@@ -341,7 +343,7 @@ public class WriterTest {
try {
- String outputFile = files[6] + ".out";
+ String outputFile = USER_DIR + files[6] + ".out";
System.out.println("Writing output to " + outputFile);
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -374,7 +376,7 @@ public class WriterTest {
xtw.writeEndDocument();
xtw.flush();
xtw.close();
- Assert.assertTrue(checkResults(files[6] + ".out", files[6] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[6] + ".org"));
System.out.println("Done");
} catch (Exception ex) {
Assert.fail("testSeven Failed " + ex);
@@ -390,7 +392,7 @@ public class WriterTest {
try {
- String outputFile = files[7] + ".out";
+ String outputFile = USER_DIR + files[7] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -424,7 +426,7 @@ public class WriterTest {
xtw.flush();
xtw.close();
// check against testSeven.xml.org
- Assert.assertTrue(checkResults(files[7] + ".out", files[7] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[7] + ".org"));
System.out.println("Done");
} catch (Exception ex) {
ex.printStackTrace();
@@ -442,7 +444,7 @@ public class WriterTest {
try {
- String outputFile = files[8] + ".out";
+ String outputFile = USER_DIR + files[8] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -476,7 +478,7 @@ public class WriterTest {
xtw.flush();
xtw.close();
// check against testSeven.xml.org
- Assert.assertTrue(checkResults(files[8] + ".out", files[7] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[7] + ".org"));
System.out.println("Done");
} catch (Exception ex) {
Assert.fail("testNine Failed " + ex);
@@ -491,7 +493,7 @@ public class WriterTest {
System.out.println("Test StreamWriter supplied with no namespace information and" + "isRepairingNamespace is set to true.");
try {
- String outputFile = files[9] + ".out";
+ String outputFile = USER_DIR + files[9] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -542,7 +544,7 @@ public class WriterTest {
System.out.println("Test StreamWriter supplied with namespace information passed through startElement and" + "isRepairingNamespace is set to true.");
try {
- String outputFile = files[10] + ".out";
+ String outputFile = USER_DIR + files[10] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -576,7 +578,7 @@ public class WriterTest {
xtw.flush();
xtw.close();
// check against testSeven.xml.org
- Assert.assertTrue(checkResults(files[10] + ".out", files[7] + ".org"));
+ Assert.assertTrue(checkResults(outputFile, files[7] + ".org"));
System.out.println("Done");
} catch (Exception ex) {
Assert.fail("testEleven Failed " + ex);
@@ -592,7 +594,7 @@ public class WriterTest {
try {
- String outputFile = files[11] + ".out";
+ String outputFile = USER_DIR + files[11] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -643,7 +645,7 @@ public class WriterTest {
try {
- String outputFile = files[12] + ".out";
+ String outputFile = USER_DIR + files[12] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
@@ -695,7 +697,7 @@ public class WriterTest {
try {
- String outputFile = files[14] + ".out";
+ String outputFile = USER_DIR + files[14] + ".out";
System.out.println("Writing output to " + outputFile);
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4693341Test.java b/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4693341Test.java
index 2b2a1e94506..1e4266d65e7 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4693341Test.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4693341Test.java
@@ -23,6 +23,8 @@
package transform;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -55,7 +57,7 @@ public class Bug4693341Test {
// save dtd file to current working directory to avoid writing into source repository
public void copyDTDtoWorkDir() throws IOException {
try (FileInputStream dtdres = new FileInputStream(getClass().getResource("Bug4693341.dtd").getPath());
- FileOutputStream dtdwork = new FileOutputStream("Bug4693341.dtd");) {
+ FileOutputStream dtdwork = new FileOutputStream(USER_DIR + "Bug4693341.dtd");) {
int n;
byte[] buffer = new byte[1024];
while((n = dtdres.read(buffer)) > -1) {
@@ -71,7 +73,7 @@ public class Bug4693341Test {
copyDTDtoWorkDir();
- File outf = new File("Bug4693341.out");
+ File outf = new File(USER_DIR + "Bug4693341.out");
StreamResult result = new StreamResult(new FileOutputStream(outf));
String in = getClass().getResource("Bug4693341.xml").getPath();
diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4892774.java b/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4892774.java
index cb92eb762ed..0419c1cf8bc 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4892774.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/transform/Bug4892774.java
@@ -23,6 +23,8 @@
package transform;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.File;
import javax.xml.transform.Source;
@@ -58,7 +60,7 @@ public class Bug4892774 {
private final String XML_FILE = "catalog.xml";
private final String XML10_FILE = "catalog_10.xml"; // 1.0 version document
- private final String TEMP_FILE = "tmp.xml";
+ private final String TEMP_FILE = USER_DIR + "tmp.xml";
private final String EXPECTED_VERSION = "1.1";
static private Transformer idTransform = null;
diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/Bug6216226Test.java b/jaxp/test/javax/xml/jaxp/unittest/transform/Bug6216226Test.java
index 7031585a864..9ba16dbc9c1 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/transform/Bug6216226Test.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/transform/Bug6216226Test.java
@@ -23,6 +23,7 @@
package transform;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.runWithTmpPermission;
import java.io.File;
@@ -52,7 +53,7 @@ public class Bug6216226Test {
@Test
public final void test() {
try {
- File test = new File("bug6216226.txt");
+ File test = new File(USER_DIR + "bug6216226.txt");
TransformerFactory tf = TransformerFactory.newInstance();
Transformer xformer = tf.newTransformer();
StringReader st = new StringReader(" ");
diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/CR6935697Test.java b/jaxp/test/javax/xml/jaxp/unittest/transform/CR6935697Test.java
index db8d8721d2e..fe65ee0e7a9 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/transform/CR6935697Test.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/transform/CR6935697Test.java
@@ -23,6 +23,8 @@
package transform;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.FileOutputStream;
import javax.xml.transform.Result;
@@ -65,7 +67,7 @@ public class CR6935697Test {
Transformer xformer = template.newTransformer();
// Prepare the input and output files
Source source = new StreamSource(getClass().getResourceAsStream(inFilename));
- Result result = new StreamResult(new FileOutputStream(outFilename));
+ Result result = new StreamResult(new FileOutputStream(USER_DIR + outFilename));
// Apply the xsl file to the source file and write the result to the
// output file
xformer.transform(source, result);
diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java b/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java
index 87360daf486..3f99410869b 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java
@@ -23,6 +23,7 @@
package transform;
+import java.io.FilePermission;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
@@ -46,6 +47,7 @@ import static org.testng.Assert.assertEquals;
import static jaxp.library.JAXPTestUtilities.runWithAllPerm;
import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
+import static jaxp.library.JAXPTestUtilities.tryRunWithTmpPermission;
import static jaxp.library.JAXPTestUtilities.getSystemProperty;
/*
@@ -77,7 +79,9 @@ public class XSLTFunctionsTest {
Transformer t = tf.newTransformer(new StreamSource(new StringReader(xsl)));
//Transform the xml
- t.transform(new StreamSource(new StringReader(xml)), new StreamResult(new StringWriter()));
+ tryRunWithTmpPermission(
+ () -> t.transform(new StreamSource(new StringReader(xml)), new StreamResult(new StringWriter())),
+ new FilePermission(output, "write"), new FilePermission(redirect, "write"));
// Verifies that the output is redirected successfully
String userDir = getSystemProperty("user.dir");
diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/util/TransformerUtil.java b/jaxp/test/javax/xml/jaxp/unittest/transform/util/TransformerUtil.java
index 61d7bfe09db..3294aeb93ae 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/transform/util/TransformerUtil.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/transform/util/TransformerUtil.java
@@ -23,6 +23,8 @@
package transform.util;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
@@ -34,7 +36,7 @@ public abstract class TransformerUtil {
protected String type;
- protected final String TEMP_FILE = "tmp.xml";
+ protected final String TEMP_FILE = USER_DIR + "tmp.xml";
public abstract Source prepareSource(InputStream is) throws Exception;
diff --git a/jaxp/test/javax/xml/jaxp/unittest/validation/CR6708840Test.java b/jaxp/test/javax/xml/jaxp/unittest/validation/CR6708840Test.java
index d3a0f1ef40c..71f55a4f3c4 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/validation/CR6708840Test.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/validation/CR6708840Test.java
@@ -23,6 +23,8 @@
package validation;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
import java.io.File;
import java.io.FileWriter;
@@ -122,7 +124,7 @@ public class CR6708840Test {
Validator schemaValidator = schemaGrammar.newValidator();
Source staxSrc = new StAXSource(staxReader);
- File resultFile = new File("gMonths.result.xml");
+ File resultFile = new File(USER_DIR + "gMonths.result.xml");
if (resultFile.exists()) {
resultFile.delete();
}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/validation/ValidatorTest.java b/jaxp/test/javax/xml/jaxp/unittest/validation/ValidatorTest.java
index 40ca0cc8d3a..22317b325bb 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/validation/ValidatorTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/validation/ValidatorTest.java
@@ -23,6 +23,7 @@
package validation;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.runWithTmpPermission;
import java.io.File;
@@ -61,7 +62,7 @@ public class ValidatorTest {
File resultFile = null;
try {
- resultFile = new File("stax.result");
+ resultFile = new File(USER_DIR + "stax.result");
if (resultFile.exists()) {
resultFile.delete();
}
@@ -88,7 +89,7 @@ public class ValidatorTest {
File resultFile = null;
try {
- resultFile = new File("stax.result");
+ resultFile = new File(USER_DIR + "stax.result");
if (resultFile.exists()) {
resultFile.delete();
}
@@ -117,7 +118,7 @@ public class ValidatorTest {
// test valid gMonths
File resultFile = null;
try {
- resultFile = new File("gMonths.result.xml");
+ resultFile = new File(USER_DIR + "gMonths.result.xml");
if (resultFile.exists()) {
resultFile.delete();
}
@@ -144,7 +145,7 @@ public class ValidatorTest {
// test invalid gMonths
File invalidResultFile = null;
try {
- invalidResultFile = new File("gMonths-invalid.result.xml");
+ invalidResultFile = new File(USER_DIR + "gMonths-invalid.result.xml");
if (invalidResultFile.exists()) {
invalidResultFile.delete();
}
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index b130a70170d..a0fbbc40500 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -399,5 +399,17 @@ c8c9c334743caf8155c9809b6b4ac315d3a66476 jdk-9+148
c48b4d4768b1c2b8fe5d1a844ca13732e5dfbe2a jdk-9+151
6f8fb1cf7e5f61c40dcc3654f9a623c505f6de1f jdk-9+152
7a532a9a227137155b905341d4b99939db51220e jdk-9+153
+34af95c7dbff74f3448fcdb7d745524e8a1cc88a jdk-10+0
34af95c7dbff74f3448fcdb7d745524e8a1cc88a jdk-9+154
9b9918656c97724fd89c04a8547043bbd37f5935 jdk-9+155
+7c829eba781409b4fe15392639289af1553dcf63 jdk-9+156
+b7e70e1e0154e1d2c69f814e03a8800ef8634fe0 jdk-9+157
+e53b322357382209fb553b9a1541ccfd12cbcb6c jdk-9+158
+0ea34706c7fa5cd71accd493eb4f54262e4a5f4e jdk-9+159
+6bff08fd5d217549aec10a20007378e52099be6c jdk-9+160
+7d5352c54fc802b3301d8433b6b2b2a92b616630 jdk-9+161
+b8aebe5292f23689f97cb8e66a9f327834dd43e6 jdk-9+162
+3890f96e8995be8c84f330d1f65269b03ac36b24 jdk-9+163
+1a52de2da827459e866fd736f9e9c62eb2ecd6bb jdk-9+164
+a987401bac0d528475e57732c9d5d93f4405804c jdk-9+165
+b1f30c27367bd286fa4eb8a767335e917a5b5b82 jdk-9+166
diff --git a/jaxws/.jcheck/conf b/jaxws/.jcheck/conf
index 5c6f62dc12c..b2581358014 100644
--- a/jaxws/.jcheck/conf
+++ b/jaxws/.jcheck/conf
@@ -1 +1 @@
-project=jdk9
+project=jdk10
diff --git a/jaxws/README b/jaxws/README
deleted file mode 100644
index 4d65125b34c..00000000000
--- a/jaxws/README
+++ /dev/null
@@ -1,19 +0,0 @@
-README:
-
- This file should be located at the top of the Mercurial repository.
-
- See http://openjdk.java.net/ for more information about the OpenJDK.
-
- See ../README-builds.html for complete details on build machine requirements.
-
-Simple Build Instructions:
- This repository can be loaded as a NetBeans project, built with ant, or
- built with GNU make, e.g.
- ant
- -OR-
- cd make && gnumake
-
- The built files that will be imported into the jdk build will be in the
- "dist" directory.
- Help information is available by running "ant -projecthelp" or "make help".
-
diff --git a/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default b/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default
index 0c22eb2efb8..1b4056b194f 100644
--- a/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default
+++ b/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default
@@ -7,6 +7,7 @@ image/gif gif GIF
image/ief ief
image/jpeg jpeg jpg jpe JPG
image/tiff tiff tif
+image/png png PNG
image/x-xwindowdump xwd
application/postscript ai eps ps
application/rtf rtf
diff --git a/jaxws/src/java.activation/share/classes/module-info.java b/jaxws/src/java.activation/share/classes/module-info.java
index 00d40e18550..8132ff67295 100644
--- a/jaxws/src/java.activation/share/classes/module-info.java
+++ b/jaxws/src/java.activation/share/classes/module-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 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
@@ -25,7 +25,11 @@
/**
* Defines the JavaBeans Activation Framework (JAF) API.
+ *
+ * @moduleGraph
+ * @since 9
*/
+@Deprecated(since="9", forRemoval=true)
module java.activation {
requires transitive java.datatransfer;
requires java.logging;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java
index 2f4da84f319..0406d5b4c6b 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -54,9 +54,7 @@ public interface Localizable {
public Object[] getArguments();
public String getResourceBundleName();
- public default ResourceBundle getResourceBundle(Locale locale) {
- return null;
- }
+ public ResourceBundle getResourceBundle(Locale locale);
/**
* Special constant that represents a message that
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
index 1d7ace5146c..747110e350f 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,6 +31,7 @@ import java.util.Arrays;
import java.util.Locale;
import java.util.ResourceBundle;
+
/**
* @author WS Development Team
*/
@@ -42,13 +43,9 @@ public final class LocalizableMessage implements Localizable {
private final String _key;
private final Object[] _args;
+ @Deprecated
public LocalizableMessage(String bundlename, String key, Object... args) {
- _bundlename = bundlename;
- _rbSupplier = null;
- _key = key;
- if(args==null)
- args = new Object[0];
- _args = args;
+ this(bundlename, null, key, args);
}
public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier,
@@ -61,15 +58,17 @@ public final class LocalizableMessage implements Localizable {
_args = args;
}
-
+ @Override
public String getKey() {
return _key;
}
+ @Override
public Object[] getArguments() {
return Arrays.copyOf(_args, _args.length);
}
+ @Override
public String getResourceBundleName() {
return _bundlename;
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java
index bf8a28b76f3..e4d5a126962 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -36,6 +36,7 @@ public class LocalizableMessageFactory {
private final String _bundlename;
private final ResourceBundleSupplier _rbSupplier;
+ @Deprecated
public LocalizableMessageFactory(String bundlename) {
_bundlename = bundlename;
_rbSupplier = null;
@@ -58,4 +59,5 @@ public class LocalizableMessageFactory {
*/
ResourceBundle getResourceBundle(Locale locale);
}
+
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java
index 2f78673eab0..a0436beafa1 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package com.sun.istack.internal.localization;
-import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Locale;
@@ -41,7 +40,7 @@ import java.util.ResourceBundle;
public class Localizer {
private final Locale _locale;
- private final HashMap _resourceBundles;
+ private final HashMap _resourceBundles;
public Localizer() {
this(Locale.getDefault());
@@ -49,7 +48,7 @@ public class Localizer {
public Localizer(Locale l) {
_locale = l;
- _resourceBundles = new HashMap();
+ _resourceBundles = new HashMap<>();
}
public Locale getLocale() {
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java
index e0fb44621f4..f9f0b7abe09 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,6 +25,9 @@
package com.sun.istack.internal.localization;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
/**
* {@link Localizable} that wraps a non-localizable string.
*
@@ -39,13 +42,20 @@ public final class NullLocalizable implements Localizable {
this.msg = msg;
}
+ @Override
public String getKey() {
return Localizable.NOT_LOCALIZABLE;
}
+ @Override
public Object[] getArguments() {
return new Object[]{msg};
}
+ @Override
public String getResourceBundleName() {
return "";
}
+ @Override
+ public ResourceBundle getResourceBundle(Locale locale) {
+ return null;
+ }
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
index a27f0825fe8..fcf907d88ee 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -533,4 +533,14 @@ public abstract class JAXBRIContext extends JAXBContext {
* @since 2.2.6
*/
public static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity";
+
+ /**
+ * If true and element namespace is not specified, namespace of parent element will be used.
+ * The default value is false.
+ *
+ * Boolean
+ * @since 2.3.0
+ */
+ public static final String BACKUP_WITH_PARENT_NAMESPACE = "com.sun.xml.internal.bind.backupWithParentNamespace";
+
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
index a18f79e1d58..73fe277419f 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -112,6 +112,8 @@ public class ContextFactory {
"is not active. Using JAXB's implementation");
}
+ Boolean backupWithParentNamespace = getPropertyValue(properties, JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE, Boolean.class);
+
RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class);
Collection tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class);
@@ -144,6 +146,7 @@ public class ContextFactory {
builder.setSupressAccessorWarnings(supressAccessorWarnings);
builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling);
builder.setDisableSecurityProcessing(disablesecurityProcessing);
+ builder.setBackupWithParentNamespace(backupWithParentNamespace);
return builder.build();
}
diff --git a/jdk/src/jdk.desktop/share/classes/module-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java
similarity index 86%
rename from jdk/src/jdk.desktop/share/classes/module-info.java
rename to jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java
index 2aac00da299..848316f6c53 100644
--- a/jdk/src/jdk.desktop/share/classes/module-info.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -23,12 +23,7 @@
* questions.
*/
-/*
- * Provides non-SE desktop APIs.
+/**
+ * Code that deals with low level byte code manipulation.
*/
-
-module jdk.desktop {
- requires transitive java.desktop;
-
- exports jdk.awt;
-}
+package com.sun.xml.internal.bind.v2.bytecode;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
deleted file mode 100644
index 092f6f3e5d2..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
- Code that deals with low level byte code manipulation.
-
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java
new file mode 100644
index 00000000000..40328931c18
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around reading annotations, to support internal/external annotations.
+ */
+package com.sun.xml.internal.bind.v2.model.annotation;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
deleted file mode 100644
index acc9be725ab..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- Abstraction around reading annotations, to support internal/external annotations.
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
index 5b97093d3fd..c584056f611 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,24 +29,25 @@ import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
/**
* listen to static errors found during building a JAXB model from a set of classes.
- * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
+ * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}.
*
*
* All the static errors have to be reported while constructing a
- * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder#link} completes.
- * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} wraps an {@link ErrorHandler} and all the model
+ * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} completes.
+ * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} wraps an {@link ErrorHandler} and all the model
* components should report errors through it.
*
*
* {@link IllegalAnnotationException} is a checked exception to remind
* the model classes to report it rather than to throw it.
*
- * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder
+ * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI
* @author Kohsuke Kawaguchi
*/
public interface ErrorHandler {
/**
* Receives a notification for an error in the annotated code.
+ * @param e
*/
void error( IllegalAnnotationException e );
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
index c3406b7da6f..83caf8f4f04 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -57,7 +57,7 @@ public enum PropertyKind {
public final boolean isOrdered;
/**
- * {@link com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
+ * {@code com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
* {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order.
*/
public final int propertyIndex;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
index 794c3396d25..9bfe5e04209 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -34,18 +34,22 @@ import javax.xml.bind.annotation.XmlRegistry;
*
*
* This interface is only meant to be used as a return type from
- * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
+ * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}.
*
* @author Kohsuke Kawaguchi
+ * @param
+ * @param
*/
public interface RegistryInfo {
/**
* Returns all the references to other types in this registry.
+ * @return
*/
Set> getReferences();
/**
* Returns the class with {@link XmlRegistry}.
+ * @return
*/
C getClazz();
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java
new file mode 100644
index 00000000000..68abc10902c
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Implementation of the com.sun.xml.internal.bind.j2s.model package.
+ */
+package com.sun.xml.internal.bind.v2.model.impl;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
deleted file mode 100644
index e37eebd2ac4..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-Implementation of the com.sun.xml.internal.bind.j2s.model package.
-
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java
new file mode 100644
index 00000000000..ea3b945f33c
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing).
+ */
+package com.sun.xml.internal.bind.v2.model.nav;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
deleted file mode 100644
index 319f86c97b9..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing).
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
index 3c918598348..5a03996782a 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -241,6 +241,16 @@ public final class JAXBContextImpl extends JAXBRIContext {
private Set xmlNsSet = null;
+ /**
+ * If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified.
+ * The default value is null for System {code}com.sun.xml.internal.bind.backupWithParentNamespace{code} property to be used,
+ * and false is assumed if it's not set either.
+ *
+ * Boolean
+ * @since 2.3.0
+ */
+ public Boolean backupWithParentNamespace = null;
+
/**
* Returns declared XmlNs annotations (from package-level annotation XmlSchema
*
@@ -263,6 +273,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
this.supressAccessorWarnings = builder.supressAccessorWarnings;
this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling;
this.disableSecurityProcessing = builder.disableSecurityProcessing;
+ this.backupWithParentNamespace = builder.backupWithParentNamespace;
Collection typeRefs = builder.typeRefs;
@@ -1024,6 +1035,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
private boolean allNillable;
private boolean improvedXsiTypeHandling = true;
private boolean disableSecurityProcessing = true;
+ private Boolean backupWithParentNamespace = null; // null for System property to be used
public JAXBContextBuilder() {};
@@ -1039,6 +1051,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport;
this.allNillable = baseImpl.allNillable;
this.disableSecurityProcessing = baseImpl.disableSecurityProcessing;
+ this.backupWithParentNamespace = baseImpl.backupWithParentNamespace;
}
public JAXBContextBuilder setRetainPropertyInfo(boolean val) {
@@ -1101,6 +1114,11 @@ public final class JAXBContextImpl extends JAXBRIContext {
return this;
}
+ public JAXBContextBuilder setBackupWithParentNamespace(Boolean backupWithParentNamespace) {
+ this.backupWithParentNamespace = backupWithParentNamespace;
+ return this;
+ }
+
public JAXBContextImpl build() throws JAXBException {
// fool-proof
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java
new file mode 100644
index 00000000000..3ae977b9d19
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Code that implements JAXBContext, Unmarshaller, and Marshaller.
+ */
+package com.sun.xml.internal.bind.v2.runtime;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
deleted file mode 100644
index 2c45e53176e..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-Code that implements JAXBContext, Unmarshaller, and Marshaller.
-
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
index 1be59952231..d2154319c48 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -39,7 +39,7 @@ class AccessorInjector {
private static final Logger logger = Util.getClassLogger();
- protected static final boolean noOptimize = Runtime.version().major() >= 9 ||
+ protected static final boolean noOptimize =
Util.getSystemProperty(ClassTailor.class.getName()+".noOptimize")!=null;
static {
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
index 17c99557d9f..9e00016d7e9 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -40,6 +40,11 @@ import java.util.logging.Logger;
import com.sun.xml.internal.bind.Util;
import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+import java.lang.reflect.Field;
+import java.security.CodeSource;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
/**
* A {@link ClassLoader} used to "inject" optimized accessor classes
@@ -131,7 +136,7 @@ final class Injector {
/**
* Injected classes keyed by their names.
*/
- private final Map classes = new HashMap();
+ private final Map classes = new HashMap<>();
private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
private final Lock r = rwl.readLock();
private final Lock w = rwl.writeLock();
@@ -141,26 +146,59 @@ final class Injector {
* False otherwise, which happens if this classloader can't see {@link Accessor}.
*/
private final boolean loadable;
- private static final Method defineClass;
- private static final Method resolveClass;
- private static final Method findLoadedClass;
+ private static Method defineClass;
+ private static Method resolveClass;
+ private static Method findLoadedClass;
+ private static Object U;
static {
- Method[] m = AccessController.doPrivileged(
- new PrivilegedAction() {
- @Override
- public Method[] run() {
- return new Method[]{
- getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
- getMethod(ClassLoader.class, "resolveClass", Class.class),
- getMethod(ClassLoader.class, "findLoadedClass", String.class)
- };
- }
+ try {
+ Method[] m = AccessController.doPrivileged(
+ new PrivilegedAction() {
+ @Override
+ public Method[] run() {
+ return new Method[]{
+ getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
+ getMethod(ClassLoader.class, "resolveClass", Class.class),
+ getMethod(ClassLoader.class, "findLoadedClass", String.class)
+ };
}
- );
- defineClass = m[0];
- resolveClass = m[1];
- findLoadedClass = m[2];
+ }
+ );
+ defineClass = m[0];
+ resolveClass = m[1];
+ findLoadedClass = m[2];
+ } catch (Throwable t) {
+ try {
+ U = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
+ public Object run() throws Exception {
+ Class u = Class.forName("sun.misc.Unsafe");
+ Field theUnsafe = u.getDeclaredField("theUnsafe");
+ theUnsafe.setAccessible(true);
+ return theUnsafe.get(null);
+ }
+ });
+ defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
+ public Method run() throws Exception {
+ try {
+ return U.getClass().getMethod("defineClass",
+ new Class[]{String.class,
+ byte[].class,
+ Integer.TYPE,
+ Integer.TYPE,
+ ClassLoader.class,
+ ProtectionDomain.class});
+ } catch (NoSuchMethodException | SecurityException ex) {
+ throw ex;
+ }
+ }
+ });
+ } catch (SecurityException | PrivilegedActionException ex) {
+ Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
}
private static Method getMethod(final Class> c, final String methodname, final Class>... params) {
@@ -210,13 +248,11 @@ final class Injector {
rlocked = false;
//find loaded class from classloader
- if (c == null) {
+ if (c == null && findLoadedClass != null) {
try {
c = (Class) findLoadedClass.invoke(parent, className.replace('/', '.'));
- } catch (IllegalArgumentException e) {
- logger.log(Level.FINE, "Unable to find " + className, e);
- } catch (IllegalAccessException e) {
+ } catch (IllegalArgumentException | IllegalAccessException e) {
logger.log(Level.FINE, "Unable to find " + className, e);
} catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
@@ -253,9 +289,13 @@ final class Injector {
// we need to inject a class into the
try {
- c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length);
- resolveClass.invoke(parent, c);
- } catch (IllegalAccessException e) {
+ if (resolveClass != null) {
+ c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length);
+ resolveClass.invoke(parent, c);
+ } else {
+ c = (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, parent, Injector.class.getProtectionDomain());
+ }
+ } catch (IllegalAccessException e) {
logger.log(Level.FINE, "Unable to inject " + className, e);
return null;
} catch (InvocationTargetException e) {
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java
new file mode 100644
index 00000000000..70ae20ccdd9
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Hosts optimized
+ * {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
+ * {@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and {@link com.sun.xml.internal.bind.v2.runtime.Transducer}.
+ *
+ * How it works
+ *
+ * Most of the classes in this package are "templates." At run-time, A template class file is slightly modified to match
+ * the target Java Bean, then it will be loaded into the VM.
+ */
+package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
deleted file mode 100644
index 9039ffafb01..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-Hosts optimized
-{@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
-{@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and
-{@link com.sun.xml.internal.bind.v2.runtime.Transducer}.
-
-How it works
-
- Most of the classes in this package are "templates." At run-time,
- A template class file is slightly modified to match the target Java Bean,
- then it will be loaded into the VM.
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java
new file mode 100644
index 00000000000..35dfd4abe9d
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around accessing data of actual objects.
+ */
+package com.sun.xml.internal.bind.v2.runtime.reflect;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
deleted file mode 100644
index 36c5c915cf8..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- Abstraction around accessing data of actual objects.
-
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
index d1e67292e4e..8ae68be34c0 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -33,7 +33,7 @@ import org.xml.sax.Locator;
import org.w3c.dom.Node;
/**
- * Object that returns the current location that the {@link com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
+ * Object that returns the current location that the {@code com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
* is parsing.
*
* @author Kohsuke Kawaguchi
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
public interface LocatorEx extends Locator {
/**
* Gets the current location in a {@link ValidationEventLocator} object.
+ * @return
*/
ValidationEventLocator getLocation();
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
index 9becb9dd086..8141e4e5178 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,7 +31,9 @@ import java.util.Map;
import javax.xml.namespace.QName;
+import com.sun.xml.internal.bind.Util;
import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
@@ -231,11 +233,26 @@ public final class StructureLoader extends Loader {
@Override
public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException {
ChildLoader child = childUnmarshallers.get(arg.uri,arg.local);
- if (child == null) {
- child = catchAll;
- if (child==null) {
- super.childElement(state,arg);
- return;
+ if(child == null) {
+ Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace;
+ backupWithParentNamespace = backupWithParentNamespace != null
+ ? backupWithParentNamespace
+ : Boolean.parseBoolean(Util.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE));
+ if ((beanInfo != null) && (beanInfo.getTypeNames() != null) && backupWithParentNamespace) {
+ Iterator> typeNamesIt = beanInfo.getTypeNames().iterator();
+ QName parentQName = null;
+ if ((typeNamesIt != null) && (typeNamesIt.hasNext()) && (catchAll == null)) {
+ parentQName = (QName) typeNamesIt.next();
+ String parentUri = parentQName.getNamespaceURI();
+ child = childUnmarshallers.get(parentUri, arg.local);
+ }
+ }
+ if (child == null) {
+ child = catchAll;
+ if(child==null) {
+ super.childElement(state,arg);
+ return;
+ }
}
}
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
index fbe7ff55cb5..f7b434e49d8 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -23,5 +23,8 @@
* questions.
*/
+/**
+ * XML Schema writer generated by TXW.
+ */
@com.sun.xml.internal.txw2.annotation.XmlNamespace("http://www.w3.org/2001/XMLSchema")
package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
deleted file mode 100644
index cce3c1b8ebf..00000000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-XML Schema writer generated by TXW.
-
-
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
index d31a1cbe0d7..d59b0e40471 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, 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
@@ -158,7 +158,7 @@ class ContextFinder {
Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader);
return newInstance(contextPath, spFactory, classLoader, properties);
} catch (ClassNotFoundException x) {
- throw new JAXBException(Messages.format(Messages.PROVIDER_NOT_FOUND, className), x);
+ throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), x);
} catch (RuntimeException | JAXBException x) {
// avoid wrapping RuntimeException to JAXBException,
@@ -228,7 +228,7 @@ class ContextFinder {
}
}
- private static Object instantiateProviderIfNecessary(Class> implClass) throws JAXBException {
+ private static Object instantiateProviderIfNecessary(final Class> implClass) throws JAXBException {
try {
if (JAXBContextFactory.class.isAssignableFrom(implClass)) {
return AccessController.doPrivileged(new PrivilegedExceptionAction