diff --git a/.hgtags b/.hgtags index 960aebae7d6..350c703b276 100644 --- a/.hgtags +++ b/.hgtags @@ -1,3 +1,6 @@ +43bf6f30fcba031ecf0cc7e511efe3a8179d0f77 jdk-9+176 +d9f6bc6ba599d0487dc18b2fbdb6c34eedf6f958 jdk-9+177 +bc9df7dd63ec76f50fafeb4acc44465044662f0a jdk-9+178 994036e74ab805bcc09afa0646be17a725bec42f jdk-9+175 94680c6d60ecd9ed3ffd1847706efde7eb947afc jdk-9+174 6dd7fda42bab7ecf648cafb0a4e9b4ca11b3094f jdk-9+173 @@ -432,3 +435,4 @@ b0f2b8ff25a2209b2c807785d75f20e5086bbfc2 jdk-10+10 036dbf8b381798e5d31065109714d04d97bf98a4 jdk-10+11 e6d70017f5b9adbb2ec82d826973d0251800a3c3 jdk-10+12 9927a9f16738e240ab7014f0118f41e314ef8f99 jdk-10+13 +9ef5029b247b4d940080417a287440bbdbab995b jdk-10+14 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 69b3f8c924a..8a1854bea7f 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -432,3 +432,6 @@ b94be69cbb1d2943b886bf2d458745756df146e4 jdk-10+9 8d4ed1e06fe184c9cb08c5b708e7d6f5c066644f jdk-10+12 8f7227c6012b0051ea4e0bcee040c627bf699b88 jdk-9+175 d67a3f1f057f7e31e12f33ebe3667cb73d252268 jdk-10+13 +1fd5901544acc50bb30fde9388c8e53cb7c449e4 jdk-10+14 +84777531d994ef70163d35078ec9c4127f2eadb5 jdk-9+176 +a4371edb589c60db01142e45c317adb9ccbcb083 jdk-9+177 diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index bad4544d17b..e3bf2462ea9 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -615,6 +615,8 @@ var getJibProfilesProfiles = function (input, common, data) { } var testOnlyProfilesPrebuilt = { "run-test-prebuilt": { + target_os: input.build_os, + target_cpu: input.build_cpu, src: "src.conf", dependencies: [ "jtreg", "gnumake", "boot_jdk", testedProfile + ".jdk", testedProfile + ".test", "src.full" @@ -635,13 +637,14 @@ var getJibProfilesProfiles = function (input, common, data) { if (input.profile == "run-test-prebuilt") { if (profiles[testedProfile] == null) { error("testedProfile is not defined: " + testedProfile); - } else { - testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"] - = profiles[testedProfile]["target_os"]; - testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"] - = profiles[testedProfile]["target_cpu"]; } } + if (profiles[testedProfile] != null) { + testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"] + = profiles[testedProfile]["target_os"]; + testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"] + = profiles[testedProfile]["target_cpu"]; + } profiles = concatObjects(profiles, testOnlyProfilesPrebuilt); // On macosx add the devkit bin dir to the path in all the run-test profiles. diff --git a/common/doc/building.html b/common/doc/building.html index 624c3e8e853..48ddbc1c6f4 100644 --- a/common/doc/building.html +++ b/common/doc/building.html @@ -4,149 +4,345 @@ - OpenJDK Build README + Building OpenJDK - + +
-

OpenJDK Build README

+

Building OpenJDK

-
-OpenJDK
OpenJDK
-
-
-

Introduction

-

This README file contains build instructions for the OpenJDK. Building the source code for the OpenJDK requires a certain degree of technical expertise.

-

!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

-

Some Headlines:

- -
-

Contents

+ +

TL;DR (Instructions for the Impatient)

+

If you are eager to try out building OpenJDK, these simple steps works most of the time. They assume that you have installed Mercurial (and Cygwin if running on Windows) and cloned the top-level OpenJDK repository that you want to build.

+
    +
  1. Get the complete source code:
    +bash get_source.sh

  2. +
  3. Run configure:
    +bash configure

    +

    If configure fails due to missing dependencies (to either the toolchain, external libraries or the boot JDK), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running bash configure again.

  4. +
  5. Run make:
    +make images

  6. +
  7. Verify your newly built JDK:
    +./build/*/images/jdk/bin/java -version

  8. +
  9. Run basic tests:
    +make run-test-tier1

  10. +
+

If any of these steps failed, or if you want to know more about build requirements or build functionality, please continue reading this document.

+

Introduction

+

OpenJDK is a complex software project. Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware.

+

If you just want to use OpenJDK and not build it yourself, this document is not for you. See for instance OpenJDK installation for some methods of installing a prebuilt OpenJDK.

+

Getting the Source Code

+

OpenJDK uses Mercurial for source control. The source code is contained not in a single Mercurial repository, but in a tree ("forest") of interrelated repositories. You will need to check out all of the repositories to be able to build OpenJDK. To assist you in dealing with this somewhat unusual arrangement, there are multiple tools available, which are explained below.

+

In any case, make sure you are getting the correct version. At the OpenJDK Mercurial server you can see a list of all available forests. If you want to build an older version, e.g. JDK 8, it is recommended that you get the jdk8u forest, which contains incremental updates, instead of the jdk8 forest, which was frozen at JDK 8 GA.

+

If you are new to Mercurial, a good place to start is the Mercurial Beginner's Guide. The rest of this document assumes a working knowledge of Mercurial.

+

Special Considerations

+

For a smooth building experience, it is recommended that you follow these rules on where and how to check out the source code.

-

Repository Source Guidelines

-

There are some very basic guidelines:

+
  • Do not check out the source code in a path which contains spaces. Chances are the build will not work. This is most likely to be an issue on Windows systems.

  • +
  • Do not check out the source code in a path which has a very long name or is nested many levels deep. Chances are you will hit an OS limitation during the build.

  • +
  • Put the source code on a local disk, not a network share. If possible, use an SSD. The build process is very disk intensive, and having slow disk access will significantly increase build times. If you need to use a network share for the source code, see below for suggestions on how to keep the build artifacts on a local disk.

  • +
  • On Windows, extra care must be taken to make sure the Cygwin environment is consistent. It is recommended that you follow this procedure:

    -
    -

    Building

    -

    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.

    -
    -

    System Setup

    -

    Before even attempting to use a system to build the OpenJDK there are some very basic system setups needed. For all systems:

    +

    Failure to follow this procedure might result in hard-to-debug build problems.

  • + +

    Using get_source.sh

    +

    The simplest way to get the entire forest is probably to clone the top-level repository and then run the get_source.sh script, like this:

    +
    hg clone http://hg.openjdk.java.net/jdk9/jdk9
    +cd jdk9
    +bash get_source.sh
    +

    The first time this is run, it will clone all the sub-repositories. Any subsequent execution of the script will update all sub-repositories to the latest revision.

    +

    Using hgforest.sh

    +

    The hgforest.sh script is more expressive than get_source.sh. It takes any number of arguments, and runs hg with those arguments on each sub-repository in the forest. The get_source.sh script is basically a simple wrapper that runs either hgforest.sh clone or hgforest.sh pull -u.

    -

    * 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.

    +

    Using the Trees Extension

    +

    The trees extension is a Mercurial add-on that helps you deal with the forest. More information is available on the Code Tools trees page.

    +

    Installing the Extension

    +

    Install the extension by cloning http://hg.openjdk.java.net/code-tools/trees and updating your .hgrc file. Here's one way to do this:

    +
    cd ~
    +mkdir hg-ext
    +cd hg-ext
    +hg clone http://hg.openjdk.java.net/code-tools/trees
    +cat << EOT >> ~/.hgrc
    +[extensions]
    +trees=~/hg-ext/trees/trees.py
    +EOT
    +

    Initializing the Tree

    +

    The trees extension needs to know the structure of the forest. If you have already cloned the entire forest using another method, you can initialize the forest like this:

    +
    hg tconf --set --walk --depth
    +

    Or you can clone the entire forest at once, if you substitute clone with tclone when cloning the top-level repository, e.g. like this:

    +
    hg tclone http://hg.openjdk.java.net/jdk9/jdk9
    +

    In this case, the forest will be properly initialized from the start.

    +

    Other Operations

    +

    The trees extensions supplement many common operations with a trees version by prefixing a t to the normal Mercurial command, e.g. tcommit, tstatus or tmerge. For instance, to update the entire forest:

    +
    hg tpull -u
    +

    Build Hardware Requirements

    +

    OpenJDK is a massive project, and require machines ranging from decent to powerful to be able to build in a reasonable amount of time, or to be able to complete a build at all.

    +

    We strongly recommend usage of an SSD disk for the build, since disk speed is one of the limiting factors for build performance.

    +

    Building on x86

    +

    At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required (8 GB minimum for building on Solaris).

    +

    Even for 32-bit builds, it is recommended to use a 64-bit build machine, and instead create a 32-bit target using --with-target-bits=32.

    +

    Building on sparc

    +

    At a minimum, a machine with 4 cores is advisable, as well as 4 GB of RAM. (The more cores to use, the more memory you need.) At least 8 GB of free disk space is required.

    +

    Building on arm/aarch64

    +

    This is not recommended. Instead, see the section on Cross-compiling.

    +

    Operating System Requirements

    +

    The mainline OpenJDK project supports Linux, Solaris, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate "port" projects.

    +

    In general, OpenJDK can be built on a wide range of versions of these operating systems, but the further you deviate from what is tested on a daily basis, the more likely you are to run into problems.

    +

    This table lists the OS versions used by Oracle when building JDK 9. Such information is always subject to change, but this table is up to date at the time of writing.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Operating systemVendor/version used
    LinuxOracle Enterprise Linux 6.4 / 7.1 (using kernel 3.8.13)
    SolarisSolaris 11.1 SRU 21.4.1 / 11.2 SRU 5.5
    macOSMac OS X 10.9 (Mavericks) / 10.10 (Yosemite)
    WindowsWindows Server 2012 R2
    +

    The double version numbers for Linux, Solaris and macOS is due to the hybrid model used at Oracle, where header files and external libraries from an older version is used when building on a more modern version of the OS.

    +

    The Build Group has a wiki page with Supported Build Platforms. From time to time, this is updated by the community to list successes or failures of building on different platforms.

    +

    Windows

    +

    Windows XP is not a supported platform, but all newer Windows should be able to build OpenJDK.

    +

    On Windows, it is important that you pay attention to the instructions in the Special Considerations.

    +

    Windows is the only non-POSIX OS supported by OpenJDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. For OpenJDK 9, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require a community effort to implement.)

    +

    Internally in the build system, all paths are represented as Unix-style paths, e.g. /cygdrive/c/hg/jdk9/Makefile rather than C:\hg\jdk9\Makefile. This rule also applies to input to the build system, e.g. in arguments to configure. So, use --with-freetype=/cygdrive/c/freetype rather than --with-freetype=c:\freetype. For details on this conversion, see the section on Fixpath.

    +

    Cygwin

    +

    A functioning Cygwin environment is thus required for building OpenJDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.

    +

    Note: Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the OpenJDK build process, and that can cause unexpected build problems.

    +

    OpenJDK requires GNU Make 4.0 or greater on Windows. This is usually not a problem, since Cygwin currently only distributes GNU Make at a version above 4.0.

    +

    Apart from the basic Cygwin installation, the following packages must also be installed:

    -

    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.

    - -

    Install XCode 6.3

    -

    Linux

    -

    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.

    -

    Solaris

    -
    Studio Compilers
    -

    At a minimum, the Studio 12 Update 4 Compilers (containing version 5.13 of the C and C++ compilers) is required, including specific patches.

    +

    Often, you can install these packages using the following command line:

    +
    <path to Cygwin setup>/setup-x86_64 -q -P make -P unzip -P zip
    +

    Unfortunately, Cygwin can be unreliable in certain circumstances. If you experience build tool crashes or strange issues when building on Windows, please check the Cygwin FAQ on the "BLODA" list and the section on fork() failures.

    +

    Solaris

    +

    See make/devkit/solaris11.1-package-list.txt for a list of recommended packages to install when building on Solaris. The versions specified in this list is the versions used by the daily builds at Oracle, and is likely to work properly.

    +

    Older versions of Solaris shipped a broken version of objcopy. At least version 2.21.1 is needed, which is provided by Solaris 11 Update 1. Objcopy is needed if you want to have external debug symbols. Please make sure you are using at least version 2.21.1 of objcopy, or that you disable external debug symbols.

    +

    macOS

    +

    Apple is using a quite aggressive scheme of pushing OS updates, and coupling these updates with required updates of Xcode. Unfortunately, this makes it difficult for a project like OpenJDK to keep pace with a continuously updated machine running macOS. See the section on Apple Xcode on some strategies to deal with this.

    +

    It is recommended that you use at least Mac OS X 10.9 (Mavericks). At the time of writing, OpenJDK has been successfully compiled on macOS versions up to 10.12.5 (Sierra), using XCode 8.3.2 and --disable-warnings-as-errors.

    +

    The standard macOS environment contains the basic tooling needed to build, but for external libraries a package manager is recommended. OpenJDK uses homebrew in the examples, but feel free to use whatever manager you want (or none).

    +

    Linux

    +

    It is often not much problem to build OpenJDK on Linux. The only general advice is to try to use the compilers, external libraries and header files as provided by your distribution.

    +

    The basic tooling is provided as part of the core operating system, but you will most likely need to install developer packages.

    +

    For apt-based distributions (Debian, Ubuntu, etc), try this:

    +
    sudo apt-get install build-essential
    +

    For rpm-based distributions (Fedora, Red Hat, etc), try this:

    +
    sudo yum groupinstall "Development Tools"
    +

    AIX

    +

    The regular builds by SAP is using AIX version 7.1, but AIX 5.3 is also supported. See the OpenJDK PowerPC Port Status Page for details.

    +

    Native Compiler (Toolchain) Requirements

    +

    Large portions of OpenJDK consists of native code, that needs to be compiled to be able to run on the target platform. In theory, toolchain and operating system should be independent factors, but in practice there's more or less a one-to-one correlation between target operating system and toolchain.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Operating systemSupported toolchain
    Linuxgcc, clang
    macOSApple Xcode (using clang)
    SolarisOracle Solaris Studio
    AIXIBM XL C/C++
    WindowsMicrosoft Visual Studio
    +

    Please see the individual sections on the toolchains for version recommendations. As a reference, these versions of the toolchains are used, at the time of writing, by Oracle for the daily builds of OpenJDK. It should be possible to compile OpenJDK with both older and newer versions, but the closer you stay to this list, the more likely you are to compile successfully without issues.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Operating systemToolchain version
    Linuxgcc 4.9.2
    macOSApple Xcode 6.3 (using clang 6.1.0)
    SolarisOracle Solaris Studio 12.4 (with compiler version 5.13)
    WindowsMicrosoft Visual Studio 2013 update 4
    +

    gcc

    +

    The minimum accepted version of gcc is 4.3. Older versions will not be accepted by configure.

    +

    However, gcc 4.3 is quite old and OpenJDK is not regularly tested on this version, so it is recommended to use a more modern gcc.

    +

    OpenJDK 9 includes patches that should allow gcc 6 to compile, but this should be considered experimental.

    +

    In general, any version between these two should be usable.

    +

    clang

    +

    The minimum accepted version of clang is 3.2. Older versions will not be accepted by configure.

    +

    To use clang instead of gcc on Linux, use --with-toolchain-type=clang.

    +

    Apple Xcode

    +

    The oldest supported version of Xcode is 5.

    +

    You will need the Xcode command lines developers tools to be able to build OpenJDK. (Actually, only the command lines tools are needed, not the IDE.) The simplest way to install these is to run:

    +
    xcode-select --install
    +

    It is advisable to keep an older version of Xcode for building OpenJDK when updating Xcode. This blog page has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use xcode-select -s before running configure, or use --with-toolchain-path to point to the version of Xcode to use, e.g. configure --with-toolchain-path=/Applications/Xcode5.app/Contents/Developer/usr/bin

    +

    If you have recently (inadvertently) updated your OS and/or Xcode version, and OpenJDK can no longer be built, please see the section on Problems with the Build Environment, and Getting Help to find out if there are any recent, non-merged patches available for this update.

    +

    Oracle Solaris Studio

    +

    The minimum accepted version of the Solaris Studio compilers is 5.13 (corresponding to Solaris Studio 12.4). Older versions will not be accepted by configure.

    The Solaris Studio installation should contain at least these packages:

    @@ -198,555 +394,567 @@
    -

    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.

    -

    Windows

    -
    Windows Unix Toolkit
    -

    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
    -

    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 NameCategoryPackageDescription
    ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
    make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
    m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
    cpio.exeUtilscpioA program to manage archives of files
    gawk.exeUtilsawkPattern-directed scanning and processing language
    file.exeUtilsfileDetermines file type using 'magic' numbers
    zip.exeArchivezipPackage and compress (archive) files
    unzip.exeArchiveunzipExtract compressed files in a ZIP archive
    free.exeSystemprocpsDisplay 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/MSYS
    -

    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
    -
    Visual Studio 2013 Compilers
    -

    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.

    -

    Mac OS X

    -

    Make sure you get the right XCode version.

    -
    -

    Configure

    -

    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

    -
    -

    Configure Options

    -

    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 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 the msvcr100.dll file 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.h or /usr/openwin/share/include/X11/extensions/Xrender.h

    -
    -
    -

    Make

    -

    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 by configure

    -
    -
    -

    dist-clean
    -remove all files generated by both and configure (basically killing the configuration)

    -
    -
    -

    help
    -give some help on using make, including some interesting make targets

    -
    -
    -

    Testing

    -

    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

    -
    -
    -

    Appendix A: Hints and Tips

    -

    FAQ

    -

    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:

    +

    Compiling with Solaris Studio can sometimes be finicky. This is the exact version used by Oracle, which worked correctly at the time of writing:

    +
    $ cc -V
    +cc: Sun C 5.13 SunOS_i386 2014/10/20
    +$ CC -V
    +CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30
    +

    Microsoft Visual Studio

    +

    The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by configure. The maximum accepted version of Visual Studio is 2013.

    +

    If you have multiple versions of Visual Studio installed, configure will by default pick the latest. You can request a specific version to be used by setting --with-toolchain-version, e.g. --with-toolchain-version=2010.

    +

    If you get LINK: fatal error LNK1123: failure during conversion to COFF: file invalid when building using Visual Studio 2010, you have encountered KB2757355, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See this stackoverflow discussion for other suggestions.

    +

    IBM XL C/C++

    +

    The regular builds by SAP is using version 12.1, described as IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0017.

    +

    See the OpenJDK PowerPC Port Status Page for details.

    +

    Boot JDK Requirements

    +

    Paradoxically, building OpenJDK requires a pre-existing JDK. This is called the "boot JDK". The boot JDK does not have to be OpenJDK, though. If you are porting OpenJDK to a new platform, chances are that there already exists another JDK for that platform that is usable as boot JDK.

    +

    The rule of thumb is that the boot JDK for building JDK major version N should be an JDK of major version N-1, so for building JDK 9 a JDK 8 would be suitable as boot JDK. However, OpenJDK should be able to "build itself", so an up-to-date build of the current OpenJDK source is an acceptable alternative. If you are following the N-1 rule, make sure you got the latest update version, since JDK 8 GA might not be able to build JDK 9 on all platforms.

    +

    If the Boot JDK is not automatically detected, or the wrong JDK is picked, use --with-boot-jdk to point to the JDK to use.

    +

    JDK 8 on Linux

    +

    On apt-based distros (like Debian and Ubuntu), sudo apt-get install openjdk-8-jdk is typically enough to install OpenJDK 8. On rpm-based distros (like Fedora and Red Hat), try sudo yum install java-1.8.0-openjdk-devel.

    +

    JDK 8 on Windows

    +

    No pre-compiled binaries of OpenJDK 8 are readily available for Windows at the time of writing. An alternative is to download the Oracle JDK. Another is the Adopt OpenJDK Project, which publishes experimental prebuilt binaries for Windows.

    +

    JDK 8 on macOS

    +

    No pre-compiled binaries of OpenJDK 8 are readily available for macOS at the time of writing. An alternative is to download the Oracle JDK, or to install it using brew cask install java. Another option is the Adopt OpenJDK Project, which publishes experimental prebuilt binaries for macOS.

    +

    JDK 8 on AIX

    +

    No pre-compiled binaries of OpenJDK 8 are readily available for AIX at the time of writing. A starting point for working with OpenJDK on AIX is the PowerPC/AIX Port Project.

    +

    External Library Requirements

    +

    Different platforms require different external libraries. In general, libraries are not optional - that is, they are either required or not used.

    +

    If a required library is not detected by configure, you need to provide the path to it. There are two forms of the configure arguments to point to an external library: --with-<LIB>=<path> or --with-<LIB>-include=<path to include> --with-<LIB>-lib=<path to lib>. The first variant is more concise, but require the include files an library files to reside in a default hierarchy under this directory. In most cases, it works fine.

    +

    As a fallback, the second version allows you to point to the include directory and the lib directory separately.

    +

    FreeType

    +

    FreeType2 from The FreeType Project is required on all platforms. At least version 2.3 is required.

    -

    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!

    -

    Build Performance Tips

    +

    Use --with-freetype=<path> if configure does not properly locate your FreeType files.

    +

    Building FreeType on Windows

    +

    On Windows, there is no readily available compiled version of FreeType. OpenJDK can help you compile FreeType from source. Download the FreeType sources and unpack them into an arbitrary directory:

    +
    wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
    +tar -xzf freetype-2.5.3.tar.gz
    +

    Then run configure with --with-freetype-src=<freetype_src>. This will automatically build the freetype library into <freetype_src>/lib64 for 64-bit builds or into <freetype_src>/lib32 for 32-bit builds. Afterwards you can always use --with-freetype-include=<freetype_src>/include and --with-freetype-lib=<freetype_src>/lib[32|64] for other builds.

    +

    Alternatively you can unpack the sources like this to use the default directory:

    +
    tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz
    +

    CUPS

    +

    CUPS, Common UNIX Printing System header files are required on all platforms, except Windows. Often these files are provided by your operating system.

    + +

    Use --with-cups=<path> if configure does not properly locate your CUPS files.

    +

    X11

    +

    Certain X11 libraries and include files are required on Linux and Solaris.

    + +

    Use --with-x=<path> if configure does not properly locate your X11 files.

    +

    ALSA

    +

    ALSA, Advanced Linux Sound Architecture is required on Linux. At least version 0.9.1 of ALSA is required.

    + +

    Use --with-alsa=<path> if configure does not properly locate your ALSA files.

    +

    libffi

    +

    libffi, the Portable Foreign Function Interface Library is required when building the Zero version of Hotspot.

    + +

    Use --with-libffi=<path> if configure does not properly locate your libffi files.

    +

    libelf

    +

    libelf from the elfutils project is required when building the AOT feature of Hotspot.

    + +

    Use --with-libelf=<path> if configure does not properly locate your libelf files.

    +

    Other Tooling Requirements

    +

    GNU Make

    +

    OpenJDK requires GNU Make. No other flavors of make are supported.

    +

    At least version 3.81 of GNU Make must be used. For distributions supporting GNU Make 4.0 or above, we strongly recommend it. GNU Make 4.0 contains useful functionality to handle parallel building (supported by --with-output-sync) and speed and stability improvements.

    +

    Note that configure locates and verifies a properly functioning version of make and stores the path to this make binary in the configuration. If you start a build using make on the command line, you will be using the version of make found first in your PATH, and not necessarily the one stored in the configuration. This initial make will be used as "bootstrap make", and in a second stage, the make located by configure will be called. Normally, this will present no issues, but if you have a very old make, or a non-GNU Make make in your path, this might cause issues.

    +

    If you want to override the default make found by configure, use the MAKE configure variable, e.g. configure MAKE=/opt/gnu/make.

    +

    On Solaris, it is common to call the GNU version of make by using gmake.

    +

    GNU Bash

    +

    OpenJDK requires GNU Bash. No other shells are supported.

    +

    At least version 3.2 of GNU Bash must be used.

    +

    Autoconf

    +

    If you want to modify the build system itself, you need to install Autoconf.

    +

    However, if you only need to build OpenJDK or if you only edit the actual OpenJDK source files, there is no dependency on autoconf, since the source distribution includes a pre-generated configure shell script.

    +

    See the section on Autoconf Details for details on how OpenJDK uses autoconf. This is especially important if you plan to contribute changes to OpenJDK that modifies the build system.

    +

    Running Configure

    +

    To build OpenJDK, you need a "configuration", which consists of a directory where to store the build output, coupled with information about the platform, the specific build machine, and choices that affect how OpenJDK is built.

    +

    The configuration is created by the configure script. The basic invocation of the configure script looks like this:

    +
    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, but the actual name depends on your specific configuration. (It can also be set directly, see Using Multiple Configurations). This directory is referred to as $BUILD in this documentation.

    +

    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.

    +

    Some command line examples:

    + +

    Common Configure Arguments

    +

    Here follows some of the most common and important configure argument.

    +

    To get up-to-date information on all available configure argument, please run:

    +
    bash configure --help
    +

    (Note that this help text also include general autoconf options, like --dvidir, that is not relevant to OpenJDK. To list only OpenJDK specific features, use bash configure --help=short instead.)

    +

    Configure Arguments for Tailoring the Build

    + +

    Configure Arguments for Native Compilation

    + +

    Configure Arguments for External Dependencies

    + +

    Certain third-party libraries used by OpenJDK (libjpeg, giflib, libpng, lcms and zlib) are included in the OpenJDK repository. The default behavior of the OpenJDK build is to use this version of these libraries, but they might be replaced by an external version. To do so, specify system as the <source> option in these arguments. (The default is bundled).

    + +

    On Linux, it is possible to select either static or dynamic linking of the C++ runtime. The default is static linking, with dynamic linking as fallback if the static library is not found.

    + +

    Configure Control Variables

    +

    It is possible to control certain aspects of configure by overriding the value of configure variables, either on the command line or in the environment.

    +

    Normally, this is not recommended. If used improperly, it can lead to a broken configuration. Unless you're well versed in the build system, this is hard to use properly. Therefore, configure will print a warning if this is detected.

    +

    However, there are a few configure variables, known as control variables that are supposed to be overriden on the command line. These are variables that describe the location of tools needed by the build, like MAKE or GREP. If any such variable is specified, configure will use that value instead of trying to autodetect the tool. For instance, bash configure MAKE=/opt/gnumake4.0/bin/make.

    +

    If a configure argument exists, use that instead, e.g. use --with-jtreg instead of setting JTREGEXE.

    +

    Also note that, despite what autoconf claims, setting CFLAGS will not accomplish anything. Instead use --with-extra-cflags (and similar for cxxflags and ldflags).

    +

    Running Make

    +

    When you have a proper configuration, all you need to do to build OpenJDK is to run make. (But see the warning at GNU Make about running the correct version of make.)

    +

    When running make without any arguments, the default target is used, which is the same as running make default or make jdk. This will build a minimal (or roughly minimal) set of compiled output (known as an "exploded image") 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 output of the exploded image resides in $BUILD/jdk. You can test the newly built JDK like this: $BUILD/jdk/bin/java -version.

    +

    Common Make Targets

    +

    Apart from the default target, here are some common make targets:

    + +

    Run make help to get an up-to-date list of important make targets and make control variables.

    +

    It is possible to build just a single module, a single phase, or a single phase of a single module, by creating make targets according to these followin patterns. A phase can be either of gensrc, gendata, copy, java, launchers, libs or rmic. See Using Fine-Grained Make Targets for more details about this functionality.

    + +

    Similarly, it is possible to clean just a part of the build by creating make targets according to these patterns:

    + +

    Make Control Variables

    +

    It is possible to control make behavior by overriding the value of make variables, either on the command line or in the environment.

    +

    Normally, this is not recommended. If used improperly, it can lead to a broken build. Unless you're well versed in the build system, this is hard to use properly. Therefore, make will print a warning if this is detected.

    +

    However, there are a few make variables, known as control variables that are supposed to be overriden on the command line. These make up the "make time" configuration, as opposed to the "configure time" configuration.

    +

    General Make Control Variables

    + +

    Test Make Control Variables

    +

    These make control variables only make sense when running tests. Please see Testing OpenJDK for details.

    + +

    Advanced Make Control Variables

    +

    These advanced make control variables can be potentially unsafe. See Hints and Suggestions for Advanced Users and Understanding the Build System for details.

    + +

    Running Tests

    +

    Most of the OpenJDK tests are using the JTReg test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the --with-jtreg=<path to jtreg home> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing lib/jtreg.jar etc.

    +

    To execute the most basic tests (tier 1), use:

    +
    make run-test-tier1
    +

    For more details on how to run tests, please see the Testing OpenJDK document.

    +

    Cross-compiling

    +

    Cross-compiling means using one platform (the build platform) to generate output that can ran on another platform (the target platform).

    +

    The typical reason for cross-compiling is that the build is performed on a more powerful desktop computer, but the resulting binaries will be able to run on a different, typically low-performing system. Most of the complications that arise when building for embedded is due to this separation of build and target systems.

    +

    This requires a more complex setup and build procedure. This section assumes you are familiar with cross-compiling in general, and will only deal with the particularities of cross-compiling OpenJDK. If you are new to cross-compiling, please see the external links at Wikipedia for a good start on reading materials.

    +

    Cross-compiling OpenJDK requires you to be able to build both for the build platform and for the target platform. The reason for the former is that we need to build and execute tools during the build process, both native tools and Java tools.

    +

    If all you want to do is to compile a 32-bit version, for the same OS, on a 64-bit machine, consider using --with-target-bits=32 instead of doing a full-blown cross-compilation. (While this surely is possible, it's a lot more work and will take much longer to build.)

    +

    Boot JDK and Build JDK

    +

    When cross-compiling, make sure you use a boot JDK that runs on the build system, and not on the target system.

    +

    To be able to build, we need a "Build JDK", which is a JDK built from the current sources (that is, the same as the end result of the entire build process), but able to run on the build system, and not the target system. (In contrast, the Boot JDK should be from an older release, e.g. JDK 8 when building JDK 9.)

    +

    The build process will create a minimal Build JDK for you, as part of building. To speed up the build, you can use --with-build-jdk to configure to point to a pre-built Build JDK. Please note that the build result is unpredictable, and can possibly break in subtle ways, if the Build JDK does not exactly match the current sources.

    +

    Specifying the Target Platform

    +

    You must specify the target platform when cross-compiling. Doing so will also automatically turn the build into a cross-compiling mode. The simplest way to do this is to use the --openjdk-target argument, e.g. --openjdk-target=arm-linux-gnueabihf. or --openjdk-target=aarch64-oe-linux. This will automatically set the --build, --host and --target options for autoconf, which can otherwise be confusing. (In autoconf terminology, the "target" is known as "host", and "target" is used for building a Canadian cross-compiler.)

    +

    Toolchain Considerations

    +

    You will need two copies of your toolchain, one which generates output that can run on the target system (the normal, or target, toolchain), and one that generates output that can run on the build system (the build toolchain). Note that cross-compiling is only supported for gcc at the time being. The gcc standard is to prefix cross-compiling toolchains with the target denominator. If you follow this standard, configure is likely to pick up the toolchain correctly.

    +

    The build toolchain will be autodetected just the same way the normal build/target toolchain will be autodetected when not cross-compiling. If this is not what you want, or if the autodetection fails, you can specify a devkit containing the build toolchain using --with-build-devkit to configure, or by giving BUILD_CC and BUILD_CXX arguments.

    +

    It is often helpful to locate the cross-compilation tools, headers and libraries in a separate directory, outside the normal path, and point out that directory to configure. Do this by setting the sysroot (--with-sysroot) and appending the directory when searching for cross-compilations tools (--with-toolchain-path). As a compact form, you can also use --with-devkit to point to a single directory, if it is correctly setup. (See basics.m4 for details.)

    +

    If you are unsure what toolchain and versions to use, these have been proved working at the time of writing:

    + +

    Native Libraries

    +

    You will need copies of external native libraries for the target system, present on the build machine while building.

    +

    Take care not to replace the build system's version of these libraries by mistake, since that can render the build machine unusable.

    +

    Make sure that the libraries you point to (ALSA, X11, etc) are for the target, not the build, platform.

    +

    ALSA

    +

    You will need alsa libraries suitable for your target system. For most cases, using Debian's pre-built libraries work fine.

    +

    Note that alsa is needed even if you only want to build a headless JDK.

    + +

    X11

    +

    You will need X11 libraries suitable for your target system. For most cases, using Debian's pre-built libraries work fine.

    +

    Note that X11 is needed even if you only want to build a headless JDK.

    + +

    Building for ARM/aarch64

    +

    A common cross-compilation target is the ARM CPU. When building for ARM, it is useful to set the ABI profile. A number of pre-defined ABI profiles are available using --with-abi-profile: arm-vfp-sflt, arm-vfp-hflt, arm-sflt, armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer properly supported on OpenJDK.

    +

    OpenJDK contains two different ports for the aarch64 platform, one is the original aarch64 port from the AArch64 Port Project and one is a 64-bit version of the Oracle contributed ARM port. When targeting aarch64, by the default the original aarch64 port is used. To select the Oracle ARM 64 port, use --with-cpu-port=arm64. Also set the corresponding value (aarch64 or arm64) to --with-abi-profile, to ensure a consistent build.

    +

    Verifying the Build

    +

    The build will end up in a directory named like build/linux-arm-normal-server-release.

    +

    Inside this build output directory, the images/jdk and images/jre will contain the newly built JDK and JRE, respectively, for your target system.

    +

    Copy these folders to your target system. Then you can run e.g. images/jdk/bin/java -version.

    +

    Build Performance

    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:

    -

    It 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.

    +

    You can also specify directly the number of build jobs to use with --with-jobs=N to configure, or JOBS=N to make. Do not use the -j flag to make. In most cases it will be ignored by the makefiles, but it can cause problems for some make targets.

    +

    It might also be necessary to specify the JVM arguments passed to the Boot JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G". Doing so will override the default JVM arguments passed to the Boot JDK.

    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!

    -

    Building with ccache

    -

    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.

    -

    Building on local disk

    -

    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.

    -

    Building only one JVM

    -

    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.

    -

    Selecting the number of cores to build on

    -

    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

    -

    Troubleshooting

    -

    Solving build problems

    -

    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.

    - -

    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.

    - -
    -

    make JOBS=1

    -
    -

    to reduce the load on the system.

    - -

    To completely disable SELinux:

    +

    If you want to tweak build performance, run with make LOG=info to get a build time summary at the end of the build process.

    +

    Disk Speed

    +

    If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk (e.g. by ln -s /localdisk/jdk-build $JDK-SHARE/build). The performance penalty is extremely high for building on a network share; close to unusable.

    +

    Also, make sure that your build tools (including Boot JDK and toolchain) is located on a local disk and not a network share.

    +

    As has been stressed elsewhere, do use SSD for source code and build directory, as well as (if possible) the build tools.

    +

    Virus Checking

    +

    The use of virus checking software, especially on Windows, can significantly slow down building of OpenJDK. If possible, turn off such software, or exclude the directory containing the OpenJDK source code from on-the-fly checking.

    +

    Ccache

    +

    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.

    +

    Precompiled Headers

    +

    By default, the Hotspot build uses preccompiled headers (PCH) on the toolchains were it is properly supported (clang, gcc, and Visual Studio). Normally, this speeds up the build process, but in some circumstances, it can actually slow things down.

    +

    You can experiment by disabling precompiled headers using --disable-precompiled-headers.

    +

    Icecc / icecream

    +

    icecc/icecream is a simple way to setup a distributed compiler network. If you have multiple machines available for building OpenJDK, you can drastically cut individual build times by utilizing it.

    +

    To use, setup an icecc network, and install icecc on the build machine. Then run configure using --enable-icecc.

    +

    Using sjavac

    +

    To speed up Java compilation, especially incremental compilations, you can try the experimental sjavac compiler by using --enable-sjavac.

    +

    Building the Right Target

    +

    Selecting the proper target to build can have dramatic impact on build time. For normal usage, jdk or the default target is just fine. You only need to build images for shipping, or if your tests require it.

    +

    See also Using Fine-Grained Make Targets on how to build an even smaller subset of the product.

    +

    Troubleshooting

    +

    If your build fails, it can sometimes be difficult to pinpoint the problem or find a proper solution.

    +

    Locating the Source of the Error

    +

    When a build fails, it can be hard to pinpoint the actual cause of the error. In a typical build process, different parts of the product build in parallel, with the output interlaced.

    +

    Build Failure Summary

    +

    To help you, the build system will print a failure summary at the end. It looks like this:

    +
    ERROR: Build failed for target 'hotspot' in configuration 'linux-x64' (exit code 2)
    +
    +=== Output from failing command(s) repeated here ===
    +* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:
    +/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
    +   ... (rest of output omitted)
    +
    +* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs.
    +=== End of repeated output ===
    +
    +=== Make failed targets repeated here ===
    +lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
    +make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
    +=== End of repeated output ===
    +
    +Hint: Try searching the build log for the name of the first failed target.
    +Hint: If caused by a warning, try configure --disable-warnings-as-errors.
    +

    Let's break it down! First, the selected configuration, and the top-level target you entered on the command line that caused the failure is printed.

    +

    Then, between the Output from failing command(s) repeated here and End of repeated output the first lines of output (stdout and stderr) from the actual failing command is repeated. In most cases, this is the error message that caused the build to fail. If multiple commands were failing (this can happen in a parallel build), output from all failed commands will be printed here.

    +

    The path to the failure-logs directory is printed. In this file you will find a <target>.log file that contains the output from this command in its entirety, and also a <target>.cmd, which contain the complete command line used for running this command. You can re-run the failing command by executing . <path to failure-logs>/<target>.cmd in your shell.

    +

    Another way to trace the failure is to follow the chain of make targets, from top-level targets to individual file targets. Between Make failed targets repeated here and End of repeated output the output from make showing this chain is repeated. The first failed recipe will typically contain the full path to the file in question that failed to compile. Following lines will show a trace of make targets why we ended up trying to compile that file.

    +

    Finally, some hints are given on how to locate the error in the complete log. In this example, we would try searching the log file for "psMemoryPool.o". Another way to quickly locate make errors in the log is to search for "] Error" or "***".

    +

    Note that the build failure summary will only help you if the issue was a compilation failure or similar. If the problem is more esoteric, or is due to errors in the build machinery, you will likely get empty output logs, and No indication of failed target found instead of the make target chain.

    +

    Checking the Build Log File

    +

    The output (stdout and stderr) from the latest build is always stored in $BUILD/build.log. The previous build log is stored as build.log.old. This means that it is not necessary to redirect the build output yourself if you want to process it.

    +

    You can increase the verbosity of the log file, by the LOG control variable to make. If you want to see the command lines used in compilations, use LOG=cmdlines. To increase the general verbosity, use LOG=info, LOG=debug or LOG=trace. Both of these can be combined with cmdlines, e.g. LOG=info,cmdlines. The debug log level will show most shell commands executed by make, and trace will show all. Beware that both these log levels will produce a massive build log!

    +

    Fixing Unexpected Build Failures

    +

    Most of the time, the build will fail due to incorrect changes in the source code.

    +

    Sometimes the build can fail with no apparent changes that have caused the failure. If this is the first time you are building OpenJDK on this particular computer, and the build fails, the problem is likely with your build environment. But even if you have previously built OpenJDK with success, and it now fails, your build environment might have changed (perhaps due to OS upgrades or similar). But most likely, such failures are due to problems with the incremental rebuild.

    +

    Problems with the Build Environment

    +

    Make sure your configuration is correct. Re-run configure, and look for any warnings. Warnings that appear in the middle of the configure output is also repeated at the end, after the summary. The entire log is stored in $BUILD/configure.log.

    +

    Verify that the summary at the end looks correct. Are you indeed using the Boot JDK and native toolchain that you expect?

    +

    By default, OpenJDK has a strict approach where warnings from the compiler is considered errors which fail the build. For very new or very old compiler versions, this can trigger new classes of warnings, which thus fails the build. Run configure with --disable-warnings-as-errors to turn of this behavior. (The warnings will still show, but not make the build fail.)

    +

    Problems with Incremental Rebuilds

    +

    Incremental rebuilds mean that when you modify part of the product, only the affected parts get rebuilt. While this works great in most cases, and significantly speed up the development process, from time to time complex interdependencies will result in an incorrect build result. This is the most common cause for unexpected build problems, together with inconsistencies between the different Mercurial repositories in the forest.

    +

    Here are a suggested list of things to try if you are having unexpected build problems. Each step requires more time than the one before, so try them in order. Most issues will be solved at step 1 or 2.

      -
    1. $ su root
    2. -
    3. # system-config-securitylevel
    4. -
    5. In the window that appears, select the SELinux tab
    6. -
    7. Disable SELinux
    8. -
    -

    Alternatively, instead of completely disabling it you could disable just this one check.

    -
      -
    1. Select System->Administration->SELinux Management
    2. -
    3. In the SELinux Management Tool which appears, select "Boolean" from the menu on the left
    4. -
    5. Expand the "Memory Protection" group
    6. -
    7. Check the first item, labeled "Allow all unconfined executables to use libraries requiring text relocation ..."
    8. +
    9. Make sure your forest is up-to-date

      +

      Run bash get_source.sh to make sure you have the latest version of all repositories.

    10. +
    11. Clean build results

      +

      The simplest way to fix incremental rebuild issues is to run make clean. This will remove all build results, but not the configuration or any build system support artifacts. In most cases, this will solve build errors resulting from incremental build mismatches.

    12. +
    13. Completely clean the build directory.

      +

      If this does not work, the next step is to run make dist-clean, or removing the build output directory ($BUILD). This will clean all generated output, including your configuration. You will need to re-run configure after this step. A good idea is to run make print-configuration before running make dist-clean, as this will print your current configure command line. Here's a way to do this:

      +
      make print-configuration > current-configuration
      +make dist-clean
      +bash configure $(cat current-configuration)
      +make
    14. +
    15. Re-clone the Mercurial forest

      +

      Sometimes the Mercurial repositories themselves gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire forest, and re-clone it. If you have local changes, save them first to a different location using hg export.

    +

    Specific Build Issues

    +

    Clock Skew

    +

    If you get an error message like this:

    +
    File 'xxx' has modification time in the future.
    +Clock skew detected. Your build may be incomplete.
    +

    then the clock on your 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 make clean and restart the build.

    +

    Out of Memory Errors

    +

    On Solaris, you might get an error message like this:

    +
    Trouble writing out table to disk
    +

    To solve this, increase the amount of swap space on your build machine.

    +

    On Windows, you might get error messages like this:

    +
    fatal error - couldn't allocate heap
    +cannot create ... Permission denied
    +spawn failed
    +

    This can be a sign of a Cygwin problem. See the information about solving problems in the Cygwin section. Rebooting the computer might help temporarily.

    +

    Getting Help

    +

    If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to build-dev@openjdk.java.net. Please include the relevant parts of the configure and/or build log.

    +

    If you need general help or advice about developing for OpenJDK, you can also contact the Adoption Group. See the section on Contributing to OpenJDK for more information.

    +

    Hints and Suggestions for Advanced Users

    +

    Setting Up a Forest for Pushing Changes (defpath)

    +

    To help you prepare a proper push path for a Mercurial repository, there exists a useful tool known as defpath. It will help you setup a proper push path for pushing changes to OpenJDK.

    +

    Install the extension by cloning http://hg.openjdk.java.net/code-tools/defpath and updating your .hgrc file. Here's one way to do this:

    +
    cd ~
    +mkdir hg-ext
    +cd hg-ext
    +hg clone http://hg.openjdk.java.net/code-tools/defpath
    +cat << EOT >> ~/.hgrc
    +[extensions]
    +defpath=~/hg-ext/defpath/defpath.py
    +EOT
    +

    You can now setup a proper push path using:

    +
    hg defpath -d -u <your OpenJDK username>
    +

    If you also have the trees extension installed in Mercurial, you will automatically get a tdefpath command, which is even more useful. By running hg tdefpath -du <username> in the top repository of your forest, all repos will get setup automatically. This is the recommended usage.

    +

    Bash Completion

    +

    The configure and make commands tries to play nice with bash command-line completion (using <tab> or <tab><tab>). To use this functionality, make sure you enable completion in your ~/.bashrc (see instructions for bash in your operating system).

    +

    Make completion will work out of the box, and will complete valid make targets. For instance, typing make jdk-i<tab> will complete to make jdk-image.

    +

    The configure script can get completion for options, but for this to work you need to help bash on the way. The standard way of running the script, bash configure, will not be understood by bash completion. You need configure to be the command to run. One way to achieve this is to add a simple helper script to your path:

    +
    cat << EOT > /tmp/configure
    +#!/bin/bash
    +if [ \$(pwd) = \$(cd \$(dirname \$0); pwd) ] ; then
    +  echo >&2 "Abort: Trying to call configure helper recursively"
    +  exit 1
    +fi
    +
    +bash \$PWD/configure "\$@"
    +EOT
    +chmod +x /tmp/configure
    +sudo mv /tmp/configure /usr/local/bin
    +

    Now configure --en<tab>-dt<tab> will result in configure --enable-dtrace.

    +

    Using Multiple Configurations

    +

    You can have multiple configurations for a single source forest. When you create a new configuration, run configure --with-conf-name=<name> to create a configuration with the name <name>. Alternatively, you can create a directory under build and run configure from there, e.g. mkdir build/<name> && cd build/<name> && bash ../../configure.

    +

    Then you can build that configuration using make CONF_NAME=<name> or make CONF=<pattern>, where <pattern> is a substring matching one or several configurations, e.g. CONF=debug. The special empty pattern (CONF=) will match all available configuration, so make CONF= hotspot will build the hotspot target for all configurations. Alternatively, you can execute make in the configuration directory, e.g. cd build/<name> && make.

    +

    Handling Reconfigurations

    +

    If you update the forest and part of the configure script has changed, the build system will force you to re-run configure.

    +

    Most of the time, you will be fine by running configure again with the same arguments as the last time, which can easily be performed by make reconfigure. To simplify this, you can use the CONF_CHECK make control variable, either as make CONF_CHECK=auto, or by setting an environment variable. For instance, if you add export CONF_CHECK=auto to your .bashrc file, make will always run reconfigure automatically whenever the configure script has changed.

    +

    You can also use CONF_CHECK=ignore to skip the check for a needed configure update. This might speed up the build, but comes at the risk of an incorrect build result. This is only recommended if you know what you're doing.

    +

    From time to time, you will also need to modify the command line to configure due to changes. Use make print-configure to show the command line used for your current configuration.

    +

    Using Fine-Grained Make Targets

    +

    The default behavior for make is to create consistent and correct output, at the expense of build speed, if necessary.

    +

    If you are prepared to take some risk of an incorrect build, and know enough of the system to understand how things build and interact, you can speed up the build process considerably by instructing make to only build a portion of the product.

    +

    Building Individual Modules

    +

    The safe way to use fine-grained make targets is to use the module specific make targets. All source code in JDK 9 is organized so it belongs to a module, e.g. java.base or jdk.jdwp.agent. You can build only a specific module, by giving it as make target: make jdk.jdwp.agent. If the specified module depends on other modules (e.g. java.base), those modules will be built first.

    +

    You can also specify a set of modules, just as you can always specify a set of make targets: make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi jdk.crypto.ucrypto

    +

    Building Individual Module Phases

    +

    The build process for each module is divided into separate phases. Not all modules need all phases. Which are needed depends on what kind of source code and other artifact the module consists of. The phases are:

    -

    The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on BLODA (applications that interfere with CYGWIN).

    +

    You can build only a single phase for a module by using the notation $MODULE-$PHASE. For instance, to build the gensrc phase for java.base, use make java.base-gensrc.

    +

    Note that some phases may depend on others, e.g. java depends on gensrc (if present). Make will build all needed prerequisites before building the requested phase.

    +

    Skipping the Dependency Check

    +

    When using an iterative development style with frequent quick rebuilds, the dependency check made by make can take up a significant portion of the time spent on the rebuild. In such cases, it can be useful to bypass the dependency check in make.

    +
    +

    Note that if used incorrectly, this can lead to a broken build!

    +
    +

    To achieve this, append -only to the build target. For instance, make jdk.jdwp.agent-java-only will only build the java phase of the jdk.jdwp.agent module. If the required dependencies are not present, the build can fail. On the other hand, the execution time measures in milliseconds.

    +

    A useful pattern is to build the first time normally (e.g. make jdk.jdwp.agent) and then on subsequent builds, use the -only make target.

    +

    Rebuilding Part of java.base (JDK_FILTER)

    +

    If you are modifying files in java.base, which is the by far largest module in OpenJDK, then you need to rebuild all those files whenever a single file has changed. (This inefficiency will hopefully be addressed in JDK 10.)

    +

    As a hack, you can use the make control variable JDK_FILTER to specify a pattern that will be used to limit the set of files being recompiled. For instance, make java.base JDK_FILTER=javax/crypto (or, to combine methods, make java.base-java-only JDK_FILTER=javax/crypto) will limit the compilation to files in the javax.crypto package.

    +

    Learn About Mercurial

    +

    To become an efficient OpenJDK developer, it is recommended that you invest in learning Mercurial properly. Here are some links that can get you started:

    -
    -

    Appendix B: GNU make

    -

    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:

    +

    Understanding the Build System

    +

    This section will give you a more technical description on the details of the build system.

    +

    Configurations

    +

    The build system expects to find one or more configuration. These are technically defined by the spec.gmk in a subdirectory to the build subdirectory. The spec.gmk file is generated by configure, and contains in principle the configuration (directly or by files included by spec.gmk).

    +

    You can, in fact, select a configuration to build by pointing to the spec.gmk file with the SPEC make control variable, e.g. make SPEC=$BUILD/spec.gmk. While this is not the recommended way to call make as a user, it is what is used under the hood by the build system.

    +

    Build Output Structure

    +

    The build output for a configuration will end up in build/<configuration name>, which we refer to as $BUILD in this document. The $BUILD directory contains the following important directories:

    +
    buildtools/
    +configure-support/
    +hotspot/
    +images/
    +jdk/
    +make-support/
    +support/
    +test-results/
    +test-support/
    +

    This is what they are used for:

    -

    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/.

    -

    Building 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
    -
    -

    Appendix C: Build Environments

    -

    Minimum Build Environments

    -

    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 ArchitectureOSC/C++ CompilerProcessorsRAM MinimumDISK Needs
    Linux X86 (32-bit) and X64 (64-bit)Oracle Enterprise Linux 6.4gcc 4.9.22 or more1 GB6 GB
    Solaris SPARCV9 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patches4 or more4 GB8 GB
    Solaris X64 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patches4 or more4 GB8 GB
    Windows X86 (32-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional Edition2 or more2 GB6 GB
    Windows X64 (64-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional Edition2 or more2 GB6 GB
    Mac OS X X64 (64-bit)Mac OS X 10.9 "Mavericks"Xcode 6.3 or newer2 or more4 GB6 GB
    -
    -

    Specific Developer Build Environments

    -

    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.

    -

    Fedora

    -

    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}"
    -

    CentOS 5.5

    -

    After installing CentOS 5.5 you need to make sure you have the following Development bundles installed:

    +

    Fixpath

    +

    Windows path typically look like C:\User\foo, while Unix paths look like /home/foo. Tools with roots from Unix often experience issues related to this mismatch when running on Windows.

    +

    In the OpenJDK build, we always use Unix paths internally, and only just before calling a tool that does not understand Unix paths do we convert them to Windows paths.

    +

    This conversion is done by the fixpath tool, which is a small wrapper that modifies unix-style paths to Windows-style paths in command lines. Fixpath is compiled automatically by configure.

    +

    Native Debug Symbols

    +

    Native libraries and executables can have debug symbol (and other debug information) associated with them. How this works is very much platform dependent, but a common problem is that debug symbol information takes a lot of disk space, but is rarely needed by the end user.

    +

    The OpenJDK supports different methods on how to handle debug symbols. The method used is selected by --with-native-debug-symbols, and available methods are none, internal, external, zipped.

    -

    Plus the following packages:

    +

    When building for distribution, zipped is a good solution. Binaries built with internal is suitable for use by developers, since they facilitate debugging, but should be stripped before distributed to end users.

    +

    Autoconf Details

    +

    The configure script is based on the autoconf framework, but in some details deviate from a normal autoconf configure script.

    +

    The configure script in the top level directory of OpenJDK is just a thin wrapper that calls common/autoconf/configure. This in turn provides functionality that is not easily expressed in the normal Autoconf framework, and then calls into the core of the configure script, which is the common/autoconf/generated-configure.sh file.

    +

    As the name implies, this file is generated by Autoconf. It is checked in after regeneration, to alleviate the common user to have to install Autoconf.

    +

    The build system will detect if the Autoconf source files have changed, and will trigger a regeneration of common/autoconf/generated-configure.sh if needed. You can also manually request such an update by bash common/autoconf/autogen.sh.

    +

    If you make changes to the build system that requires a re-generation, note the following:

    -

    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.

    -

    Debian 5.0 (Lenny)

    -

    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}"
    -

    Ubuntu 12.04

    -

    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}"
    -

    OpenSUSE 11.1

    -

    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`
    -

    Mandriva Linux One 2009 Spring

    -

    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}"
    -

    OpenSolaris 2009.06

    -

    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!

    +

    Developing the Build System Itself

    +

    This section contains a few remarks about how to develop for the build system itself. It is not relevant if you are only making changes in the product source code.

    +

    While technically using make, the make source files of the OpenJDK does not resemble most other Makefiles. Instead of listing specific targets and actions (perhaps using patterns), the basic modus operandi is to call a high-level function (or properly, macro) from the API in make/common. For instance, to compile all classes in the jdk.internal.foo package in the jdk.foo module, a call like this would be made:

    +
    $(eval $(call SetupJavaCompilation, BUILD_FOO_CLASSES, \
    +    SETUP := GENERATE_OLDBYTECODE, \
    +    SRC := $(JDK_TOPDIR)/src/jkd.foo/share/classes, \
    +    INCLUDES := jdk/internal/foo, \
    +    BIN := $(SUPPORT_OUTPUTDIR)/foo_classes, \
    +))
    +

    By encapsulating and expressing the high-level knowledge of what should be done, rather than how it should be done (as is normal in Makefiles), we can build a much more powerful and flexible build system.

    +

    Correct dependency tracking is paramount. Sloppy dependency tracking will lead to improper parallelization, or worse, race conditions.

    +

    To test for/debug race conditions, try running make JOBS=1 and make JOBS=100 and see if it makes any difference. (It shouldn't).

    +

    To compare the output of two different builds and see if, and how, they differ, run $BUILD1/compare.sh -o $BUILD2, where $BUILD1 and $BUILD2 are the two builds you want to compare.

    +

    To automatically build two consecutive versions and compare them, use COMPARE_BUILD. The value of COMPARE_BUILD is a set of variable=value assignments, like this:

    +
    make COMPARE_BUILD=CONF=--enable-new-hotspot-feature:MAKE=hotspot
    +

    See make/InitSupport.gmk for details on how to use COMPARE_BUILD.

    +

    To analyze build performance, run with LOG=trace and check $BUILD/build-trace-time.log. Use JOBS=1 to avoid parallelism.

    +

    Please check that you adhere to the Code Conventions for the Build System before submitting patches. Also see the section in Autoconf Details about the generated configure script.

    +

    Contributing to OpenJDK

    +

    So, now you've build your OpenJDK, and made your first patch, and want to contribute it back to the OpenJDK community.

    +

    First of all: Thank you! We gladly welcome your contribution to the OpenJDK. However, please bear in mind that OpenJDK is a massive project, and we must ask you to follow our rules and guidelines to be able to accept your contribution.

    +

    The official place to start is the 'How to contribute' page. There is also an official (but somewhat outdated and skimpy on details) Developer's Guide.

    +

    If this seems overwhelming to you, the Adoption Group is there to help you! A good place to start is their 'New Contributor' page, or start reading the comprehensive Getting Started Kit. The Adoption Group will also happily answer any questions you have about contributing. Contact them by mail or IRC.

    diff --git a/common/doc/building.md b/common/doc/building.md index 3eb96dfd6e1..a6dd2a6c96c 100644 --- a/common/doc/building.md +++ b/common/doc/building.md @@ -1,715 +1,1185 @@ -% OpenJDK Build README +% Building OpenJDK -![OpenJDK](http://openjdk.java.net/images/openjdk.png) +## TL;DR (Instructions for the Impatient) --------------------------------------------------------------------------------- +If you are eager to try out building OpenJDK, these simple steps works most of +the time. They assume that you have installed Mercurial (and Cygwin if running +on Windows) and cloned the top-level OpenJDK repository that you want to build. + + 1. [Get the complete source code](#getting-the-source-code): \ + `bash get_source.sh` + + 2. [Run configure](#running-configure): \ + `bash configure` + + If `configure` fails due to missing dependencies (to either the + [toolchain](#native-compiler-toolchain-requirements), [external libraries]( + #external-library-requirements) or the [boot JDK](#boot-jdk-requirements)), + most of the time it prints a suggestion on how to resolve the situation on + your platform. Follow the instructions, and try running `bash configure` + again. + + 3. [Run make](#running-make): \ + `make images` + + 4. Verify your newly built JDK: \ + `./build/*/images/jdk/bin/java -version` + + 5. [Run basic tests](##running-tests): \ + `make run-test-tier1` + +If any of these steps failed, or if you want to know more about build +requirements or build functionality, please continue reading this document. ## Introduction -This README file contains build instructions for the -[OpenJDK](http://openjdk.java.net). Building the source code for the OpenJDK -requires a certain degree of technical expertise. +OpenJDK is a complex software project. Building it requires a certain amount of +technical expertise, a fair number of dependencies on external software, and +reasonably powerful hardware. -### !!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!! - -Some Headlines: - - * The build is now a "`configure && make`" style build - * Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer - 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 - * 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 - supported - -------------------------------------------------------------------------------- - -## Contents - - * [Introduction](#introduction) - * [Use of Mercurial](#hg) - * [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) - * [Testing](#testing) - -------------------------------------------------------------------------------- - - * [Appendix A: Hints and Tips](#hints) - * [FAQ](#faq) - * [Build Performance Tips](#performance) - * [Troubleshooting](#troubleshooting) - * [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. - -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. - -### Getting the Source - -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 - -### Repositories - -The set of repositories and what they contain: - - * **. (root)** contains common configure and makefile logic - * **hotspot** contains source code and make files for building the OpenJDK - Hotspot Virtual Machine - * **langtools** contains source code for the OpenJDK javac and language tools - * **jdk** contains source code and make files for building the OpenJDK runtime - libraries and misc files - * **jaxp** contains source code for the OpenJDK JAXP functionality - * **jaxws** contains source code for the OpenJDK JAX-WS functionality - * **corba** contains source code for the OpenJDK Corba functionality - * **nashorn** contains source code for the OpenJDK JavaScript implementation - -### Repository Source Guidelines - -There are some very basic guidelines: - - * Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is - restricted. No TABs, no trailing whitespace on lines, and files should not - terminate in more than one blank line. - * Files with execute permissions should not be added to the source - repositories. - * All generated files need to be kept isolated from the files maintained or - managed by the source control system. The standard area for generated files - is the top level `build/` directory. - * The default build process should be to build the product and nothing else, - in one form, e.g. a product (optimized), debug (non-optimized, -g plus - assert logic), or fastdebug (optimized, -g plus assert logic). - * The `.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. - * Directory names and file names should never contain blanks or non-printing - characters. - * Generated source or binary files should NEVER be added to the repository - (that includes `javah` output). There are some exceptions to this rule, in - particular with some of the generated configure scripts. - * 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 -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. - -------------------------------------------------------------------------------- - -### System Setup - -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](http://www.oracle.com/technetwork/java/javase/downloads/index.html). - 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](#alsa), [freetype](#freetype), [cups](#cups), and - [xrender](#xrender). See [specific system packages](#SDBE). - - * **Solaris** - - Install all the software development packages needed including [Studio - Compilers](#studio), [freetype](#freetype), [cups](#cups), and - [xrender](#xrender). See [specific system packages](#SDBE). - - * **Windows** - - * Install one of [CYGWIN](#cygwin) or [MinGW/MSYS](#msys) - * Install [Visual Studio 2013](#vs2013) - - * **Mac OS X** - - Install [XCode 6.3](https://developer.apple.com/xcode/) - -#### Linux - -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 +If you just want to use OpenJDK and not build it yourself, this document is not +for you. See for instance [OpenJDK installation]( +http://openjdk.java.net/install) for some methods of installing a prebuilt OpenJDK. -#### Solaris +## Getting the Source Code -##### Studio Compilers +OpenJDK uses [Mercurial](http://www.mercurial-scm.org) for source control. The +source code is contained not in a single Mercurial repository, but in a tree +("forest") of interrelated repositories. You will need to check out all of the +repositories to be able to build OpenJDK. To assist you in dealing with this +somewhat unusual arrangement, there are multiple tools available, which are +explained below. -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. +In any case, make sure you are getting the correct version. At the [OpenJDK +Mercurial server](http://hg.openjdk.java.net/) you can see a list of all +available forests. If you want to build an older version, e.g. JDK 8, it is +recommended that you get the `jdk8u` forest, which contains incremental +updates, instead of the `jdk8` forest, which was frozen at JDK 8 GA. + +If you are new to Mercurial, a good place to start is the [Mercurial Beginner's +Guide](http://www.mercurial-scm.org/guide). The rest of this document assumes a +working knowledge of Mercurial. + +### Special Considerations + +For a smooth building experience, it is recommended that you follow these rules +on where and how to check out the source code. + + * Do not check out the source code in a path which contains spaces. Chances + are the build will not work. This is most likely to be an issue on Windows + systems. + + * Do not check out the source code in a path which has a very long name or is + nested many levels deep. Chances are you will hit an OS limitation during + the build. + + * Put the source code on a local disk, not a network share. If possible, use + an SSD. The build process is very disk intensive, and having slow disk + access will significantly increase build times. If you need to use a + network share for the source code, see below for suggestions on how to keep + the build artifacts on a local disk. + + * On Windows, extra care must be taken to make sure the [Cygwin](#cygwin) + environment is consistent. It is recommended that you follow this + procedure: + + * Create the directory that is going to contain the top directory of the + OpenJDK clone by using the `mkdir` command in the Cygwin bash shell. + That is, do *not* create it using Windows Explorer. This will ensure + that it will have proper Cygwin attributes, and that it's children will + inherit those attributes. + + * Do not put the OpenJDK clone in a path under your Cygwin home + directory. This is especially important if your user name contains + spaces and/or mixed upper and lower case letters. + + * Clone the OpenJDK repository using the Cygwin command line `hg` client + as instructed in this document. That is, do *not* use another Mercurial + client such as TortoiseHg. + + Failure to follow this procedure might result in hard-to-debug build + problems. + +### Using get\_source.sh + +The simplest way to get the entire forest is probably to clone the top-level +repository and then run the `get_source.sh` script, like this: + +``` +hg clone http://hg.openjdk.java.net/jdk9/jdk9 +cd jdk9 +bash get_source.sh +``` + +The first time this is run, it will clone all the sub-repositories. Any +subsequent execution of the script will update all sub-repositories to the +latest revision. + +### Using hgforest.sh + +The `hgforest.sh` script is more expressive than `get_source.sh`. It takes any +number of arguments, and runs `hg` with those arguments on each sub-repository +in the forest. The `get_source.sh` script is basically a simple wrapper that +runs either `hgforest.sh clone` or `hgforest.sh pull -u`. + + * Cloning the forest: + ``` + hg clone http://hg.openjdk.java.net/jdk9/jdk9 + cd jdk9 + bash common/bin/hgforest.sh clone + ``` + + * Pulling and updating the forest: + ``` + bash common/bin/hgforest.sh pull -u + ``` + + * Merging over the entire forest: + ``` + bash common/bin/hgforest.sh merge + ``` + +### Using the Trees Extension + +The trees extension is a Mercurial add-on that helps you deal with the forest. +More information is available on the [Code Tools trees page]( +http://openjdk.java.net/projects/code-tools/trees). + +#### Installing the Extension + +Install the extension by cloning `http://hg.openjdk.java.net/code-tools/trees` +and updating your `.hgrc` file. Here's one way to do this: + +``` +cd ~ +mkdir hg-ext +cd hg-ext +hg clone http://hg.openjdk.java.net/code-tools/trees +cat << EOT >> ~/.hgrc +[extensions] +trees=~/hg-ext/trees/trees.py +EOT +``` + +#### Initializing the Tree + +The trees extension needs to know the structure of the forest. If you have +already cloned the entire forest using another method, you can initialize the +forest like this: + +``` +hg tconf --set --walk --depth +``` + +Or you can clone the entire forest at once, if you substitute `clone` with +`tclone` when cloning the top-level repository, e.g. like this: + +``` +hg tclone http://hg.openjdk.java.net/jdk9/jdk9 +``` + +In this case, the forest will be properly initialized from the start. + +#### Other Operations + +The trees extensions supplement many common operations with a trees version by +prefixing a `t` to the normal Mercurial command, e.g. `tcommit`, `tstatus` or +`tmerge`. For instance, to update the entire forest: + +``` +hg tpull -u +``` + +## Build Hardware Requirements + +OpenJDK is a massive project, and require machines ranging from decent to +powerful to be able to build in a reasonable amount of time, or to be able to +complete a build at all. + +We *strongly* recommend usage of an SSD disk for the build, since disk speed is +one of the limiting factors for build performance. + +### Building on x86 + +At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM. +(The more cores to use, the more memory you need.) At least 6 GB of free disk +space is required (8 GB minimum for building on Solaris). + +Even for 32-bit builds, it is recommended to use a 64-bit build machine, and +instead create a 32-bit target using `--with-target-bits=32`. + +### Building on sparc + +At a minimum, a machine with 4 cores is advisable, as well as 4 GB of RAM. (The +more cores to use, the more memory you need.) At least 8 GB of free disk space +is required. + +### Building on arm/aarch64 + +This is not recommended. Instead, see the section on [Cross-compiling]( +#cross-compiling). + +## Operating System Requirements + +The mainline OpenJDK project supports Linux, Solaris, macOS, AIX and Windows. +Support for other operating system, e.g. BSD, exists in separate "port" +projects. + +In general, OpenJDK can be built on a wide range of versions of these operating +systems, but the further you deviate from what is tested on a daily basis, the +more likely you are to run into problems. + +This table lists the OS versions used by Oracle when building JDK 9. Such +information is always subject to change, but this table is up to date at the +time of writing. + + Operating system Vendor/version used + ----------------- ------------------------------------------------------- + Linux Oracle Enterprise Linux 6.4 / 7.1 (using kernel 3.8.13) + Solaris Solaris 11.1 SRU 21.4.1 / 11.2 SRU 5.5 + macOS Mac OS X 10.9 (Mavericks) / 10.10 (Yosemite) + Windows Windows Server 2012 R2 + +The double version numbers for Linux, Solaris and macOS is due to the hybrid +model used at Oracle, where header files and external libraries from an older +version is used when building on a more modern version of the OS. + +The Build Group has a wiki page with [Supported Build Platforms]( +https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms). From +time to time, this is updated by the community to list successes or failures of +building on different platforms. + +### Windows + +Windows XP is not a supported platform, but all newer Windows should be able to +build OpenJDK. + +On Windows, it is important that you pay attention to the instructions in the +[Special Considerations](#special-considerations). + +Windows is the only non-POSIX OS supported by OpenJDK, and as such, requires +some extra care. A POSIX support layer is required to build on Windows. For +OpenJDK 9, the only supported such layer is Cygwin. (Msys is no longer +supported due to a too old bash; msys2 and the new Windows Subsystem for Linux +(WSL) would likely be possible to support in a future version but that would +require a community effort to implement.) + +Internally in the build system, all paths are represented as Unix-style paths, +e.g. `/cygdrive/c/hg/jdk9/Makefile` rather than `C:\hg\jdk9\Makefile`. This +rule also applies to input to the build system, e.g. in arguments to +`configure`. So, use `--with-freetype=/cygdrive/c/freetype` rather than +`--with-freetype=c:\freetype`. For details on this conversion, see the section +on [Fixpath](#fixpath). + +#### Cygwin + +A functioning [Cygwin](http://www.cygwin.com/) environment is thus required for +building OpenJDK on Windows. If you have a 64-bit OS, we strongly recommend +using the 64-bit version of Cygwin. + +**Note:** Cygwin has a model of continuously updating all packages without any +easy way to install or revert to a specific version of a package. This means +that whenever you add or update a package in Cygwin, you might (inadvertently) +update tools that are used by the OpenJDK build process, and that can cause +unexpected build problems. + +OpenJDK requires GNU Make 4.0 or greater on Windows. This is usually not a +problem, since Cygwin currently only distributes GNU Make at a version above +4.0. + +Apart from the basic Cygwin installation, the following packages must also be +installed: + + * `make` + * `zip` + * `unzip` + +Often, you can install these packages using the following command line: +``` +/setup-x86_64 -q -P make -P unzip -P zip +``` + +Unfortunately, Cygwin can be unreliable in certain circumstances. If you +experience build tool crashes or strange issues when building on Windows, +please check the Cygwin FAQ on the ["BLODA" list]( +https://cygwin.com/faq/faq.html#faq.using.bloda) and the section on [fork() +failures](https://cygwin.com/faq/faq.html#faq.using.fixing-fork-failures). + +### Solaris + +See `make/devkit/solaris11.1-package-list.txt` for a list of recommended +packages to install when building on Solaris. The versions specified in this +list is the versions used by the daily builds at Oracle, and is likely to work +properly. + +Older versions of Solaris shipped a broken version of `objcopy`. At least +version 2.21.1 is needed, which is provided by Solaris 11 Update 1. Objcopy is +needed if you want to have external debug symbols. Please make sure you are +using at least version 2.21.1 of objcopy, or that you disable external debug +symbols. + +### macOS + +Apple is using a quite aggressive scheme of pushing OS updates, and coupling +these updates with required updates of Xcode. Unfortunately, this makes it +difficult for a project like OpenJDK to keep pace with a continuously updated +machine running macOS. See the section on [Apple Xcode](#apple-xcode) on some +strategies to deal with this. + +It is recommended that you use at least Mac OS X 10.9 (Mavericks). At the time +of writing, OpenJDK has been successfully compiled on macOS versions up to +10.12.5 (Sierra), using XCode 8.3.2 and `--disable-warnings-as-errors`. + +The standard macOS environment contains the basic tooling needed to build, but +for external libraries a package manager is recommended. OpenJDK uses +[homebrew](https://brew.sh/) in the examples, but feel free to use whatever +manager you want (or none). + +### Linux + +It is often not much problem to build OpenJDK on Linux. The only general advice +is to try to use the compilers, external libraries and header files as provided +by your distribution. + +The basic tooling is provided as part of the core operating system, but you +will most likely need to install developer packages. + +For apt-based distributions (Debian, Ubuntu, etc), try this: +``` +sudo apt-get install build-essential +``` + +For rpm-based distributions (Fedora, Red Hat, etc), try this: +``` +sudo yum groupinstall "Development Tools" +``` + +### AIX + +The regular builds by SAP is using AIX version 7.1, but AIX 5.3 is also +supported. See the [OpenJDK PowerPC Port Status Page]( +http://cr.openjdk.java.net/~simonis/ppc-aix-port) for details. + +## Native Compiler (Toolchain) Requirements + +Large portions of OpenJDK consists of native code, that needs to be compiled to +be able to run on the target platform. In theory, toolchain and operating +system should be independent factors, but in practice there's more or less a +one-to-one correlation between target operating system and toolchain. + + Operating system Supported toolchain + ------------------ ------------------------- + Linux gcc, clang + macOS Apple Xcode (using clang) + Solaris Oracle Solaris Studio + AIX IBM XL C/C++ + Windows Microsoft Visual Studio + +Please see the individual sections on the toolchains for version +recommendations. As a reference, these versions of the toolchains are used, at +the time of writing, by Oracle for the daily builds of OpenJDK. It should be +possible to compile OpenJDK with both older and newer versions, but the closer +you stay to this list, the more likely you are to compile successfully without +issues. + + Operating system Toolchain version + ------------------ ------------------------------------------------------- + Linux gcc 4.9.2 + macOS Apple Xcode 6.3 (using clang 6.1.0) + Solaris Oracle Solaris Studio 12.4 (with compiler version 5.13) + Windows Microsoft Visual Studio 2013 update 4 + +### gcc + +The minimum accepted version of gcc is 4.3. Older versions will not be accepted +by `configure`. + +However, gcc 4.3 is quite old and OpenJDK is not regularly tested on this +version, so it is recommended to use a more modern gcc. + +OpenJDK 9 includes patches that should allow gcc 6 to compile, but this should +be considered experimental. + +In general, any version between these two should be usable. + +### clang + +The minimum accepted version of clang is 3.2. Older versions will not be +accepted by `configure`. + +To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`. + +### Apple Xcode + +The oldest supported version of Xcode is 5. + +You will need the Xcode command lines developers tools to be able to build +OpenJDK. (Actually, *only* the command lines tools are needed, not the IDE.) +The simplest way to install these is to run: +``` +xcode-select --install +``` + +It is advisable to keep an older version of Xcode for building OpenJDK when +updating Xcode. This [blog page]( +http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html) has +good suggestions on managing multiple Xcode versions. To use a specific version +of Xcode, use `xcode-select -s` before running `configure`, or use +`--with-toolchain-path` to point to the version of Xcode to use, e.g. +`configure --with-toolchain-path=/Applications/Xcode5.app/Contents/Developer/usr/bin` + +If you have recently (inadvertently) updated your OS and/or Xcode version, and +OpenJDK can no longer be built, please see the section on [Problems with the +Build Environment](#problems-with-the-build-environment), and [Getting +Help](#getting-help) to find out if there are any recent, non-merged patches +available for this update. + +### Oracle Solaris Studio + +The minimum accepted version of the Solaris Studio compilers is 5.13 +(corresponding to Solaris Studio 12.4). Older versions will not be accepted by +configure. 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 + 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. +Compiling with Solaris Studio can sometimes be finicky. This is the exact +version used by Oracle, which worked correctly at the time of writing: +``` +$ cc -V +cc: Sun C 5.13 SunOS_i386 2014/10/20 +$ CC -V +CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30 +``` -Place the `bin` directory in `PATH`. +### Microsoft Visual Studio -The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express -Download -site](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-142582.html) -are also an option, although these compilers have not been extensively used -yet. +The minimum accepted version of Visual Studio is 2010. Older versions will not +be accepted by `configure`. The maximum accepted version of Visual Studio is +2013. -#### Windows +If you have multiple versions of Visual Studio installed, `configure` will by +default pick the latest. You can request a specific version to be used by +setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2010`. -##### Windows Unix Toolkit +If you get `LINK: fatal error LNK1123: failure during conversion to COFF: file +invalid` when building using Visual Studio 2010, you have encountered +[KB2757355](http://support.microsoft.com/kb/2757355), a bug triggered by a +specific installation order. However, the solution suggested by the KB article +does not always resolve the problem. See [this stackoverflow discussion]( +https://stackoverflow.com/questions/10888391) for other suggestions. -Building on Windows requires a Unix-like environment, notably a Unix-like -shell. There are several such environments available of which -[Cygwin](http://www.cygwin.com/) and -[MinGW/MSYS](http://www.mingw.org/wiki/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](http://en.wikipedia.org/wiki/8.3_filename). +### IBM XL C/C++ -###### CYGWIN +The regular builds by SAP is using version 12.1, described as `IBM XL C/C++ for +AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0017`. -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 `:` to a virtual directory -`/cygdrive/`. +See the [OpenJDK PowerPC Port Status Page]( +http://cr.openjdk.java.net/~simonis/ppc-aix-port) for details. -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 ""`. +## Boot JDK Requirements -Note that the use of CYGWIN creates a unique problem with regards to setting -[`PATH`](#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. +Paradoxically, building OpenJDK requires a pre-existing JDK. This is called the +"boot JDK". The boot JDK does not have to be OpenJDK, though. If you are +porting OpenJDK to a new platform, chances are that there already exists +another JDK for that platform that is usable as boot JDK. -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](http://www.cygwin.com). +The rule of thumb is that the boot JDK for building JDK major version *N* +should be an JDK of major version *N-1*, so for building JDK 9 a JDK 8 would be +suitable as boot JDK. However, OpenJDK should be able to "build itself", so an +up-to-date build of the current OpenJDK source is an acceptable alternative. If +you are following the *N-1* rule, make sure you got the latest update version, +since JDK 8 GA might not be able to build JDK 9 on all platforms. -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. +If the Boot JDK is not automatically detected, or the wrong JDK is picked, use +`--with-boot-jdk` to point to the JDK to use. - 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 +### JDK 8 on Linux -Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a -[FAQ](http://cygwin.com/faq/faq.using.html) for known issues and problems, -of particular interest is the section on [BLODA (applications that interfere -with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). +On apt-based distros (like Debian and Ubuntu), `sudo apt-get install +openjdk-8-jdk` is typically enough to install OpenJDK 8. On rpm-based distros +(like Fedora and Red Hat), try `sudo yum install java-1.8.0-openjdk-devel`. -###### MinGW/MSYS +### JDK 8 on Windows -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](http://www.mingw.org/wiki/MSYS) for more information. +No pre-compiled binaries of OpenJDK 8 are readily available for Windows at the +time of writing. An alternative is to download the [Oracle JDK]( +http://www.oracle.com/technetwork/java/javase/downloads). Another is the [Adopt +OpenJDK Project](https://adoptopenjdk.net/), which publishes experimental +prebuilt binaries for Windows. -Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters `:` -replaced by a virtual directory `/`. 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](http://mingw.org/wiki/Posix_path_conversion). +### JDK 8 on macOS -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: +No pre-compiled binaries of OpenJDK 8 are readily available for macOS at the +time of writing. An alternative is to download the [Oracle JDK]( +http://www.oracle.com/technetwork/java/javase/downloads), or to install it +using `brew cask install java`. Another option is the [Adopt OpenJDK Project]( +https://adoptopenjdk.net/), which publishes experimental prebuilt binaries for +macOS. - mingw-get.exe install msys-zip - mingw-get.exe install msys-unzip +### JDK 8 on AIX -##### Visual Studio 2013 Compilers +No pre-compiled binaries of OpenJDK 8 are readily available for AIX at the +time of writing. A starting point for working with OpenJDK on AIX is +the [PowerPC/AIX Port Project](http://openjdk.java.net/projects/ppc-aix-port/). -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. +## External Library Requirements -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. +Different platforms require different external libraries. In general, libraries +are not optional - that is, they are either required or not used. -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. +If a required library is not detected by `configure`, you need to provide the +path to it. There are two forms of the `configure` arguments to point to an +external library: `--with-=` or `--with--include= --with--lib=`. The first variant is more concise, +but require the include files an library files to reside in a default hierarchy +under this directory. In most cases, it works fine. -#### Mac OS X +As a fallback, the second version allows you to point to the include directory +and the lib directory separately. -Make sure you get the right XCode version. +### FreeType -------------------------------------------------------------------------------- +FreeType2 from [The FreeType Project](http://www.freetype.org/) is required on +all platforms. At least version 2.3 is required. -### Configure + * To install on an apt-based Linux, try running `sudo apt-get install + libcups2-dev`. + * To install on an rpm-based Linux, try running `sudo yum install + cups-devel`. + * To install on Solaris, try running `pkg install system/library/freetype-2`. + * To install on macOS, try running `brew install freetype`. + * To install on Windows, see [below](#building-freetype-on-windows). -The basic invocation of the `configure` script looks like: +Use `--with-freetype=` if `configure` does not properly locate your +FreeType files. -> **`bash ./configure [options]`** +#### Building FreeType on Windows -This will create an output directory containing the "configuration" and setup -an area for the build result. This directory typically looks like: +On Windows, there is no readily available compiled version of FreeType. OpenJDK +can help you compile FreeType from source. Download the FreeType sources and +unpack them into an arbitrary directory: -> **`build/linux-x64-normal-server-release`** +``` +wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz +tar -xzf freetype-2.5.3.tar.gz +``` + +Then run `configure` with `--with-freetype-src=`. This will +automatically build the freetype library into `/lib64` for 64-bit +builds or into `/lib32` for 32-bit builds. Afterwards you can +always use `--with-freetype-include=/include` and +`--with-freetype-lib=/lib[32|64]` for other builds. + +Alternatively you can unpack the sources like this to use the default +directory: + +``` +tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz +``` + +### CUPS + +CUPS, [Common UNIX Printing System](http://www.cups.org) header files are +required on all platforms, except Windows. Often these files are provided by +your operating system. + + * To install on an apt-based Linux, try running `sudo apt-get install + libcups2-dev`. + * To install on an rpm-based Linux, try running `sudo yum install + cups-devel`. + * To install on Solaris, try running `pkg install print/cups`. + +Use `--with-cups=` if `configure` does not properly locate your CUPS +files. + +### X11 + +Certain [X11](http://www.x.org/) libraries and include files are required on +Linux and Solaris. + + * To install on an apt-based Linux, try running `sudo apt-get install + libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev`. + * To install on an rpm-based Linux, try running `sudo yum install + libXtst-devel libXt-devel libXrender-devel libXi-devel`. + * To install on Solaris, try running `pkg install x11/header/x11-protocols + x11/library/libice x11/library/libpthread-stubs x11/library/libsm + x11/library/libx11 x11/library/libxau x11/library/libxcb + x11/library/libxdmcp x11/library/libxevie x11/library/libxext + x11/library/libxrender x11/library/libxscrnsaver x11/library/libxtst + x11/library/toolkit/libxt`. + +Use `--with-x=` if `configure` does not properly locate your X11 files. + +### ALSA + +ALSA, [Advanced Linux Sound Architecture](https://www.alsa-project.org/) is +required on Linux. At least version 0.9.1 of ALSA is required. + + * To install on an apt-based Linux, try running `sudo apt-get install + libasound2-dev`. + * To install on an rpm-based Linux, try running `sudo yum install + alsa-lib-devel`. + +Use `--with-alsa=` if `configure` does not properly locate your ALSA +files. + +### libffi + +libffi, the [Portable Foreign Function Interface Library]( +http://sourceware.org/libffi) is required when building the Zero version of +Hotspot. + + * To install on an apt-based Linux, try running `sudo apt-get install + libffi-dev`. + * To install on an rpm-based Linux, try running `sudo yum install + libffi-devel`. + +Use `--with-libffi=` if `configure` does not properly locate your libffi +files. + +### libelf + +libelf from the [elfutils project](http://sourceware.org/elfutils) is required +when building the AOT feature of Hotspot. + + * To install on an apt-based Linux, try running `sudo apt-get install + libelf-dev`. + * To install on an rpm-based Linux, try running `sudo yum install + elfutils-libelf-devel`. + +Use `--with-libelf=` if `configure` does not properly locate your libelf +files. + +## Other Tooling Requirements + +### GNU Make + +OpenJDK requires [GNU Make](http://www.gnu.org/software/make). No other flavors +of make are supported. + +At least version 3.81 of GNU Make must be used. For distributions supporting +GNU Make 4.0 or above, we strongly recommend it. GNU Make 4.0 contains useful +functionality to handle parallel building (supported by `--with-output-sync`) +and speed and stability improvements. + +Note that `configure` locates and verifies a properly functioning version of +`make` and stores the path to this `make` binary in the configuration. If you +start a build using `make` on the command line, you will be using the version +of make found first in your `PATH`, and not necessarily the one stored in the +configuration. This initial make will be used as "bootstrap make", and in a +second stage, the make located by `configure` will be called. Normally, this +will present no issues, but if you have a very old `make`, or a non-GNU Make +`make` in your path, this might cause issues. + +If you want to override the default make found by `configure`, use the `MAKE` +configure variable, e.g. `configure MAKE=/opt/gnu/make`. + +On Solaris, it is common to call the GNU version of make by using `gmake`. + +### GNU Bash + +OpenJDK requires [GNU Bash](http://www.gnu.org/software/bash). No other shells +are supported. + +At least version 3.2 of GNU Bash must be used. + +### Autoconf + +If you want to modify the build system itself, you need to install [Autoconf]( +http://www.gnu.org/software/autoconf). + +However, if you only need to build OpenJDK or if you only edit the actual +OpenJDK source files, there is no dependency on autoconf, since the source +distribution includes a pre-generated `configure` shell script. + +See the section on [Autoconf Details](#autoconf-details) for details on how +OpenJDK uses autoconf. This is especially important if you plan to contribute +changes to OpenJDK that modifies the build system. + +## Running Configure + +To build OpenJDK, you need a "configuration", which consists of a directory +where to store the build output, coupled with information about the platform, +the specific build machine, and choices that affect how OpenJDK is built. + +The configuration is created by the `configure` script. The basic invocation of +the `configure` script looks like this: + +``` +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`, but the actual name depends on your +specific configuration. (It can also be set directly, see [Using Multiple +Configurations](#using-multiple-configurations)). This directory is referred to +as `$BUILD` in this documentation. `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](#configureoptions). +automatically, it will exit and inform you about the problem. + +Some command line examples: + + * Create a 32-bit build for Windows with FreeType2 in `C:\freetype-i586`: + ``` + bash configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32 + ``` + + * Create a debug build with the `server` JVM and DTrace enabled: + ``` + bash configure --enable-debug --with-jvm-variants=server --enable-dtrace + ``` + +### Common Configure Arguments + +Here follows some of the most common and important `configure` argument. + +To get up-to-date information on *all* available `configure` argument, please +run: +``` +bash configure --help +``` + +(Note that this help text also include general autoconf options, like +`--dvidir`, that is not relevant to OpenJDK. To list only OpenJDK specific +features, use `bash configure --help=short` instead.) + +#### Configure Arguments for Tailoring the Build + + * `--enable-debug` - Set the debug level to `fastdebug` (this is a shorthand + for `--with-debug-level=fastdebug`) + * `--with-debug-level=` - Set the debug level, which can be `release`, + `fastdebug`, `slowdebug` or `optimized`. Default is `release`. `optimized` + is variant of `release` with additional Hotspot debug code. + * `--with-native-debug-symbols=` - Specify if and how native debug + symbols should be built. Available methods are `none`, `internal`, + `external`, `zipped`. Default behavior depends on platform. See [Native + Debug Symbols](#native-debug-symbols) for more details. + * `--with-version-string=` - Specify the version string this build + will be identified with. + * `--with-version-=` - A group of options, where `` can be + any of `pre`, `opt`, `build`, `major`, `minor`, `security` or `patch`. Use + these options to modify just the corresponding part of the version string + from the default, or the value provided by `--with-version-string`. + * `--with-jvm-variants=[,...]` - Build the specified variant + (or variants) of Hotspot. Valid variants are: `server`, `client`, + `minimal`, `core`, `zero`, `zeroshark`, `custom`. Note that not all + variants are possible to combine in a single build. + * `--with-jvm-features=[,...]` - Use the specified JVM + features when building Hotspot. The list of features will be enabled on top + of the default list. For the `custom` JVM variant, this default list is + empty. A complete list of available JVM features can be found using `bash + configure --help`. + * `--with-target-bits=` - Create a target binary suitable for running + on a `` platform. Use this to create 32-bit output on a 64-bit build + platform, instead of doing a full cross-compile. (This is known as a + *reduced* build.) + +#### Configure Arguments for Native Compilation + + * `--with-devkit=` - Use this devkit for compilers, tools and resources + * `--with-sysroot=` - Use this directory as sysroot + * `--with-extra-path=[;]` - Prepend these directories to the + default path when searching for all kinds of binaries + * `--with-toolchain-path=[;]` - Prepend these directories when + searching for toolchain binaries (compilers etc) + * `--with-extra-cflags=` - Append these flags when compiling JDK C + files + * `--with-extra-cxxflags=` - Append these flags when compiling JDK C++ + files + * `--with-extra-ldflags=` - Append these flags when linking JDK + libraries + +#### Configure Arguments for External Dependencies + + * `--with-boot-jdk=` - Set the path to the [Boot JDK]( + #boot-jdk-requirements) + * `--with-freetype=` - Set the path to [FreeType](#freetype) + * `--with-cups=` - Set the path to [CUPS](#cups) + * `--with-x=` - Set the path to [X11](#x11) + * `--with-alsa=` - Set the path to [ALSA](#alsa) + * `--with-libffi=` - Set the path to [libffi](#libffi) + * `--with-libelf=` - Set the path to [libelf](#libelf) + * `--with-jtreg=` - Set the path to JTReg. See [Running Tests]( + #running-tests) + +Certain third-party libraries used by OpenJDK (libjpeg, giflib, libpng, lcms +and zlib) are included in the OpenJDK repository. The default behavior of the +OpenJDK build is to use this version of these libraries, but they might be +replaced by an external version. To do so, specify `system` as the `` +option in these arguments. (The default is `bundled`). + + * `--with-libjpeg=` - Use the specified source for libjpeg + * `--with-giflib=` - Use the specified source for giflib + * `--with-libpng=` - Use the specified source for libpng + * `--with-lcms=` - Use the specified source for lcms + * `--with-zlib=` - Use the specified source for zlib + +On Linux, it is possible to select either static or dynamic linking of the C++ +runtime. The default is static linking, with dynamic linking as fallback if the +static library is not found. + + * `--with-stdc++lib=` - Use the specified method (`static`, `dynamic` + or `default`) for linking the C++ runtime. + +### Configure Control Variables + +It is possible to control certain aspects of `configure` by overriding the +value of `configure` variables, either on the command line or in the +environment. + +Normally, this is **not recommended**. If used improperly, it can lead to a +broken configuration. Unless you're well versed in the build system, this is +hard to use properly. Therefore, `configure` will print a warning if this is +detected. + +However, there are a few `configure` variables, known as *control variables* +that are supposed to be overriden on the command line. These are variables that +describe the location of tools needed by the build, like `MAKE` or `GREP`. If +any such variable is specified, `configure` will use that value instead of +trying to autodetect the tool. For instance, `bash configure +MAKE=/opt/gnumake4.0/bin/make`. + +If a configure argument exists, use that instead, e.g. use `--with-jtreg` +instead of setting `JTREGEXE`. + +Also note that, despite what autoconf claims, setting `CFLAGS` will not +accomplish anything. Instead use `--with-extra-cflags` (and similar for +`cxxflags` and `ldflags`). + +## Running Make + +When you have a proper configuration, all you need to do to build OpenJDK is to +run `make`. (But see the warning at [GNU Make](#gnu-make) about running the +correct version of make.) + +When running `make` without any arguments, the default target is used, which is +the same as running `make default` or `make jdk`. This will build a minimal (or +roughly minimal) set of compiled output (known as an "exploded image") 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 output of the exploded image resides in `$BUILD/jdk`. You can test the +newly built JDK like this: `$BUILD/jdk/bin/java -version`. + +### Common Make Targets + +Apart from the default target, here are some common make targets: + + * `hotspot` - Build all of hotspot (but only hotspot) + * `hotspot-` - Build just the specified jvm variant + * `images` or `product-images` - Build the JRE and JDK images + * `docs` or `docs-image` - Build the documentation image + * `test-image` - Build the test image + * `all` or `all-images` - Build all images (product, docs and test) + * `bootcycle-images` - Build images twice, second time with newly built JDK + (good for testing) + * `clean` - Remove all files generated by make, but not those generated by + configure + * `dist-clean` - Remove all files, including configuration + +Run `make help` to get an up-to-date list of important make targets and make +control variables. + +It is possible to build just a single module, a single phase, or a single phase +of a single module, by creating make targets according to these followin +patterns. A phase can be either of `gensrc`, `gendata`, `copy`, `java`, +`launchers`, `libs` or `rmic`. See [Using Fine-Grained Make Targets]( +#using-fine-grained-make-targets) for more details about this functionality. + + * `` - Build the specified phase and everything it depends on + * `` - Build the specified module and everything it depends on + * `-` - Compile the specified phase for the specified module + and everything it depends on + +Similarly, it is possible to clean just a part of the build by creating make +targets according to these patterns: + + * `clean-` - Remove the subdir in the output dir with the name + * `clean-` - Remove all build results related to a certain build + phase + * `clean-` - Remove all build results related to a certain module + * `clean--` - Remove all build results related to a certain + module and phase + +### Make Control Variables + +It is possible to control `make` behavior by overriding the value of `make` +variables, either on the command line or in the environment. + +Normally, this is **not recommended**. If used improperly, it can lead to a +broken build. Unless you're well versed in the build system, this is hard to +use properly. Therefore, `make` will print a warning if this is detected. + +However, there are a few `make` variables, known as *control variables* that +are supposed to be overriden on the command line. These make up the "make time" +configuration, as opposed to the "configure time" configuration. + +#### General Make Control Variables + + * `JOBS` - Specify the number of jobs to build with. See [Build + Performance](#build-performance). + * `LOG` - Specify the logging level and functionality. See [Checking the + Build Log File](#checking-the-build-log-file) + * `CONF` and `CONF_NAME` - Selecting the configuration(s) to use. See [Using + Multiple Configurations](#using-multiple-configurations) + +#### Test Make Control Variables + +These make control variables only make sense when running tests. Please see +[Testing OpenJDK](testing.html) for details. + + * `TEST` + * `TEST_JOBS` + * `JTREG` + * `GTEST` + +#### Advanced Make Control Variables + +These advanced make control variables can be potentially unsafe. See [Hints and +Suggestions for Advanced Users](#hints-and-suggestions-for-advanced-users) and +[Understanding the Build System](#understanding-the-build-system) for details. + + * `SPEC` + * `CONF_CHECK` + * `COMPARE_BUILD` + * `JDK_FILTER` + +## Running Tests + +Most of the OpenJDK tests are using the [JTReg](http://openjdk.java.net/jtreg) +test framework. Make sure that your configuration knows where to find your +installation of JTReg. If this is not picked up automatically, use the +`--with-jtreg=` option to point to the JTReg framework. +Note that this option should point to the JTReg home, i.e. the top directory, +containing `lib/jtreg.jar` etc. + +To execute the most basic tests (tier 1), use: +``` +make run-test-tier1 +``` + +For more details on how to run tests, please see the [Testing +OpenJDK](testing.html) document. + +## Cross-compiling + +Cross-compiling means using one platform (the *build* platform) to generate +output that can ran on another platform (the *target* platform). + +The typical reason for cross-compiling is that the build is performed on a more +powerful desktop computer, but the resulting binaries will be able to run on a +different, typically low-performing system. Most of the complications that +arise when building for embedded is due to this separation of *build* and +*target* systems. + +This requires a more complex setup and build procedure. This section assumes +you are familiar with cross-compiling in general, and will only deal with the +particularities of cross-compiling OpenJDK. If you are new to cross-compiling, +please see the [external links at Wikipedia]( +https://en.wikipedia.org/wiki/Cross_compiler#External_links) for a good start +on reading materials. + +Cross-compiling OpenJDK requires you to be able to build both for the build +platform and for the target platform. The reason for the former is that we need +to build and execute tools during the build process, both native tools and Java +tools. + +If all you want to do is to compile a 32-bit version, for the same OS, on a +64-bit machine, consider using `--with-target-bits=32` instead of doing a +full-blown cross-compilation. (While this surely is possible, it's a lot more +work and will take much longer to build.) -Some examples: +### Boot JDK and Build JDK -> **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` - -#### Configure Options - -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](#bootjdk) - -> **`--with-boot-jdk-jvmargs=`**"_args_" \ -> provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk) - -> **`--with-cacerts=`**_path_ \ -> select the path to the cacerts file. - -> See [Certificate Authority on - Wikipedia](http://en.wikipedia.org/wiki/Certificate_Authority) 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](http://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](http://www.freetype.org). Building the freetype 2 libraries from - scratch is also possible, however on Windows refer to the [Windows FreeType - DLL build instructions](http://freetype.freedesktop.org/wiki/FreeType_DLL). - -> 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](http://freetype.sourceforge.net/freetype2) - 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 the `msvcr100.dll` file 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.h` or - `/usr/openwin/share/include/X11/extensions/Xrender.h` - -------------------------------------------------------------------------------- - -### Make - -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 by `configure` - -> **`dist-clean`** \ -> remove all files generated by both and `configure` (basically killing the - configuration) - -> **`help`** \ -> give some help on using `make`, including some interesting make targets - -------------------------------------------------------------------------------- - -## Testing - -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](http://openjdk.java.net/jtreg/). The provided regression tests in the -repositories can be run with the command: - -> **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``** - -------------------------------------------------------------------------------- - -## Appendix A: Hints and Tips - -### FAQ - -**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! - -### Build Performance Tips +When cross-compiling, make sure you use a boot JDK that runs on the *build* +system, and not on the *target* system. + +To be able to build, we need a "Build JDK", which is a JDK built from the +current sources (that is, the same as the end result of the entire build +process), but able to run on the *build* system, and not the *target* system. +(In contrast, the Boot JDK should be from an older release, e.g. JDK 8 when +building JDK 9.) + +The build process will create a minimal Build JDK for you, as part of building. +To speed up the build, you can use `--with-build-jdk` to `configure` to point +to a pre-built Build JDK. Please note that the build result is unpredictable, +and can possibly break in subtle ways, if the Build JDK does not **exactly** +match the current sources. + +### Specifying the Target Platform + +You *must* specify the target platform when cross-compiling. Doing so will also +automatically turn the build into a cross-compiling mode. The simplest way to +do this is to use the `--openjdk-target` argument, e.g. +`--openjdk-target=arm-linux-gnueabihf`. or `--openjdk-target=aarch64-oe-linux`. +This will automatically set the `--build`, `--host` and `--target` options for +autoconf, which can otherwise be confusing. (In autoconf terminology, the +"target" is known as "host", and "target" is used for building a Canadian +cross-compiler.) + +### Toolchain Considerations + +You will need two copies of your toolchain, one which generates output that can +run on the target system (the normal, or *target*, toolchain), and one that +generates output that can run on the build system (the *build* toolchain). Note +that cross-compiling is only supported for gcc at the time being. The gcc +standard is to prefix cross-compiling toolchains with the target denominator. +If you follow this standard, `configure` is likely to pick up the toolchain +correctly. + +The *build* toolchain will be autodetected just the same way the normal +*build*/*target* toolchain will be autodetected when not cross-compiling. If +this is not what you want, or if the autodetection fails, you can specify a +devkit containing the *build* toolchain using `--with-build-devkit` to +`configure`, or by giving `BUILD_CC` and `BUILD_CXX` arguments. + +It is often helpful to locate the cross-compilation tools, headers and +libraries in a separate directory, outside the normal path, and point out that +directory to `configure`. Do this by setting the sysroot (`--with-sysroot`) and +appending the directory when searching for cross-compilations tools +(`--with-toolchain-path`). As a compact form, you can also use `--with-devkit` +to point to a single directory, if it is correctly setup. (See `basics.m4` for +details.) + +If you are unsure what toolchain and versions to use, these have been proved +working at the time of writing: + + * [aarch64]( +https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux.tar.xz) + * [arm 32-bit hardware floating point]( +https://launchpad.net/linaro-toolchain-unsupported/trunk/2012.09/+download/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux.tar.bz2) + +### Native Libraries + +You will need copies of external native libraries for the *target* system, +present on the *build* machine while building. + +Take care not to replace the *build* system's version of these libraries by +mistake, since that can render the *build* machine unusable. + +Make sure that the libraries you point to (ALSA, X11, etc) are for the +*target*, not the *build*, platform. + +#### ALSA + +You will need alsa libraries suitable for your *target* system. For most cases, +using Debian's pre-built libraries work fine. + +Note that alsa is needed even if you only want to build a headless JDK. + + * Go to [Debian Package Search](https://www.debian.org/distrib/packages) and + search for the `libasound2` and `libasound2-dev` packages for your *target* + system. Download them to /tmp. + + * Install the libraries into the cross-compilation toolchain. For instance: +``` +cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc +dpkg-deb -x /tmp/libasound2_1.0.25-4_armhf.deb . +dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb . +``` + + * If alsa is not properly detected by `configure`, you can point it out by + `--with-alsa`. + +#### X11 + +You will need X11 libraries suitable for your *target* system. For most cases, +using Debian's pre-built libraries work fine. + +Note that X11 is needed even if you only want to build a headless JDK. + + * Go to [Debian Package Search](https://www.debian.org/distrib/packages), + search for the following packages for your *target* system, and download them + to /tmp/target-x11: + * libxi + * libxi-dev + * x11proto-core-dev + * x11proto-input-dev + * x11proto-kb-dev + * x11proto-render-dev + * x11proto-xext-dev + * libice-dev + * libxrender + * libxrender-dev + * libsm-dev + * libxt-dev + * libx11 + * libx11-dev + * libxtst + * libxtst-dev + * libxext + * libxext-dev + + * Install the libraries into the cross-compilation toolchain. For instance: + ``` + cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc/usr + mkdir X11R6 + cd X11R6 + for deb in /tmp/target-x11/*.deb ; do dpkg-deb -x $deb . ; done + mv usr/* . + cd lib + cp arm-linux-gnueabihf/* . + ``` + + You can ignore the following messages. These libraries are not needed to + successfully complete a full JDK build. + ``` + cp: cannot stat `arm-linux-gnueabihf/libICE.so': No such file or directory + cp: cannot stat `arm-linux-gnueabihf/libSM.so': No such file or directory + cp: cannot stat `arm-linux-gnueabihf/libXt.so': No such file or directory + ``` + + * If the X11 libraries are not properly detected by `configure`, you can + point them out by `--with-x`. + +### Building for ARM/aarch64 + +A common cross-compilation target is the ARM CPU. When building for ARM, it is +useful to set the ABI profile. A number of pre-defined ABI profiles are +available using `--with-abi-profile`: arm-vfp-sflt, arm-vfp-hflt, arm-sflt, +armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer +properly supported on OpenJDK. + +OpenJDK contains two different ports for the aarch64 platform, one is the +original aarch64 port from the [AArch64 Port Project]( +http://openjdk.java.net/projects/aarch64-port) and one is a 64-bit version of +the Oracle contributed ARM port. When targeting aarch64, by the default the +original aarch64 port is used. To select the Oracle ARM 64 port, use +`--with-cpu-port=arm64`. Also set the corresponding value (`aarch64` or +`arm64`) to --with-abi-profile, to ensure a consistent build. + +### Verifying the Build + +The build will end up in a directory named like +`build/linux-arm-normal-server-release`. + +Inside this build output directory, the `images/jdk` and `images/jre` will +contain the newly built JDK and JRE, respectively, for your *target* system. + +Copy these folders to your *target* system. Then you can run e.g. +`images/jdk/bin/java -version`. + +## Build Performance 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 @@ -718,398 +1188,696 @@ 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=1024` + * `--with-num-cores` -- number of cores in the build system, e.g. + `--with-num-cores=8`. -It 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. + * `--with-memory-size` -- memory (in MB) available in the build system, e.g. + `--with-memory-size=1024` -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. +You can also specify directly the number of build jobs to use with +`--with-jobs=N` to `configure`, or `JOBS=N` to `make`. Do not use the `-j` flag +to `make`. In most cases it will be ignored by the makefiles, but it can cause +problems for some make targets. + +It might also be necessary to specify the JVM arguments passed to the Boot JDK, +using e.g. `--with-boot-jdk-jvmargs="-Xmx8G"`. Doing so will override the +default JVM arguments passed to the Boot JDK. 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! -#### Building with ccache +If you want to tweak build performance, run with `make LOG=info` to get a build +time summary at the end of the build process. + +### Disk Speed + +If you are using network shares, e.g. via NFS, for your source code, make sure +the build directory is situated on local disk (e.g. by `ln -s +/localdisk/jdk-build $JDK-SHARE/build`). The performance penalty is extremely +high for building on a network share; close to unusable. + +Also, make sure that your build tools (including Boot JDK and toolchain) is +located on a local disk and not a network share. + +As has been stressed elsewhere, do use SSD for source code and build directory, +as well as (if possible) the build tools. + +### Virus Checking + +The use of virus checking software, especially on Windows, can *significantly* +slow down building of OpenJDK. If possible, turn off such software, or exclude +the directory containing the OpenJDK source code from on-the-fly checking. + +### Ccache 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 +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`. -#### Building on local disk +### Precompiled Headers -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. +By default, the Hotspot build uses preccompiled headers (PCH) on the toolchains +were it is properly supported (clang, gcc, and Visual Studio). Normally, this +speeds up the build process, but in some circumstances, it can actually slow +things down. -#### Building only one JVM +You can experiment by disabling precompiled headers using +`--disable-precompiled-headers`. -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`. +### Icecc / icecream -#### Selecting the number of cores to build on - -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`. +[icecc/icecream](http://github.com/icecc/icecream) is a simple way to setup a +distributed compiler network. If you have multiple machines available for +building OpenJDK, you can drastically cut individual build times by utilizing +it. -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. +To use, setup an icecc network, and install icecc on the build machine. Then +run `configure` using `--enable-icecc`. -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` - -### Troubleshooting - -#### Solving build problems - -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](http://mail.openjdk.java.net/mailman/listinfo/build-dev) or the -[build-infra-dev](http://mail.openjdk.java.net/mailman/listinfo/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. +### Using sjavac - * **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](http://ccache.samba.org/). - - * **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](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built - without the `-fPIC` for performance reasons. - - To completely disable SELinux: - - 1. `$ su root` - 2. `# system-config-securitylevel` - 3. `In the window that appears, select the SELinux tab` - 4. `Disable SELinux` - - Alternatively, instead of completely disabling it you could disable just - this one check. - - 1. Select System->Administration->SELinux Management - 2. In the SELinux Management Tool which appears, select "Boolean" from the - menu on the left - 3. Expand the "Memory Protection" group - 4. Check the first item, labeled "Allow all unconfined executables to use - libraries requiring text relocation ..." - - * **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)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - - * **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. - -------------------------------------------------------------------------------- - -## Appendix B: GNU make +To speed up Java compilation, especially incremental compilations, you can try +the experimental sjavac compiler by using `--enable-sjavac`. -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: +### Building the Right Target - * You need GNU make version 3.81 or newer. On Windows 4.0 or newer is - recommended. If the GNU make utility on your systems is not of a suitable - version, see "[Building GNU make](#buildgmake)". - * Place the location of the GNU make binary in the `PATH`. - * **Solaris:** Do NOT use `/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`. - * **Windows:** Make sure you start your build inside a bash shell. - * **Mac OS X:** The XCode "command line tools" must be installed on your Mac. +Selecting the proper target to build can have dramatic impact on build time. +For normal usage, `jdk` or the default target is just fine. You only need to +build `images` for shipping, or if your tests require it. -Information on GNU make, and access to ftp download sites, are available on the -[GNU make web site](http://www.gnu.org/software/make/make.html). The latest -source to GNU make is available at -[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). +See also [Using Fine-Grained Make Targets](#using-fine-grained-make-targets) on +how to build an even smaller subset of the product. -### Building GNU make +## Troubleshooting -First step is to get the GNU make 3.81 or newer source from -[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). Building is a -little different depending on the OS but is basically done with: +If your build fails, it can sometimes be difficult to pinpoint the problem or +find a proper solution. - bash ./configure - make +### Locating the Source of the Error -------------------------------------------------------------------------------- +When a build fails, it can be hard to pinpoint the actual cause of the error. +In a typical build process, different parts of the product build in parallel, +with the output interlaced. -## Appendix C: Build Environments +#### Build Failure Summary -### Minimum Build Environments +To help you, the build system will print a failure summary at the end. It looks +like this: -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. +``` +ERROR: Build failed for target 'hotspot' in configuration 'linux-x64' (exit code 2) -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. +=== Output from failing command(s) repeated here === +* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o: +/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type + ... (rest of output omitted) -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. +* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs. +=== End of repeated output === -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. +=== Make failed targets repeated here === +lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed +make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed +=== End of repeated output === -**NOTE: We expect a change here off these older Windows OS releases and to a -'less older' one, probably Windows 2008R2 X64.** +Hint: Try searching the build log for the name of the first failed target. +Hint: If caused by a warning, try configure --disable-warnings-as-errors. +``` -With Linux, it was just a matter of picking a stable distribution that is a -good representative for Linux in general. +Let's break it down! First, the selected configuration, and the top-level +target you entered on the command line that caused the failure is printed. -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. +Then, between the `Output from failing command(s) repeated here` and `End of +repeated output` the first lines of output (stdout and stderr) from the actual +failing command is repeated. In most cases, this is the error message that +caused the build to fail. If multiple commands were failing (this can happen in +a parallel build), output from all failed commands will be printed here. -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. +The path to the `failure-logs` directory is printed. In this file you will find +a `.log` file that contains the output from this command in its +entirety, and also a `.cmd`, which contain the complete command line +used for running this command. You can re-run the failing command by executing +`. /.cmd` in your shell. -Bootstrap JDK: JDK 8 +Another way to trace the failure is to follow the chain of make targets, from +top-level targets to individual file targets. Between `Make failed targets +repeated here` and `End of repeated output` the output from make showing this +chain is repeated. The first failed recipe will typically contain the full path +to the file in question that failed to compile. Following lines will show a +trace of make targets why we ended up trying to compile that file. - 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 +Finally, some hints are given on how to locate the error in the complete log. +In this example, we would try searching the log file for "`psMemoryPool.o`". +Another way to quickly locate make errors in the log is to search for "`] +Error`" or "`***`". -------------------------------------------------------------------------------- +Note that the build failure summary will only help you if the issue was a +compilation failure or similar. If the problem is more esoteric, or is due to +errors in the build machinery, you will likely get empty output logs, and `No +indication of failed target found` instead of the make target chain. -### Specific Developer Build Environments +#### Checking the Build Log File -We won't be listing all the possible environments, but we will try to provide -what information we have available to us. +The output (stdout and stderr) from the latest build is always stored in +`$BUILD/build.log`. The previous build log is stored as `build.log.old`. This +means that it is not necessary to redirect the build output yourself if you +want to process it. -**NOTE: The community can help out by updating this part of the document.** +You can increase the verbosity of the log file, by the `LOG` control variable +to `make`. If you want to see the command lines used in compilations, use +`LOG=cmdlines`. To increase the general verbosity, use `LOG=info`, `LOG=debug` +or `LOG=trace`. Both of these can be combined with `cmdlines`, e.g. +`LOG=info,cmdlines`. The `debug` log level will show most shell commands +executed by make, and `trace` will show all. Beware that both these log levels +will produce a massive build log! -#### Fedora +### Fixing Unexpected Build Failures -After installing the latest [Fedora](http://fedoraproject.org) you need to -install several build dependencies. The simplest way to do it is to execute the -following commands as user `root`: +Most of the time, the build will fail due to incorrect changes in the source +code. - yum-builddep java-1.7.0-openjdk - yum install gcc gcc-c++ +Sometimes the build can fail with no apparent changes that have caused the +failure. If this is the first time you are building OpenJDK on this particular +computer, and the build fails, the problem is likely with your build +environment. But even if you have previously built OpenJDK with success, and it +now fails, your build environment might have changed (perhaps due to OS +upgrades or similar). But most likely, such failures are due to problems with +the incremental rebuild. + +#### Problems with the Build Environment + +Make sure your configuration is correct. Re-run `configure`, and look for any +warnings. Warnings that appear in the middle of the `configure` output is also +repeated at the end, after the summary. The entire log is stored in +`$BUILD/configure.log`. + +Verify that the summary at the end looks correct. Are you indeed using the Boot +JDK and native toolchain that you expect? + +By default, OpenJDK has a strict approach where warnings from the compiler is +considered errors which fail the build. For very new or very old compiler +versions, this can trigger new classes of warnings, which thus fails the build. +Run `configure` with `--disable-warnings-as-errors` to turn of this behavior. +(The warnings will still show, but not make the build fail.) + +#### Problems with Incremental Rebuilds + +Incremental rebuilds mean that when you modify part of the product, only the +affected parts get rebuilt. While this works great in most cases, and +significantly speed up the development process, from time to time complex +interdependencies will result in an incorrect build result. This is the most +common cause for unexpected build problems, together with inconsistencies +between the different Mercurial repositories in the forest. + +Here are a suggested list of things to try if you are having unexpected build +problems. Each step requires more time than the one before, so try them in +order. Most issues will be solved at step 1 or 2. + + 1. Make sure your forest is up-to-date + + Run `bash get_source.sh` to make sure you have the latest version of all + repositories. + + 2. Clean build results + + The simplest way to fix incremental rebuild issues is to run `make clean`. + This will remove all build results, but not the configuration or any build + system support artifacts. In most cases, this will solve build errors + resulting from incremental build mismatches. + + 3. Completely clean the build directory. + + If this does not work, the next step is to run `make dist-clean`, or + removing the build output directory (`$BUILD`). This will clean all + generated output, including your configuration. You will need to re-run + `configure` after this step. A good idea is to run `make + print-configuration` before running `make dist-clean`, as this will print + your current `configure` command line. Here's a way to do this: + + ``` + make print-configuration > current-configuration + make dist-clean + bash configure $(cat current-configuration) + make + ``` + + 4. Re-clone the Mercurial forest + + Sometimes the Mercurial repositories themselves gets in a state that causes + the product to be un-buildable. In such a case, the simplest solution is + often the "sledgehammer approach": delete the entire forest, and re-clone + it. If you have local changes, save them first to a different location + using `hg export`. + +### Specific Build Issues + +#### Clock Skew + +If you get an error message like this: +``` +File 'xxx' has modification time in the future. +Clock skew detected. Your build may be incomplete. +``` +then the clock on your 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 `make +clean` and restart the build. + +#### Out of Memory Errors + +On Solaris, you might get an error message like this: +``` +Trouble writing out table to disk +``` +To solve this, increase the amount of swap space on your build machine. + +On Windows, you might get error messages like this: +``` +fatal error - couldn't allocate heap +cannot create ... Permission denied +spawn failed +``` +This can be a sign of a Cygwin problem. See the information about solving +problems in the [Cygwin](#cygwin) section. Rebooting the computer might help +temporarily. + +### Getting Help + +If none of the suggestions in this document helps you, or if you find what you +believe is a bug in the build system, please contact the Build Group by sending +a mail to [build-dev@openjdk.java.net](mailto:build-dev@openjdk.java.net). +Please include the relevant parts of the configure and/or build log. + +If you need general help or advice about developing for OpenJDK, you can also +contact the Adoption Group. See the section on [Contributing to OpenJDK]( +#contributing-to-openjdk) for more information. + +## Hints and Suggestions for Advanced Users + +### Setting Up a Forest for Pushing Changes (defpath) + +To help you prepare a proper push path for a Mercurial repository, there exists +a useful tool known as [defpath]( +http://openjdk.java.net/projects/code-tools/defpath). It will help you setup a +proper push path for pushing changes to OpenJDK. + +Install the extension by cloning +`http://hg.openjdk.java.net/code-tools/defpath` and updating your `.hgrc` file. +Here's one way to do this: + +``` +cd ~ +mkdir hg-ext +cd hg-ext +hg clone http://hg.openjdk.java.net/code-tools/defpath +cat << EOT >> ~/.hgrc +[extensions] +defpath=~/hg-ext/defpath/defpath.py +EOT +``` + +You can now setup a proper push path using: +``` +hg defpath -d -u +``` + +If you also have the `trees` extension installed in Mercurial, you will +automatically get a `tdefpath` command, which is even more useful. By running +`hg tdefpath -du ` in the top repository of your forest, all repos +will get setup automatically. This is the recommended usage. + +### Bash Completion + +The `configure` and `make` commands tries to play nice with bash command-line +completion (using `` or ``). To use this functionality, make +sure you enable completion in your `~/.bashrc` (see instructions for bash in +your operating system). + +Make completion will work out of the box, and will complete valid make targets. +For instance, typing `make jdk-i` will complete to `make jdk-image`. + +The `configure` script can get completion for options, but for this to work you +need to help `bash` on the way. The standard way of running the script, `bash +configure`, will not be understood by bash completion. You need `configure` to +be the command to run. One way to achieve this is to add a simple helper script +to your path: + +``` +cat << EOT > /tmp/configure +#!/bin/bash +if [ \$(pwd) = \$(cd \$(dirname \$0); pwd) ] ; then + echo >&2 "Abort: Trying to call configure helper recursively" + exit 1 +fi + +bash \$PWD/configure "\$@" +EOT +chmod +x /tmp/configure +sudo mv /tmp/configure /usr/local/bin +``` + +Now `configure --en-dt` will result in `configure --enable-dtrace`. + +### Using Multiple Configurations + +You can have multiple configurations for a single source forest. When you +create a new configuration, run `configure --with-conf-name=` to create a +configuration with the name ``. Alternatively, you can create a directory +under `build` and run `configure` from there, e.g. `mkdir build/ && cd +build/ && bash ../../configure`. + +Then you can build that configuration using `make CONF_NAME=` or `make +CONF=`, where `` is a substring matching one or several +configurations, e.g. `CONF=debug`. The special empty pattern (`CONF=`) will +match *all* available configuration, so `make CONF= hotspot` will build the +`hotspot` target for all configurations. Alternatively, you can execute `make` +in the configuration directory, e.g. `cd build/ && make`. + +### Handling Reconfigurations + +If you update the forest and part of the configure script has changed, the +build system will force you to re-run `configure`. + +Most of the time, you will be fine by running `configure` again with the same +arguments as the last time, which can easily be performed by `make +reconfigure`. To simplify this, you can use the `CONF_CHECK` make control +variable, either as `make CONF_CHECK=auto`, or by setting an environment +variable. For instance, if you add `export CONF_CHECK=auto` to your `.bashrc` +file, `make` will always run `reconfigure` automatically whenever the configure +script has changed. + +You can also use `CONF_CHECK=ignore` to skip the check for a needed configure +update. This might speed up the build, but comes at the risk of an incorrect +build result. This is only recommended if you know what you're doing. + +From time to time, you will also need to modify the command line to `configure` +due to changes. Use `make print-configure` to show the command line used for +your current configuration. + +### Using Fine-Grained Make Targets + +The default behavior for make is to create consistent and correct output, at +the expense of build speed, if necessary. + +If you are prepared to take some risk of an incorrect build, and know enough of +the system to understand how things build and interact, you can speed up the +build process considerably by instructing make to only build a portion of the +product. + +#### Building Individual Modules + +The safe way to use fine-grained make targets is to use the module specific +make targets. All source code in JDK 9 is organized so it belongs to a module, +e.g. `java.base` or `jdk.jdwp.agent`. You can build only a specific module, by +giving it as make target: `make jdk.jdwp.agent`. If the specified module +depends on other modules (e.g. `java.base`), those modules will be built first. + +You can also specify a set of modules, just as you can always specify a set of +make targets: `make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi +jdk.crypto.ucrypto` + +#### Building Individual Module Phases + +The build process for each module is divided into separate phases. Not all +modules need all phases. Which are needed depends on what kind of source code +and other artifact the module consists of. The phases are: -In addition, it's necessary to set a few environment variables for the build: + * `gensrc` (Generate source code to compile) + * `gendata` (Generate non-source code artifacts) + * `copy` (Copy resource artifacts) + * `java` (Compile Java code) + * `launchers` (Compile native executables) + * `libs` (Compile native libraries) + * `rmic` (Run the `rmic` tool) + +You can build only a single phase for a module by using the notation +`$MODULE-$PHASE`. For instance, to build the `gensrc` phase for `java.base`, +use `make java.base-gensrc`. + +Note that some phases may depend on others, e.g. `java` depends on `gensrc` (if +present). Make will build all needed prerequisites before building the +requested phase. + +#### Skipping the Dependency Check - export LANG=C - export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}" +When using an iterative development style with frequent quick rebuilds, the +dependency check made by make can take up a significant portion of the time +spent on the rebuild. In such cases, it can be useful to bypass the dependency +check in make. -#### CentOS 5.5 +> **Note that if used incorrectly, this can lead to a broken build!** -After installing [CentOS 5.5](http://www.centos.org/) you need to make sure you -have the following Development bundles installed: +To achieve this, append `-only` to the build target. For instance, `make +jdk.jdwp.agent-java-only` will *only* build the `java` phase of the +`jdk.jdwp.agent` module. If the required dependencies are not present, the +build can fail. On the other hand, the execution time measures in milliseconds. - * Development Libraries - * Development Tools - * Java Development - * X Software Development (Including XFree86-devel) +A useful pattern is to build the first time normally (e.g. `make +jdk.jdwp.agent`) and then on subsequent builds, use the `-only` make target. -Plus the following packages: +#### Rebuilding Part of java.base (JDK\_FILTER) - * cups devel: Cups Development Package - * alsa devel: Alsa Development Package - * Xi devel: libXi.so Development Package +If you are modifying files in `java.base`, which is the by far largest module +in OpenJDK, then you need to rebuild all those files whenever a single file has +changed. (This inefficiency will hopefully be addressed in JDK 10.) -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](http://downloads.sourceforge.net/freetype). Build and install -with something like: +As a hack, you can use the make control variable `JDK_FILTER` to specify a +pattern that will be used to limit the set of files being recompiled. For +instance, `make java.base JDK_FILTER=javax/crypto` (or, to combine methods, +`make java.base-java-only JDK_FILTER=javax/crypto`) will limit the compilation +to files in the `javax.crypto` package. - bash ./configure - make - sudo -u root make install +### Learn About Mercurial -Mercurial packages could not be found easily, but a Google search should find -ones, and they usually include Python if it's needed. +To become an efficient OpenJDK developer, it is recommended that you invest in +learning Mercurial properly. Here are some links that can get you started: -#### Debian 5.0 (Lenny) + * [Mercurial for git users](http://www.mercurial-scm.org/wiki/GitConcepts) + * [The official Mercurial tutorial](http://www.mercurial-scm.org/wiki/Tutorial) + * [hg init](http://hginit.com/) + * [Mercurial: The Definitive Guide](http://hgbook.red-bean.com/read/) -After installing [Debian](http://debian.org) 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`: +## Understanding the Build System - aptitude build-dep openjdk-7 - aptitude install openjdk-7-jdk libmotif-dev +This section will give you a more technical description on the details of the +build system. -In addition, it's necessary to set a few environment variables for the build: +### Configurations - export LANG=C - export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}" +The build system expects to find one or more configuration. These are +technically defined by the `spec.gmk` in a subdirectory to the `build` +subdirectory. The `spec.gmk` file is generated by `configure`, and contains in +principle the configuration (directly or by files included by `spec.gmk`). -#### Ubuntu 12.04 +You can, in fact, select a configuration to build by pointing to the `spec.gmk` +file with the `SPEC` make control variable, e.g. `make SPEC=$BUILD/spec.gmk`. +While this is not the recommended way to call `make` as a user, it is what is +used under the hood by the build system. -After installing [Ubuntu](http://ubuntu.org) 12.04 you need to install several -build dependencies. The simplest way to do it is to execute the following -commands: +### Build Output Structure - sudo aptitude build-dep openjdk-7 - sudo aptitude install openjdk-7-jdk +The build output for a configuration will end up in `build/`, which we refer to as `$BUILD` in this document. The `$BUILD` directory +contains the following important directories: -In addition, it's necessary to set a few environment variables for the build: +``` +buildtools/ +configure-support/ +hotspot/ +images/ +jdk/ +make-support/ +support/ +test-results/ +test-support/ +``` - export LANG=C - export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}" +This is what they are used for: -#### OpenSUSE 11.1 + * `images`: This is the directory were the output of the `*-image` make + targets end up. For instance, `make jdk-image` ends up in `images/jdk`. -After installing [OpenSUSE](http://opensuse.org) 11.1 you need to install -several build dependencies. The simplest way to install the build dependencies -is to execute the following commands: + * `jdk`: This is the "exploded image". After `make jdk`, you will be able to + launch the newly built JDK by running `$BUILD/jdk/bin/java`. - sudo zypper source-install -d java-1_7_0-openjdk - sudo zypper install make + * `test-results`: This directory contains the results from running tests. -In addition, it is necessary to set a few environment variables for the build: + * `support`: This is an area for intermediate files needed during the build, + e.g. generated source code, object files and class files. Some noteworthy + directories in `support` is `gensrc`, which contains the generated source + code, and the `modules_*` directories, which contains the files in a + per-module hierarchy that will later be collapsed into the `jdk` directory + of the exploded image. - export LANG=C - export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}" + * `buildtools`: This is an area for tools compiled for the build platform + that are used during the rest of the build. -Finally, you need to unset the `JAVA_HOME` environment variable: + * `hotspot`: This is an area for intermediate files needed when building + hotspot. - export -n JAVA_HOME` + * `configure-support`, `make-support` and `test-support`: These directories + contain files that are needed by the build system for `configure`, `make` + and for running tests. -#### Mandriva Linux One 2009 Spring +### Fixpath -After installing [Mandriva](http://mandriva.org) 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`: +Windows path typically look like `C:\User\foo`, while Unix paths look like +`/home/foo`. Tools with roots from Unix often experience issues related to this +mismatch when running on Windows. - 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 the OpenJDK build, we always use Unix paths internally, and only just before +calling a tool that does not understand Unix paths do we convert them to +Windows paths. -In addition, it is necessary to set a few environment variables for the build: +This conversion is done by the `fixpath` tool, which is a small wrapper that +modifies unix-style paths to Windows-style paths in command lines. Fixpath is +compiled automatically by `configure`. - export LANG=C - export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}" +### Native Debug Symbols -#### OpenSolaris 2009.06 +Native libraries and executables can have debug symbol (and other debug +information) associated with them. How this works is very much platform +dependent, but a common problem is that debug symbol information takes a lot of +disk space, but is rarely needed by the end user. -After installing [OpenSolaris](http://opensolaris.org) 2009.06 you need to -install several build dependencies. The simplest way to install the build -dependencies is to execute the following commands: +The OpenJDK supports different methods on how to handle debug symbols. The +method used is selected by `--with-native-debug-symbols`, and available methods +are `none`, `internal`, `external`, `zipped`. - pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip - SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2 + * `none` means that no debug symbols will be generated during the build. -In addition, it is necessary to set a few environment variables for the build: + * `internal` means that debug symbols will be generated during the build, and + they will be stored in the generated binary. - export LANG=C - export PATH="/opt/SunStudioExpress/bin:${PATH}" + * `external` means that debug symbols will be generated during the build, and + after the compilation, they will be moved into a separate `.debuginfo` file. + (This was previously known as FDS, Full Debug Symbols). -------------------------------------------------------------------------------- + * `zipped` is like `external`, but the .debuginfo file will also be zipped + into a `.diz` file. -End of the OpenJDK build README document. +When building for distribution, `zipped` is a good solution. Binaries built +with `internal` is suitable for use by developers, since they facilitate +debugging, but should be stripped before distributed to end users. -Please come again! +### Autoconf Details + +The `configure` script is based on the autoconf framework, but in some details +deviate from a normal autoconf `configure` script. + +The `configure` script in the top level directory of OpenJDK is just a thin +wrapper that calls `common/autoconf/configure`. This in turn provides +functionality that is not easily expressed in the normal Autoconf framework, +and then calls into the core of the `configure` script, which is the +`common/autoconf/generated-configure.sh` file. + +As the name implies, this file is generated by Autoconf. It is checked in after +regeneration, to alleviate the common user to have to install Autoconf. + +The build system will detect if the Autoconf source files have changed, and +will trigger a regeneration of `common/autoconf/generated-configure.sh` if +needed. You can also manually request such an update by `bash +common/autoconf/autogen.sh`. + +If you make changes to the build system that requires a re-generation, note the +following: + + * You must use *exactly* version 2.69 of autoconf for your patch to be + accepted. This is to avoid spurious changes in the generated file. Note + that Ubuntu 16.04 ships a patched version of autoconf which claims to be + 2.69, but is not. + + * You do not need to include the generated file in reviews. + + * If the generated file needs updating, the Oracle JDK closed counter-part + will also need to be updated. It is very much appreciated if you ask for an + Oracle engineer to sponsor your push so this can be made in tandem. + +### Developing the Build System Itself + +This section contains a few remarks about how to develop for the build system +itself. It is not relevant if you are only making changes in the product source +code. + +While technically using `make`, the make source files of the OpenJDK does not +resemble most other Makefiles. Instead of listing specific targets and actions +(perhaps using patterns), the basic modus operandi is to call a high-level +function (or properly, macro) from the API in `make/common`. For instance, to +compile all classes in the `jdk.internal.foo` package in the `jdk.foo` module, +a call like this would be made: + +``` +$(eval $(call SetupJavaCompilation, BUILD_FOO_CLASSES, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(JDK_TOPDIR)/src/jkd.foo/share/classes, \ + INCLUDES := jdk/internal/foo, \ + BIN := $(SUPPORT_OUTPUTDIR)/foo_classes, \ +)) +``` + +By encapsulating and expressing the high-level knowledge of *what* should be +done, rather than *how* it should be done (as is normal in Makefiles), we can +build a much more powerful and flexible build system. + +Correct dependency tracking is paramount. Sloppy dependency tracking will lead +to improper parallelization, or worse, race conditions. + +To test for/debug race conditions, try running `make JOBS=1` and `make +JOBS=100` and see if it makes any difference. (It shouldn't). + +To compare the output of two different builds and see if, and how, they differ, +run `$BUILD1/compare.sh -o $BUILD2`, where `$BUILD1` and `$BUILD2` are the two +builds you want to compare. + +To automatically build two consecutive versions and compare them, use +`COMPARE_BUILD`. The value of `COMPARE_BUILD` is a set of variable=value +assignments, like this: +``` +make COMPARE_BUILD=CONF=--enable-new-hotspot-feature:MAKE=hotspot +``` +See `make/InitSupport.gmk` for details on how to use `COMPARE_BUILD`. + +To analyze build performance, run with `LOG=trace` and check `$BUILD/build-trace-time.log`. +Use `JOBS=1` to avoid parallelism. + +Please check that you adhere to the [Code Conventions for the Build System]( +http://openjdk.java.net/groups/build/doc/code-conventions.html) before +submitting patches. Also see the section in [Autoconf Details]( +#autoconf-details) about the generated configure script. + +## Contributing to OpenJDK + +So, now you've build your OpenJDK, and made your first patch, and want to +contribute it back to the OpenJDK community. + +First of all: Thank you! We gladly welcome your contribution to the OpenJDK. +However, please bear in mind that OpenJDK is a massive project, and we must ask +you to follow our rules and guidelines to be able to accept your contribution. + +The official place to start is the ['How to contribute' page]( +http://openjdk.java.net/contribute/). There is also an official (but somewhat +outdated and skimpy on details) [Developer's Guide]( +http://openjdk.java.net/guide/). + +If this seems overwhelming to you, the Adoption Group is there to help you! A +good place to start is their ['New Contributor' page]( +https://wiki.openjdk.java.net/display/Adoption/New+Contributor), or start +reading the comprehensive [Getting Started Kit]( +https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-started-kit/en/). The +Adoption Group will also happily answer any questions you have about +contributing. Contact them by [mail]( +http://mail.openjdk.java.net/mailman/listinfo/adoption-discuss) or [IRC]( +http://openjdk.java.net/irc/). + +--- +# Override styles from the base CSS file that are not ideal for this document. +header-includes: + - '' +--- diff --git a/common/doc/testing.html b/common/doc/testing.html index 023cdf45b77..7ac23de060e 100644 --- a/common/doc/testing.html +++ b/common/doc/testing.html @@ -6,7 +6,7 @@ Testing OpenJDK - + diff --git a/corba/.hgtags b/corba/.hgtags index cd452cb8148..f62c7b03bd8 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -432,3 +432,6 @@ c62e5964cfcf144d8f72e9ba69757897785349a9 jdk-9+171 00ae6307d78bac49883ddc85d687aa88c49f3971 jdk-10+12 dc78a3dd6b3a4f11cdae8a3e3d160e6a78bc7838 jdk-9+175 564fced058bd2c8375e9104aa8f9494642cd7bdd jdk-10+13 +25d991a67cba240eeaf15c19c5857b40fdd71561 jdk-10+14 +40fb9f229471ef357d493813d34b15afcce9f32b jdk-9+176 +c72e9d3823f04cb3ef3166646dfea9e4c2769133 jdk-9+177 diff --git a/corba/src/java.corba/share/classes/module-info.java b/corba/src/java.corba/share/classes/module-info.java index f20ef16d44d..b2d862fa3b2 100644 --- a/corba/src/java.corba/share/classes/module-info.java +++ b/corba/src/java.corba/share/classes/module-info.java @@ -26,7 +26,7 @@ /** * Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API. * - *

    This module is upgradeble. + *

    This module is upgradeable. * * @moduleGraph * @since 9 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 4c61de8151b..df44ec6a6e7 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -592,3 +592,6 @@ e64b1cb48d6e7703928a9d1da106fc27f8cb65fd jdk-9+173 070aa7a2eb14c4645f7eb31384cba0a2ba72a4b5 jdk-10+12 8f04d457168b9f1f4a1b2c37f49e0513ca9d33a7 jdk-9+175 a9da03357f190807591177fe9846d6e68ad64fc0 jdk-10+13 +e920b4d008d914f3414bd4630b58837cf0b7f08d jdk-10+14 +2ab74e5dbdc2b6a962c865500cafd23cf387dc60 jdk-9+176 +1ca8f038fceb88c640badf9bd18905205bc63b43 jdk-9+177 diff --git a/hotspot/src/share/vm/opto/arraycopynode.cpp b/hotspot/src/share/vm/opto/arraycopynode.cpp index 01fe12c8173..e61a053c3d8 100644 --- a/hotspot/src/share/vm/opto/arraycopynode.cpp +++ b/hotspot/src/share/vm/opto/arraycopynode.cpp @@ -748,41 +748,3 @@ bool ArrayCopyNode::modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransf return false; } -// We try to replace a load from the destination of an arraycopy with -// a load from the source so the arraycopy has a chance to be -// eliminated. It's only valid if the arraycopy doesn't change the -// element that would be loaded from the source array. -bool ArrayCopyNode::can_replace_dest_load_with_src_load(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase) const { - assert(_kind == ArrayCopy || _kind == CopyOf || _kind == CopyOfRange, "only for real array copies"); - - Node* src = in(Src); - Node* dest = in(Dest); - - // Check whether, assuming source and destination are the same - // array, the arraycopy modifies the element from the source we - // would load. - if ((src != dest && in(SrcPos) == in(DestPos)) || !modifies(offset_lo, offset_hi, phase, false)) { - // if not the transformation is legal - return true; - } - - AllocateNode* src_alloc = AllocateNode::Ideal_allocation(src, phase); - AllocateNode* dest_alloc = AllocateNode::Ideal_allocation(dest, phase); - - // Check whether source and destination can be proved to be - // different arrays - const TypeOopPtr* t_src = phase->type(src)->isa_oopptr(); - const TypeOopPtr* t_dest = phase->type(dest)->isa_oopptr(); - - if (t_src != NULL && t_dest != NULL && - (t_src->is_known_instance() || t_dest->is_known_instance()) && - t_src->instance_id() != t_dest->instance_id()) { - return true; - } - - if (MemNode::detect_ptr_independence(src->uncast(), src_alloc, dest->uncast(), dest_alloc, phase)) { - return true; - } - - return false; -} diff --git a/hotspot/src/share/vm/opto/arraycopynode.hpp b/hotspot/src/share/vm/opto/arraycopynode.hpp index 46e57003168..7b54458aa3b 100644 --- a/hotspot/src/share/vm/opto/arraycopynode.hpp +++ b/hotspot/src/share/vm/opto/arraycopynode.hpp @@ -168,7 +168,6 @@ public: static bool may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTransform *phase, ArrayCopyNode*& ac); bool modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase, bool must_modify) const; - bool can_replace_dest_load_with_src_load(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase) const; #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 4e5051ee01c..ff65d68d8c1 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -5171,6 +5171,10 @@ bool LibraryCallKit::inline_arraycopy() { Deoptimization::Action_make_not_entrant); assert(stopped(), "Should be stopped"); } + + const TypeKlassPtr* dest_klass_t = _gvn.type(dest_klass)->is_klassptr(); + const Type *toop = TypeOopPtr::make_from_klass(dest_klass_t->klass()); + src = _gvn.transform(new CheckCastPPNode(control(), src, toop)); } arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp, new_idx); diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index 3fd63287071..740c5892666 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -885,7 +885,7 @@ static bool skip_through_membars(Compile::AliasType* atp, const TypeInstPtr* tp, // Is the value loaded previously stored by an arraycopy? If so return // a load node that reads from the source array so we may be able to // optimize out the ArrayCopy node later. -Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseTransform* phase) const { +Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const { Node* ld_adr = in(MemNode::Address); intptr_t ld_off = 0; AllocateNode* ld_alloc = AllocateNode::Ideal_allocation(ld_adr, phase, ld_off); @@ -893,23 +893,27 @@ Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseTransform* phase) const { if (ac != NULL) { assert(ac->is_ArrayCopy(), "what kind of node can this be?"); - Node* ld = clone(); + Node* mem = ac->in(TypeFunc::Memory); + Node* ctl = ac->in(0); + Node* src = ac->in(ArrayCopyNode::Src); + + if (!ac->as_ArrayCopy()->is_clonebasic() && !phase->type(src)->isa_aryptr()) { + return NULL; + } + + LoadNode* ld = clone()->as_Load(); + Node* addp = in(MemNode::Address)->clone(); if (ac->as_ArrayCopy()->is_clonebasic()) { assert(ld_alloc != NULL, "need an alloc"); - Node* addp = in(MemNode::Address)->clone(); assert(addp->is_AddP(), "address must be addp"); assert(addp->in(AddPNode::Base) == ac->in(ArrayCopyNode::Dest)->in(AddPNode::Base), "strange pattern"); assert(addp->in(AddPNode::Address) == ac->in(ArrayCopyNode::Dest)->in(AddPNode::Address), "strange pattern"); - addp->set_req(AddPNode::Base, ac->in(ArrayCopyNode::Src)->in(AddPNode::Base)); - addp->set_req(AddPNode::Address, ac->in(ArrayCopyNode::Src)->in(AddPNode::Address)); - ld->set_req(MemNode::Address, phase->transform(addp)); - if (in(0) != NULL) { - assert(ld_alloc->in(0) != NULL, "alloc must have control"); - ld->set_req(0, ld_alloc->in(0)); - } + addp->set_req(AddPNode::Base, src->in(AddPNode::Base)); + addp->set_req(AddPNode::Address, src->in(AddPNode::Address)); } else { - Node* src = ac->in(ArrayCopyNode::Src); - Node* addp = in(MemNode::Address)->clone(); + assert(ac->as_ArrayCopy()->is_arraycopy_validated() || + ac->as_ArrayCopy()->is_copyof_validated() || + ac->as_ArrayCopy()->is_copyofrange_validated(), "only supported cases"); assert(addp->in(AddPNode::Base) == addp->in(AddPNode::Address), "should be"); addp->set_req(AddPNode::Base, src); addp->set_req(AddPNode::Address, src); @@ -927,21 +931,17 @@ Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseTransform* phase) const { Node* offset = phase->transform(new AddXNode(addp->in(AddPNode::Offset), diff)); addp->set_req(AddPNode::Offset, offset); - ld->set_req(MemNode::Address, phase->transform(addp)); - - const TypeX *ld_offs_t = phase->type(offset)->isa_intptr_t(); - - if (!ac->as_ArrayCopy()->can_replace_dest_load_with_src_load(ld_offs_t->_lo, ld_offs_t->_hi, phase)) { - return NULL; - } - - if (in(0) != NULL) { - assert(ac->in(0) != NULL, "alloc must have control"); - ld->set_req(0, ac->in(0)); - } } + addp = phase->transform(addp); +#ifdef ASSERT + const TypePtr* adr_type = phase->type(addp)->is_ptr(); + ld->_adr_type = adr_type; +#endif + ld->set_req(MemNode::Address, addp); + ld->set_req(0, ctl); + ld->set_req(MemNode::Memory, mem); // load depends on the tests that validate the arraycopy - ld->as_Load()->_control_dependency = Pinned; + ld->_control_dependency = Pinned; return ld; } return NULL; diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index 3409446861a..eb421b86f7b 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -270,7 +270,7 @@ protected: const Type* load_array_final_field(const TypeKlassPtr *tkls, ciKlass* klass) const; - Node* can_see_arraycopy_value(Node* st, PhaseTransform* phase) const; + Node* can_see_arraycopy_value(Node* st, PhaseGVN* phase) const; // depends_only_on_test is almost always true, and needs to be almost always // true to enable key hoisting & commoning optimizations. However, for the diff --git a/hotspot/test/compiler/arraycopy/TestLoadBypassACWithWrongMem.java b/hotspot/test/compiler/arraycopy/TestLoadBypassACWithWrongMem.java new file mode 100644 index 00000000000..14670002614 --- /dev/null +++ b/hotspot/test/compiler/arraycopy/TestLoadBypassACWithWrongMem.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8181742 + * @summary Loads that bypass arraycopy ends up with wrong memory state + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM -XX:+StressLCM TestLoadBypassACWithWrongMem + * + */ + +import java.util.Arrays; + +public class TestLoadBypassACWithWrongMem { + + static int test1(int[] src) { + int[] dst = new int[10]; + System.arraycopy(src, 0, dst, 0, 10); + src[1] = 0x42; + // dst[1] is transformed to src[1], src[1] must use the + // correct memory state (not the store above). + return dst[1]; + } + + static int test2(int[] src) { + int[] dst = (int[])src.clone(); + src[1] = 0x42; + // Same as above for clone + return dst[1]; + } + + static Object test5_src = null; + static int test3() { + int[] dst = new int[10]; + System.arraycopy(test5_src, 0, dst, 0, 10); + ((int[])test5_src)[1] = 0x42; + System.arraycopy(test5_src, 0, dst, 0, 10); + // dst[1] is transformed to test5_src[1]. test5_src is Object + // but test5_src[1] must be on the slice for int[] not + // Object+some offset. + return dst[1]; + } + + static public void main(String[] args) { + int[] src = new int[10]; + for (int i = 0; i < 20000; i++) { + Arrays.fill(src, 0); + int res = test1(src); + if (res != 0) { + throw new RuntimeException("bad result: " + res + " != " + 0); + } + Arrays.fill(src, 0); + res = test2(src); + if (res != 0) { + throw new RuntimeException("bad result: " + res + " != " + 0); + } + Arrays.fill(src, 0); + test5_src = src; + res = test3(); + if (res != 0x42) { + throw new RuntimeException("bad result: " + res + " != " + 0x42); + } + } + } +} diff --git a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java index 1e8f790307b..0c41ba78d3a 100644 --- a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java +++ b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java @@ -108,8 +108,8 @@ public class TestAnonymousClassUnloading { */ static public void main(String[] args) throws Exception { // (1) Load an anonymous version of this class using the corresponding Unsafe method - URL classUrl = TestAnonymousClassUnloading.class.getResource( - TestAnonymousClassUnloading.class.getName().replace('.', '/') + ".class"); + String rn = TestAnonymousClassUnloading.class.getSimpleName() + ".class"; + URL classUrl = TestAnonymousClassUnloading.class.getResource(rn); URLConnection connection = classUrl.openConnection(); int length = connection.getContentLength(); diff --git a/hotspot/test/runtime/logging/ClassLoadUnloadTest.java b/hotspot/test/runtime/logging/ClassLoadUnloadTest.java index 1c2396327aa..07c0c9c8be2 100644 --- a/hotspot/test/runtime/logging/ClassLoadUnloadTest.java +++ b/hotspot/test/runtime/logging/ClassLoadUnloadTest.java @@ -74,7 +74,7 @@ public class ClassLoadUnloadTest { List argsList = new ArrayList<>(); Collections.addAll(argsList, args); Collections.addAll(argsList, "-Xmn8m"); - Collections.addAll(argsList, "-Dtest.classes=" + System.getProperty("test.classes",".")); + Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", ".")); Collections.addAll(argsList, ClassUnloadTestMain.class.getName()); return ProcessTools.createJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); } diff --git a/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java b/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java index d92361396bb..33e2d6c56ea 100644 --- a/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java +++ b/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java @@ -31,8 +31,10 @@ import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.stream.Stream; public class ClassUnloadCommon { public static class TestFailure extends RuntimeException { @@ -61,14 +63,45 @@ public class ClassUnloadCommon { System.gc(); } + /** + * Creates a class loader that loads classes from {@code ${test.class.path}} + * before delegating to the system class loader. + */ public static ClassLoader newClassLoader() { - try { - return new URLClassLoader(new URL[] { - Paths.get(System.getProperty("test.classes",".") + File.separatorChar + "classes").toUri().toURL(), - }, null); - } catch (MalformedURLException e){ - throw new RuntimeException("Unexpected URL conversion failure", e); - } + String cp = System.getProperty("test.class.path", "."); + URL[] urls = Stream.of(cp.split(File.pathSeparator)) + .map(Paths::get) + .map(ClassUnloadCommon::toURL) + .toArray(URL[]::new); + return new URLClassLoader(urls) { + @Override + public Class loadClass(String cn, boolean resolve) + throws ClassNotFoundException + { + synchronized (getClassLoadingLock(cn)) { + Class c = findLoadedClass(cn); + if (c == null) { + try { + c = findClass(cn); + } catch (ClassNotFoundException e) { + c = getParent().loadClass(cn); + } + + } + if (resolve) { + resolveClass(c); + } + return c; + } + } + }; } + static URL toURL(Path path) { + try { + return path.toUri().toURL(); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + } } diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 315d5f63b43..825fb9489db 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -432,3 +432,6 @@ b9c0b105002272d7414c8b34af9aded151f9cad6 jdk-9+174 ff293e39e83366c40a5687dacd1ccb2305ed2c1e jdk-10+12 736412a8dccee9d439044e6b1af2e7470d0a3563 jdk-9+175 5d374af9e78d02976e0e7f8dc2706f91a020f025 jdk-10+13 +4d05f673cf773f1c20e8f5a879d64115d2f741d9 jdk-10+14 +38cf34e2328070cc691c4f136e6dde1a44c04171 jdk-9+176 +332ad9f92632f56f337b8c40edef9a95a42b26bc jdk-9+177 diff --git a/jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java b/jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java index 93824c8ffa4..7b941a9cf03 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java +++ b/jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -114,7 +114,7 @@ public class virtual_parse_stack { real_next++; /* put the state number from the Symbol onto the virtual stack */ - vstack.push(new Integer(stack_sym.parse_state)); + vstack.push(stack_sym.parse_state); } /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ @@ -161,7 +161,7 @@ public class virtual_parse_stack { /** Push a state number onto the stack. */ public void push(int state_num) { - vstack.push(new Integer(state_num)); + vstack.push(state_num); } /*-----------------------------------------------------------*/ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java index 0471f684863..a1a425679d8 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -104,6 +103,6 @@ public final class ConstantDouble extends Constant implements ConstantObject { /** @return Double object */ public Object getConstantValue(ConstantPool cp) { - return new Double(bytes); + return bytes; } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java index 693ed70c13b..2b2a68a3760 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -103,6 +102,6 @@ public final class ConstantFloat extends Constant implements ConstantObject { /** @return Float object */ public Object getConstantValue(ConstantPool cp) { - return new Float(bytes); + return bytes; } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java index 5e8e098c0ef..458400145fe 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -109,6 +108,6 @@ public final class ConstantInteger extends Constant implements ConstantObject { /** @return Integer object */ public Object getConstantValue(ConstantPool cp) { - return new Integer(bytes); + return bytes; } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java index d1d1ab30a89..35102789a0d 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -101,6 +100,6 @@ public final class ConstantLong extends Constant implements ConstantObject { /** @return Long object */ public Object getConstantValue(ConstantPool cp) { - return new Long(bytes); + return bytes; } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/JavaClass.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/JavaClass.java index 2ccb0646231..2e6c2ba23a3 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/JavaClass.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/JavaClass.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -425,7 +424,7 @@ public class JavaClass extends AccessFlags implements Cloneable, Node { } if(debug != null) - JavaClass.debug = new Boolean(debug).booleanValue(); + JavaClass.debug = Boolean.valueOf(debug); if(sep != null) try { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BIPUSH.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BIPUSH.java index b1859d5ae0f..bb4e12f858a 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BIPUSH.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BIPUSH.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -72,7 +71,7 @@ public class BIPUSH extends Instruction implements ConstantPushInstruction { b = bytes.readByte(); } - public Number getValue() { return new Integer(b); } + public Number getValue() { return Integer.valueOf(b); } /** @return Type.BYTE */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/DCONST.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/DCONST.java index e3c69483137..af6154b7659 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/DCONST.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/DCONST.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -52,7 +51,7 @@ public class DCONST extends Instruction value = f; } - public Number getValue() { return new Double(value); } + public Number getValue() { return Double.valueOf(value); } /** @return Type.DOUBLE */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FCONST.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FCONST.java index e54a8c0d576..76f2b40cd06 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FCONST.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FCONST.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -54,7 +53,7 @@ public class FCONST extends Instruction value = f; } - public Number getValue() { return new Float(value); } + public Number getValue() { return Float.valueOf(value); } /** @return Type.FLOAT */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FieldGen.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FieldGen.java index eb139241b91..42f76abf9f3 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FieldGen.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FieldGen.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -95,56 +94,56 @@ public class FieldGen extends FieldGenOrMethodGen { checkType(Type.LONG); if(l != 0L) - value = new Long(l); + value = Long.valueOf(l); } public void setInitValue(int i) { checkType(Type.INT); if(i != 0) - value = new Integer(i); + value = Integer.valueOf(i); } public void setInitValue(short s) { checkType(Type.SHORT); if(s != 0) - value = new Integer(s); + value = Integer.valueOf(s); } public void setInitValue(char c) { checkType(Type.CHAR); if(c != 0) - value = new Integer(c); + value = Integer.valueOf(c); } public void setInitValue(byte b) { checkType(Type.BYTE); if(b != 0) - value = new Integer(b); + value = Integer.valueOf(b); } public void setInitValue(boolean b) { checkType(Type.BOOLEAN); if(b) - value = new Integer(1); + value = Integer.valueOf(1); } public void setInitValue(float f) { checkType(Type.FLOAT); if(f != 0.0) - value = new Float(f); + value = Float.valueOf(f); } public void setInitValue(double d) { checkType(Type.DOUBLE); if(d != 0.0) - value = new Double(d); + value = Double.valueOf(d); } /** Remove any initial value. diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ICONST.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ICONST.java index e7668d186f4..41345d82864 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ICONST.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ICONST.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -50,7 +49,7 @@ public class ICONST extends Instruction value = i; } - public Number getValue() { return new Integer(value); } + public Number getValue() { return Integer.valueOf(value); } /** @return Type.INT */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java index 889d6f8ca79..7b2753e2d68 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -23,7 +22,6 @@ package com.sun.org.apache.bcel.internal.generic; import com.sun.org.apache.bcel.internal.Constants; -import com.sun.org.apache.bcel.internal.classfile.Utility; import com.sun.org.apache.bcel.internal.classfile.ConstantPool; import java.io.*; import com.sun.org.apache.bcel.internal.util.ByteSequence; @@ -165,7 +163,7 @@ public abstract class Instruction implements Cloneable, Serializable { } try { - obj = (Instruction)clazz.newInstance(); + obj = (Instruction)clazz.getConstructor().newInstance(); if(wide && !((obj instanceof LocalVariableInstruction) || (obj instanceof IINC) || diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java index bc4420961ed..7deb0eceaa3 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -455,7 +454,7 @@ public class InstructionFactory Instruction i = null; try { - i = (Instruction)java.lang.Class.forName(name).newInstance(); + i = (Instruction)java.lang.Class.forName(name).getConstructor().newInstance(); } catch(Exception e) { throw new RuntimeException("Could not find instruction: " + name); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LCONST.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LCONST.java index a209eadb939..dcc2383877c 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LCONST.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LCONST.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -52,7 +51,7 @@ public class LCONST extends Instruction value = l; } - public Number getValue() { return new Long(value); } + public Number getValue() { return Long.valueOf(value); } /** @return Type.LONG */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC.java index 7dc55289e7b..80899e77d95 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -96,10 +95,10 @@ public class LDC extends CPInstruction return ((com.sun.org.apache.bcel.internal.classfile.ConstantUtf8)c).getBytes(); case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Float: - return new Float(((com.sun.org.apache.bcel.internal.classfile.ConstantFloat)c).getBytes()); + return Float.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantFloat)c).getBytes()); case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Integer: - return new Integer(((com.sun.org.apache.bcel.internal.classfile.ConstantInteger)c).getBytes()); + return Integer.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantInteger)c).getBytes()); default: // Never reached throw new RuntimeException("Unknown or invalid constant type at " + index); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC2_W.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC2_W.java index f06c2cf46b7..2279676c61a 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC2_W.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC2_W.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -55,10 +54,10 @@ public class LDC2_W extends CPInstruction switch(c.getTag()) { case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long: - return new Long(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes()); + return Long.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes()); case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double: - return new Double(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes()); + return Double.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes()); default: // Never reached throw new RuntimeException("Unknown or invalid constant type at " + index); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/SIPUSH.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/SIPUSH.java index b0413b6fd3f..74a30454bd2 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/SIPUSH.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/SIPUSH.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -69,7 +68,7 @@ public class SIPUSH extends Instruction implements ConstantPushInstruction { b = bytes.readShort(); } - public Number getValue() { return new Integer(b); } + public Number getValue() { return Integer.valueOf(b); } /** @return Type.SHORT */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SecuritySupport.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SecuritySupport.java index c33995983f7..3d8447e95b6 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SecuritySupport.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -172,7 +171,7 @@ public final class SecuritySupport { static long getLastModified(final File f) { return ((Long) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Long(f.lastModified()); + return f.lastModified(); } })).longValue(); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java index 25cf7249184..5f635837047 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -375,7 +374,7 @@ public class ExsltMath extends ExsltBase if (value != null) { - int bits = new Double(precision).intValue(); + int bits = (int)precision; if (bits <= value.length()) value = value.substring(0, bits); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java index e858ac47b63..d09fd523c61 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -124,7 +123,7 @@ public class ObjectFactory { ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader(); try{ Class providerClass = findProviderClass(className, cl, doFallback); - Object instance = providerClass.newInstance(); + Object instance = providerClass.getConstructor().newInstance(); debugPrintln(()->"created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java index d1ad28ac9c1..8f24f3888fb 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -177,7 +176,7 @@ public final class SecuritySupport { static long getLastModified(final File f) { return ((Long) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Long(f.lastModified()); + return f.lastModified(); } })).longValue(); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java index 2fb0b470db2..85e9764f99e 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.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. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -1005,7 +1005,7 @@ public class Parser implements Constants, ContentHandler { if (className != null) { try { final Class clazz = ObjectFactory.findProviderClass(className, true); - node = (SyntaxTreeNode)clazz.newInstance(); + node = (SyntaxTreeNode)clazz.getDeclaredConstructor().newInstance(); node.setQName(qname); node.setParser(this); if (_locator != null) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java index c5dc46865d3..623b3f81417 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -875,7 +874,7 @@ return newSymbol(sym.EOF); case -21: break; case 21: - { return newSymbol(sym.INT, new Long(yytext())); } + { return newSymbol(sym.INT, Long.valueOf(yytext())); } case -22: break; case 22: @@ -903,7 +902,7 @@ return newSymbol(sym.EOF); case -28: break; case 28: - { return newSymbol(sym.REAL, new Double(yytext())); } + { return newSymbol(sym.REAL, Double.valueOf(yytext())); } case -29: break; case 29: @@ -929,7 +928,7 @@ return newSymbol(sym.EOF); case -34: break; case 34: - { return newSymbol(sym.REAL, new Double(yytext())); } + { return newSymbol(sym.REAL, Double.valueOf(yytext())); } case -35: break; case 35: @@ -1057,11 +1056,11 @@ return newSymbol(sym.EOF); case -66: break; case 67: - { return newSymbol(sym.INT, new Long(yytext())); } + { return newSymbol(sym.INT, Long.valueOf(yytext())); } case -67: break; case 68: - { return newSymbol(sym.REAL, new Double(yytext())); } + { return newSymbol(sym.REAL, Double.valueOf(yytext())); } case -68: break; case 70: diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java index fbc5a603afc..93659b8e582 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -1342,7 +1342,7 @@ class CUP$XPathParser$actions { case 120: // NodeTest ::= PI { Object RESULT = null; - RESULT = new Integer(NodeTest.PI); + RESULT = Integer.valueOf(NodeTest.PI); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1371,7 +1371,7 @@ class CUP$XPathParser$actions { case 118: // NodeTest ::= COMMENT { Object RESULT = null; - RESULT = new Integer(NodeTest.COMMENT); + RESULT = Integer.valueOf(NodeTest.COMMENT); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1380,7 +1380,7 @@ class CUP$XPathParser$actions { case 117: // NodeTest ::= TEXT { Object RESULT = null; - RESULT = new Integer(NodeTest.TEXT); + RESULT = Integer.valueOf(NodeTest.TEXT); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1389,7 +1389,7 @@ class CUP$XPathParser$actions { case 116: // NodeTest ::= NODE { Object RESULT = null; - RESULT = new Integer(NodeTest.ANODE); + RESULT = Integer.valueOf(NodeTest.ANODE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1815,7 +1815,7 @@ class CUP$XPathParser$actions { case 96: // AxisName ::= SELF { Integer RESULT = null; - RESULT = new Integer(Axis.SELF); + RESULT = Integer.valueOf(Axis.SELF); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1824,7 +1824,7 @@ class CUP$XPathParser$actions { case 95: // AxisName ::= PRECEDINGSIBLING { Integer RESULT = null; - RESULT = new Integer(Axis.PRECEDINGSIBLING); + RESULT = Integer.valueOf(Axis.PRECEDINGSIBLING); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1833,7 +1833,7 @@ class CUP$XPathParser$actions { case 94: // AxisName ::= PRECEDING { Integer RESULT = null; - RESULT = new Integer(Axis.PRECEDING); + RESULT = Integer.valueOf(Axis.PRECEDING); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1842,7 +1842,7 @@ class CUP$XPathParser$actions { case 93: // AxisName ::= PARENT { Integer RESULT = null; - RESULT = new Integer(Axis.PARENT); + RESULT = Integer.valueOf(Axis.PARENT); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1851,7 +1851,7 @@ class CUP$XPathParser$actions { case 92: // AxisName ::= NAMESPACE { Integer RESULT = null; - RESULT = new Integer(Axis.NAMESPACE); + RESULT = Integer.valueOf(Axis.NAMESPACE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1860,7 +1860,7 @@ class CUP$XPathParser$actions { case 91: // AxisName ::= FOLLOWINGSIBLING { Integer RESULT = null; - RESULT = new Integer(Axis.FOLLOWINGSIBLING); + RESULT = Integer.valueOf(Axis.FOLLOWINGSIBLING); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1869,7 +1869,7 @@ class CUP$XPathParser$actions { case 90: // AxisName ::= FOLLOWING { Integer RESULT = null; - RESULT = new Integer(Axis.FOLLOWING); + RESULT = Integer.valueOf(Axis.FOLLOWING); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1878,7 +1878,7 @@ class CUP$XPathParser$actions { case 89: // AxisName ::= DESCENDANTORSELF { Integer RESULT = null; - RESULT = new Integer(Axis.DESCENDANTORSELF); + RESULT = Integer.valueOf(Axis.DESCENDANTORSELF); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1887,7 +1887,7 @@ class CUP$XPathParser$actions { case 88: // AxisName ::= DESCENDANT { Integer RESULT = null; - RESULT = new Integer(Axis.DESCENDANT); + RESULT = Integer.valueOf(Axis.DESCENDANT); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1896,7 +1896,7 @@ class CUP$XPathParser$actions { case 87: // AxisName ::= CHILD { Integer RESULT = null; - RESULT = new Integer(Axis.CHILD); + RESULT = Integer.valueOf(Axis.CHILD); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1905,7 +1905,7 @@ class CUP$XPathParser$actions { case 86: // AxisName ::= ATTRIBUTE { Integer RESULT = null; - RESULT = new Integer(Axis.ATTRIBUTE); + RESULT = Integer.valueOf(Axis.ATTRIBUTE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1914,7 +1914,7 @@ class CUP$XPathParser$actions { case 85: // AxisName ::= ANCESTORORSELF { Integer RESULT = null; - RESULT = new Integer(Axis.ANCESTORORSELF); + RESULT = Integer.valueOf(Axis.ANCESTORORSELF); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1923,7 +1923,7 @@ class CUP$XPathParser$actions { case 84: // AxisName ::= ANCESTOR { Integer RESULT = null; - RESULT = new Integer(Axis.ANCESTOR); + RESULT = Integer.valueOf(Axis.ANCESTOR); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -1932,7 +1932,7 @@ class CUP$XPathParser$actions { case 83: // AxisSpecifier ::= ATSIGN { Integer RESULT = null; - RESULT = new Integer(Axis.ATTRIBUTE); + RESULT = Integer.valueOf(Axis.ATTRIBUTE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(41/*AxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2697,7 +2697,7 @@ class CUP$XPathParser$actions { case 35: // ChildOrAttributeAxisSpecifier ::= ATTRIBUTE DCOLON { Integer RESULT = null; - RESULT = new Integer(Axis.ATTRIBUTE); + RESULT = Integer.valueOf(Axis.ATTRIBUTE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2706,7 +2706,7 @@ class CUP$XPathParser$actions { case 34: // ChildOrAttributeAxisSpecifier ::= CHILD DCOLON { Integer RESULT = null; - RESULT = new Integer(Axis.CHILD); + RESULT = Integer.valueOf(Axis.CHILD); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2715,7 +2715,7 @@ class CUP$XPathParser$actions { case 33: // ChildOrAttributeAxisSpecifier ::= ATSIGN { Integer RESULT = null; - RESULT = new Integer(Axis.ATTRIBUTE); + RESULT = Integer.valueOf(Axis.ATTRIBUTE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2745,7 +2745,7 @@ class CUP$XPathParser$actions { case 30: // NodeTestPattern ::= PI { Object RESULT = null; - RESULT = new Integer(NodeTest.PI); + RESULT = Integer.valueOf(NodeTest.PI); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2754,7 +2754,7 @@ class CUP$XPathParser$actions { case 29: // NodeTestPattern ::= COMMENT { Object RESULT = null; - RESULT = new Integer(NodeTest.COMMENT); + RESULT = Integer.valueOf(NodeTest.COMMENT); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2763,7 +2763,7 @@ class CUP$XPathParser$actions { case 28: // NodeTestPattern ::= TEXT { Object RESULT = null; - RESULT = new Integer(NodeTest.TEXT); + RESULT = Integer.valueOf(NodeTest.TEXT); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; @@ -2772,7 +2772,7 @@ class CUP$XPathParser$actions { case 27: // NodeTestPattern ::= NODE { Object RESULT = null; - RESULT = new Integer(NodeTest.ANODE); + RESULT = Integer.valueOf(NodeTest.ANODE); CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); } return CUP$XPathParser$result; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java index e8f80a2c502..25f5a495ff8 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -342,7 +342,7 @@ public final class XSLTC { _elements = new HashMap<>(); _attributes = new HashMap<>(); _namespaces = new HashMap<>(); - _namespaces.put("",new Integer(_nextNSType)); + _namespaces.put("", _nextNSType); _namesIndex = new Vector(128); _namespaceIndex = new Vector(32); _namespacePrefixes = new HashMap<>(); @@ -852,7 +852,7 @@ public final class XSLTC { _namespaces.put(namespaceURI,code); _namespaceIndex.addElement(namespaceURI); } - return code.intValue(); + return code; } public int nextModeSerial() { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java index cb9124b0e18..e0e526427f4 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.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. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -35,7 +35,7 @@ import java.io.File; import java.io.PrintWriter; import java.net.URL; import java.net.URLConnection; -import java.net.URLDecoder; +import java.nio.file.Paths; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -199,7 +199,7 @@ public final class DocumentCache implements DOMCache { // Check for a "file:" URI (courtesy of Brian Ewins) if (timestamp == 0){ // get 0 for local URI if ("file".equals(url.getProtocol())){ - File localfile = new File(URLDecoder.decode(url.getFile())); + File localfile = Paths.get(url.toURI()).toFile(); timestamp = localfile.lastModified(); } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java index 47acd8a9482..fd39e5218ae 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java @@ -94,7 +94,7 @@ public class KeyIndex extends DTMAxisIteratorBase { if (_currentDocumentNode != rootNode) { _currentDocumentNode = rootNode; _index = new HashMap<>(); - _rootToIndexMap.put(new Integer(rootNode), _index); + _rootToIndexMap.put(rootNode, _index); } IntegerArray nodes = _index.get(value); @@ -178,7 +178,7 @@ public class KeyIndex extends DTMAxisIteratorBase { int ident = _enhancedDOM.getElementById(id); if (ident != DTM.NULL) { - Integer root = new Integer(_enhancedDOM.getDocument()); + Integer root = _enhancedDOM.getDocument(); Map index = _rootToIndexMap.get(root); if (index == null) { @@ -247,7 +247,7 @@ public class KeyIndex extends DTMAxisIteratorBase { // Get the mapping table for the document containing the context node Map index = - _rootToIndexMap.get(new Integer(rootHandle)); + _rootToIndexMap.get(rootHandle); // Split argument to id function into XML whitespace separated tokens final StringTokenizer values = new StringTokenizer(string, " \n\t"); @@ -298,7 +298,7 @@ public class KeyIndex extends DTMAxisIteratorBase { // Get the mapping table for the document containing the context node Map index = - _rootToIndexMap.get(new Integer(rootHandle)); + _rootToIndexMap.get(rootHandle); // Check whether the context node is present in the set of nodes // returned by the key function @@ -701,7 +701,7 @@ public class KeyIndex extends DTMAxisIteratorBase { IntegerArray result = null; // Get mapping from key values/IDs to DTM nodes for this document - Map index = _rootToIndexMap.get(new Integer(root)); + Map index = _rootToIndexMap.get(root); if (!_isKeyIterator) { // For id function, tokenize argument as whitespace separated diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java index 45920a15409..4b2eb9d1e8a 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java @@ -187,11 +187,11 @@ public abstract class NodeSortRecord { translet, _last); Double num; try { - num = new Double(str); + num = Double.parseDouble(str); } // Treat number as NaN if it cannot be parsed as a double catch (NumberFormatException e) { - num = new Double(Double.NEGATIVE_INFINITY); + num = Double.NEGATIVE_INFINITY; } _values[_scanned++] = num; return(num); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java index 6ba882d8ad5..b55d555181e 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java @@ -26,6 +26,7 @@ import com.sun.org.apache.xalan.internal.xsltc.TransletException; import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; import com.sun.org.apache.xml.internal.utils.LocaleUtility; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import java.lang.reflect.InvocationTargetException; import java.util.Locale; import java.text.Collator; @@ -148,10 +149,17 @@ public class NodeSortRecordFactory { SecurityException, TransletException { - final NodeSortRecord sortRecord = - (NodeSortRecord)_class.newInstance(); - sortRecord.initialize(node, last, _dom, _sortSettings); - return sortRecord; + try { + final NodeSortRecord sortRecord; + //NodeSortRecord subclasses are generated with a public empty constructor + // refer to com.sun.org.apache.xalan.internal.xsltc.compiler.Sort::compileInit + sortRecord = (NodeSortRecord)_class.getConstructor().newInstance(); + sortRecord.initialize(node, last, _dom, _sortSettings); + return sortRecord; + } catch (NoSuchMethodException | IllegalArgumentException | + InvocationTargetException ex) { + throw new InstantiationException(ex.getMessage()); + } } public String getClassName() { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java index 9a8bc34892a..a78e1f8458b 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.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. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -471,7 +471,7 @@ public final class SAXImpl extends SAX2DTM2 return 0; } int eType = getIdForNamespace(s); - return _nsIndex.get(new Integer(eType)); + return _nsIndex.get(eType); } @@ -672,7 +672,7 @@ public final class SAXImpl extends SAX2DTM2 for (i=0; i convert node to boolean if (left instanceof Node || right instanceof Node) { if (left instanceof Boolean) { - right = new Boolean(booleanF(right)); + right = booleanF(right); hasSimpleArgs = true; } if (right instanceof Boolean) { - left = new Boolean(booleanF(left)); + left = booleanF(left); hasSimpleArgs = true; } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java index bdbdca9137e..83a09a6e19f 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java @@ -43,6 +43,7 @@ import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; import java.lang.module.ModuleReference; import java.lang.module.ModuleReader; +import java.lang.reflect.InvocationTargetException; import java.security.AccessController; import java.security.CodeSigner; import java.security.CodeSource; @@ -549,7 +550,8 @@ public final class TemplatesImpl implements Templates, Serializable { // The translet needs to keep a reference to all its auxiliary // class to prevent the GC from collecting them - AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance(); + AbstractTranslet translet = (AbstractTranslet) + _class[_transletIndex].getConstructor().newInstance(); translet.postInitialization(); translet.setTemplates(this); translet.setServicesMechnism(_useServicesMechanism); @@ -560,13 +562,10 @@ public final class TemplatesImpl implements Templates, Serializable { return translet; } - catch (InstantiationException e) { + catch (InstantiationException | IllegalAccessException | + NoSuchMethodException | InvocationTargetException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); - throw new TransformerConfigurationException(err.toString()); - } - catch (IllegalAccessException e) { - ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); - throw new TransformerConfigurationException(err.toString()); + throw new TransformerConfigurationException(err.toString(), e); } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java index 77e68d43010..e34ae9f963c 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -49,6 +48,7 @@ import org.xml.sax.helpers.XMLReaderFactory; * @author Santiago Pericas-Geertsen * @author G. Todd Miller */ +@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory public class TrAXFilter extends XMLFilterImpl { private Templates _templates; private TransformerImpl _transformer; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java index a6f89185efd..207a88ef0c3 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -55,6 +55,7 @@ import org.xml.sax.helpers.XMLReaderFactory; * * Added Catalog Support for URI resolution */ +@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory public final class Util { public static String baseName(String name) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java index 53a32642b8e..b3c6a360fd8 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -25,9 +24,7 @@ import com.sun.org.apache.xerces.internal.parsers.DOMParserImpl; import com.sun.org.apache.xerces.internal.parsers.DTDConfiguration; import com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration; import com.sun.org.apache.xerces.internal.util.XMLChar; -import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; -import com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl; import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; @@ -345,13 +342,7 @@ public class CoreDOMImplementationImpl * reference to the default error handler. */ public LSSerializer createLSSerializer() { - try { - return new com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl(); - } - catch (Exception e) {} - // Fall back to Xerces' deprecated serializer if - // the Xalan based serializer is unavailable. - return new DOMSerializerImpl(); + return new com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl(); } /** diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java index 2d446c3fb41..9dcfde4d003 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java @@ -1473,12 +1473,12 @@ public class CoreDocumentImpl if (nodeTable == null) { nodeTable = new HashMap<>(); num = --nodeCounter; - nodeTable.put(node, new Integer(num)); + nodeTable.put(node, num); } else { Integer n = (Integer) nodeTable.get(node); if (n == null) { num = --nodeCounter; - nodeTable.put(node, new Integer(num)); + nodeTable.put(node, num); } else { num = n.intValue(); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java index 2b1b8000081..7db04887485 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -1831,7 +1830,7 @@ public class DOMNormalizer implements XMLDocumentHandler { // flag to "true" which may overwrite a "false" // value from the attribute list. boolean specified = attr.getSpecified(); - attr.setValue(attrPSVI.getSchemaNormalizedValue()); + attr.setValue(attrPSVI.getSchemaValue().getNormalizedValue()); if (!specified) { ((AttrImpl) attr).setSpecified(specified); } @@ -1972,7 +1971,7 @@ public class DOMNormalizer implements XMLDocumentHandler { ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI); } // include element default content (if one is available) - String normalizedValue = elementPSVI.getSchemaNormalizedValue(); + String normalizedValue = elementPSVI.getSchemaValue().getNormalizedValue(); if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) { if (normalizedValue !=null) elementNode.setTextContent(normalizedValue); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java index ba60cd788f4..791cb1f8e8e 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -472,42 +472,6 @@ public class DeferredDocumentImpl return attrNodeIndex; } - /** - * Sets an attribute on an element node. - * @deprecated - */ - @Deprecated - public int setDeferredAttribute(int elementNodeIndex, - String attrName, String attrURI, - String attrValue, boolean specified) { - // create attribute - int attrNodeIndex = createDeferredAttribute(attrName, attrURI, - attrValue, specified); - int attrChunk = attrNodeIndex >> CHUNK_SHIFT; - int attrIndex = attrNodeIndex & CHUNK_MASK; - // set attribute's parent to element - setChunkIndex(fNodeParent, elementNodeIndex, attrChunk, attrIndex); - - int elementChunk = elementNodeIndex >> CHUNK_SHIFT; - int elementIndex = elementNodeIndex & CHUNK_MASK; - - // get element's last attribute - int lastAttrNodeIndex = getChunkIndex(fNodeExtra, - elementChunk, elementIndex); - if (lastAttrNodeIndex != 0) { - // add link from new attribute to last attribute - setChunkIndex(fNodePrevSib, lastAttrNodeIndex, - attrChunk, attrIndex); - } - // add link from element to new last attribute - setChunkIndex(fNodeExtra, attrNodeIndex, - elementChunk, elementIndex); - - // return node index - return attrNodeIndex; - - } // setDeferredAttribute(int,String,String,String,boolean):int - /** Creates an attribute in the table. */ public int createDeferredAttribute(String attrName, String attrValue, boolean specified) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java index 593959ac287..8b4ffaca0f8 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java @@ -1,3 +1,6 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -108,6 +111,7 @@ public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI { * @return The canonical lexical representation of the declaration's {value constraint} value. * @see XML Schema Part 1: Structures [schema default] */ + @SuppressWarnings("deprecation") public String getSchemaDefault() { return fDeclaration == null ? null : fDeclaration.getConstraintValue(); } @@ -130,6 +134,7 @@ public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI { * @see = 0 && index < data.length) { - return new Byte(data[index]); + return data[index]; } throw new IndexOutOfBoundsException("Index: " + index); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java index fdbf305c47a..847156369c2 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -129,6 +128,7 @@ public class AttributePSVImpl implements AttributePSVI { * @return The canonical lexical representation of the declaration's {value constraint} value. * @see XML Schema Part 1: Structures [schema default] */ + @SuppressWarnings("deprecation") public String getSchemaDefault() { return fDeclaration == null ? null : fDeclaration.getConstraintValue(); } @@ -165,6 +165,7 @@ public class ElementPSVImpl implements ElementPSVI { * @see maxOccurNodeLimit && !fSchemaHandler.fSecurityManager.isNoLimit(maxOccurNodeLimit)) { - reportSchemaFatalError("MaxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element); + reportSchemaFatalError("MaxOccurLimit", new Object[] {maxOccurNodeLimit}, element); // reset max values in case processing continues on error attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java index 0c7d663363f..7e8f96e3499 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -1214,8 +1213,8 @@ class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser { fGlobalStore[fGlobalStorePos++] = fName ; fGlobalStore[fGlobalStorePos++] = fTargetNamespace; // let's save ourselves a couple of objects... - fGlobalStore[fGlobalStorePos++] = new Integer((fDerivedBy << 16) + fFinal); - fGlobalStore[fGlobalStorePos++] = new Integer((fBlock << 16) + fContentType); + fGlobalStore[fGlobalStorePos++] = (fDerivedBy << 16) + fFinal; + fGlobalStore[fGlobalStorePos++] = (fBlock << 16) + fContentType; fGlobalStore[fGlobalStorePos++] = fBaseType; fGlobalStore[fGlobalStorePos++] = fAttrGrp; fGlobalStore[fGlobalStorePos++] = fParticle; @@ -1229,15 +1228,15 @@ class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser { fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos]; fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos]; fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos]; - int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue(); + int i = ((Integer)(fGlobalStore[--fGlobalStorePos])); fBlock = (short)(i >> 16); fContentType = (short)i; - i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue(); + i = ((Integer)(fGlobalStore[--fGlobalStorePos])); fDerivedBy = (short)(i >> 16); fFinal = (short)i; fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos]; fName = (String)fGlobalStore[--fGlobalStorePos]; - fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue(); + fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]); fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos]; } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java index e6e3c64676f..107ae2d94a3 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -131,6 +131,7 @@ import org.xml.sax.helpers.XMLReaderFactory; * @author Pavani Mukthipudi, Sun Microsystems * */ +@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory public class XSDHandler { /** Feature identifier: validation. */ diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java index 0491444b6d3..8cb83982a50 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -112,7 +111,7 @@ public final class ShortListImpl extends AbstractList implements ShortList { public Object get(int index) { if (index >= 0 && index < fLength) { - return new Short(fArray[index]); + return fArray[index]; } throw new IndexOutOfBoundsException("Index: " + index); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java index 0ec3ac72fff..56036bedb8a 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -63,6 +63,7 @@ import org.xml.sax.helpers.DefaultHandler; * @author Edwin Goei * */ +@SuppressWarnings("deprecation") public class SAXParserImpl extends javax.xml.parsers.SAXParser implements JAXPConstants, PSVIProvider { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java index 0b96a733cff..c26728a806b 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -27,6 +26,7 @@ import java.io.ObjectStreamException; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; +import java.math.RoundingMode; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -1399,7 +1399,7 @@ class DurationImpl BigDecimal bd = getFieldAsBigDecimal(FIELDS[i]); bd = bd.multiply(factor).add(carry); - buf[i] = bd.setScale(0, BigDecimal.ROUND_DOWN); + buf[i] = bd.setScale(0, RoundingMode.DOWN); bd = bd.subtract(buf[i]); if (i == 1) { @@ -1607,7 +1607,7 @@ class DurationImpl BigDecimal borrow = buf[i].abs().divide( FACTORS[i - 1], - BigDecimal.ROUND_UP); + RoundingMode.UP); if (buf[i].signum() > 0) { borrow = borrow.negate(); } @@ -1796,7 +1796,7 @@ class DurationImpl if (seconds != null) { BigDecimal fraction = - seconds.subtract(seconds.setScale(0, BigDecimal.ROUND_DOWN)); + seconds.subtract(seconds.setScale(0, RoundingMode.DOWN)); int millisec = fraction.movePointRight(3).intValue(); calendar.add(Calendar.MILLISECOND, millisec * signum); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java index 9026a6f5f61..2dd0ba80321 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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,23 +25,23 @@ package com.sun.org.apache.xerces.internal.jaxp.datatype; +import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; -import java.util.TimeZone; +import java.math.RoundingMode; import java.util.Calendar; -import java.util.GregorianCalendar; import java.util.Date; +import java.util.GregorianCalendar; import java.util.Locale; - +import java.util.TimeZone; import javax.xml.datatype.DatatypeConstants; import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; -import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter; -import com.sun.org.apache.xerces.internal.utils.SecuritySupport; /** *

    Representation for W3C XML Schema 1.0 date/time datatypes. @@ -379,7 +379,7 @@ public class XMLGregorianCalendarImpl throws IllegalArgumentException { // compute format string for this lexical representation. - String format = null; + String format; String lexRep = lexicalRepresentation; final int NOT_FOUND = -1; int lexRepLength = lexRep.length(); @@ -525,34 +525,10 @@ public class XMLGregorianCalendarImpl throw new IllegalArgumentException( DatatypeMessageFormatter.formatMessage(null, "InvalidXGCValue-fractional", - new Object[] { year, new Integer(month), new Integer(day), - new Integer(hour), new Integer(minute), new Integer(second), - fractionalSecond, new Integer(timezone)}) + new Object[] { year, month, day, + hour, minute, second, + fractionalSecond, timezone}) ); - - /** - String yearString = "null"; - if (year != null) { - yearString = year.toString(); - } - String fractionalSecondString = "null"; - if (fractionalSecond != null) { - fractionalSecondString = fractionalSecond.toString(); - } - - throw new IllegalArgumentException( - "year = " + yearString - + ", month = " + month - + ", day = " + day - + ", hour = " + hour - + ", minute = " + minute - + ", second = " + second - + ", fractionalSecond = " + fractionalSecondString - + ", timezone = " + timezone - + ", is not a valid representation of an XML Gregorian Calendar value." - ); - */ - } save(); @@ -601,24 +577,10 @@ public class XMLGregorianCalendarImpl throw new IllegalArgumentException( DatatypeMessageFormatter.formatMessage(null, "InvalidXGCValue-milli", - new Object[] { new Integer(year), new Integer(month), new Integer(day), - new Integer(hour), new Integer(minute), new Integer(second), - new Integer(millisecond), new Integer(timezone)}) + new Object[] { year, month, day, + hour, minute, second, + millisecond, timezone}) ); - /* - throw new IllegalArgumentException( - "year = " + year - + ", month = " + month - + ", day = " + day - + ", hour = " + hour - + ", minute = " + minute - + ", second = " + second - + ", millisecond = " + millisecond - + ", timezone = " + timezone - + ", is not a valid representation of an XML Gregorian Calendar value." - ); - */ - } save(); @@ -683,11 +645,11 @@ public class XMLGregorianCalendarImpl */ public XMLGregorianCalendarImpl(GregorianCalendar cal) { - int year = cal.get(Calendar.YEAR); + int year1 = cal.get(Calendar.YEAR); if (cal.get(Calendar.ERA) == GregorianCalendar.BC) { - year = -year; + year1 = -year1; } - this.setYear(year); + this.setYear(year1); // Calendar.MONTH is zero based, XSD Date datatype's month field starts // with JANUARY as 1. @@ -1201,7 +1163,7 @@ public class XMLGregorianCalendarImpl * outside value constraints for the field as specified in * date/time field mapping table. */ - public void setYear(BigInteger year) { + public final void setYear(BigInteger year) { if (year == null) { this.eon = null; this.year = DatatypeConstants.FIELD_UNDEFINED; @@ -1225,7 +1187,7 @@ public class XMLGregorianCalendarImpl * @param year value constraints are summarized in year field of date/time field mapping table. * If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to null. */ - public void setYear(int year) { + public final void setYear(int year) { if (year == DatatypeConstants.FIELD_UNDEFINED) { this.year = DatatypeConstants.FIELD_UNDEFINED; this.eon = null; @@ -1269,7 +1231,7 @@ public class XMLGregorianCalendarImpl * outside value constraints for the field as specified in * date/time field mapping table. */ - public void setMonth(int month) { + public final void setMonth(int month) { if(monthdate/time field mapping table. */ - public void setDay(int day) { + public final void setDay(int day) { if(day<1 || 31date/time field mapping table. */ - public void setTimezone(int offset) { + public final void setTimezone(int offset) { if(offset<-14*60 || 14*60date/time field mapping table. */ - public void setTime(int hour, int minute, int second) { + public final void setTime(int hour, int minute, int second) { setTime(hour, minute, second, null); } private void invalidFieldValue(int field, int value) { throw new IllegalArgumentException( DatatypeMessageFormatter.formatMessage(null, "InvalidFieldValue", - new Object[]{ new Integer(value), FIELD_NAME[field]}) + new Object[]{ value, FIELD_NAME[field]}) ); } @@ -1406,7 +1368,7 @@ public class XMLGregorianCalendarImpl * outside value constraints for the field as specified in * date/time field mapping table. */ - public void setTime( + public final void setTime( int hour, int minute, int second, @@ -1446,7 +1408,7 @@ public class XMLGregorianCalendarImpl * outside value constraints for the field as specified in * date/time field mapping table. */ - public void setTime(int hour, int minute, int second, int millisecond) { + public final void setTime(int hour, int minute, int second, int millisecond) { setHour(hour, false); @@ -1990,7 +1952,7 @@ public class XMLGregorianCalendarImpl * Validate instance by getXMLSchemaType() constraints. * @return true if data values are valid. */ - public boolean isValid() { + public final boolean isValid() { // since setters do not allow for invalid values, // (except for exceptional case of year field of zero), // no need to check for anything except for constraints @@ -2091,7 +2053,8 @@ public class XMLGregorianCalendarImpl BigInteger temp = BigInteger.valueOf((long) startMonth).add(dMonths); setMonth(temp.subtract(BigInteger.ONE).mod(TWELVE).intValue() + 1); BigInteger carry = - new BigDecimal(temp.subtract(BigInteger.ONE)).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_FLOOR).toBigInteger(); + new BigDecimal(temp.subtract(BigInteger.ONE)) + .divide(DECIMAL_TWELVE, RoundingMode.FLOOR).toBigInteger(); /* Years (may be modified additionally below) * E[year] := S[year] + D[year] + carry @@ -2129,7 +2092,7 @@ public class XMLGregorianCalendarImpl BigDecimal dSeconds = DurationImpl.sanitize((BigDecimal) duration.getField(DatatypeConstants.SECONDS), signum); BigDecimal tempBD = startSeconds.add(dSeconds); BigDecimal fQuotient = - new BigDecimal(new BigDecimal(tempBD.toBigInteger()).divide(DECIMAL_SIXTY, BigDecimal.ROUND_FLOOR).toBigInteger()); + new BigDecimal(new BigDecimal(tempBD.toBigInteger()).divide(DECIMAL_SIXTY, RoundingMode.FLOOR).toBigInteger()); BigDecimal endSeconds = tempBD.subtract(fQuotient.multiply(DECIMAL_SIXTY)); carry = fQuotient.toBigInteger(); @@ -2161,7 +2124,7 @@ public class XMLGregorianCalendarImpl temp = BigInteger.valueOf(startMinutes).add(dMinutes).add(carry); setMinute(temp.mod(SIXTY).intValue()); - carry = new BigDecimal(temp).divide(DECIMAL_SIXTY, BigDecimal.ROUND_FLOOR).toBigInteger(); + carry = new BigDecimal(temp).divide(DECIMAL_SIXTY, RoundingMode.FLOOR).toBigInteger(); /* Hours * temp := S[hour] + D[hour] + carry @@ -2177,7 +2140,8 @@ public class XMLGregorianCalendarImpl temp = BigInteger.valueOf(startHours).add(dHours).add(carry); setHour(temp.mod(TWENTY_FOUR).intValue(), false); - carry = new BigDecimal(temp).divide(new BigDecimal(TWENTY_FOUR), BigDecimal.ROUND_FLOOR).toBigInteger(); + carry = new BigDecimal(temp).divide(DECIMAL_TWENTY_FOUR, + RoundingMode.FLOOR).toBigInteger(); /* Days * if S[day] > maximumDayInMonthFor(E[year], E[month]) @@ -2225,15 +2189,19 @@ public class XMLGregorianCalendarImpl // calculate days in previous month, watch for month roll over BigInteger mdimf = null; if (month >= 2) { - mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), getMonth() - 1)); + mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), + getMonth() - 1)); } else { // roll over to December of previous year - mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear().subtract(BigInteger.valueOf((long) 1)), 12)); + mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear() + .subtract(BigInteger.ONE), 12)); } endDays = endDays.add(mdimf); monthCarry = -1; - } else if (endDays.compareTo(BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), getMonth()))) > 0) { - endDays = endDays.add(BigInteger.valueOf(-maximumDayInMonthFor(getEonAndYear(), getMonth()))); + } else if (endDays.compareTo(BigInteger.valueOf( + maximumDayInMonthFor(getEonAndYear(), getMonth()))) > 0) { + endDays = endDays.add(BigInteger.valueOf( + -maximumDayInMonthFor(getEonAndYear(), getMonth()))); monthCarry = 1; } else { break; @@ -2244,7 +2212,8 @@ public class XMLGregorianCalendarImpl int quotient; if (endMonth < 0) { endMonth = (13 - 1) + endMonth + 1; - quotient = BigDecimal.valueOf(intTemp - 1).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_UP).intValue(); + quotient = BigDecimal.valueOf(intTemp - 1) + .divide(DECIMAL_TWELVE, RoundingMode.UP).intValue(); } else { quotient = (intTemp - 1) / (13 - 1); endMonth += 1; @@ -2292,6 +2261,8 @@ public class XMLGregorianCalendarImpl private static final BigInteger TWELVE = BigInteger.valueOf(12); private static final BigDecimal DECIMAL_ZERO = BigDecimal.valueOf(0); private static final BigDecimal DECIMAL_ONE = BigDecimal.valueOf(1); + private static final BigDecimal DECIMAL_TWELVE = BigDecimal.valueOf(12); + private static final BigDecimal DECIMAL_TWENTY_FOUR = BigDecimal.valueOf(24); private static final BigDecimal DECIMAL_SIXTY = BigDecimal.valueOf(60); @@ -2779,7 +2750,7 @@ public class XMLGregorianCalendarImpl } } - public void setFractionalSecond(BigDecimal fractional) { + public final void setFractionalSecond(BigDecimal fractional) { if (fractional != null) { if ((fractional.compareTo(DECIMAL_ZERO) < 0) || (fractional.compareTo(DECIMAL_ONE) > 0)) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java index 68c3acd3fbb..d1cff86d9a0 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -790,7 +789,7 @@ public class AbstractDOMParser extends AbstractXMLDocumentParser { // use specified document class try { Class documentClass = ObjectFactory.findProviderClass (fDocumentClassName, true); - fDocument = (Document)documentClass.newInstance (); + fDocument = (Document)documentClass.getConstructor().newInstance(); // if subclass of our own class that's cool too Class defaultDocClass = @@ -1750,7 +1749,9 @@ public class AbstractDOMParser extends AbstractXMLDocumentParser { "xml:base", "http://www.w3.org/XML/1998/namespace", baseURI, - true); + true, + false, + null); } } else if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java index ab289f875d8..07059d57e72 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -79,6 +78,7 @@ import org.xml.sax.helpers.LocatorImpl; * @author Andy Clark, IBM * */ +@SuppressWarnings("deprecation") public abstract class AbstractSAXParser extends AbstractXMLDocumentParser implements PSVIProvider, // PSVI diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AttributesProxy.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AttributesProxy.java index e3a7746d3ad..4d07fcae413 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AttributesProxy.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AttributesProxy.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -34,6 +33,7 @@ import org.xml.sax.ext.Attributes2; * @author Andy Clark, IBM * */ +@SuppressWarnings("deprecation") public final class AttributesProxy implements AttributeList, Attributes2 { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java index b8ee53ad3cc..a818978ca53 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -157,7 +156,7 @@ public final class ObjectFactory { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); - Object instance = providerClass.newInstance(); + Object instance = providerClass.getConstructor().newInstance(); debugPrintln(()->"created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java index ea00756d8d1..2b8fc9b582b 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -117,7 +116,7 @@ final class SecuritySupport { return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Boolean(f.exists()); + return f.exists(); } })).booleanValue(); } @@ -126,7 +125,7 @@ final class SecuritySupport { return ((Long) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Long(f.lastModified()); + return f.lastModified(); } })).longValue(); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java index 5efe85f9410..05c52ffaabd 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -1702,7 +1702,7 @@ public class XIncludeHandler if (fEntityResolver != null) fChildConfig.setProperty(ENTITY_RESOLVER, fEntityResolver); fChildConfig.setProperty(SECURITY_MANAGER, fSecurityManager); fChildConfig.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - fChildConfig.setProperty(BUFFER_SIZE, new Integer(fBufferSize)); + fChildConfig.setProperty(BUFFER_SIZE, fBufferSize); // features must be copied to child configuration fNeedCopyFeatures = true; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java index 33bf6b880e7..2322ee4ea04 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -536,9 +535,9 @@ final class ElementSchemePointer implements XPointerPart { private Tokens(SymbolTable symbolTable) { fSymbolTable = symbolTable; - fTokenNames.put(new Integer(XPTRTOKEN_ELEM_NCNAME), + fTokenNames.put(XPTRTOKEN_ELEM_NCNAME, "XPTRTOKEN_ELEM_NCNAME"); - fTokenNames.put(new Integer(XPTRTOKEN_ELEM_CHILD), + fTokenNames.put(XPTRTOKEN_ELEM_CHILD, "XPTRTOKEN_ELEM_CHILD"); } @@ -548,7 +547,7 @@ final class ElementSchemePointer implements XPointerPart { * @return String The token string */ private String getTokenString(int token) { - return fTokenNames.get(new Integer(token)); + return fTokenNames.get(token); } /** @@ -560,7 +559,7 @@ final class ElementSchemePointer implements XPointerPart { String str = fTokenNames.get(tokenStr); Integer tokenInt = str == null ? null : Integer.parseInt(str); if (tokenInt == null) { - tokenInt = new Integer(fTokenNames.size()); + tokenInt = fTokenNames.size(); fTokenNames.put(tokenInt, tokenStr); } addToken(tokenInt.intValue()); @@ -763,7 +762,7 @@ final class ElementSchemePointer implements XPointerPart { // An invalid child sequence character if (child == 0) { reportError("InvalidChildSequenceCharacter", - new Object[] { new Character((char) ch) }); + new Object[] { (char) ch }); return false; } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java index c068917e2d0..daaaad731b2 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -227,7 +226,7 @@ final class ShortHandPointer implements XPointerPart { // if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) { - return attrPSVI.getSchemaNormalizedValue(); + return attrPSVI.getSchemaValue().getNormalizedValue(); } // 4 & 5 NA diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java index e67ac7c3fb9..14ecbd6f990 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -249,8 +248,8 @@ public final class XPointerHandler extends XIncludeHandler implements if (openParenCount != closeParenCount) { reportError("UnbalancedParenthesisInXPointerExpression", new Object[] { xpointer, - new Integer(openParenCount), - new Integer(closeParenCount) }); + openParenCount, + closeParenCount }); } // Perform scheme specific parsing of the pointer part @@ -497,15 +496,15 @@ public final class XPointerHandler extends XIncludeHandler implements private Tokens(SymbolTable symbolTable) { fSymbolTable = symbolTable; - fTokenNames.put(new Integer(XPTRTOKEN_OPEN_PAREN), + fTokenNames.put(XPTRTOKEN_OPEN_PAREN, "XPTRTOKEN_OPEN_PAREN"); - fTokenNames.put(new Integer(XPTRTOKEN_CLOSE_PAREN), + fTokenNames.put(XPTRTOKEN_CLOSE_PAREN, "XPTRTOKEN_CLOSE_PAREN"); - fTokenNames.put(new Integer(XPTRTOKEN_SHORTHAND), + fTokenNames.put(XPTRTOKEN_SHORTHAND, "XPTRTOKEN_SHORTHAND"); - fTokenNames.put(new Integer(XPTRTOKEN_SCHEMENAME), + fTokenNames.put(XPTRTOKEN_SCHEMENAME, "XPTRTOKEN_SCHEMENAME"); - fTokenNames.put(new Integer(XPTRTOKEN_SCHEMEDATA), + fTokenNames.put(XPTRTOKEN_SCHEMEDATA, "XPTRTOKEN_SCHEMEDATA"); } @@ -515,7 +514,7 @@ public final class XPointerHandler extends XIncludeHandler implements * @return String The token string */ private String getTokenString(int token) { - return fTokenNames.get(new Integer(token)); + return fTokenNames.get(token); } /** @@ -527,7 +526,7 @@ public final class XPointerHandler extends XIncludeHandler implements String str = fTokenNames.get(tokenStr); Integer tokenInt = str == null ? null : Integer.parseInt(str); if (tokenInt == null) { - tokenInt = new Integer(fTokenNames.size()); + tokenInt = fTokenNames.size(); fTokenNames.put(tokenInt, tokenStr); } addToken(tokenInt.intValue()); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java index 205a4b320c2..5c29d629681 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -113,7 +112,7 @@ public class IncrementalSAXSource_Xerces Class xniStdConfigClass=ObjectFactory.findProviderClass( "com.sun.org.apache.xerces.internal.parsers.StandardParserConfiguration", true); - fPullParserConfig=xniStdConfigClass.newInstance(); + fPullParserConfig=xniStdConfigClass.getConstructor().newInstance(); Object[] args2={fPullParserConfig}; fIncrementalParser = (SAXParser)ctor.newInstance(args2); @@ -386,6 +385,7 @@ public class IncrementalSAXSource_Xerces /** Simple unit test. Attempt coroutine parsing of document indicated * by first argument (as a URI), report progress. */ + @Deprecated public static void _main(String args[]) { System.out.println("Starting..."); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java index f9294958150..5bd40e467af 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -117,7 +116,7 @@ final class SecuritySupport { return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Boolean(f.exists()); + return f.exists(); } })).booleanValue(); } @@ -126,7 +125,7 @@ final class SecuritySupport { return ((Long) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Long(f.lastModified()); + return f.lastModified(); } })).longValue(); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java index 86736b95489..de796fc5f22 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -205,7 +204,7 @@ public final class OutputPropertiesFactory private static final int S_XALAN_PREFIX_LEN = S_XALAN_PREFIX.length(); /** Synchronization object for lazy initialization of the above tables. */ - private static Integer m_synch_object = new Integer(1); + private static final Object m_synch_object = new Object(); /** the directory in which the various method property files are located */ private static final String PROP_DIR = "com/sun/org/apache/xml/internal/serializer/"; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java index 10d6d19ee31..058c0fe28ef 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -125,7 +124,7 @@ public final class SerializerFactory // _serializers.put(method, cls); - Object obj = cls.newInstance(); + Object obj = cls.getConstructor().newInstance(); if (obj instanceof SerializationHandler) { @@ -151,7 +150,7 @@ public final class SerializerFactory className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, true); SerializationHandler sh = - (SerializationHandler) cls.newInstance(); + (SerializationHandler) cls.getConstructor().newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java index 400741e330f..32b6b003af1 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.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. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -1170,7 +1170,7 @@ final class DOM3TreeWalker { } } // Reference to invalid character which is returned - refInvalidChar = new Character(ch); + refInvalidChar = ch; return false; } } @@ -1191,7 +1191,7 @@ final class DOM3TreeWalker { } } // Reference to invalid character which is returned - refInvalidChar = new Character(ch); + refInvalidChar = ch; return false; } } @@ -1233,7 +1233,7 @@ final class DOM3TreeWalker { } } // Reference to invalid character which is returned - refInvalidChar = new Character(ch); + refInvalidChar = ch; return refInvalidChar; } } @@ -1254,7 +1254,7 @@ final class DOM3TreeWalker { } } // Reference to invalid character which is returned - refInvalidChar = new Character(ch); + refInvalidChar = ch; return refInvalidChar; } } @@ -1296,7 +1296,7 @@ final class DOM3TreeWalker { String msg = Utils.messages.createMessage( MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, - new Object[] { new Character(c)}); + new Object[] { c}); if (fErrorHandler != null) { fErrorHandler.handleError( @@ -1345,7 +1345,7 @@ final class DOM3TreeWalker { String msg = Utils.messages.createMessage( MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, - new Object[] { new Character(c)}); + new Object[] { c}); if (fErrorHandler != null) { fErrorHandler.handleError( diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java index 5c24bb4afea..4f54f604cd9 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -26,6 +25,7 @@ import java.util.ArrayList; import com.sun.org.apache.xml.internal.res.XMLErrorResources; import com.sun.org.apache.xml.internal.res.XMLMessages; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import java.lang.reflect.InvocationTargetException; /** @@ -134,13 +134,14 @@ public class ObjectPool implements java.io.Serializable // Create a new object if so. try { - return objectType.newInstance(); + return objectType.getConstructor().newInstance(); } - catch (InstantiationException ex){} - catch (IllegalAccessException ex){} + catch (InstantiationException | IllegalAccessException | SecurityException | + IllegalArgumentException | InvocationTargetException | NoSuchMethodException ex){} // Throw unchecked exception for error in pool configuration. - throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null)); //"exception creating new instance for pool"); + throw new RuntimeException(XMLMessages.createXMLMessage( + XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null)); } else { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java index 4abd7716c34..0a96fed4c02 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -42,6 +41,7 @@ import org.xml.sax.helpers.XMLReaderFactory; * in this class should allow easy garbage collection of source * trees (not yet!), and should centralize parsing for those source trees. */ +@SuppressWarnings("deprecation") public class SourceTreeManager { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java index 82aa7da9413..8f01a3be1bb 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -1295,11 +1294,11 @@ public class XPathContext extends DTMManager // implements ExpressionContext m_DTMXRTreeFrags = new HashMap(); } - if(m_DTMXRTreeFrags.containsKey(new Integer(dtmIdentity))){ - return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(new Integer(dtmIdentity)); + if(m_DTMXRTreeFrags.containsKey(dtmIdentity)){ + return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(dtmIdentity); }else{ final DTMXRTreeFrag frag = new DTMXRTreeFrag(dtmIdentity,this); - m_DTMXRTreeFrags.put(new Integer(dtmIdentity),frag); + m_DTMXRTreeFrags.put(dtmIdentity,frag); return frag ; } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java index c70279642a6..d532b457576 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -36,6 +35,7 @@ import com.sun.org.apache.xpath.internal.operations.Plus; import com.sun.org.apache.xpath.internal.operations.Quo; import com.sun.org.apache.xpath.internal.operations.Variable; +@SuppressWarnings("deprecation") public class HasPositionalPredChecker extends XPathVisitor { private boolean m_hasPositionalPred = false; diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java index fe37af57234..df4507535f6 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.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. */ /** * Licensed to the Apache Software Foundation (ASF) under one @@ -19,12 +19,11 @@ * specific language governing permissions and limitations * under the License. */ -/* - * $Id: FunctionTable.java,v 1.3 2005/09/28 13:49:34 pvedula Exp $ - */ + package com.sun.org.apache.xpath.internal.compiler; import com.sun.org.apache.xpath.internal.functions.Function; +import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import javax.xml.transform.TransformerException; @@ -150,7 +149,7 @@ public class FunctionTable private static Class m_functions[]; /** Table of function name to function ID associations. */ - private static HashMap m_functionID = new HashMap(); + private static final HashMap m_functionID = new HashMap<>(); /** * The function table contains customized functions @@ -160,7 +159,7 @@ public class FunctionTable /** * Table of function name to function ID associations for customized functions */ - private HashMap m_functionID_customer = new HashMap(); + private HashMap m_functionID_customer = new HashMap<>(); /** * Number of built in functions. Be sure to update this as @@ -239,77 +238,77 @@ public class FunctionTable static{ m_functionID.put(Keywords.FUNC_CURRENT_STRING, - new Integer(FunctionTable.FUNC_CURRENT)); + FunctionTable.FUNC_CURRENT); m_functionID.put(Keywords.FUNC_LAST_STRING, - new Integer(FunctionTable.FUNC_LAST)); + FunctionTable.FUNC_LAST); m_functionID.put(Keywords.FUNC_POSITION_STRING, - new Integer(FunctionTable.FUNC_POSITION)); + FunctionTable.FUNC_POSITION); m_functionID.put(Keywords.FUNC_COUNT_STRING, - new Integer(FunctionTable.FUNC_COUNT)); + FunctionTable.FUNC_COUNT); m_functionID.put(Keywords.FUNC_ID_STRING, - new Integer(FunctionTable.FUNC_ID)); + FunctionTable.FUNC_ID); m_functionID.put(Keywords.FUNC_KEY_STRING, - new Integer(FunctionTable.FUNC_KEY)); + FunctionTable.FUNC_KEY); m_functionID.put(Keywords.FUNC_LOCAL_PART_STRING, - new Integer(FunctionTable.FUNC_LOCAL_PART)); + FunctionTable.FUNC_LOCAL_PART); m_functionID.put(Keywords.FUNC_NAMESPACE_STRING, - new Integer(FunctionTable.FUNC_NAMESPACE)); + FunctionTable.FUNC_NAMESPACE); m_functionID.put(Keywords.FUNC_NAME_STRING, - new Integer(FunctionTable.FUNC_QNAME)); + FunctionTable.FUNC_QNAME); m_functionID.put(Keywords.FUNC_GENERATE_ID_STRING, - new Integer(FunctionTable.FUNC_GENERATE_ID)); + FunctionTable.FUNC_GENERATE_ID); m_functionID.put(Keywords.FUNC_NOT_STRING, - new Integer(FunctionTable.FUNC_NOT)); + FunctionTable.FUNC_NOT); m_functionID.put(Keywords.FUNC_TRUE_STRING, - new Integer(FunctionTable.FUNC_TRUE)); + FunctionTable.FUNC_TRUE); m_functionID.put(Keywords.FUNC_FALSE_STRING, - new Integer(FunctionTable.FUNC_FALSE)); + FunctionTable.FUNC_FALSE); m_functionID.put(Keywords.FUNC_BOOLEAN_STRING, - new Integer(FunctionTable.FUNC_BOOLEAN)); + FunctionTable.FUNC_BOOLEAN); m_functionID.put(Keywords.FUNC_LANG_STRING, - new Integer(FunctionTable.FUNC_LANG)); + FunctionTable.FUNC_LANG); m_functionID.put(Keywords.FUNC_NUMBER_STRING, - new Integer(FunctionTable.FUNC_NUMBER)); + FunctionTable.FUNC_NUMBER); m_functionID.put(Keywords.FUNC_FLOOR_STRING, - new Integer(FunctionTable.FUNC_FLOOR)); + FunctionTable.FUNC_FLOOR); m_functionID.put(Keywords.FUNC_CEILING_STRING, - new Integer(FunctionTable.FUNC_CEILING)); + FunctionTable.FUNC_CEILING); m_functionID.put(Keywords.FUNC_ROUND_STRING, - new Integer(FunctionTable.FUNC_ROUND)); + FunctionTable.FUNC_ROUND); m_functionID.put(Keywords.FUNC_SUM_STRING, - new Integer(FunctionTable.FUNC_SUM)); + FunctionTable.FUNC_SUM); m_functionID.put(Keywords.FUNC_STRING_STRING, - new Integer(FunctionTable.FUNC_STRING)); + FunctionTable.FUNC_STRING); m_functionID.put(Keywords.FUNC_STARTS_WITH_STRING, - new Integer(FunctionTable.FUNC_STARTS_WITH)); + FunctionTable.FUNC_STARTS_WITH); m_functionID.put(Keywords.FUNC_CONTAINS_STRING, - new Integer(FunctionTable.FUNC_CONTAINS)); + FunctionTable.FUNC_CONTAINS); m_functionID.put(Keywords.FUNC_SUBSTRING_BEFORE_STRING, - new Integer(FunctionTable.FUNC_SUBSTRING_BEFORE)); + FunctionTable.FUNC_SUBSTRING_BEFORE); m_functionID.put(Keywords.FUNC_SUBSTRING_AFTER_STRING, - new Integer(FunctionTable.FUNC_SUBSTRING_AFTER)); + FunctionTable.FUNC_SUBSTRING_AFTER); m_functionID.put(Keywords.FUNC_NORMALIZE_SPACE_STRING, - new Integer(FunctionTable.FUNC_NORMALIZE_SPACE)); + FunctionTable.FUNC_NORMALIZE_SPACE); m_functionID.put(Keywords.FUNC_TRANSLATE_STRING, - new Integer(FunctionTable.FUNC_TRANSLATE)); + FunctionTable.FUNC_TRANSLATE); m_functionID.put(Keywords.FUNC_CONCAT_STRING, - new Integer(FunctionTable.FUNC_CONCAT)); + FunctionTable.FUNC_CONCAT); m_functionID.put(Keywords.FUNC_SYSTEM_PROPERTY_STRING, - new Integer(FunctionTable.FUNC_SYSTEM_PROPERTY)); + FunctionTable.FUNC_SYSTEM_PROPERTY); m_functionID.put(Keywords.FUNC_EXT_FUNCTION_AVAILABLE_STRING, - new Integer(FunctionTable.FUNC_EXT_FUNCTION_AVAILABLE)); + FunctionTable.FUNC_EXT_FUNCTION_AVAILABLE); m_functionID.put(Keywords.FUNC_EXT_ELEM_AVAILABLE_STRING, - new Integer(FunctionTable.FUNC_EXT_ELEM_AVAILABLE)); + FunctionTable.FUNC_EXT_ELEM_AVAILABLE); m_functionID.put(Keywords.FUNC_SUBSTRING_STRING, - new Integer(FunctionTable.FUNC_SUBSTRING)); + FunctionTable.FUNC_SUBSTRING); m_functionID.put(Keywords.FUNC_STRING_LENGTH_STRING, - new Integer(FunctionTable.FUNC_STRING_LENGTH)); + FunctionTable.FUNC_STRING_LENGTH); m_functionID.put(Keywords.FUNC_UNPARSED_ENTITY_URI_STRING, - new Integer(FunctionTable.FUNC_UNPARSED_ENTITY_URI)); + FunctionTable.FUNC_UNPARSED_ENTITY_URI); m_functionID.put(Keywords.FUNC_DOCLOCATION_STRING, - new Integer(FunctionTable.FUNC_DOCLOCATION)); + FunctionTable.FUNC_DOCLOCATION); m_functionID.put(Keywords.FUNC_HERE_STRING, - new Integer(FunctionTable.FUNC_HERE)); + FunctionTable.FUNC_HERE); } public FunctionTable(){ @@ -341,15 +340,14 @@ public class FunctionTable { try{ if (which < NUM_BUILT_IN_FUNCS) { - return (Function) m_functions[which].newInstance(); + return (Function) m_functions[which].getConstructor().newInstance(); } else { Class c = m_functions_customer[which-NUM_BUILT_IN_FUNCS]; - return (Function) c.newInstance(); + return (Function) c.getConstructor().newInstance(); } - }catch (IllegalAccessException ex){ - throw new TransformerException(ex.getMessage()); - }catch (InstantiationException ex){ - throw new TransformerException(ex.getMessage()); + }catch (InstantiationException | IllegalAccessException | SecurityException | + IllegalArgumentException | InvocationTargetException | NoSuchMethodException ex){ + throw new TransformerException(ex.getMessage()); } } @@ -360,8 +358,8 @@ public class FunctionTable * found in {@link com.sun.org.apache.xpath.internal.compiler.FunctionTable}, but may be a * value installed by an external module. */ - Object getFunctionID(String key){ - Object id = m_functionID_customer.get(key); + Integer getFunctionID(String key){ + Integer id = m_functionID_customer.get(key); if (null == id) id = m_functionID.get(key); return id; } @@ -376,7 +374,7 @@ public class FunctionTable { int funcIndex; - Object funcIndexObj = getFunctionID(name); + Integer funcIndexObj = getFunctionID(name); if (func != null && !Function.class.isAssignableFrom(func)) { throw new ClassCastException(func.getName() @@ -386,22 +384,19 @@ public class FunctionTable if (null != funcIndexObj) { - funcIndex = ((Integer) funcIndexObj).intValue(); + funcIndex = funcIndexObj; if (funcIndex < NUM_BUILT_IN_FUNCS){ funcIndex = m_funcNextFreeIndex++; - m_functionID_customer.put(name, new Integer(funcIndex)); + m_functionID_customer.put(name, funcIndex); } m_functions_customer[funcIndex - NUM_BUILT_IN_FUNCS] = func; } else { funcIndex = m_funcNextFreeIndex++; - m_functions_customer[funcIndex-NUM_BUILT_IN_FUNCS] = func; - - m_functionID_customer.put(name, - new Integer(funcIndex)); + m_functionID_customer.put(name, funcIndex); } return funcIndex; } @@ -415,11 +410,11 @@ public class FunctionTable */ public boolean functionAvailable(String methName) { - Object tblEntry = m_functionID.get(methName); + Integer tblEntry = m_functionID.get(methName); if (null != tblEntry) return true; else{ tblEntry = m_functionID_customer.get(methName); - return (null != tblEntry)? true : false; + return (null != tblEntry); } } } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathParser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathParser.java index a1d2587e040..54b9ff3d695 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathParser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathParser.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -667,8 +666,7 @@ public class XPathParser { int tok; - - Object id; + Integer id; try { @@ -676,7 +674,7 @@ public class XPathParser // a FilterExpr. id = Keywords.lookupNodeTest(key); if (null == id) id = m_functionTable.getFunctionID(key); - tok = ((Integer) id).intValue(); + tok = id; } catch (NullPointerException npe) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java index 0f111e4024c..871943a5906 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -170,7 +169,7 @@ public class XPathFactoryImpl extends XPathFactory { if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, - new Object[] { CLASS_NAME, new Boolean( value) } ); + new Object[] { CLASS_NAME, value } ); throw new NullPointerException( fmsg ); } @@ -179,7 +178,7 @@ public class XPathFactoryImpl extends XPathFactory { if ((_isSecureMode) && (!value)) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SECUREPROCESSING_FEATURE, - new Object[] { name, CLASS_NAME, new Boolean(value) } ); + new Object[] { name, CLASS_NAME, value } ); throw new XPathFactoryConfigurationException( fmsg ); } @@ -207,7 +206,7 @@ public class XPathFactoryImpl extends XPathFactory { // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, - new Object[] { name, CLASS_NAME, new Boolean(value) } ); + new Object[] { name, CLASS_NAME, value } ); throw new XPathFactoryConfigurationException( fmsg ); } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XBoolean.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XBoolean.java index e7c60643fbc..8a2710631c9 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XBoolean.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XBoolean.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -134,7 +133,7 @@ public class XBoolean extends XObject public Object object() { if(null == m_obj) - setObject(new Boolean(m_val)); + setObject(m_val); return m_obj; } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNumber.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNumber.java index df98cd5658d..55f88d224dd 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNumber.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNumber.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -378,7 +377,7 @@ public class XNumber extends XObject public Object object() { if(null == m_obj) - setObject(new Double(m_val)); + setObject(m_val); return m_obj; } diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java index f678d7c1e7b..0d16b93e2db 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -499,13 +498,13 @@ public class XObject extends Expression implements Serializable, Cloneable result = str(); break; case CLASS_NUMBER : - result = new Double(num()); + result = num(); break; case CLASS_NODESET : result = iter(); break; case CLASS_BOOLEAN : - result = new Boolean(bool()); + result = bool(); break; case CLASS_UNKNOWN : result = m_obj; diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Catalog.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Catalog.java index fcefd012666..bab7152543e 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Catalog.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Catalog.java @@ -57,7 +57,6 @@ import java.util.stream.Stream; *

    * In addition to the above entry types, a catalog may define nextCatalog * entries to add additional catalog entry files. - *

    * * @since 9 */ diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java index 5fca3130cf6..17961e79620 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java @@ -32,30 +32,30 @@ import jdk.xml.internal.SecuritySupport; /** * The CatalogFeatures holds a collection of features and properties. - *

    * * * * * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * * * - * - * + * + * * * + * * * * - * + * * @@ -63,7 +63,7 @@ import jdk.xml.internal.SecuritySupport; * * * - * + * * * * - * + * * * * * * - * - * + * * * - * - * + * * * * - * + * * @@ -97,35 +99,40 @@ import jdk.xml.internal.SecuritySupport; * * * - * - * + * * * - * - * + * + * * * * - * + * * * * * * - * - * + * * * - * - * + * * * - * - * + * * * @@ -156,7 +163,7 @@ import jdk.xml.internal.SecuritySupport; * [5] If the intention is to share an entire catalog store, it may be desirable to * set the property {@code javax.xml.catalog.defer} to false to allow the entire * catalog to be pre-loaded. - *

    + * *

    Scope and Order

    * Features and properties can be set through the catalog file, the Catalog API, * system properties, and {@code jaxp.properties}, with a preference in the same order. @@ -195,7 +202,6 @@ import jdk.xml.internal.SecuritySupport; .build(); * } * - *

    *

    JAXP XML Processor Support

    * The Catalog Features are supported throughout the JAXP processors, including * SAX and DOM ({@link javax.xml.parsers}), and StAX parsers ({@link javax.xml.stream}), @@ -204,7 +210,7 @@ import jdk.xml.internal.SecuritySupport; * factories or processors that define a setProperty or setAttribute interface. * For example, the following code snippet sets a URI to a catalog file on a SAX * parser through the {@code javax.xml.catalog.files} property: - *

    + * *

    {@code
      *      SAXParserFactory spf = SAXParserFactory.newInstance();
      *      spf.setFeature(XMLConstants.USE_CATALOG, true); [1]
    @@ -240,21 +246,20 @@ import jdk.xml.internal.SecuritySupport;
      * The Catalog support is available for any process in the JAXP library that
      * supports a resolver. The following table lists all such processes.
      *
    - * 

    *

    Processes with Catalog Support

    * *
    Catalog Features
    FeatureDescriptionProperty NameSystem Property [1]jaxp.properties [1]Value [2]ActionFeatureDescriptionProperty NameSystem Property [1]jaxp.properties [1]Value [2]Action
    TypeValueTypeValue
    FILESFILESA semicolon-delimited list of URIs to locate the catalog files. * The URIs must be absolute and have a URL protocol handler for the URI scheme. * javax.xml.catalog.filesjavax.xml.catalog.filesStringURIsURIs * Reads the first catalog as the current catalog; Loads others if no match * is found in the current catalog including delegate catalogs if any. @@ -71,25 +71,27 @@ import jdk.xml.internal.SecuritySupport; *
    PREFERPREFERIndicates the preference between the public and system * identifiers. The default value is public [3].javax.xml.catalog.preferN/AN/AString{@code system}Searches system entries for a match; Searches public entries when + * {@code system} + * Searches system entries for a match; Searches public entries when * external identifier specifies only a public identifier
    {@code public}Searches system entries for a match; Searches public entries when + * {@code public} + * Searches system entries for a match; Searches public entries when * there is no matching system entry.
    DEFERDEFERIndicates that the alternative catalogs including those * specified in delegate entries or nextCatalog are not read until they are * needed. The default value is true.javax.xml.catalog.deferjavax.xml.catalog.deferString{@code true}Loads alternative catalogs as needed. + * {@code true} + * Loads alternative catalogs as needed. *
    {@code false}Loads all catalogs[5]. {@code false} + * Loads all catalogs[5].
    RESOLVERESOLVEDetermines the action if there is no matching entry found after * all of the specified catalogs are exhausted. The default is strict.javax.xml.catalog.resolve [4]javax.xml.catalog.resolvejavax.xml.catalog.resolveString{@code strict}Throws CatalogException if there is no match. + * {@code strict} + * Throws CatalogException if there is no match. *
    {@code continue}Allows the XML parser to continue as if there is no match. + * {@code continue} + * Allows the XML parser to continue as if there is no match. *
    {@code ignore}Tells the XML parser to skip the external references if there no match. + * {@code ignore} + * Tells the XML parser to skip the external references if there no match. *
    * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/Duration.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/Duration.java index 1caf4508a48..82f9c848d70 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/Duration.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/Duration.java @@ -125,18 +125,18 @@ public abstract class Duration { * (timezone is optional for all date/time datatypes) * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * * * * * - * + * * * * @@ -145,7 +145,7 @@ public abstract class Duration { * * * - * + * * * * @@ -154,7 +154,7 @@ public abstract class Duration { * * * - * + * * * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java index 770284ac016..44df5808ba3 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -190,7 +190,7 @@ class FactoryFinder { if (!type.isAssignableFrom(providerClass)) { throw new ClassCastException(className + " cannot be cast to " + type.getName()); } - Object instance = providerClass.newInstance(); + Object instance = providerClass.getConstructor().newInstance(); final ClassLoader clD = cl; dPrint(()->"created new instance of " + providerClass + " using ClassLoader: " + clD); diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/SecuritySupport.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/SecuritySupport.java index 25ebbd19e8a..df8f000f875 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/SecuritySupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -79,7 +79,7 @@ class SecuritySupport { return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Boolean(f.exists()); + return f.exists(); } })).booleanValue(); } diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java index cc25c17a3e4..57e1d365458 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java @@ -58,16 +58,16 @@ import java.util.GregorianCalendar; * * * - * - * - * + * + * * * * * - * + * * @@ -85,12 +85,12 @@ import java.util.GregorianCalendar; * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * * * * * - * + * * * * @@ -769,7 +769,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -778,7 +778,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -787,7 +787,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -796,7 +796,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -805,7 +805,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -814,7 +814,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -823,7 +823,7 @@ public abstract class XMLGregorianCalendar * * * - * + * * * * @@ -908,45 +908,45 @@ public abstract class XMLGregorianCalendar * {@code java.util.GregorianCalendar} * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/package-info.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/package-info.java index 9f943d7f653..3a440a5eafb 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/package-info.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/package-info.java @@ -52,46 +52,46 @@ * * * - * - * + * + * * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * @@ -105,18 +105,18 @@ * * * - * - * + * + * * * * * * - * + * * * * - * + * * * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java b/jaxp/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java index 1ad999acb14..fe05123068b 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java @@ -92,13 +92,13 @@ public interface NamespaceContext { * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * @@ -157,39 +157,39 @@ public interface NamespaceContext { * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * @@ -224,14 +224,14 @@ public interface NamespaceContext { * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java index 88a772d89f6..8af5a032f51 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.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 @@ -190,7 +190,7 @@ class FactoryFinder { if (!type.isAssignableFrom(providerClass)) { throw new ClassCastException(className + " cannot be cast to " + type.getName()); } - Object instance = providerClass.newInstance(); + Object instance = providerClass.getConstructor().newInstance(); final ClassLoader clD = cl; dPrint(()->"created new instance of " + providerClass + " using ClassLoader: " + clD); diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParser.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParser.java index 9be9381f59e..fa1fe998037 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParser.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -77,6 +77,7 @@ import org.xml.sax.helpers.DefaultHandler; * @author Jeff Suttor * @since 1.4 */ +@SuppressWarnings("deprecation") public abstract class SAXParser { /** diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SecuritySupport.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SecuritySupport.java index ba736fa7326..2d91e50e252 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SecuritySupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -83,7 +83,7 @@ class SecuritySupport { return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Boolean(f.exists()); + return f.exists(); } })).booleanValue(); } diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java index c5b05ffe8ff..23b9b80747d 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java @@ -191,7 +191,7 @@ class FactoryFinder { if (!type.isAssignableFrom(providerClass)) { throw new ClassCastException(className + " cannot be cast to " + type.getName()); } - Object instance = providerClass.newInstance(); + Object instance = providerClass.getConstructor().newInstance(); final ClassLoader clD = cl; dPrint(()->"created new instance of " + providerClass + " using ClassLoader: " + clD); diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventWriter.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventWriter.java index 0df399bb5d0..54656d52c2e 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventWriter.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventWriter.java @@ -68,15 +68,15 @@ public interface XMLEventWriter extends XMLEventConsumer { * * * - * - * - * - * + * + * + * + * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * @@ -137,7 +137,7 @@ public interface XMLEventWriter extends XMLEventConsumer { * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java index 4a25f8fc33e..d3bb45a1d6c 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java @@ -40,23 +40,23 @@ import javax.xml.transform.Source; * * * - * - * - * - * - * + * + * + * + * + * * * * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * * *
    Processes with Catalog Support
    ProcessCatalog Entry TypeExampleProcessCatalog Entry TypeExample
    DTDs and external entitiesDTDs and external entitiespublic, system *
    {@literal
    @@ -269,7 +274,7 @@ import jdk.xml.internal.SecuritySupport;
      * 
    XIncludeXIncludeuri *
    {@literal
    @@ -284,7 +289,7 @@ import jdk.xml.internal.SecuritySupport;
      * 
    XSD importXSD importuri *
    {@literal
    @@ -302,7 +307,7 @@ import jdk.xml.internal.SecuritySupport;
      * 
    XSD includeXSD includeuri *
    {@literal
    @@ -317,7 +322,7 @@ import jdk.xml.internal.SecuritySupport;
      * 
    XSL import and includeXSL import and includeuri *
    {@literal
    @@ -332,7 +337,7 @@ import jdk.xml.internal.SecuritySupport;
      * 
    XSL document functionXSL document functionuri *
    {@literal
    diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java
    index fe1b6f2177d..bb2d2b4fe7c 100644
    --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java
    +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java
    @@ -53,7 +53,7 @@ import org.xml.sax.InputSource;
      * The search is started in the current catalog. If a match is found,
      * no further attempt will be made. Only if there is no match in the current
      * catalog, will alternate catalogs including delegate and next catalogs be considered.
    - * 

    + * *

    Search Order

    * The resolver will first search the system-type of entries with the specified * {@code systemId}. The system entries include {@code system}, @@ -75,7 +75,6 @@ import org.xml.sax.InputSource; * with the specified {@code systemId} or {@code href}. The {@code uri} entries * include {@code uri}, {@code rewriteURI}, and {@code uriSuffix} entries. * - *

    *

    Error Handling

    * The interfaces that the CatalogResolver extend specified checked exceptions, including: *
      diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java index ebd600eb196..afa1d1809a9 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java @@ -779,32 +779,32 @@ public abstract class DatatypeFactory { * {@link GregorianCalendar} to an {@link XMLGregorianCalendar} *
    {@code java.util.GregorianCalendar} field{@code javax.xml.datatype.XMLGregorianCalendar} field{@code java.util.GregorianCalendar} field{@code javax.xml.datatype.XMLGregorianCalendar} field
    {@code ERA == GregorianCalendar.BC ? -YEAR : YEAR}{@code ERA == GregorianCalendar.BC ? -YEAR : YEAR}{@link XMLGregorianCalendar#setYear(int year)}
    {@code MONTH + 1}{@code MONTH + 1}{@link XMLGregorianCalendar#setMonth(int month)}
    {@code DAY_OF_MONTH}{@code DAY_OF_MONTH}{@link XMLGregorianCalendar#setDay(int day)}
    {@code HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND}{@code HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND}{@link XMLGregorianCalendar#setTime(int hour, int minute, int second, BigDecimal fractional)}
    + * * {@code (ZONE_OFFSET + DST_OFFSET) / (60*1000)}
    * (in minutes) - * + *
    {@link XMLGregorianCalendar#setTimezone(int offset)}* *
    DatatypeyearmonthdayhourminutesecondDatatypeyearmonthdayhourminutesecond
    {@link DatatypeConstants#DURATION}{@link DatatypeConstants#DURATION}XXXX
    {@link DatatypeConstants#DURATION_DAYTIME}{@link DatatypeConstants#DURATION_DAYTIME}XX
    {@link DatatypeConstants#DURATION_YEARMONTH}{@link DatatypeConstants#DURATION_YEARMONTH}XX
    Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation
    XML Schema 1.0
    + *
    XML Schema 1.0
    * datatype
    * field
    Related
    XMLGregorianCalendar
    Accessor(s)
    Value RangeRelated
    XMLGregorianCalendar
    Accessor(s)
    Value Range
    yearyear {@link #getYear()} + {@link #getEon()} or
    * {@link #getEonAndYear} *
    monthmonth {@link #getMonth()} 1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED}
    dayday {@link #getDay()} Independent of month, max range is 1 to 31 or {@link DatatypeConstants#FIELD_UNDEFINED}.
    * The normative value constraint stated relative to month @@ -98,7 +98,7 @@ import java.util.GregorianCalendar; *
    hourhour{@link #getHour()} * 0 to 23 or {@link DatatypeConstants#FIELD_UNDEFINED}. @@ -110,12 +110,12 @@ import java.util.GregorianCalendar; *
    minuteminute {@link #getMinute()} 0 to 59 or {@link DatatypeConstants#FIELD_UNDEFINED}
    secondsecond * {@link #getSecond()} + {@link #getMillisecond()}/1000 or
    * {@link #getSecond()} + {@link #getFractionalSecond()} @@ -131,7 +131,7 @@ import java.util.GregorianCalendar; *
    timezonetimezone {@link #getTimezone()} Number of minutes or {@link DatatypeConstants#FIELD_UNDEFINED}. * Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes). @@ -749,18 +749,18 @@ public abstract class XMLGregorianCalendar * (timezone is optional for all date/time datatypes) *
    DatatypeyearmonthdayhourminutesecondDatatypeyearmonthdayhourminutesecond
    {@link DatatypeConstants#DATETIME}{@link DatatypeConstants#DATETIME}XXXX
    {@link DatatypeConstants#DATE}{@link DatatypeConstants#DATE}XXX
    {@link DatatypeConstants#TIME}{@link DatatypeConstants#TIME}X
    {@link DatatypeConstants#GYEARMONTH}{@link DatatypeConstants#GYEARMONTH}XX
    {@link DatatypeConstants#GMONTHDAY}{@link DatatypeConstants#GMONTHDAY}XX
    {@link DatatypeConstants#GYEAR}{@link DatatypeConstants#GYEAR}X
    {@link DatatypeConstants#GMONTH}{@link DatatypeConstants#GMONTH}X
    {@link DatatypeConstants#GDAY}{@link DatatypeConstants#GDAY}X
    {@code java.util.GregorianCalendar} field{@code javax.xml.datatype.XMLGregorianCalendar} field{@code java.util.GregorianCalendar} field{@code javax.xml.datatype.XMLGregorianCalendar} field
    {@code ERA}{@code ERA}{@link #getEonAndYear()}{@code .signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD}
    {@code YEAR}{@code YEAR}{@link #getEonAndYear()}{@code .abs().intValue()}*
    {@code MONTH}{@code MONTH}{@link #getMonth()} - {@link DatatypeConstants#JANUARY} + {@link GregorianCalendar#JANUARY}
    {@code DAY_OF_MONTH}{@code DAY_OF_MONTH}{@link #getDay()}
    {@code HOUR_OF_DAY}{@code HOUR_OF_DAY}{@link #getHour()}
    {@code MINUTE}{@code MINUTE}{@link #getMinute()}
    {@code SECOND}{@code SECOND}{@link #getSecond()}
    {@code MILLISECOND}{@code MILLISECOND}get millisecond order from {@link #getFractionalSecond()}*
    {@code GregorianCalendar.setTimeZone(TimeZone)}{@code GregorianCalendar.setTimeZone(TimeZone)}{@link #getTimezone()} formatted into Custom timezone id
    W3C XML Schema/Java Type Mappings
    W3C XML Schema Data TypeJava Data TypeW3C XML Schema Data TypeJava Data Type
    xs:datexs:date{@link javax.xml.datatype.XMLGregorianCalendar}
    xs:dateTimexs:dateTime{@link javax.xml.datatype.XMLGregorianCalendar}
    xs:durationxs:duration{@link javax.xml.datatype.Duration}
    xs:gDayxs:gDay{@link javax.xml.datatype.XMLGregorianCalendar}
    xs:gMonth xs:gMonth {@link javax.xml.datatype.XMLGregorianCalendar}
    xs:gMonthDayxs:gMonthDay{@link javax.xml.datatype.XMLGregorianCalendar}
    xs:gYearxs:gYear{@link javax.xml.datatype.XMLGregorianCalendar}
    xs:gYearMonthxs:gYearMonth{@link javax.xml.datatype.XMLGregorianCalendar}
    xs:timexs:time{@link javax.xml.datatype.XMLGregorianCalendar}
    XQuery and XPath/Java Type Mappings
    XQuery 1.0 and XPath 2.0 Data ModelJava Data TypeXQuery 1.0 and XPath 2.0 Data ModelJava Data Type
    xdt:dayTimeDurationxdt:dayTimeDuration{@link javax.xml.datatype.Duration}
    xdt:yearMonthDurationxdt:yearMonthDuration{@link javax.xml.datatype.Duration}
    Return value for specified prefixes
    prefix parameterNamespace URI return valueprefix parameterNamespace URI return value
    {@code DEFAULT_NS_PREFIX} (""){@code DEFAULT_NS_PREFIX} ("")default Namespace URI in the current scope or * {@link * javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI("")} @@ -106,11 +106,11 @@ public interface NamespaceContext { * when there is no default Namespace URI in the current scope
    bound prefixbound prefixNamespace URI bound to prefix in current scope
    unbound prefixunbound prefix * {@link * javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI("")} @@ -118,17 +118,17 @@ public interface NamespaceContext { *
    {@code XMLConstants.XML_NS_PREFIX} ("xml"){@code XMLConstants.XML_NS_PREFIX} ("xml"){@code XMLConstants.XML_NS_URI} * ("http://www.w3.org/XML/1998/namespace")
    {@code XMLConstants.XMLNS_ATTRIBUTE} ("xmlns"){@code XMLConstants.XMLNS_ATTRIBUTE} ("xmlns"){@code XMLConstants.XMLNS_ATTRIBUTE_NS_URI} * ("http://www.w3.org/2000/xmlns/")
    {@code null}{@code null}{@code IllegalArgumentException} is thrown
    Return value for specified Namespace URIs
    Namespace URI parameterprefix value returnedNamespace URI parameterprefix value returned
    {@code }{@code }{@code XMLConstants.DEFAULT_NS_PREFIX} ("") *
    bound Namespace URIbound Namespace URIprefix bound to Namespace URI in the current scope, * if multiple prefixes are bound to the Namespace URI in * the current scope, a single arbitrary prefix, whose * choice is implementation dependent, is returned
    unbound Namespace URIunbound Namespace URI{@code null}
    {@code XMLConstants.XML_NS_URI} - * ("http://www.w3.org/XML/1998/namespace"){@code XMLConstants.XML_NS_URI} + * ("http://www.w3.org/XML/1998/namespace"){@code XMLConstants.XML_NS_PREFIX} ("xml")
    {@code XMLConstants.XMLNS_ATTRIBUTE_NS_URI} - * ("http://www.w3.org/2000/xmlns/"){@code XMLConstants.XMLNS_ATTRIBUTE_NS_URI} + * ("http://www.w3.org/2000/xmlns/"){@code XMLConstants.XMLNS_ATTRIBUTE} ("xmlns")
    {@code null}{@code null}{@code IllegalArgumentException} is thrown
    Return value for specified Namespace URIs
    Namespace URI parameterprefixes value returnedNamespace URI parameterprefixes value returned
    bound Namespace URI, - * including the {@code }bound Namespace URI, + * including the {@code } * {@code Iterator} over prefixes bound to Namespace URI in * the current scope in an arbitrary, @@ -240,23 +240,23 @@ public interface NamespaceContext { *
    unbound Namespace URIunbound Namespace URIempty {@code Iterator}
    {@code XMLConstants.XML_NS_URI} - * ("http://www.w3.org/XML/1998/namespace"){@code XMLConstants.XML_NS_URI} + * ("http://www.w3.org/XML/1998/namespace"){@code Iterator} with one element set to * {@code XMLConstants.XML_NS_PREFIX} ("xml")
    {@code XMLConstants.XMLNS_ATTRIBUTE_NS_URI} - * ("http://www.w3.org/2000/xmlns/"){@code XMLConstants.XMLNS_ATTRIBUTE_NS_URI} + * ("http://www.w3.org/2000/xmlns/"){@code Iterator} with one element set to * {@code XMLConstants.XMLNS_ATTRIBUTE} ("xmlns")
    {@code null}{@code null}{@code IllegalArgumentException} is thrown
    Required and optional fields for events added to the writer
    Event TypeRequired FieldsOptional FieldsRequired BehaviorEvent TypeRequired FieldsOptional FieldsRequired Behavior
    START_ELEMENT START_ELEMENT QName name namespaces , attributes A START_ELEMENT will be written by writing the name, @@ -96,7 +96,7 @@ public interface XMLEventWriter extends XMLEventConsumer { *
    END_ELEMENT END_ELEMENT Qname name None A well formed END_ELEMENT tag is written. @@ -111,7 +111,7 @@ public interface XMLEventWriter extends XMLEventConsumer { *
    ATTRIBUTE ATTRIBUTE QName name , String value QName type An attribute is written using the same algorithm @@ -122,7 +122,7 @@ public interface XMLEventWriter extends XMLEventConsumer { *
    NAMESPACE NAMESPACE String prefix, String namespaceURI, * boolean isDefaultNamespaceDeclaration *
    PROCESSING_INSTRUCTION PROCESSING_INSTRUCTION None String target, String data The data does not need to be present and may be @@ -149,7 +149,7 @@ public interface XMLEventWriter extends XMLEventConsumer { *
    COMMENT COMMENT None String comment If the comment is present (not null) it is written, otherwise an @@ -157,7 +157,7 @@ public interface XMLEventWriter extends XMLEventConsumer { *
    START_DOCUMENT START_DOCUMENT None String encoding , boolean standalone, String version A START_DOCUMENT event is not required to be written to the @@ -166,13 +166,13 @@ public interface XMLEventWriter extends XMLEventConsumer { *
    END_DOCUMENT END_DOCUMENT None None Nothing is written to the output
    DTD DTD String DocumentTypeDefinition None The DocumentTypeDefinition is written to the output
    Configuration Parameters
    Property NameBehaviorReturn typeDefault ValueRequiredProperty NameBehaviorReturn typeDefault ValueRequired
    javax.xml.stream.isValidatingTurns on/off implementation specific DTD validationBooleanFalseNo
    javax.xml.stream.isNamespaceAwareTurns on/off namespace processing for XML 1.0 supportBooleanTrueTrue (required) / False (optional)
    javax.xml.stream.isCoalescingRequires the processor to coalesce adjacent character dataBooleanFalseYes
    javax.xml.stream.isReplacingEntityReferencesreplace internal entity references with their replacement text and report them as charactersBooleanTrueYes
    javax.xml.stream.isSupportingExternalEntitiesResolve external parsed entitiesBooleanUnspecifiedYes
    javax.xml.stream.supportDTDUse this property to request processors that do not support DTDsBooleanTrueYes
    javax.xml.stream.reportersets/gets the impl of the XMLReporter javax.xml.stream.XMLReporterNullYes
    javax.xml.stream.resolversets/gets the impl of the XMLResolver interfacejavax.xml.stream.XMLResolverNullYes
    javax.xml.stream.allocatorsets/gets the impl of the XMLEventAllocator interfacejavax.xml.stream.util.XMLEventAllocatorNullYes
    javax.xml.stream.isValidatingTurns on/off implementation specific DTD validationBooleanFalseNo
    javax.xml.stream.isNamespaceAwareTurns on/off namespace processing for XML 1.0 supportBooleanTrueTrue (required) / False (optional)
    javax.xml.stream.isCoalescingRequires the processor to coalesce adjacent character dataBooleanFalseYes
    javax.xml.stream.isReplacingEntityReferencesreplace internal entity references with their replacement text and report them as charactersBooleanTrueYes
    javax.xml.stream.isSupportingExternalEntitiesResolve external parsed entitiesBooleanUnspecifiedYes
    javax.xml.stream.supportDTDUse this property to request processors that do not support DTDsBooleanTrueYes
    javax.xml.stream.reportersets/gets the impl of the XMLReporter javax.xml.stream.XMLReporterNullYes
    javax.xml.stream.resolversets/gets the impl of the XMLResolver interfacejavax.xml.stream.XMLResolverNullYes
    javax.xml.stream.allocatorsets/gets the impl of the XMLEventAllocator interfacejavax.xml.stream.util.XMLEventAllocatorNullYes
    * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java index 0203273256c..2c0cc0ac088 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java @@ -40,15 +40,15 @@ import javax.xml.transform.Result; * Configuration Parameters * * - * Property Name - * Behavior - * Return type - * Default Value - * Required + * Property Name + * Behavior + * Return type + * Default Value + * Required * * * - * javax.xml.stream.isRepairingNamespacesdefaults prefixes + * javax.xml.stream.isRepairingNamespacesdefaults prefixes * on the output sideBooleanFalseYes * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamReader.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamReader.java index 06c44f9b532..ac8362b1bf2 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamReader.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamReader.java @@ -75,13 +75,13 @@ import javax.xml.namespace.QName; * Valid methods for each state * * - * Event Type - * Valid Methods + * Event Type + * Valid Methods * * * * - * All States + * All States * getProperty(), hasNext(), require(), close(), * getNamespaceURI(), isStartElement(), * isEndElement(), isCharacters(), isWhiteSpace(), @@ -90,7 +90,7 @@ import javax.xml.namespace.QName; * * * - * START_ELEMENT + * START_ELEMENT * next(), getName(), getLocalName(), hasName(), getPrefix(), * getAttributeXXX(), isAttributeSpecified(), * getNamespaceXXX(), @@ -98,58 +98,58 @@ import javax.xml.namespace.QName; * * * - * ATTRIBUTE + * ATTRIBUTE * next(), nextTag() * getAttributeXXX(), isAttributeSpecified(), * * * - * NAMESPACE + * NAMESPACE * next(), nextTag() * getNamespaceXXX() * * * - * END_ELEMENT + * END_ELEMENT * next(), getName(), getLocalName(), hasName(), getPrefix(), * getNamespaceXXX(), nextTag() * * * - * CHARACTERS + * CHARACTERS * next(), getTextXXX(), nextTag() * * - * CDATA + * CDATA * next(), getTextXXX(), nextTag() * * - * COMMENT + * COMMENT * next(), getTextXXX(), nextTag() * * - * SPACE + * SPACE * next(), getTextXXX(), nextTag() * * - * START_DOCUMENT + * START_DOCUMENT * next(), getEncoding(), getVersion(), isStandalone(), standaloneSet(), * getCharacterEncodingScheme(), nextTag() * * - * END_DOCUMENT + * END_DOCUMENT * close() * * - * PROCESSING_INSTRUCTION + * PROCESSING_INSTRUCTION * next(), getPITarget(), getPIData(), nextTag() * * - * ENTITY_REFERENCE + * ENTITY_REFERENCE * next(), getLocalName(), getText(), nextTag() * * - * DTD + * DTD * next(), getText(), nextTag() * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamWriter.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamWriter.java index 1f0a3c34577..0ad0c29a03c 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamWriter.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLStreamWriter.java @@ -42,22 +42,22 @@ import javax.xml.namespace.NamespaceContext; * XML Namespaces, {@code javax.xml.stream.isRepairingNamespaces} and write method behaviour * * - * Method - * {@code isRepairingNamespaces} == true - * {@code isRepairingNamespaces} == false + * Method + * {@code isRepairingNamespaces} == true + * {@code isRepairingNamespaces} == false * * - * - * namespaceURI bound - * namespaceURI unbound - * namespaceURI bound - * namespaceURI unbound + * + * namespaceURI bound + * namespaceURI unbound + * namespaceURI bound + * namespaceURI unbound * * * * * - * {@code writeAttribute(namespaceURI, localName, value)} + * {@code writeAttribute(namespaceURI, localName, value)} * * * @@ -79,7 +79,7 @@ import javax.xml.namespace.NamespaceContext; * * * - * {@code writeAttribute(prefix, namespaceURI, localName, value)} + * {@code writeAttribute(prefix, namespaceURI, localName, value)} * * * @@ -109,11 +109,11 @@ import javax.xml.namespace.NamespaceContext; * * * - * {@code writeStartElement(namespaceURI, localName)}
    + * {@code writeStartElement(namespaceURI, localName)}
    *
    * {@code writeEmptyElement(namespaceURI, localName)} * - * + * * * {@code [1] * @@ -133,7 +133,7 @@ import javax.xml.namespace.NamespaceContext; * * * - * {@code writeStartElement(prefix, localName, namespaceURI)}
    + * {@code writeStartElement(prefix, localName, namespaceURI)}
    *
    * {@code writeEmptyElement(prefix, localName, namespaceURI)} * @@ -164,25 +164,20 @@ import javax.xml.namespace.NamespaceContext; * * * - * - * - * - * Notes: - *

      - *
    • [1] if namespaceURI == default Namespace URI, then no prefix is written
    • - *
    • [2] if prefix == "" || null {@literal &&} namespaceURI == "", then - * no prefix or Namespace declaration is generated or written
    • - *
    • [3] if prefix == "" || null, then a prefix is randomly generated
    • - *
    • [4] if prefix == "" || null, then it is treated as the default Namespace and - * no prefix is generated or written, an xmlns declaration is generated - * and written if the namespaceURI is unbound
    • - *
    • [5] if prefix == "" || null, then it is treated as an invalid attempt to - * define the default Namespace and an XMLStreamException is thrown
    • - *
    - * - * - * * + + * Notes: + *
      + *
    • [1] if namespaceURI == default Namespace URI, then no prefix is written
    • + *
    • [2] if prefix == "" || null {@literal &&} namespaceURI == "", then + * no prefix or Namespace declaration is generated or written
    • + *
    • [3] if prefix == "" || null, then a prefix is randomly generated
    • + *
    • [4] if prefix == "" || null, then it is treated as the default Namespace and + * no prefix is generated or written, an xmlns declaration is generated + * and written if the namespaceURI is unbound
    • + *
    • [5] if prefix == "" || null, then it is treated as an invalid attempt to + * define the default Namespace and an XMLStreamException is thrown
    • + *
    * * @version 1.0 * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java index 99413a27816..c847a07d4fc 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.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 @@ -176,7 +176,7 @@ class FactoryFinder { instance = newInstanceNoServiceLoader(type, providerClass); } if (instance == null) { - instance = providerClass.newInstance(); + instance = providerClass.getConstructor().newInstance(); } final ClassLoader clD = cl; dPrint(()->"created new instance of " + providerClass + diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/SecuritySupport.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/SecuritySupport.java index 6f2a05233ad..bb325dd0e03 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/transform/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/SecuritySupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -81,7 +81,7 @@ class SecuritySupport { return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - return new Boolean(f.exists()); + return f.exists(); } })).booleanValue(); } diff --git a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java index aafa5cd844b..680aabcd39b 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java @@ -88,17 +88,17 @@ import org.xml.sax.SAXParseException; * URIs for Supported Schema languages * * - * value - * language + * value + * language * * * * - * {@link javax.xml.XMLConstants#W3C_XML_SCHEMA_NS_URI} ("{@code http://www.w3.org/2001/XMLSchema}") + * {@link javax.xml.XMLConstants#W3C_XML_SCHEMA_NS_URI} ("{@code http://www.w3.org/2001/XMLSchema}") * W3C XML Schema 1.0 * * - * {@link javax.xml.XMLConstants#RELAXNG_NS_URI} ("{@code http://relaxng.org/ns/structure/1.0}") + * {@link javax.xml.XMLConstants#RELAXNG_NS_URI} ("{@code http://relaxng.org/ns/structure/1.0}") * RELAX NG 1.0 * * diff --git a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java index 812882923f4..ff257f8c02e 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.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 @@ -26,6 +26,7 @@ package javax.xml.validation; import java.io.File; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.security.AccessControlContext; @@ -286,41 +287,31 @@ class SchemaFactoryFinder { // get Class from className Class clazz = createClass(className); if (clazz == null) { - debugPrintln(()->"failed to getClass(" + className + ")"); - return null; + debugPrintln(()->"failed to getClass(" + className + ")"); + return null; } debugPrintln(()->"loaded " + className + " from " + which(clazz)); // instantiate Class as a SchemaFactory try { - if (!SchemaFactory.class.isAssignableFrom(clazz)) { - throw new ClassCastException(clazz.getName() - + " cannot be cast to " + SchemaFactory.class); - } - if (!useServicesMechanism) { - schemaFactory = newInstanceNoServiceLoader(clazz); - } - if (schemaFactory == null) { - schemaFactory = (SchemaFactory) clazz.newInstance(); - } - } catch (ClassCastException classCastException) { - debugPrintln(()->"could not instantiate " + clazz.getName()); - if (debug) { - classCastException.printStackTrace(); - } - return null; - } catch (IllegalAccessException illegalAccessException) { - debugPrintln(()->"could not instantiate " + clazz.getName()); - if (debug) { - illegalAccessException.printStackTrace(); - } - return null; - } catch (InstantiationException instantiationException) { - debugPrintln(()->"could not instantiate " + clazz.getName()); - if (debug) { - instantiationException.printStackTrace(); - } - return null; + if (!SchemaFactory.class.isAssignableFrom(clazz)) { + throw new ClassCastException(clazz.getName() + + " cannot be cast to " + SchemaFactory.class); + } + if (!useServicesMechanism) { + schemaFactory = newInstanceNoServiceLoader(clazz); + } + if (schemaFactory == null) { + schemaFactory = (SchemaFactory) clazz.getConstructor().newInstance(); + } + } catch (ClassCastException | IllegalAccessException | IllegalArgumentException | + InstantiationException | InvocationTargetException | NoSuchMethodException | + SecurityException ex) { + debugPrintln(()->"could not instantiate " + clazz.getName()); + if (debug) { + ex.printStackTrace(); + } + return null; } return schemaFactory; diff --git a/jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java b/jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java index b71319c8023..da212c2867f 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java @@ -135,44 +135,44 @@ public abstract class Validator { * {@code Source} / {@code Result} Accepted * * - * - * {@link javax.xml.transform.stream.StreamSource} - * {@link javax.xml.transform.sax.SAXSource} - * {@link javax.xml.transform.dom.DOMSource} - * {@link javax.xml.transform.stax.StAXSource} + * > + * {@link javax.xml.transform.stream.StreamSource} + * {@link javax.xml.transform.sax.SAXSource} + * {@link javax.xml.transform.dom.DOMSource} + * {@link javax.xml.transform.stax.StAXSource} * * * * - * {@code null} + * {@code null} * OK * OK * OK * OK * * - * {@link javax.xml.transform.stream.StreamResult} + * {@link javax.xml.transform.stream.StreamResult} * OK * {@code IllegalArgumentException} * {@code IllegalArgumentException} * {@code IllegalArgumentException} * * - * {@link javax.xml.transform.sax.SAXResult} + * {@link javax.xml.transform.sax.SAXResult} * {@code IllegalArgumentException} * OK * {@code IllegalArgumentException} * {@code IllegalArgumentException} * * - * {@link javax.xml.transform.dom.DOMResult} + * {@link javax.xml.transform.dom.DOMResult} * {@code IllegalArgumentException} * {@code IllegalArgumentException} * OK * {@code IllegalArgumentException} * * - * {@link javax.xml.transform.stax.StAXResult} + * {@link javax.xml.transform.stax.StAXResult} * {@code IllegalArgumentException} * {@code IllegalArgumentException} * {@code IllegalArgumentException} diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPath.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPath.java index 8270231254c..b38af931b19 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPath.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPath.java @@ -38,13 +38,13 @@ import org.xml.sax.InputSource; * Evaluation of XPath Expressions * * - * Factor - * Behavior + * Factor + * Behavior * * * * - * context + * context * * The type of the context is implementation-dependent. If the value is * null, the operation must have no dependency on the context, otherwise @@ -55,7 +55,7 @@ import org.xml.sax.InputSource; * * * - * variables + * variables * * If the expression contains a variable reference, its value will be found through the {@link XPathVariableResolver} * set with {@link #setXPathVariableResolver(XPathVariableResolver resolver)}. @@ -65,7 +65,7 @@ import org.xml.sax.InputSource; * * * - * functions + * functions * * If the expression contains a function reference, the function will be found through the {@link XPathFunctionResolver} * set with {@link #setXPathFunctionResolver(XPathFunctionResolver resolver)}. @@ -74,14 +74,14 @@ import org.xml.sax.InputSource; * * * - * QNames + * QNames * * QNames in the expression are resolved against the XPath namespace context * set with {@link #setNamespaceContext(NamespaceContext nsContext)}. * * * - * result + * result * * This result of evaluating an expression is converted to an instance of the desired return type. * Valid return types are defined in {@link XPathConstants}. diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathExpression.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathExpression.java index b6616685231..550a4ff93c3 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathExpression.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathExpression.java @@ -37,13 +37,13 @@ import org.xml.sax.InputSource; * Evaluation of XPath Expressions * * - * Factor - * Behavior + * Factor + * Behavior * * * * - * context + * context * * The type of the context is implementation-dependent. If the value is * null, the operation must have no dependency on the context, otherwise @@ -54,7 +54,7 @@ import org.xml.sax.InputSource; * * * - * variables + * variables * * If the expression contains a variable reference, its value will be found through the {@link XPathVariableResolver}. * An {@link XPathExpressionException} is raised if the variable resolver is undefined or @@ -63,7 +63,7 @@ import org.xml.sax.InputSource; * * * - * functions + * functions * * If the expression contains a function reference, the function will be found through the {@link XPathFunctionResolver}. * An {@link XPathExpressionException} is raised if the function resolver is undefined or @@ -71,13 +71,13 @@ import org.xml.sax.InputSource; * * * - * QNames + * QNames * * QNames in the expression are resolved against the XPath namespace context. * * * - * result + * result * * This result of evaluating an expression is converted to an instance of the desired return type. * Valid return types are defined in {@link XPathConstants}. diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java index 9db2556ea54..420fe0d2332 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java @@ -26,6 +26,7 @@ package javax.xml.xpath; import java.io.File; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.security.AccessControlContext; @@ -297,26 +298,16 @@ class XPathFactoryFinder { xPathFactory = newInstanceNoServiceLoader(clazz); } if (xPathFactory == null) { - xPathFactory = (XPathFactory) clazz.newInstance(); + xPathFactory = (XPathFactory) clazz.getConstructor().newInstance(); } - } catch (ClassCastException classCastException) { - debugPrintln(()->"could not instantiate " + clazz.getName()); - if (debug) { - classCastException.printStackTrace(); - } - return null; - } catch (IllegalAccessException illegalAccessException) { - debugPrintln(()->"could not instantiate " + clazz.getName()); - if (debug) { - illegalAccessException.printStackTrace(); - } - return null; - } catch (InstantiationException instantiationException) { - debugPrintln(()->"could not instantiate " + clazz.getName()); - if (debug) { - instantiationException.printStackTrace(); - } - return null; + } catch (ClassCastException | IllegalAccessException | IllegalArgumentException | + InstantiationException | InvocationTargetException | NoSuchMethodException | + SecurityException ex) { + debugPrintln(()->"could not instantiate " + clazz.getName()); + if (debug) { + ex.printStackTrace(); + } + return null; } return xPathFactory; diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/package-info.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/package-info.java index b700c969b63..6a8e8200634 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/package-info.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/package-info.java @@ -148,37 +148,37 @@ * Examples of Location Path * * - * Location Path - * Description + * Location Path + * Description * * * * - * + * * /foo/bar/@id - * + * * * Selects the attribute id of the <bar> element * * * - * /foo/bar/text() - * + * /foo/bar/text() + * * * Selects the text nodes of the <bar> element. No * distinction is made between escaped and non-escaped character data. * * * - * /foo/bar/comment() - * + * /foo/bar/comment() + * * * Selects all comment nodes contained in the <bar> element. * * * - * /foo/bar/processing-instruction() - * + * /foo/bar/processing-instruction() + * * * Selects all processing-instruction nodes contained in the * <bar> element. diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/Attr.java b/jaxp/src/java.xml/share/classes/org/w3c/dom/Attr.java index 7b125dedb8e..7f3d196d461 100644 --- a/jaxp/src/java.xml/share/classes/org/w3c/dom/Attr.java +++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/Attr.java @@ -115,17 +115,17 @@ package org.w3c.dom; * Examples of the Original, Normalized and Serialized Values * * - * Examples - * Parsed + * Examples + * Parsed * attribute value - * Initial Attr.value - * Serialized attribute value + * Initial Attr.value + * Serialized attribute value * * * * - * - * Character reference + * + * Character reference * *
    "x&#178;=5"
    * @@ -137,8 +137,8 @@ package org.w3c.dom; * * * - * Built-in - * character entity + * Built-in + * character entity * *
    "y&lt;6"
    * @@ -150,7 +150,7 @@ package org.w3c.dom; * * * - * Literal newline between + * Literal newline between * *
      * "x=5&#10;y=6"
    @@ -163,7 +163,7 @@ package org.w3c.dom; * * * - * Normalized newline between + * Normalized newline between * *
    "x=5
      * y=6"
    @@ -176,7 +176,7 @@ package org.w3c.dom; * * * - * Entity e with literal newline + * Entity e with literal newline * *
      * <!ENTITY e '...&#10;...'> [...]> "x=5&e;y=6"
    diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/Comment.java b/jaxp/src/java.xml/share/classes/org/w3c/dom/Comment.java index a8d07a5ec19..61bb67d4ae0 100644 --- a/jaxp/src/java.xml/share/classes/org/w3c/dom/Comment.java +++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/Comment.java @@ -43,8 +43,8 @@ package org.w3c.dom; /** * This interface inherits from CharacterData and represents the - * content of a comment, i.e., all the characters between the starting ' - * <!--' and ending '-->'. Note that this is + * content of a comment, i.e., all the characters between the starting + * '{@code }'. Note that this is * the definition of a comment in XML, and, in practice, HTML, although some * HTML tools may implement the full SGML comment structure. *

    No lexical check is done on the content of a comment and it is diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/Document.java b/jaxp/src/java.xml/share/classes/org/w3c/dom/Document.java index c489fade718..df10e9d9ae5 100644 --- a/jaxp/src/java.xml/share/classes/org/w3c/dom/Document.java +++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/Document.java @@ -357,34 +357,34 @@ public interface Document extends Node { * Attributes of the {@code Element} object * * - * Attribute - * Value + * Attribute + * Value * * * * - * Node.nodeName + * Node.nodeName * * qualifiedName * * - * Node.namespaceURI + * Node.namespaceURI * * namespaceURI * * - * Node.prefix + * Node.prefix * prefix, extracted * from qualifiedName, or null if there is * no prefix * * - * Node.localName + * Node.localName * local name, extracted from * qualifiedName * * - * Element.tagName + * Element.tagName * * qualifiedName * @@ -426,40 +426,40 @@ public interface Document extends Node { * Attributes of the {@code Attr} object * * - * + * * Attribute - * Value + * Value * * * * - * Node.nodeName + * Node.nodeName * qualifiedName * * - * - * Node.namespaceURI + * + * Node.namespaceURI * namespaceURI * * - * - * Node.prefix + * + * Node.prefix * prefix, extracted from * qualifiedName, or null if there is no * prefix * * - * Node.localName + * Node.localName * local name, extracted from * qualifiedName * * - * Attr.name + * Attr.name * * qualifiedName * * - * Node.nodeValue + * Node.nodeValue * the empty * string * diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/Node.java b/jaxp/src/java.xml/share/classes/org/w3c/dom/Node.java index 79cbada7935..2ba7fc12564 100644 --- a/jaxp/src/java.xml/share/classes/org/w3c/dom/Node.java +++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/Node.java @@ -65,23 +65,23 @@ package org.w3c.dom; * Interface table * * - * Interface - * nodeName - * nodeValue - * attributes + * Interface + * nodeName + * nodeValue + * attributes * * * * - * - * Attr + * + * Attr * same as Attr.name * same as * Attr.value * null * * - * CDATASection + * CDATASection * * "#cdata-section" * same as CharacterData.data, the @@ -89,7 +89,7 @@ package org.w3c.dom; * null * * - * Comment + * Comment * * "#comment" * same as CharacterData.data, the @@ -97,58 +97,58 @@ package org.w3c.dom; * null * * - * Document + * Document * * "#document" * null * null * * - * - * DocumentFragment + * + * DocumentFragment * "#document-fragment" * * null * null * * - * DocumentType + * DocumentType * same as * DocumentType.name * null * null * * - * - * Element + * + * Element * same as Element.tagName * null * * NamedNodeMap * * - * Entity + * Entity * entity name * null * * null * * - * EntityReference + * EntityReference * name of entity referenced * * null * null * * - * Notation + * Notation * notation name * * null * null * * - * ProcessingInstruction + * ProcessingInstruction * same * as ProcessingInstruction.target * same as @@ -156,7 +156,7 @@ package org.w3c.dom; * null * * - * Text + * Text * * "#text" * same as CharacterData.data, the content @@ -696,28 +696,28 @@ public interface Node { * Node/Content table * * - * Node type - * Content + * Node type + * Content * * * * - * + * * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, - * DOCUMENT_FRAGMENT_NODE + * DOCUMENT_FRAGMENT_NODE * concatenation of the textContent * attribute value of every child node, excluding COMMENT_NODE and * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the * node has no children. * * - * TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, - * PROCESSING_INSTRUCTION_NODE + * TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, + * PROCESSING_INSTRUCTION_NODE * nodeValue * * - * DOCUMENT_NODE, - * DOCUMENT_TYPE_NODE, NOTATION_NODE + * DOCUMENT_NODE, + * DOCUMENT_TYPE_NODE, NOTATION_NODE * null * * @@ -751,28 +751,28 @@ public interface Node { * Node/Content table * * - * Node type - * Content + * Node type + * Content * * * * - * + * * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, - * DOCUMENT_FRAGMENT_NODE + * DOCUMENT_FRAGMENT_NODE * concatenation of the textContent * attribute value of every child node, excluding COMMENT_NODE and * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the * node has no children. * * - * TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, - * PROCESSING_INSTRUCTION_NODE + * TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, + * PROCESSING_INSTRUCTION_NODE * nodeValue * * - * DOCUMENT_NODE, - * DOCUMENT_TYPE_NODE, NOTATION_NODE + * DOCUMENT_NODE, + * DOCUMENT_TYPE_NODE, NOTATION_NODE * null * * diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java b/jaxp/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java index 6099cf3cb32..0b735732f92 100644 --- a/jaxp/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java +++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java @@ -50,6 +50,7 @@ import org.w3c.dom.DOMImplementation; import java.io.InputStream; import java.io.BufferedReader; import java.io.InputStreamReader; +import java.lang.reflect.InvocationTargetException; import java.security.AccessController; import java.security.PrivilegedAction; @@ -183,9 +184,13 @@ public final class DOMImplementationRegistry { } else { sourceClass = Class.forName(sourceName); } - DOMImplementationSource source = - (DOMImplementationSource) sourceClass.newInstance(); - sources.addElement(source); + try { + DOMImplementationSource source = + (DOMImplementationSource) sourceClass.getConstructor().newInstance(); + sources.addElement(source); + } catch (NoSuchMethodException | InvocationTargetException e) { + throw new InstantiationException(e.getMessage()); + } } } return new DOMImplementationRegistry(sources); diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/ls/LSSerializer.java b/jaxp/src/java.xml/share/classes/org/w3c/dom/ls/LSSerializer.java index 05b003a15a7..772a8d3f6d7 100644 --- a/jaxp/src/java.xml/share/classes/org/w3c/dom/ls/LSSerializer.java +++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/ls/LSSerializer.java @@ -136,7 +136,7 @@ import org.w3c.dom.DOMException; *

    Within markup, but outside of attributes, any occurrence of a character * that cannot be represented in the output character encoding is reported * as a DOMError fatal error. An example would be serializing - * the element <LaCa\u00f1ada/> with encoding="us-ascii". + * the element <LaCañada/> with encoding="us-ascii". * This will result with a generation of a DOMError * "wf-invalid-character-in-node-name" (as proposed in " * well-formed"). diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/NewInstance.java b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/NewInstance.java index c881c0ed9f1..e4576319068 100644 --- a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/NewInstance.java +++ b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/NewInstance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -32,6 +32,7 @@ package org.xml.sax.helpers; +import java.lang.reflect.InvocationTargetException; import java.util.Objects; /** @@ -90,7 +91,11 @@ class NewInstance { driverClass = classLoader.loadClass(className); } - return type.cast(driverClass.newInstance()); + try { + return type.cast(driverClass.getConstructor().newInstance()); + } catch (NoSuchMethodException | SecurityException | InvocationTargetException ex) { + throw new InstantiationException(ex.getMessage()); + } } } diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java index 3c69e5c9aae..0dbcc470954 100644 --- a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java +++ b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -79,6 +79,7 @@ import org.xml.sax.SAXNotSupportedException; * @see org.xml.sax.XMLReader * @see org.xml.sax.Parser */ +@SuppressWarnings("deprecation") public class ParserAdapter implements XMLReader, DocumentHandler { private static SecuritySupport ss = new SecuritySupport(); diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/SecuritySupport.java b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/SecuritySupport.java index 3d753b1dcd3..42a2de3cdf0 100644 --- a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/SecuritySupport.java +++ b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/SecuritySupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -86,7 +86,7 @@ class SecuritySupport { boolean doesFileExist(final File f) { return (AccessController.doPrivileged((PrivilegedAction)() -> - new Boolean(f.exists()))); + f.exists())); } } diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderAdapter.java b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderAdapter.java index 8256d976761..9f8164a1d42 100644 --- a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderAdapter.java +++ b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -73,6 +73,7 @@ import org.xml.sax.SAXNotSupportedException; * @see org.xml.sax.Parser * @see org.xml.sax.XMLReader */ +@SuppressWarnings("deprecation") public class XMLReaderAdapter implements Parser, ContentHandler { diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderFactory.java b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderFactory.java index 6b183ff7350..3491ae51006 100644 --- a/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderFactory.java +++ b/jaxp/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -100,7 +100,6 @@ final public class XMLReaderFactory * Obtains a new instance of a {@link org.xml.sax.XMLReader}. * This method uses the following ordered lookup procedure to find and load * the {@link org.xml.sax.XMLReader} implementation class: - *

    *

      *
    1. If the system property {@code org.xml.sax.driver} * has a value, that is used as an XMLReader class name.
    2. diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/package-info.java b/jaxp/src/java.xml/share/classes/org/xml/sax/package-info.java index 419f3e7ab50..6928f78881e 100644 --- a/jaxp/src/java.xml/share/classes/org/xml/sax/package-info.java +++ b/jaxp/src/java.xml/share/classes/org/xml/sax/package-info.java @@ -48,16 +48,20 @@ * setFeature. Those standard identifiers are: * * - * - * - * - * - * - * - * - * + *
      Feature IDAccessDefaultDescription
      + * + * * - * + * + * + * + * + * + * + * + * + * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * * - * + * * * * * + * *
      Standard Features
      external-general-entitiesFeature IDAccessDefaultDescription
      external-general-entitiesread/writeunspecified Reports whether this parser processes external @@ -66,7 +70,7 @@ *
      external-parameter-entitiesexternal-parameter-entitiesread/writeunspecified Reports whether this parser processes external @@ -75,7 +79,7 @@ *
      is-standaloneis-standalone(parsing) read-only, (not parsing) nonenot applicable May be examined only during a parse, after the @@ -86,7 +90,7 @@ *
      lexical-handler/parameter-entitieslexical-handler/parameter-entitiesread/writeunspecified A value of "true" indicates that the LexicalHandler will report @@ -95,7 +99,7 @@ *
      namespacesnamespacesread/writetrue A value of "true" indicates namespace URIs and unprefixed local names @@ -104,7 +108,7 @@ *
      namespace-prefixesnamespace-prefixesread/writefalse A value of "true" indicates that XML qualified names (with prefixes) and @@ -113,7 +117,7 @@ *
      resolve-dtd-urisresolve-dtd-urisread/writetrue A value of "true" indicates that system IDs in declarations will @@ -135,7 +139,7 @@ *
      string-interningstring-interningread/writeunspecified Has a value of "true" if all XML names (for elements, prefixes, @@ -148,7 +152,7 @@ *
      unicode-normalization-checkingunicode-normalization-checkingread/writefalse Controls whether the parser reports Unicode normalization @@ -161,7 +165,7 @@ *
      use-attributes2use-attributes2read-onlynot applicable Returns "true" if the Attributes objects passed by @@ -175,7 +179,7 @@ *
      use-locator2use-locator2read-onlynot applicable Returns "true" if the Locator objects passed by @@ -188,7 +192,7 @@ *
      use-entity-resolver2use-entity-resolver2read/writetrue Returns "true" if, when setEntityResolver is given @@ -200,7 +204,7 @@ *
      validationvalidationread/writeunspecified Controls whether the parser is reporting all validity @@ -209,7 +213,7 @@ *
      xmlns-urisxmlns-urisread/writefalse Controls whether, when the namespace-prefixes feature @@ -225,13 +229,14 @@ *
      xml-1.1xml-1.1read-onlynot applicable Returns "true" if the parser supports both XML 1.1 and XML 1.0. * Returns "false" if the parser supports only XML 1.0. *
      * *

      @@ -262,14 +267,18 @@ * dom-node. Manage those properties using * setProperty(). Those identifiers are: * - * - * - * - * - * - * + *
      Property IDDescription
      + * + * * - * + * + * + * + * + * + * + * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * + * *
      Standard Property IDs
      declaration-handlerProperty IDDescription
      declaration-handler Used to see most DTD declarations except those treated * as lexical ("document element name is ...") or which are * mandatory for all SAX parsers (DTDHandler). @@ -279,7 +288,7 @@ *
      document-xml-versiondocument-xml-version May be examined only during a parse, after the startDocument() * callback has been completed; read-only. This property is a * literal string describing the actual XML version of the document, @@ -288,7 +297,7 @@ *
      dom-nodedom-node For "DOM Walker" style parsers, which ignore their * parser.parse() parameters, this is used to * specify the DOM (sub)tree being walked by the parser. @@ -298,7 +307,7 @@ *
      lexical-handlerlexical-handler Used to see some syntax events that are essential in some * applications: comments, CDATA delimiters, selected general * entity inclusions, and the start and end of the DTD @@ -309,11 +318,12 @@ *
      xml-stringxml-string Readable only during a parser callback, this exposes a TBS * chunk of characters responsible for the current event. *
      * *

      diff --git a/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java b/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java index 97953d3993a..e0dc44bf9bc 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java @@ -45,8 +45,6 @@ import org.testng.annotations.DataProvider; /* * @test * @bug 8145974 - * @modules javax.xml - * @test * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest * @run testng/othervm -DrunSecMngr=true stream.XMLStreamWriterTest.SurrogatesTest * @run testng/othervm stream.XMLStreamWriterTest.SurrogatesTest diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 2b956827083..44f51b44f96 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -435,3 +435,6 @@ c2296642010f1b215ac35da89e92c3ce44104e32 jdk-9+174 712a3a657654079514590d37a0f4894d43541d5c jdk-10+12 a5d361b9d1f7f78a675f3baef0d1fd32deee9ea2 jdk-9+175 46a14aad004aa0b980d5f4ff7810d894fd5a36ae jdk-10+13 +bddeaa49ffd55567ad232548c38aa270e1a1420a jdk-10+14 +ea819b6009d33a72e6672bab6c101d51db0cfb4c jdk-9+176 +b44a721aee3d3b2537754e559fe9ecccadea548b jdk-9+177 diff --git a/jaxws/src/java.activation/share/classes/module-info.java b/jaxws/src/java.activation/share/classes/module-info.java index 22b1512da9a..c575883a67c 100644 --- a/jaxws/src/java.activation/share/classes/module-info.java +++ b/jaxws/src/java.activation/share/classes/module-info.java @@ -26,7 +26,7 @@ /** * Defines the JavaBeans Activation Framework (JAF) API. * - *

      This module is upgradeble. + *

      This module is upgradeable. * * @moduleGraph * @since 9 diff --git a/jaxws/src/java.xml.bind/share/classes/module-info.java b/jaxws/src/java.xml.bind/share/classes/module-info.java index e38ab7ab355..34ff29794b7 100644 --- a/jaxws/src/java.xml.bind/share/classes/module-info.java +++ b/jaxws/src/java.xml.bind/share/classes/module-info.java @@ -26,7 +26,7 @@ /** * Defines the Java Architecture for XML Binding (JAXB) API. * - *

      This module is upgradeble. + *

      This module is upgradeable. * * @uses javax.xml.bind.JAXBContextFactory * diff --git a/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java b/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java index 768e4339611..fdf5e66b636 100644 --- a/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java +++ b/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java @@ -27,7 +27,7 @@ * Defines a subset of the Common Annotations API to support programs running * on the Java SE Platform. * - *

      This module is upgradeble. + *

      This module is upgradeable. * * @moduleGraph * @since 9 diff --git a/jaxws/src/java.xml.ws/share/classes/module-info.java b/jaxws/src/java.xml.ws/share/classes/module-info.java index fa16a92cc39..0fcd8120181 100644 --- a/jaxws/src/java.xml.ws/share/classes/module-info.java +++ b/jaxws/src/java.xml.ws/share/classes/module-info.java @@ -27,7 +27,7 @@ * Defines the Java API for XML-Based Web Services (JAX-WS), and * the Web Services Metadata API. * - *

      This module is upgradeble. + *

      This module is upgradeable. * * @uses javax.xml.soap.MessageFactory * @uses javax.xml.soap.SAAJMetaFactory diff --git a/jdk/.hgtags b/jdk/.hgtags index 45aa796a2d8..e3517984641 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -432,3 +432,7 @@ a5506b425f1bf91530d8417b57360e5d89328c0c jdk-9+173 5f504872a75b71f2fb19299f0d1e3395cf32eaa0 jdk-10+12 e6c4f6ef717d104dba880e2dae538690c993b46f jdk-9+175 4540d6376f3ef22305cca546f85f9b2ce9a210c4 jdk-10+13 +7a2bc0a80087b63c909df2af6ec7d9ef44e6d7f7 jdk-10+14 +9f27d513658d5375b0e26846857d92563f279073 jdk-9+176 +80acf577b7d0b886fb555c9916552844f6cc72af jdk-9+177 +e069834e2c518a7bc2ffadc8c7e3cd7ec69fa8a0 jdk-10+15 diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 9407f91b329..3eafa4a47ea 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -749,12 +749,14 @@ ifeq ($(OPENJDK_TARGET_OS), windows) $(BUILD_LIBJAWT): $(BUILD_LIBAWT) - $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT) - $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@)) - $(call MakeDir, $(@D)) - $(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@ + $(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \ + FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX), \ + DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \ + )) - TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) + $(COPY_JAWT_LIB): $(BUILD_LIBJAWT) + + TARGETS += $(COPY_JAWT_LIB) else # OPENJDK_TARGET_OS not windows diff --git a/jdk/make/mapfiles/libsunec/mapfile-vers b/jdk/make/mapfiles/libsunec/mapfile-vers index af575506048..7ba855202cd 100644 --- a/jdk/make/mapfiles/libsunec/mapfile-vers +++ b/jdk/make/mapfiles/libsunec/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 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,6 +27,7 @@ SUNWprivate_1.1 { global: + Java_sun_security_ec_ECKeyPairGenerator_isCurveSupported; Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair; Java_sun_security_ec_ECDSASignature_signDigest; Java_sun_security_ec_ECDSASignature_verifySignedDigest; diff --git a/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java index 6983eaa64d2..6e2b0309667 100644 --- a/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java +++ b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java @@ -29,6 +29,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Set; import javax.lang.model.element.Element; +import javax.lang.model.element.ModuleElement; import com.sun.source.doctree.DocTree; import jdk.javadoc.doclet.Taglet; import static jdk.javadoc.doclet.Taglet.Location.*; @@ -62,7 +63,7 @@ public class ModuleGraph implements Taglet { return ""; } - String moduleName = element.getSimpleName().toString(); + String moduleName = ((ModuleElement) element).getQualifiedName().toString(); String imageFile = moduleName + "-graph.png"; int thumbnailHeight = -1; String hoverImage = ""; diff --git a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java index b2e08f8cb27..b162ed56733 100644 --- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java +++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java @@ -139,21 +139,21 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * * * - * + * * * - * + * * - * + * * - * + * * - * + * * diff --git a/jdk/src/java.base/share/classes/java/io/SerializablePermission.java b/jdk/src/java.base/share/classes/java/io/SerializablePermission.java index 93034a165a4..0080f33d507 100644 --- a/jdk/src/java.base/share/classes/java/io/SerializablePermission.java +++ b/jdk/src/java.base/share/classes/java/io/SerializablePermission.java @@ -48,15 +48,15 @@ import java.util.StringTokenizer; * * * - * - * - * + * + * + * * * * * * - * + * * @@ -69,7 +69,7 @@ import java.util.StringTokenizer; * * * - * + * * * * * - * + * * * diff --git a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java index 762740a5917..722618749da 100644 --- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java +++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java @@ -48,15 +48,15 @@ import java.lang.module.ModuleFinder; * what the target allows, and associated risks * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * @@ -255,7 +255,7 @@ import java.lang.module.ModuleFinder; * * * - * + * * @@ -267,7 +267,7 @@ import java.lang.module.ModuleFinder; * * * - * + * * @@ -277,7 +277,7 @@ import java.lang.module.ModuleFinder; * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * - * - * - * - * - * + * * * * * * - * + * * * * - * + * * * * - * + * * * diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java index 14ddf1463c7..c7687e78d4c 100644 --- a/jdk/src/java.base/share/classes/java/lang/System.java +++ b/jdk/src/java.base/share/classes/java/lang/System.java @@ -582,67 +582,67 @@ public final class System { *
      Access mode permitted values and meanings
      ValueMeaning
      ValueMeaning
      {@code "r"}
      {@code "r"} Open for reading only. Invoking any of the {@code write} * methods of the resulting object will cause an * {@link java.io.IOException} to be thrown.
      {@code "rw"}
      {@code "rw"} Open for reading and writing. If the file does not already * exist then an attempt will be made to create it.
      {@code "rws"}
      {@code "rws"} Open for reading and writing, as with {@code "rw"}, and also * require that every update to the file's content or metadata be * written synchronously to the underlying storage device.
      {@code "rwd"}
      {@code "rwd"} Open for reading and writing, as with {@code "rw"}, and also * require that every update to the file's content be written * synchronously to the underlying storage device.
      Permission target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      enableSubclassImplementationenableSubclassImplementationSubclass implementation of ObjectOutputStream or ObjectInputStream * to override the default serialization or deserialization, respectively, * of objects
      enableSubstitutionenableSubstitutionSubstitution of one object for another during * serialization or deserializationThis is dangerous because malicious code @@ -78,7 +78,7 @@ import java.util.StringTokenizer; *
      serialFilterserialFilterSetting a filter for ObjectInputStreams.Code could remove a configured filter and remove protections * already established.
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      createClassLoadercreateClassLoaderCreation of a class loaderThis is an extremely dangerous permission to grant. * Malicious applications that can instantiate their own class @@ -67,7 +67,7 @@ import java.lang.module.ModuleFinder; *
      getClassLoadergetClassLoaderRetrieval of a class loader (e.g., the class loader for the calling * class)This would grant an attacker permission to get the @@ -78,7 +78,7 @@ import java.lang.module.ModuleFinder; *
      setContextClassLoadersetContextClassLoaderSetting of the context class loader used by a threadThe context class loader is used by system code and extensions * when they need to lookup resources that might not exist in the system @@ -88,7 +88,7 @@ import java.lang.module.ModuleFinder; *
      enableContextClassLoaderOverrideenableContextClassLoaderOverrideSubclass implementation of the thread context class loader methodsThe context class loader is used by system code and extensions * when they need to lookup resources that might not exist in the system @@ -98,14 +98,14 @@ import java.lang.module.ModuleFinder; *
      closeClassLoadercloseClassLoaderClosing of a ClassLoaderGranting this permission allows code to close any URLClassLoader * that it has a reference to.
      setSecurityManagersetSecurityManagerSetting of the security manager (possibly replacing an existing one) * The security manager is a class that allows @@ -117,14 +117,14 @@ import java.lang.module.ModuleFinder; *
      createSecurityManagercreateSecurityManagerCreation of a new security managerThis gives code access to protected, sensitive methods that may * disclose information about other classes or the execution stack.
      getenv.{variable name}getenv.{variable name}Reading of the value of the specified environment variableThis would allow code to read the value, or determine the * existence, of a particular environment variable. This is @@ -132,7 +132,7 @@ import java.lang.module.ModuleFinder; *
      exitVM.{exit status}exitVM.{exit status}Halting of the Java Virtual Machine with the specified exit statusThis allows an attacker to mount a denial-of-service attack * by automatically forcing the virtual machine to halt. @@ -143,14 +143,14 @@ import java.lang.module.ModuleFinder; *
      shutdownHooksshutdownHooksRegistration and cancellation of virtual-machine shutdown hooksThis allows an attacker to register a malicious shutdown * hook that interferes with the clean shutdown of the virtual machine.
      setFactorysetFactorySetting of the socket factory used by ServerSocket or Socket, * or of the stream handler factory used by URLThis allows code to set the actual implementation @@ -160,7 +160,7 @@ import java.lang.module.ModuleFinder; *
      setIOsetIOSetting of System.out, System.in, and System.errThis allows changing the value of the standard system streams. * An attacker may change System.in to monitor and @@ -169,7 +169,7 @@ import java.lang.module.ModuleFinder; *
      modifyThreadmodifyThreadModification of threads, e.g., via calls to Thread * {@code interrupt, stop, suspend, resume, setDaemon, setPriority, * setName} and {@code setUncaughtExceptionHandler} @@ -179,7 +179,7 @@ import java.lang.module.ModuleFinder; *
      stopThreadstopThreadStopping of threads via calls to the Thread stop * methodThis allows code to stop any thread in the system provided that it is @@ -189,7 +189,7 @@ import java.lang.module.ModuleFinder; *
      modifyThreadGroupmodifyThreadGroupmodification of thread groups, e.g., via calls to ThreadGroup * destroy, getParent, resume, * setDaemon, setMaxPriority, stop, @@ -199,7 +199,7 @@ import java.lang.module.ModuleFinder; *
      getProtectionDomaingetProtectionDomainRetrieval of the ProtectionDomain for a classThis allows code to obtain policy information * for a particular code source. While obtaining policy information @@ -209,7 +209,7 @@ import java.lang.module.ModuleFinder; *
      getFileSystemAttributesgetFileSystemAttributesRetrieval of file system attributesThis allows code to obtain file system information such as disk usage * or disk space available to the caller. This is potentially dangerous @@ -219,7 +219,7 @@ import java.lang.module.ModuleFinder; *
      readFileDescriptorreadFileDescriptorReading of file descriptorsThis would allow code to read the particular file associated * with the file descriptor read. This is dangerous if the file @@ -227,7 +227,7 @@ import java.lang.module.ModuleFinder; *
      writeFileDescriptorwriteFileDescriptorWriting to file descriptorsThis allows code to write to a particular file associated * with the descriptor. This is dangerous because it may allow @@ -236,7 +236,7 @@ import java.lang.module.ModuleFinder; *
      loadLibrary.{library name}loadLibrary.{library name}Dynamic linking of the specified libraryIt is dangerous to allow an applet permission to load native code * libraries, because the Java security architecture is not designed to and @@ -244,7 +244,7 @@ import java.lang.module.ModuleFinder; *
      accessClassInPackage.{package name}accessClassInPackage.{package name}Access to the specified package via a class loader's * loadClass method when that class loader calls * the SecurityManager checkPackageAccess method
      defineClassInPackage.{package name}defineClassInPackage.{package name}Definition of classes in the specified package, via a class * loader's defineClass method when that class loader calls * the SecurityManager checkPackageDefinition method.
      defineClassdefineClassDefine a class with * {@link java.lang.invoke.MethodHandles.Lookup#defineClass(byte[]) * Lookup.defineClass}.
      accessDeclaredMembersaccessDeclaredMembersAccess to the declared members of a classThis grants code permission to query a class for its public, * protected, default (package) access, and private fields and/or @@ -295,14 +295,14 @@ import java.lang.module.ModuleFinder;
      queuePrintJobqueuePrintJobInitiation of a print job requestThis could print sensitive information to a printer, * or simply waste paper.
      getStackTracegetStackTraceRetrieval of the stack trace information of another thread.This allows retrieval of the stack trace information of * another thread. This might allow malicious code to monitor the @@ -310,7 +310,7 @@ import java.lang.module.ModuleFinder; *
      getStackWalkerWithClassReferencegetStackWalkerWithClassReferenceGet a stack walker that can retrieve stack frames with class reference.This allows retrieval of Class objects from stack walking. * This might allow malicious code to access Class objects on the stack @@ -318,7 +318,7 @@ import java.lang.module.ModuleFinder; *
      setDefaultUncaughtExceptionHandlersetDefaultUncaughtExceptionHandlerSetting the default handler to be used when a thread * terminates abruptly due to an uncaught exceptionThis allows an attacker to register a malicious @@ -327,7 +327,7 @@ import java.lang.module.ModuleFinder; *
      preferencespreferencesRepresents the permission required to get access to the * java.util.prefs.Preferences implementations user or system root * which in turn allows retrieval or update operations within the @@ -340,22 +340,14 @@ import java.lang.module.ModuleFinder; *
      usePolicyGranting this permission disables the Java Plug-In's default - * security prompting behavior.For more information, refer to the deployment guide. - *
      manageProcessmanageProcessNative process termination and information about processes * {@link ProcessHandle}.Allows code to identify and terminate processes that it did not create.
      localeServiceProviderlocaleServiceProviderThis {@code RuntimePermission} is required to be granted to * classes which subclass and implement * {@code java.util.spi.LocaleServiceProvider}. The permission is @@ -368,7 +360,7 @@ import java.lang.module.ModuleFinder; *
      loggerFinderloggerFinderThis {@code RuntimePermission} is required to be granted to * classes which subclass or call methods on * {@code java.lang.System.LoggerFinder}. The permission is @@ -381,7 +373,7 @@ import java.lang.module.ModuleFinder; *
      accessSystemModulesaccessSystemModulesAccess system modules in the runtime image.This grants the permission to access resources in the * {@linkplain ModuleFinder#ofSystem system modules} in the runtime image.
      * * - * - * + * + * * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * *
      Shows property keys and associated values
      KeyDescription of Associated Value
      KeyDescription of Associated Value
      java.version
      java.versionJava Runtime Environment version which may be interpreted * as a {@link Runtime.Version}
      java.vendor
      java.vendorJava Runtime Environment vendor
      java.vendor.url
      java.vendor.urlJava vendor URL
      java.home
      java.homeJava installation directory
      java.vm.specification.version
      java.vm.specification.versionJava Virtual Machine specification version which may be * interpreted as a {@link Runtime.Version}
      java.vm.specification.vendor
      java.vm.specification.vendorJava Virtual Machine specification vendor
      java.vm.specification.name
      java.vm.specification.nameJava Virtual Machine specification name
      java.vm.version
      java.vm.versionJava Virtual Machine implementation version which may be * interpreted as a {@link Runtime.Version}
      java.vm.vendor
      java.vm.vendorJava Virtual Machine implementation vendor
      java.vm.name
      java.vm.nameJava Virtual Machine implementation name
      java.specification.version
      java.specification.versionJava Runtime Environment specification version which may be * interpreted as a {@link Runtime.Version}
      java.specification.vendor
      java.specification.vendorJava Runtime Environment specification vendor
      java.specification.name
      java.specification.nameJava Runtime Environment specification name
      java.class.version
      java.class.versionJava class format version number
      java.class.path
      java.class.pathJava class path
      java.library.path
      java.library.pathList of paths to search when loading libraries
      java.io.tmpdir
      java.io.tmpdirDefault temp file path
      java.compiler
      java.compilerName of JIT compiler to use
      os.name
      os.nameOperating system name
      os.arch
      os.archOperating system architecture
      os.version
      os.versionOperating system version
      file.separator
      file.separatorFile separator ("/" on UNIX)
      path.separator
      path.separatorPath separator (":" on UNIX)
      line.separator
      line.separatorLine separator ("\n" on UNIX)
      user.name
      user.nameUser's account name
      user.home
      user.homeUser's home directory
      user.dir
      user.dirUser's current working directory
      @@ -659,17 +659,17 @@ public final class System { * * * - * - * + * + * * * - * + * * - * + * * - * + * * - * + * * * *
      Shows property keys and associated values
      KeyDescription of Associated Value
      KeyDescription of Associated Value
      {@code jdk.module.path}
      {@code jdk.module.path}The application module path
      {@code jdk.module.upgrade.path}
      {@code jdk.module.upgrade.path}The upgrade module path
      {@code jdk.module.main}
      {@code jdk.module.main}The module name of the initial/main module
      {@code jdk.module.main.class}
      {@code jdk.module.main.class}The main class name of the initial module
      diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java index 909f271c672..4c6121e2910 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java @@ -84,43 +84,43 @@ import static java.lang.invoke.MethodHandleStatics.*; * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index df76d3dbbcf..2bd64edb0e5 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -282,66 +282,66 @@ public class MethodHandles { * * * - * - * - * + * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java b/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java index 8b34ae3b4f2..58986bc8ce2 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java @@ -36,15 +36,15 @@ package java.lang.reflect; * * * - * - * - * + * + * + * * * * * * - * + * * * * - * + * * * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * @@ -108,7 +108,7 @@ import java.util.StringTokenizer; * * * - * + * * * * * - * + * * @@ -128,7 +128,7 @@ import java.util.StringTokenizer; * * * - * + * * * * * - * + * * * * * - * + * * * * * - * - * + * + * * * * * - * + * * * * - * + * *
      reference kinds
      reference kinddescriptive namescopememberbehavior
      reference kinddescriptive namescopememberbehavior
      {@code 1}{@code REF_getField}{@code class}{@code 1}{@code REF_getField}{@code class}{@code FT f;}{@code (T) this.f;}
      {@code 2}{@code REF_getStatic}{@code class} or {@code interface}{@code 2}{@code REF_getStatic}{@code class} or {@code interface}{@code static}
      {@code FT f;}
      {@code (T) C.f;}
      {@code 3}{@code REF_putField}{@code class}{@code 3}{@code REF_putField}{@code class}{@code FT f;}{@code this.f = x;}
      {@code 4}{@code REF_putStatic}{@code class}{@code 4}{@code REF_putStatic}{@code class}{@code static}
      {@code FT f;}
      {@code C.f = arg;}
      {@code 5}{@code REF_invokeVirtual}{@code class}{@code 5}{@code REF_invokeVirtual}{@code class}{@code T m(A*);}{@code (T) this.m(arg*);}
      {@code 6}{@code REF_invokeStatic}{@code class} or {@code interface}{@code 6}{@code REF_invokeStatic}{@code class} or {@code interface}{@code static}
      {@code T m(A*);}
      {@code (T) C.m(arg*);}
      {@code 7}{@code REF_invokeSpecial}{@code class} or {@code interface}{@code 7}{@code REF_invokeSpecial}{@code class} or {@code interface}{@code T m(A*);}{@code (T) super.m(arg*);}
      {@code 8}{@code REF_newInvokeSpecial}{@code class}{@code 8}{@code REF_newInvokeSpecial}{@code class}{@code C(A*);}{@code new C(arg*);}
      {@code 9}{@code REF_invokeInterface}{@code interface}{@code 9}{@code REF_invokeInterface}{@code interface}{@code T m(A*);}{@code (T) this.m(arg*);}
      lookup method behaviors
      lookup expressionmemberbytecode behaviorlookup expressionmemberbytecode behavior
      {@link java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}{@code FT f;}{@code (T) this.f;}
      {@link java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}{@code static}
      {@code FT f;}
      {@code (T) C.f;}
      {@link java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}{@code FT f;}{@code this.f = x;}
      {@link java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}{@code static}
      {@code FT f;}
      {@code C.f = arg;}
      {@link java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}{@link java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}{@code T m(A*);}{@code (T) this.m(arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}{@link java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}{@code static}
      {@code T m(A*);}
      {@code (T) C.m(arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}{@link java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}{@code T m(A*);}{@code (T) super.m(arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}{@link java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}{@code C(A*);}{@code new C(arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}{@link java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}({@code static})?
      {@code FT f;}
      {@code (FT) aField.get(thisOrNull);}
      {@link java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}{@link java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}({@code static})?
      {@code FT f;}
      {@code aField.set(thisOrNull, arg);}
      {@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}({@code static})?
      {@code T m(A*);}
      {@code (T) aMethod.invoke(thisOrNull, arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}{@link java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}{@code C(A*);}{@code (C) aConstructor.newInstance(arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}({@code static})?
      {@code T m(A*);}
      {@code (T) aMethod.invoke(thisOrNull, arg*);}
      {@link java.lang.invoke.MethodHandles.Lookup#findClass lookup.findClass("C")}{@link java.lang.invoke.MethodHandles.Lookup#findClass lookup.findClass("C")}{@code class C { ... }}{@code C.class;}
      Table shows permission target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      suppressAccessCheckssuppressAccessChecksability to suppress the standard Java language access checks * on fields and methods in a class; allow access not only public members * but also allow access to default (package) access, protected, @@ -53,7 +53,7 @@ package java.lang.reflect; * methods normally unavailable would be accessible to malicious code.
      newProxyInPackage.{package name}newProxyInPackage.{package name}ability to create a proxy instance in the specified package of which * the non-public interface that the proxy class implements.This gives code access to classes in packages to which it normally diff --git a/jdk/src/java.base/share/classes/java/net/NetPermission.java b/jdk/src/java.base/share/classes/java/net/NetPermission.java index f17c1b46d05..0df2c91a299 100644 --- a/jdk/src/java.base/share/classes/java/net/NetPermission.java +++ b/jdk/src/java.base/share/classes/java/net/NetPermission.java @@ -51,14 +51,14 @@ import java.util.StringTokenizer; *
      Permission target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      allowHttpTraceallowHttpTraceThe ability to use the HTTP TRACE method in HttpURLConnection.Malicious code using HTTP TRACE could get access to security sensitive * information in the HTTP headers (such as cookies) that it might not @@ -66,7 +66,7 @@ import java.util.StringTokenizer; *
      getCookieHandlergetCookieHandlerThe ability to get the cookie handler that processes highly * security sensitive cookie information for an Http session.Malicious code can get a cookie handler to obtain access to @@ -76,14 +76,14 @@ import java.util.StringTokenizer; *
      getNetworkInformationgetNetworkInformationThe ability to retrieve all information about local network interfaces.Malicious code can read information about network hardware such as * MAC addresses, which could be used to construct local IPv6 addresses.
      getProxySelectorgetProxySelectorThe ability to get the proxy selector used to make decisions * on which proxies to use when making network connections.Malicious code can get a ProxySelector to discover proxy @@ -92,7 +92,7 @@ import java.util.StringTokenizer; *
      getResponseCachegetResponseCacheThe ability to get the response cache that provides * access to a local response cache.Malicious code getting access to the local response cache @@ -100,7 +100,7 @@ import java.util.StringTokenizer; *
      requestPasswordAuthenticationrequestPasswordAuthenticationThe ability * to ask the authenticator registered with the system for * a password
      setCookieHandlersetCookieHandlerThe ability to set the cookie handler that processes highly * security sensitive cookie information for an Http session.Malicious code can set a cookie handler to obtain access to @@ -118,7 +118,7 @@ import java.util.StringTokenizer; *
      setDefaultAuthenticatorsetDefaultAuthenticatorThe ability to set the * way authentication information is retrieved when * a proxy or HTTP server asks for authentication
      setProxySelectorsetProxySelectorThe ability to set the proxy selector used to make decisions * on which proxies to use when making network connections.Malicious code can set a ProxySelector that directs network @@ -136,7 +136,7 @@ import java.util.StringTokenizer; *
      setResponseCachesetResponseCacheThe ability to set the response cache that provides access to * a local response cache.Malicious code getting access to the local response cache @@ -145,7 +145,7 @@ import java.util.StringTokenizer; *
      specifyStreamHandlerspecifyStreamHandlerThe ability * to specify a stream handler when constructing a URLMalicious code may create a URL with resources that it would diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java index acd7da8b1d9..2ee7fd7a3ad 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java @@ -64,13 +64,13 @@ import java.util.concurrent.TimeUnit; *
      System properties
      System propertyDescriptionSystem propertyDescription
      {@code java.nio.channels.DefaultThreadPool.threadFactory} {@code java.nio.channels.DefaultThreadPool.threadFactory} The value of this property is taken to be the fully-qualified name * of a concrete {@link java.util.concurrent.ThreadFactory ThreadFactory} * class. The class is loaded using the system class loader and instantiated. @@ -81,7 +81,7 @@ import java.util.concurrent.TimeUnit; * construction of the default group.
      {@code java.nio.channels.DefaultThreadPool.initialSize} {@code java.nio.channels.DefaultThreadPool.initialSize} The value of the {@code initialSize} parameter for the default * group (see {@link #withCachedThreadPool withCachedThreadPool}). * The value of the property is taken to be the {@code String} diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java index 9653a433050..0c0d0e6d3b5 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java @@ -136,17 +136,17 @@ public abstract class AsynchronousFileChannel * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java index 6ba16628632..8e54704beab 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java @@ -66,29 +66,29 @@ import java.nio.ByteBuffer; * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java index ac96bc61596..2aea82e1d34 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java @@ -61,44 +61,44 @@ import java.nio.channels.spi.SelectorProvider; * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java index 551ef21bb2c..9ee447dbaf6 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java @@ -177,11 +177,11 @@ public abstract class FileChannel *
      additional options
      Option Description
      Option Description
      {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} When opening an existing file, the file is first truncated to a * size of 0 bytes. This option is ignored when the file is opened only * for reading.
      {@link StandardOpenOption#CREATE_NEW CREATE_NEW} {@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if * the file already exists. When creating a file the check for the * existence of the file and the creation of the file if it does not exist @@ -154,7 +154,7 @@ public abstract class AsynchronousFileChannel * ignored when the file is opened only for reading.
      {@link StandardOpenOption#CREATE CREATE} {@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it * exists, otherwise a new file is created. When creating a file the check * for the existence of the file and the creation of the file if it does @@ -163,7 +163,7 @@ public abstract class AsynchronousFileChannel * the file is opened only for reading.
      {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a * best effort attempt to delete the file when closed by the * the {@link #close close} method. If the {@code close} method is not @@ -171,20 +171,20 @@ public abstract class AsynchronousFileChannel * when the Java virtual machine terminates.
      {@link StandardOpenOption#SPARSE SPARSE} {@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the * new file will be sparse. This option is ignored when not creating * a new file.
      {@link StandardOpenOption#SYNC SYNC} {@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see Synchronized I/O file * integrity).
      {@link StandardOpenOption#DSYNC DSYNC} {@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written * synchronously to the underlying storage device. (see Synchronized I/O file diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java index 137451c7763..d50fa743199 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java @@ -56,17 +56,17 @@ import java.io.IOException; *
      Socket options
      Option NameDescriptionOption NameDescription
      {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
      {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
      Socket options
      Option NameDescriptionOption NameDescription
      {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} The size of the socket send buffer
      {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
      {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} Keep connection alive
      {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
      {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} Disable the Nagle algorithm
      Socket options
      Option NameDescriptionOption NameDescription
      {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} The size of the socket send buffer
      {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
      {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
      {@link java.net.StandardSocketOptions#SO_BROADCAST SO_BROADCAST} {@link java.net.StandardSocketOptions#SO_BROADCAST SO_BROADCAST} Allow transmission of broadcast datagrams
      {@link java.net.StandardSocketOptions#IP_TOS IP_TOS} {@link java.net.StandardSocketOptions#IP_TOS IP_TOS} The Type of Service (ToS) octet in the Internet Protocol (IP) header
      {@link java.net.StandardSocketOptions#IP_MULTICAST_IF IP_MULTICAST_IF} {@link java.net.StandardSocketOptions#IP_MULTICAST_IF IP_MULTICAST_IF} The network interface for Internet Protocol (IP) multicast datagrams
      {@link java.net.StandardSocketOptions#IP_MULTICAST_TTL - * IP_MULTICAST_TTL} {@link java.net.StandardSocketOptions#IP_MULTICAST_TTL + * IP_MULTICAST_TTL} The time-to-live for Internet Protocol (IP) multicast * datagrams
      {@link java.net.StandardSocketOptions#IP_MULTICAST_LOOP - * IP_MULTICAST_LOOP} {@link java.net.StandardSocketOptions#IP_MULTICAST_LOOP + * IP_MULTICAST_LOOP} Loopback for Internet Protocol (IP) multicast datagrams
      * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java index 0025d2c22cf..b3b73dd7dfa 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java @@ -70,34 +70,34 @@ import java.nio.channels.spi.SelectorProvider; * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java index 3af94ff623f..7d54357f59c 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java @@ -150,23 +150,23 @@ import sun.security.action.GetPropertyAction; *
      additional options
      Option Description
      Option Description
      {@link StandardOpenOption#APPEND APPEND} {@link StandardOpenOption#APPEND APPEND} If this option is present then the file is opened for writing and * each invocation of the channel's {@code write} method first advances * the position to the end of the file and then writes the requested @@ -191,13 +191,13 @@ public abstract class FileChannel * with the {@code READ} or {@code TRUNCATE_EXISTING} options.
      {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} If this option is present then the existing file is truncated to * a size of 0 bytes. This option is ignored when the file is opened only * for reading.
      {@link StandardOpenOption#CREATE_NEW CREATE_NEW} {@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if * the file already exists. When creating a file the check for the * existence of the file and the creation of the file if it does not exist @@ -205,7 +205,7 @@ public abstract class FileChannel * ignored when the file is opened only for reading.
      {@link StandardOpenOption#CREATE CREATE} {@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it * exists, otherwise a new file is created. When creating a file the check * for the existence of the file and the creation of the file if it does @@ -214,7 +214,7 @@ public abstract class FileChannel * the file is opened only for reading.
      {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a * best effort attempt to delete the file when closed by the * the {@link #close close} method. If the {@code close} method is not @@ -222,20 +222,20 @@ public abstract class FileChannel * when the Java virtual machine terminates.
      {@link StandardOpenOption#SPARSE SPARSE} {@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the * new file will be sparse. This option is ignored when not creating * a new file.
      {@link StandardOpenOption#SYNC SYNC} {@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see Synchronized I/O file * integrity).
      {@link StandardOpenOption#DSYNC DSYNC} {@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written * synchronously to the underlying storage device. (see Synchronized I/O file diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java index ea8951b2d2e..24992385688 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java @@ -50,17 +50,17 @@ import java.nio.channels.spi.SelectorProvider; *
      Socket options
      Option NameDescriptionOption NameDescription
      {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
      {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
      Socket options
      Option NameDescriptionOption NameDescription
      {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} The size of the socket send buffer
      {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
      {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} Keep connection alive
      {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
      {@link java.net.StandardSocketOptions#SO_LINGER SO_LINGER} {@link java.net.StandardSocketOptions#SO_LINGER SO_LINGER} Linger on close if data is present (when configured in blocking mode * only)
      {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} Disable the Nagle algorithm
      * * - * + * * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * diff --git a/jdk/src/java.base/share/classes/java/nio/file/Files.java b/jdk/src/java.base/share/classes/java/nio/file/Files.java index ac662e4e431..09bce16a844 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java @@ -236,11 +236,11 @@ public final class Files { *
      Description of standard charsets
      CharsetDescription
      CharsetDescription
      {@code US-ASCII}
      {@code US-ASCII}Seven-bit ASCII, a.k.a. {@code ISO646-US}, * a.k.a. the Basic Latin block of the Unicode character set
      ISO-8859-1  
      ISO-8859-1  ISO Latin Alphabet No. 1, a.k.a. {@code ISO-LATIN-1}
      {@code UTF-8}
      {@code UTF-8}Eight-bit UCS Transformation Format
      {@code UTF-16BE}
      {@code UTF-16BE}Sixteen-bit UCS Transformation Format, * big-endian byte order
      {@code UTF-16LE}
      {@code UTF-16LE}Sixteen-bit UCS Transformation Format, * little-endian byte order
      {@code UTF-16}
      {@code UTF-16}Sixteen-bit UCS Transformation Format, * byte order identified by an optional byte-order mark
      * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * *
      Options
      Option Description
      Option Description
      {@link StandardOpenOption#APPEND APPEND} {@link StandardOpenOption#APPEND APPEND} If this option is present then the file is opened for writing and * each invocation of the channel's {@code write} method first advances * the position to the end of the file and then writes the requested @@ -250,13 +250,13 @@ public final class Files { * with the {@code READ} or {@code TRUNCATE_EXISTING} options.
      {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} If this option is present then the existing file is truncated to * a size of 0 bytes. This option is ignored when the file is opened only * for reading.
      {@link StandardOpenOption#CREATE_NEW CREATE_NEW} {@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if * the file already exists or is a symbolic link. When creating a file the * check for the existence of the file and the creation of the file if it @@ -264,14 +264,14 @@ public final class Files { * This option is ignored when the file is opened only for reading.
      {@link StandardOpenOption#CREATE CREATE} {@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it * exists, otherwise a new file is created. This option is ignored if the * {@code CREATE_NEW} option is also present or the file is opened only * for reading.
      {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a * best effort attempt to delete the file when closed by the * {@link SeekableByteChannel#close close} method. If the {@code close} @@ -279,20 +279,20 @@ public final class Files { * delete the file when the Java virtual machine terminates.
      {@link StandardOpenOption#SPARSE SPARSE} {@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the * new file will be sparse. This option is ignored when not creating * a new file.
      {@link StandardOpenOption#SYNC SYNC} {@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see Synchronized I/O file * integrity).
      {@link StandardOpenOption#DSYNC DSYNC} {@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written * synchronously to the underlying storage device. (see Synchronized I/O file @@ -1196,18 +1196,18 @@ public final class Files { * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/util/Formatter.java b/jdk/src/java.base/share/classes/java/util/Formatter.java index 39c23af20ff..a65bbd0f487 100644 --- a/jdk/src/java.base/share/classes/java/util/Formatter.java +++ b/jdk/src/java.base/share/classes/java/util/Formatter.java @@ -293,12 +293,12 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      Options
      Option Description
      Option Description
      {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it * is not a non-empty directory. If the target file exists and is a * symbolic link, then the symbolic link itself, not the target of * the link, is replaced.
      {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} Attempts to copy the file attributes associated with this file to * the target file. The exact file attributes that are copied is platform * and file system dependent and therefore unspecified. Minimally, the @@ -1217,7 +1217,7 @@ public final class Files { * loss.
      {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} Symbolic links are not followed. If the file is a symbolic link, * then the symbolic link itself, not the target of the link, is copied. * It is implementation specific if file attributes can be copied to the @@ -1319,18 +1319,18 @@ public final class Files { * * * - * + * * * * - * + * * * * - * + * * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java index 465fb6bc3f3..a6b3e41ee8e 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java @@ -45,45 +45,45 @@ import java.io.IOException; * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java index be4f570b46b..0c600fbda0a 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java @@ -45,25 +45,25 @@ import java.io.IOException; * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java index 9e171768603..7e294d8ac45 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java @@ -78,17 +78,17 @@ import java.io.IOException; * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java index 26dc40606de..0af9162a768 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java @@ -922,21 +922,21 @@ public abstract class FileSystemProvider { *
      Options
      Option Description
      Option Description
      {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it * is not a non-empty directory. If the target file exists and is a * symbolic link, then the symbolic link itself, not the target of * the link, is replaced.
      {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} The move is performed as an atomic file system operation and all * other options are ignored. If the target file exists then it is * implementation specific if the existing file is replaced or this method diff --git a/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java b/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java index 8f82d9f2adb..a7c3cc8a4ca 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java +++ b/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java @@ -37,14 +37,14 @@ import java.security.BasicPermission; *
      Table shows permission target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      hardhard Ability to add an existing file to a directory. This is sometimes * known as creating a link, or hard link. Extreme care should be taken when granting this permission. It allows @@ -52,7 +52,7 @@ import java.security.BasicPermission; * attacker access to all files.
      symbolicsymbolic Ability to create symbolic links. Extreme care should be taken when granting this permission. It allows * linking to any file or directory in the file system thus allowing the diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java index 4ba76741dd0..6db57e2fa50 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java @@ -98,17 +98,17 @@ import java.io.IOException; *
      Supported attributes
      Name Type Name Type
      "acl" "acl" {@link List}<{@link AclEntry}>
      "owner" "owner" {@link UserPrincipal}
      Supported attributes
      Name Type Name Type
      "lastModifiedTime" "lastModifiedTime" {@link FileTime}
      "lastAccessTime" "lastAccessTime" {@link FileTime}
      "creationTime" "creationTime" {@link FileTime}
      "size" "size" {@link Long}
      "isRegularFile" "isRegularFile" {@link Boolean}
      "isDirectory" "isDirectory" {@link Boolean}
      "isSymbolicLink" "isSymbolicLink" {@link Boolean}
      "isOther" "isOther" {@link Boolean}
      "fileKey" "fileKey" {@link Object}
      Supported attributes
      Name Type Name Type
      readonly readonly {@link Boolean}
      hidden hidden {@link Boolean}
      system system {@link Boolean}
      archive archive {@link Boolean}
      Supported attributes
      Name Type Name Type
      "permissions" "permissions" {@link Set}<{@link PosixFilePermission}>
      "group" "group" {@link GroupPrincipal}
      * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * @@ -296,7 +296,7 @@ import java.util.StringTokenizer; * * * - * + * * * * * - * + * * * * * - * * * - * - * - * - * - * - * - * - * - * - * - * * * - * * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * * * - * * * - * - * - * - * - * - * - * - * - * - * - * *
      Access Modes
      Value Description
      Value Description
      {@link AccessMode#READ READ} {@link AccessMode#READ READ} Checks that the file exists and that the Java virtual machine has * permission to read the file.
      {@link AccessMode#WRITE WRITE} {@link AccessMode#WRITE WRITE} Checks that the file exists and that the Java virtual machine has * permission to write to the file,
      {@link AccessMode#EXECUTE EXECUTE} {@link AccessMode#EXECUTE EXECUTE} Checks that the file exists and that the Java virtual machine has * permission to {@link Runtime#exec execute} the file. The semantics * may differ when checking access to a directory. For example, on UNIX diff --git a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java index 5211c23735d..ccf013cd05a 100644 --- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java +++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java @@ -49,15 +49,15 @@ import java.util.StringTokenizer; *
      target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      authProvider.{provider name}authProvider.{provider name}Allow the named provider to be an AuthProvider for login and * logout operations. This allows the named provider to perform login and logout @@ -68,7 +68,7 @@ import java.util.StringTokenizer; *
      createAccessControlContextcreateAccessControlContextCreation of an AccessControlContextThis allows someone to instantiate an AccessControlContext * with a {@code DomainCombiner}. Extreme care must be taken when @@ -78,7 +78,7 @@ import java.util.StringTokenizer; *
      getDomainCombinergetDomainCombinerRetrieval of an AccessControlContext's DomainCombinerThis allows someone to retrieve an AccessControlContext's * {@code DomainCombiner}. Since DomainCombiners may contain @@ -86,7 +86,7 @@ import java.util.StringTokenizer; *
      getPolicygetPolicyRetrieval of the system-wide security policy (specifically, of the * currently-installed Policy object)This allows someone to query the policy via the @@ -99,7 +99,7 @@ import java.util.StringTokenizer; *
      setPolicysetPolicySetting of the system-wide security policy (specifically, * the Policy object)Granting this permission is extremely dangerous, as malicious @@ -108,7 +108,7 @@ import java.util.StringTokenizer; *
      createPolicy.{policy type}createPolicy.{policy type}Getting an instance of a Policy implementation from a providerGranting this permission enables code to obtain a Policy object. * Malicious code may query the Policy object to determine what permissions @@ -116,7 +116,7 @@ import java.util.StringTokenizer; *
      getProperty.{key}getProperty.{key}Retrieval of the security property with the specified keyDepending on the particular key for which access has * been granted, the code may have access to the list of security @@ -129,7 +129,7 @@ import java.util.StringTokenizer; *
      setProperty.{key}setProperty.{key}Setting of the security property with the specified keyThis could include setting a security provider or defining * the location of the system-wide security policy. Malicious @@ -144,7 +144,7 @@ import java.util.StringTokenizer; *
      insertProviderinsertProviderAddition of a new providerThis would allow somebody to introduce a possibly * malicious provider (e.g., one that discloses the private keys passed @@ -158,7 +158,7 @@ import java.util.StringTokenizer; *
      removeProvider.{provider name}removeProvider.{provider name}Removal of the specified providerThis may change the behavior or disable execution of other * parts of the program. If a provider subsequently requested by the @@ -171,7 +171,7 @@ import java.util.StringTokenizer; *
      clearProviderProperties.{provider name}clearProviderProperties.{provider name}"Clearing" of a Provider so that it no longer contains the properties * used to look up services implemented by the providerThis disables the lookup of services implemented by the provider. @@ -181,7 +181,7 @@ import java.util.StringTokenizer; *
      putProviderProperty.{provider name}putProviderProperty.{provider name}Setting of properties for the specified ProviderThe provider properties each specify the name and location * of a particular service implemented by the provider. By granting @@ -190,7 +190,7 @@ import java.util.StringTokenizer; *
      removeProviderProperty.{provider name}removeProviderProperty.{provider name}Removal of properties from the specified ProviderThis disables the lookup of services implemented by the * provider. They are no longer accessible due to removal of the properties @@ -213,15 +213,15 @@ import java.util.StringTokenizer; *
      target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      insertProvider.{provider name}insertProvider.{provider name}Addition of a new provider, with the specified nameUse of this permission is discouraged from further use because it is * possible to circumvent the name restrictions by overriding the @@ -238,7 +238,7 @@ import java.util.StringTokenizer; *
      setSystemScopesetSystemScopeSetting of the system identity scopeThis would allow an attacker to configure the system identity scope with * certificates that should not be trusted, thereby granting applet or @@ -247,7 +247,7 @@ import java.util.StringTokenizer; *
      setIdentityPublicKeysetIdentityPublicKeySetting of the public key for an IdentityIf the identity is marked as "trusted", this allows an attacker to * introduce a different public key (e.g., its own) that is not trusted @@ -257,7 +257,7 @@ import java.util.StringTokenizer; *
      setIdentityInfosetIdentityInfoSetting of a general information string for an IdentityThis allows attackers to set the general description for * an identity. This may trick applications into using a different @@ -266,7 +266,7 @@ import java.util.StringTokenizer; *
      addIdentityCertificateaddIdentityCertificateAddition of a certificate for an IdentityThis allows attackers to set a certificate for * an identity's public key. This is dangerous because it affects @@ -275,7 +275,7 @@ import java.util.StringTokenizer; *
      removeIdentityCertificateremoveIdentityCertificateRemoval of a certificate for an IdentityThis allows attackers to remove a certificate for * an identity's public key. This is dangerous because it affects @@ -284,7 +284,7 @@ import java.util.StringTokenizer; *
      printIdentityprintIdentityViewing the name of a principal * and optionally the scope in which it is used, and whether * or not it is considered "trusted" in that scope
      getSignerPrivateKeygetSignerPrivateKeyRetrieval of a Signer's private keyIt is very dangerous to allow access to a private key; private * keys are supposed to be kept secret. Otherwise, code can use the @@ -305,7 +305,7 @@ import java.util.StringTokenizer; *
      setSignerKeyPairsetSignerKeyPairSetting of the key pair (public key and private key) for a SignerThis would allow an attacker to replace somebody else's (the "target's") * keypair with a possibly weaker keypair (e.g., a keypair of a smaller diff --git a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java index 84f6fcbab8e..60c82abc126 100644 --- a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java +++ b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java @@ -176,60 +176,60 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; *
      Chart showing symbol, location, localized, and meaning.
      Symbol - * Location - * Localized? - * Meaning + * Symbol + * Location + * Localized? + * Meaning *
      0 + * 0 * Number * Yes * Digit *
      # + * # * Number * Yes * Digit, zero shows as absent *
      . + * . * Number * Yes * Decimal separator or monetary decimal separator *
      - + * - * Number * Yes * Minus sign *
      , + * , * Number * Yes * Grouping separator *
      E + * E * Number * Yes * Separates mantissa and exponent in scientific notation. * Need not be quoted in prefix or suffix. *
      ; + * ; * Subpattern boundary * Yes * Separates positive and negative subpatterns *
      % + * % * Prefix or suffix * Yes * Multiply by 100 and show as percentage *
      \u2030 + * \u2030 * Prefix or suffix * Yes * Multiply by 1000 and show as per mille value *
      ¤ (\u00A4) + * ¤ (\u00A4) * Prefix or suffix * No * Currency sign, replaced by currency symbol. If @@ -237,7 +237,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * If present in a pattern, the monetary decimal separator * is used instead of the decimal separator. *
      ' + * ' * Prefix or suffix * No * Used to quote special characters in a prefix or suffix, diff --git a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java index 4990338e1a6..805d1ef313a 100644 --- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java +++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java @@ -96,124 +96,124 @@ import sun.util.locale.provider.LocaleProviderAdapter; *
      Chart shows pattern letters, date/time component, presentation, and examples.
      Letter - * Date or Time Component - * Presentation - * Examples + * Letter + * Date or Time Component + * Presentation + * Examples *
      G + * G * Era designator * Text * AD *
      y + * y * Year * Year * 1996; 96 *
      Y + * Y * Week year * Year * 2009; 09 *
      M + * M * Month in year (context sensitive) * Month * July; Jul; 07 *
      L + * L * Month in year (standalone form) * Month * July; Jul; 07 *
      w + * w * Week in year * Number * 27 *
      W + * W * Week in month * Number * 2 *
      D + * D * Day in year * Number * 189 *
      d + * d * Day in month * Number * 10 *
      F + * F * Day of week in month * Number * 2 *
      E + * E * Day name in week * Text * Tuesday; Tue *
      u + * u * Day number of week (1 = Monday, ..., 7 = Sunday) * Number * 1 *
      a + * a * Am/pm marker * Text * PM *
      H + * H * Hour in day (0-23) * Number * 0 *
      k + * k * Hour in day (1-24) * Number * 24 *
      K + * K * Hour in am/pm (0-11) * Number * 0 *
      h + * h * Hour in am/pm (1-12) * Number * 12 *
      m + * m * Minute in hour * Number * 30 *
      s + * s * Second in minute * Number * 55 *
      S + * S * Millisecond * Number * 978 *
      z + * z * Time zone * General time zone * Pacific Standard Time; PST; GMT-08:00 *
      Z + * Z * Time zone * RFC 822 time zone * -0800 *
      X + * X * Time zone * ISO 8601 time zone * -08; -0800; -08:00 @@ -379,42 +379,42 @@ import sun.util.locale.provider.LocaleProviderAdapter; *
      Examples of date and time patterns interpreted in the U.S. locale
      Date and Time Pattern - * Result + * Date and Time Pattern + * Result *
      "yyyy.MM.dd G 'at' HH:mm:ss z" + * "yyyy.MM.dd G 'at' HH:mm:ss z" * 2001.07.04 AD at 12:08:56 PDT *
      "EEE, MMM d, ''yy" + * "EEE, MMM d, ''yy" * Wed, Jul 4, '01 *
      "h:mm a" + * "h:mm a" * 12:08 PM *
      "hh 'o''clock' a, zzzz" + * "hh 'o''clock' a, zzzz" * 12 o'clock PM, Pacific Daylight Time *
      "K:mm a, z" + * "K:mm a, z" * 0:08 PM, PDT *
      "yyyyy.MMMMM.dd GGG hh:mm aaa" + * "yyyyy.MMMMM.dd GGG hh:mm aaa" * 02001.July.04 AD 12:08 PM *
      "EEE, d MMM yyyy HH:mm:ss Z" + * "EEE, d MMM yyyy HH:mm:ss Z" * Wed, 4 Jul 2001 12:08:56 -0700 *
      "yyMMddHHmmssZ" + * "yyMMddHHmmssZ" * 010704120856-0700 *
      "yyyy-MM-dd'T'HH:mm:ss.SSSZ" + * "yyyy-MM-dd'T'HH:mm:ss.SSSZ" * 2001-07-04T12:08:56.235-0700 *
      "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" + * "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" * 2001-07-04T12:08:56.235-07:00 *
      "YYYY-'W'ww-u" + * "YYYY-'W'ww-u" * 2001-W27-3 *
      diff --git a/jdk/src/java.base/share/classes/java/time/OffsetDateTime.java b/jdk/src/java.base/share/classes/java/time/OffsetDateTime.java index 075638a6f68..0e1c47c8a10 100644 --- a/jdk/src/java.base/share/classes/java/time/OffsetDateTime.java +++ b/jdk/src/java.base/share/classes/java/time/OffsetDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -100,7 +100,7 @@ import java.util.Objects; * {@code OffsetDateTime} is an immutable representation of a date-time with an offset. * This class stores all date and time fields, to a precision of nanoseconds, * as well as the offset from UTC/Greenwich. For example, the value - * "2nd October 2007 at 13:45.30.123456789 +02:00" can be stored in an {@code OffsetDateTime}. + * "2nd October 2007 at 13:45:30.123456789 +02:00" can be stored in an {@code OffsetDateTime}. *

      * {@code OffsetDateTime}, {@link java.time.ZonedDateTime} and {@link java.time.Instant} all store an instant * on the time-line to nanosecond precision. diff --git a/jdk/src/java.base/share/classes/java/time/OffsetTime.java b/jdk/src/java.base/share/classes/java/time/OffsetTime.java index 65cf560f2bb..36a22e6d4c1 100644 --- a/jdk/src/java.base/share/classes/java/time/OffsetTime.java +++ b/jdk/src/java.base/share/classes/java/time/OffsetTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -100,7 +100,7 @@ import java.util.Objects; * viewed as hour-minute-second-offset. * This class stores all time fields, to a precision of nanoseconds, * as well as a zone offset. - * For example, the value "13:45.30.123456789+02:00" can be stored + * For example, the value "13:45:30.123456789+02:00" can be stored * in an {@code OffsetTime}. * *

      diff --git a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java index cda0f8abb48..7315a9a3544 100644 --- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java +++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java @@ -154,103 +154,103 @@ import java.util.Set; *

      Predefined Formatters
      FormatterDescriptionExampleFormatterDescriptionExample
      {@link #ofLocalizedDate ofLocalizedDate(dateStyle)} {@link #ofLocalizedDate ofLocalizedDate(dateStyle)} Formatter with date style from the locale '2011-12-03'
      {@link #ofLocalizedTime ofLocalizedTime(timeStyle)} {@link #ofLocalizedTime ofLocalizedTime(timeStyle)} Formatter with time style from the locale '10:15:30'
      {@link #ofLocalizedDateTime ofLocalizedDateTime(dateTimeStyle)} {@link #ofLocalizedDateTime ofLocalizedDateTime(dateTimeStyle)} Formatter with a style for date and time from the locale '3 Jun 2008 11:05:30'
      {@link #ofLocalizedDateTime ofLocalizedDateTime(dateStyle,timeStyle)} - * {@link #ofLocalizedDateTime ofLocalizedDateTime(dateStyle,timeStyle)} + * Formatter with date and time styles from the locale '3 Jun 2008 11:05'
      {@link #BASIC_ISO_DATE} {@link #BASIC_ISO_DATE}Basic ISO date '20111203'
      {@link #ISO_LOCAL_DATE} {@link #ISO_LOCAL_DATE} ISO Local Date '2011-12-03'
      {@link #ISO_OFFSET_DATE} {@link #ISO_OFFSET_DATE} ISO Date with offset '2011-12-03+01:00'
      {@link #ISO_DATE} {@link #ISO_DATE} ISO Date with or without offset '2011-12-03+01:00'; '2011-12-03'
      {@link #ISO_LOCAL_TIME} {@link #ISO_LOCAL_TIME} Time without offset '10:15:30'
      {@link #ISO_OFFSET_TIME} {@link #ISO_OFFSET_TIME} Time with offset '10:15:30+01:00'
      {@link #ISO_TIME} {@link #ISO_TIME} Time with or without offset '10:15:30+01:00'; '10:15:30'
      {@link #ISO_LOCAL_DATE_TIME} {@link #ISO_LOCAL_DATE_TIME} ISO Local Date and Time '2011-12-03T10:15:30'
      {@link #ISO_OFFSET_DATE_TIME} {@link #ISO_OFFSET_DATE_TIME} Date Time with Offset * 2011-12-03T10:15:30+01:00'
      {@link #ISO_ZONED_DATE_TIME} {@link #ISO_ZONED_DATE_TIME} Zoned Date Time '2011-12-03T10:15:30+01:00[Europe/Paris]'
      {@link #ISO_DATE_TIME} {@link #ISO_DATE_TIME} Date and time with ZoneId '2011-12-03T10:15:30+01:00[Europe/Paris]'
      {@link #ISO_ORDINAL_DATE} {@link #ISO_ORDINAL_DATE} Year and day of year '2012-337'
      {@link #ISO_WEEK_DATE} {@link #ISO_WEEK_DATE} Year and Week 2012-W48-6'
      {@link #ISO_INSTANT} {@link #ISO_INSTANT} Date and Time of an Instant '2011-12-03T10:15:30Z'
      {@link #RFC_1123_DATE_TIME} {@link #RFC_1123_DATE_TIME} RFC 1123 / RFC 822 'Tue, 3 Jun 2008 11:05:30 GMT'
      * * - * * - *
      genConv
      Conversion - * Argument Category - * Description + *
      Conversion + * Argument Category + * Description *
      {@code 'b'}, {@code 'B'} + *
      {@code 'b'}, {@code 'B'} * general * If the argument arg is {@code null}, then the result is * "{@code false}". If arg is a {@code boolean} or {@link @@ -306,64 +306,64 @@ import jdk.internal.math.FormattedFloatingDecimal; * String#valueOf(boolean) String.valueOf(arg)}. Otherwise, the result is * "true". * - *
      {@code 'h'}, {@code 'H'} + *
      {@code 'h'}, {@code 'H'} * general * The result is obtained by invoking * {@code Integer.toHexString(arg.hashCode())}. * - *
      {@code 's'}, {@code 'S'} + *
      {@code 's'}, {@code 'S'} * general * If arg implements {@link Formattable}, then * {@link Formattable#formatTo arg.formatTo} is invoked. Otherwise, the * result is obtained by invoking {@code arg.toString()}. * - *
      {@code 'c'}, {@code 'C'} + *
      {@code 'c'}, {@code 'C'} * character * The result is a Unicode character * - *
      {@code 'd'} + *
      {@code 'd'} * integral * The result is formatted as a decimal integer * - *
      {@code 'o'} + *
      {@code 'o'} * integral * The result is formatted as an octal integer * - *
      {@code 'x'}, {@code 'X'} + *
      {@code 'x'}, {@code 'X'} * integral * The result is formatted as a hexadecimal integer * - *
      {@code 'e'}, {@code 'E'} + *
      {@code 'e'}, {@code 'E'} * floating point * The result is formatted as a decimal number in computerized * scientific notation * - *
      {@code 'f'} + *
      {@code 'f'} * floating point * The result is formatted as a decimal number * - *
      {@code 'g'}, {@code 'G'} + *
      {@code 'g'}, {@code 'G'} * floating point * The result is formatted using computerized scientific notation or * decimal format, depending on the precision and the value after rounding. * - *
      {@code 'a'}, {@code 'A'} + *
      {@code 'a'}, {@code 'A'} * floating point * The result is formatted as a hexadecimal floating-point number with * a significand and an exponent. This conversion is not supported * for the {@code BigDecimal} type despite the latter's being in the * floating point argument category. * - *
      {@code 't'}, {@code 'T'} + *
      {@code 't'}, {@code 'T'} * date/time * Prefix for date and time conversion characters. See Date/Time Conversions. * - *
      {@code '%'} + *
      {@code '%'} * percent * The result is a literal {@code '%'} ('\u0025') * - *
      {@code 'n'} + *
      {@code 'n'} * line separator * The result is the platform-specific line separator * @@ -387,44 +387,44 @@ import jdk.internal.math.FormattedFloatingDecimal; * * * - * * * - * @@ -519,25 +519,25 @@ import jdk.internal.math.FormattedFloatingDecimal; * * * - * * * - * - * - * + * + * + * * * * * - * * * * - * * * * - * * * * - * * * * * - * * * * - * - * - * + * + * + * * * * * * - * + * * * * - * + * * * * * - * + * * * - - + + - + - + - + - + diff --git a/jdk/src/java.sql/share/classes/java/sql/Connection.java b/jdk/src/java.sql/share/classes/java/sql/Connection.java index 446f63c0f36..f3a6da0caa5 100644 --- a/jdk/src/java.sql/share/classes/java/sql/Connection.java +++ b/jdk/src/java.sql/share/classes/java/sql/Connection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1523,7 +1523,7 @@ throws SQLException; * * @implSpec * The default implementation is a no-op. - *

      + * * @apiNote * This method is to be used by Connection pooling managers. *

      diff --git a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java index 6c4f68a58b8..2399b596d8f 100644 --- a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java +++ b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,6 @@ import jdk.internal.reflect.Reflection; * via the {@linkplain ServiceLoader#load service-provider loading} mechanism. * * - *

      * @implNote * {@code DriverManager} initialization is done lazily and looks up service * providers using the thread context class loader. The drivers loaded and diff --git a/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java b/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java index 9907b98cc0d..dbdfb50efa0 100644 --- a/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java +++ b/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java @@ -62,29 +62,29 @@ import java.security.*; *

      * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * *
      time
      {@code 'H'} + *
      {@code 'H'} * Hour of the day for the 24-hour clock, formatted as two digits with * a leading zero as necessary i.e. {@code 00 - 23}. * - *
      {@code 'I'} + *
      {@code 'I'} * Hour for the 12-hour clock, formatted as two digits with a leading * zero as necessary, i.e. {@code 01 - 12}. * - *
      {@code 'k'} + *
      {@code 'k'} * Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}. * - *
      {@code 'l'} + *
      {@code 'l'} * Hour for the 12-hour clock, i.e. {@code 1 - 12}. * - *
      {@code 'M'} + *
      {@code 'M'} * Minute within the hour formatted as two digits with a leading zero * as necessary, i.e. {@code 00 - 59}. * - *
      {@code 'S'} + *
      {@code 'S'} * Seconds within the minute, formatted as two digits with a leading * zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special * value required to support leap seconds). * - *
      {@code 'L'} + *
      {@code 'L'} * Millisecond within the second formatted as three digits with * leading zeros as necessary, i.e. {@code 000 - 999}. * - *
      {@code 'N'} + *
      {@code 'N'} * Nanosecond within the second, formatted as nine digits with leading * zeros as necessary, i.e. {@code 000000000 - 999999999}. * - *
      {@code 'p'} + *
      {@code 'p'} * Locale-specific {@linkplain * java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker * in lower case, e.g."{@code am}" or "{@code pm}". Use of the conversion * prefix {@code 'T'} forces this output to upper case. * - *
      {@code 'z'} + *
      {@code 'z'} * RFC 822 * style numeric time zone offset from GMT, e.g. {@code -0800}. This * value will be adjusted as necessary for Daylight Saving Time. For @@ -432,7 +432,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * the {@linkplain TimeZone#getDefault() default time zone} for this * instance of the Java virtual machine. * - *
      {@code 'Z'} + *
      {@code 'Z'} * A string representing the abbreviation for the time zone. This * value will be adjusted as necessary for Daylight Saving Time. For * {@code long}, {@link Long}, and {@link Date} the time zone used is @@ -440,12 +440,12 @@ import jdk.internal.math.FormattedFloatingDecimal; * instance of the Java virtual machine. The Formatter's locale will * supersede the locale of the argument (if any). * - *
      {@code 's'} + *
      {@code 's'} * Seconds since the beginning of the epoch starting at 1 January 1970 * {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to * {@code Long.MAX_VALUE/1000}. * - *
      {@code 'Q'} + *
      {@code 'Q'} * Milliseconds since the beginning of the epoch starting at 1 January * 1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to * {@code Long.MAX_VALUE}. @@ -459,54 +459,54 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      date
      {@code 'B'} + *
      {@code 'B'} * Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths * full month name}, e.g. {@code "January"}, {@code "February"}. * - *
      {@code 'b'} + *
      {@code 'b'} * Locale-specific {@linkplain * java.text.DateFormatSymbols#getShortMonths abbreviated month name}, * e.g. {@code "Jan"}, {@code "Feb"}. * - *
      {@code 'h'} + *
      {@code 'h'} * Same as {@code 'b'}. * - *
      {@code 'A'} + *
      {@code 'A'} * Locale-specific full name of the {@linkplain * java.text.DateFormatSymbols#getWeekdays day of the week}, * e.g. {@code "Sunday"}, {@code "Monday"} * - *
      {@code 'a'} + *
      {@code 'a'} * Locale-specific short name of the {@linkplain * java.text.DateFormatSymbols#getShortWeekdays day of the week}, * e.g. {@code "Sun"}, {@code "Mon"} * - *
      {@code 'C'} + *
      {@code 'C'} * Four-digit year divided by {@code 100}, formatted as two digits * with leading zero as necessary, i.e. {@code 00 - 99} * - *
      {@code 'Y'} + *
      {@code 'Y'} * Year, formatted as at least four digits with leading zeros as * necessary, e.g. {@code 0092} equals {@code 92} CE for the Gregorian * calendar. * - *
      {@code 'y'} + *
      {@code 'y'} * Last two digits of the year, formatted with leading zeros as * necessary, i.e. {@code 00 - 99}. * - *
      {@code 'j'} + *
      {@code 'j'} * Day of year, formatted as three digits with leading zeros as * necessary, e.g. {@code 001 - 366} for the Gregorian calendar. * - *
      {@code 'm'} + *
      {@code 'm'} * Month, formatted as two digits with leading zeros as necessary, * i.e. {@code 01 - 13}. * - *
      {@code 'd'} + *
      {@code 'd'} * Day of month, formatted as two digits with leading zeros as * necessary, i.e. {@code 01 - 31} * - *
      {@code 'e'} + *
      {@code 'e'} * Day of month, formatted as two digits, i.e. {@code 1 - 31}. * *
      composites
      {@code 'R'} + *
      {@code 'R'} * Time formatted for the 24-hour clock as {@code "%tH:%tM"} * - *
      {@code 'T'} + *
      {@code 'T'} * Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}. * - *
      {@code 'r'} + *
      {@code 'r'} * Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS %Tp"}. * The location of the morning or afternoon marker ({@code '%Tp'}) may be * locale-dependent. * - *
      {@code 'D'} + *
      {@code 'D'} * Date formatted as {@code "%tm/%td/%ty"}. * - *
      {@code 'F'} + *
      {@code 'F'} * ISO 8601 * complete date formatted as {@code "%tY-%tm-%td"}. * - *
      {@code 'c'} + *
      {@code 'c'} * Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"}, * e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}. * @@ -555,49 +555,49 @@ import jdk.internal.math.FormattedFloatingDecimal; * * * - * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * - * * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * diff --git a/jdk/src/java.base/share/classes/java/util/Locale.java b/jdk/src/java.base/share/classes/java/util/Locale.java index 1ebd6cb03ab..825ba8b8ff5 100644 --- a/jdk/src/java.base/share/classes/java/util/Locale.java +++ b/jdk/src/java.base/share/classes/java/util/Locale.java @@ -1590,29 +1590,29 @@ public final class Locale implements Cloneable, Serializable { *
      genConv
      Flag General - * Character Integral - * Floating Point - * Date/Time - * Description + *
      Flag General + * Character Integral + * Floating Point + * Date/Time + * Description *
      '-' y + *
      '-' y * y * y * y * y * The result will be left-justified. * - *
      '#' y1 + *
      '#' y1 * - * y3 * y * - * The result should use a conversion-dependent alternate form * - *
      '+' - + *
      '+' - * - * y4 * y * - * The result will always include a sign * - *
      '  ' - + *
      '  ' - * - * y4 * y * - * The result will include a leading space for positive values * - *
      '0' - + *
      '0' - * - * y * y * - * The result will be zero-padded * - *
      ',' - + *
      ',' - * - * y2 * y5 @@ -605,7 +605,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * The result will include locale-specific {@linkplain * java.text.DecimalFormatSymbols#getGroupingSeparator grouping separators} * - *
      '(' - + *
      '(' - * - * y4 * y5 @@ -723,7 +723,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      dgConv
      {@code 'b'} + *
      {@code 'b'} * '\u0062' * Produces either "{@code true}" or "{@code false}" as returned by * {@link Boolean#toString(boolean)}. @@ -737,11 +737,11 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'B'} + *
      {@code 'B'} * '\u0042' * The upper-case variant of {@code 'b'}. * - *
      {@code 'h'} + *
      {@code 'h'} * '\u0068' * Produces a string representing the hash code value of the object. * @@ -751,11 +751,11 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'H'} + *
      {@code 'H'} * '\u0048' * The upper-case variant of {@code 'h'}. * - *
      {@code 's'} + *
      {@code 's'} * '\u0073' * Produces a string. * @@ -768,7 +768,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * Formattable} , then a {@link FormatFlagsConversionMismatchException} * will be thrown. * - *
      {@code 'S'} + *
      {@code 'S'} * '\u0053' * The upper-case variant of {@code 's'}. * @@ -781,7 +781,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      dFlags
      {@code '-'} + *
      {@code '-'} * '\u002d' * Left justifies the output. Spaces ('\u0020') will be * added at the end of the converted value as required to fill the minimum @@ -789,7 +789,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * MissingFormatWidthException} will be thrown. If this flag is not given * then the output will be right-justified. * - *
      {@code '#'} + *
      {@code '#'} * '\u0023' * Requires the output use an alternate form. The definition of the * form is specified by the conversion. @@ -825,7 +825,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      charConv
      {@code 'c'} + *
      {@code 'c'} * '\u0063' * Formats the argument as a Unicode character as described in Unicode Character @@ -835,7 +835,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'C'} + *
      {@code 'C'} * '\u0043' * The upper-case variant of {@code 'c'}. * @@ -929,7 +929,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      IntConv
      {@code 'd'} + *
      {@code 'd'} * '\u0064' * Formats the argument as a decimal integer. The localization algorithm is applied. @@ -940,7 +940,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'o'} + *
      {@code 'o'} * '\u006f' * Formats the argument as an integer in base eight. No localization * is applied. @@ -962,7 +962,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * are given then a {@link FormatFlagsConversionMismatchException} will be * thrown. * - *
      {@code 'x'} + *
      {@code 'x'} * '\u0078' * Formats the argument as an integer in base sixteen. No * localization is applied. @@ -985,7 +985,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * {@code ','} flags are given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *
      {@code 'X'} + *
      {@code 'X'} * '\u0058' * The upper-case variant of {@code 'x'}. The entire string * representing the number will be converted to {@linkplain @@ -1012,7 +1012,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      intFlags
      {@code '+'} + *
      {@code '+'} * '\u002b' * Requires the output to include a positive sign for all positive * numbers. If this flag is not given then only negative values will @@ -1021,7 +1021,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If both the {@code '+'} and '  ' flags are given * then an {@link IllegalFormatFlagsException} will be thrown. * - *

      '  ' + *
      '  ' * '\u0020' * Requires the output to include a single extra space * ('\u0020') for non-negative values. @@ -1029,7 +1029,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If both the {@code '+'} and '  ' flags are given * then an {@link IllegalFormatFlagsException} will be thrown. * - *

      {@code '0'} + *
      {@code '0'} * '\u0030' * Requires the output to be padded with leading {@linkplain * java.text.DecimalFormatSymbols#getZeroDigit zeros} to the minimum field @@ -1040,14 +1040,14 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If both the {@code '-'} and {@code '0'} flags are given then an * {@link IllegalFormatFlagsException} will be thrown. * - *

      {@code ','} + *
      {@code ','} * '\u002c' * Requires the output to include the locale-specific {@linkplain * java.text.DecimalFormatSymbols#getGroupingSeparator group separators} as * described in the "group" section of the * localization algorithm. * - *
      {@code '('} + *
      {@code '('} * '\u0028' * Requires the output to prepend a {@code '('} * ('\u0028') and append a {@code ')'} @@ -1093,7 +1093,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      bIntConv
      {@code 'd'} + *
      {@code 'd'} * '\u0064' * Requires the output to be formatted as a decimal integer. The localization algorithm is applied. @@ -1101,7 +1101,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'o'} + *
      {@code 'o'} * '\u006f' * Requires the output to be formatted as an integer in base eight. * No localization is applied. @@ -1124,7 +1124,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code ','} flag is given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'x'} + *
      {@code 'x'} * '\u0078' * Requires the output to be formatted as an integer in base * sixteen. No localization is applied. @@ -1148,7 +1148,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code ','} flag is given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'X'} + *
      {@code 'X'} * '\u0058' * The upper-case variant of {@code 'x'}. The entire string * representing the number will be converted to {@linkplain @@ -1190,7 +1190,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      floatConv
      {@code 'e'} + *
      {@code 'e'} * '\u0065' * Requires the output to be formatted using computerized scientific notation. The If the {@code ','} flag is given, then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *
      {@code 'E'} + *
      {@code 'E'} * '\u0045' * The upper-case variant of {@code 'e'}. The exponent symbol * will be {@code 'E'} ('\u0045'). * - *
      {@code 'g'} + *
      {@code 'g'} * '\u0067' * Requires the output to be formatted in general scientific notation * as described below. The localization @@ -1268,11 +1268,11 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'G'} + *
      {@code 'G'} * '\u0047' * The upper-case variant of {@code 'g'}. * - *
      {@code 'f'} + *
      {@code 'f'} * '\u0066' * Requires the output to be formatted using decimal * format. The localization algorithm is @@ -1304,7 +1304,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * Float#toString(float)} or {@link Double#toString(double)} as * appropriate. * - *
      {@code 'a'} + *
      {@code 'a'} * '\u0061' * Requires the output to be formatted in hexadecimal exponential * form. No localization is applied. @@ -1357,7 +1357,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '('} or {@code ','} flags are given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'A'} + *
      {@code 'A'} * '\u0041' * The upper-case variant of {@code 'a'}. The entire string * representing the number will be converted to upper case including the @@ -1427,7 +1427,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      floatConv
      {@code 'e'} + *
      {@code 'e'} * '\u0065' * Requires the output to be formatted using computerized scientific notation. The If the {@code ','} flag is given, then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *
      {@code 'E'} + *
      {@code 'E'} * '\u0045' * The upper-case variant of {@code 'e'}. The exponent symbol * will be {@code 'E'} ('\u0045'). * - *
      {@code 'g'} + *
      {@code 'g'} * '\u0067' * Requires the output to be formatted in general scientific notation * as described below. The localization @@ -1499,11 +1499,11 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      If the {@code '#'} flag is given then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

      {@code 'G'} + *
      {@code 'G'} * '\u0047' * The upper-case variant of {@code 'g'}. * - *
      {@code 'f'} + *
      {@code 'f'} * '\u0066' * Requires the output to be formatted using decimal * format. The localization algorithm is @@ -1554,10 +1554,10 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      DTConv
      {@code 't'} + *
      {@code 't'} * '\u0074' * Prefix for date and time conversion characters. - *
      {@code 'T'} + *
      {@code 'T'} * '\u0054' * The upper-case variant of {@code 't'}. * @@ -1577,52 +1577,52 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      time
      {@code 'H'} + *
      {@code 'H'} * '\u0048' * Hour of the day for the 24-hour clock, formatted as two digits with * a leading zero as necessary i.e. {@code 00 - 23}. {@code 00} * corresponds to midnight. * - *
      {@code 'I'} + *
      {@code 'I'} * '\u0049' * Hour for the 12-hour clock, formatted as two digits with a leading * zero as necessary, i.e. {@code 01 - 12}. {@code 01} corresponds to * one o'clock (either morning or afternoon). * - *
      {@code 'k'} + *
      {@code 'k'} * '\u006b' * Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}. * {@code 0} corresponds to midnight. * - *
      {@code 'l'} + *
      {@code 'l'} * '\u006c' * Hour for the 12-hour clock, i.e. {@code 1 - 12}. {@code 1} * corresponds to one o'clock (either morning or afternoon). * - *
      {@code 'M'} + *
      {@code 'M'} * '\u004d' * Minute within the hour formatted as two digits with a leading zero * as necessary, i.e. {@code 00 - 59}. * - *
      {@code 'S'} + *
      {@code 'S'} * '\u0053' * Seconds within the minute, formatted as two digits with a leading * zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special * value required to support leap seconds). * - *
      {@code 'L'} + *
      {@code 'L'} * '\u004c' * Millisecond within the second formatted as three digits with * leading zeros as necessary, i.e. {@code 000 - 999}. * - *
      {@code 'N'} + *
      {@code 'N'} * '\u004e' * Nanosecond within the second, formatted as nine digits with leading * zeros as necessary, i.e. {@code 000000000 - 999999999}. The precision * of this value is limited by the resolution of the underlying operating * system or hardware. * - *
      {@code 'p'} + *
      {@code 'p'} * '\u0070' * Locale-specific {@linkplain * java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker @@ -1632,7 +1632,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * GNU {@code date} and POSIX {@code strftime(3c)} which produce * upper-case output.) * - *
      {@code 'z'} + *
      {@code 'z'} * '\u007a' * RFC 822 * style numeric time zone offset from GMT, e.g. {@code -0800}. This @@ -1641,7 +1641,7 @@ import jdk.internal.math.FormattedFloatingDecimal; * the {@linkplain TimeZone#getDefault() default time zone} for this * instance of the Java virtual machine. * - *
      {@code 'Z'} + *
      {@code 'Z'} * '\u005a' * A string representing the abbreviation for the time zone. This * value will be adjusted as necessary for Daylight Saving Time. For @@ -1650,13 +1650,13 @@ import jdk.internal.math.FormattedFloatingDecimal; * instance of the Java virtual machine. The Formatter's locale will * supersede the locale of the argument (if any). * - *
      {@code 's'} + *
      {@code 's'} * '\u0073' * Seconds since the beginning of the epoch starting at 1 January 1970 * {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to * {@code Long.MAX_VALUE/1000}. * - *
      {@code 'Q'} + *
      {@code 'Q'} * '\u004f' * Milliseconds since the beginning of the epoch starting at 1 January * 1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to @@ -1672,68 +1672,68 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      date
      {@code 'B'} + *
      {@code 'B'} * '\u0042' * Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths * full month name}, e.g. {@code "January"}, {@code "February"}. * - *
      {@code 'b'} + *
      {@code 'b'} * '\u0062' * Locale-specific {@linkplain * java.text.DateFormatSymbols#getShortMonths abbreviated month name}, * e.g. {@code "Jan"}, {@code "Feb"}. * - *
      {@code 'h'} + *
      {@code 'h'} * '\u0068' * Same as {@code 'b'}. * - *
      {@code 'A'} + *
      {@code 'A'} * '\u0041' * Locale-specific full name of the {@linkplain * java.text.DateFormatSymbols#getWeekdays day of the week}, * e.g. {@code "Sunday"}, {@code "Monday"} * - *
      {@code 'a'} + *
      {@code 'a'} * '\u0061' * Locale-specific short name of the {@linkplain * java.text.DateFormatSymbols#getShortWeekdays day of the week}, * e.g. {@code "Sun"}, {@code "Mon"} * - *
      {@code 'C'} + *
      {@code 'C'} * '\u0043' * Four-digit year divided by {@code 100}, formatted as two digits * with leading zero as necessary, i.e. {@code 00 - 99} * - *
      {@code 'Y'} + *
      {@code 'Y'} * '\u0059' Year, formatted to at least * four digits with leading zeros as necessary, e.g. {@code 0092} equals * {@code 92} CE for the Gregorian calendar. * - *
      {@code 'y'} + *
      {@code 'y'} * '\u0079' * Last two digits of the year, formatted with leading zeros as * necessary, i.e. {@code 00 - 99}. * - *
      {@code 'j'} + *
      {@code 'j'} * '\u006a' * Day of year, formatted as three digits with leading zeros as * necessary, e.g. {@code 001 - 366} for the Gregorian calendar. * {@code 001} corresponds to the first day of the year. * - *
      {@code 'm'} + *
      {@code 'm'} * '\u006d' * Month, formatted as two digits with leading zeros as necessary, * i.e. {@code 01 - 13}, where "{@code 01}" is the first month of the * year and ("{@code 13}" is a special value required to support lunar * calendars). * - *
      {@code 'd'} + *
      {@code 'd'} * '\u0064' * Day of month, formatted as two digits with leading zeros as * necessary, i.e. {@code 01 - 31}, where "{@code 01}" is the first day * of the month. * - *
      {@code 'e'} + *
      {@code 'e'} * '\u0065' * Day of month, formatted as two digits, i.e. {@code 1 - 31} where * "{@code 1}" is the first day of the month. @@ -1748,30 +1748,30 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      composites
      {@code 'R'} + *
      {@code 'R'} * '\u0052' * Time formatted for the 24-hour clock as {@code "%tH:%tM"} * - *
      {@code 'T'} + *
      {@code 'T'} * '\u0054' * Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}. * - *
      {@code 'r'} + *
      {@code 'r'} * '\u0072' * Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS * %Tp"}. The location of the morning or afternoon marker * ({@code '%Tp'}) may be locale-dependent. * - *
      {@code 'D'} + *
      {@code 'D'} * '\u0044' * Date formatted as {@code "%tm/%td/%ty"}. * - *
      {@code 'F'} + *
      {@code 'F'} * '\u0046' * ISO 8601 * complete date formatted as {@code "%tY-%tm-%td"}. * - *
      {@code 'c'} + *
      {@code 'c'} * '\u0063' * Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"}, * e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}. @@ -1802,7 +1802,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *
      DTConv
      {@code '%'} + *
      {@code '%'} * The result is a literal {@code '%'} ('\u0025') * *

      The width is the minimum number of characters to @@ -1830,7 +1830,7 @@ import jdk.internal.math.FormattedFloatingDecimal; *

      DTConv
      {@code 'n'} + *
      {@code 'n'} * the platform-specific line separator as returned by {@link * System#lineSeparator()}. * diff --git a/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java b/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java index 8d2835fe5ac..a54b6463127 100644 --- a/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java +++ b/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java @@ -163,83 +163,83 @@ import sun.util.calendar.ZoneInfo; *
      GregorianCalendar default field values
      + * * Field * + * Default Value *
      + * * ERA - * + * * AD *
      + * * YEAR - * + * * 1970 *
      + * * MONTH - * + * * JANUARY *
      + * * DAY_OF_MONTH - * + * * 1 *
      + * * DAY_OF_WEEK - * + * * the first day of week *
      + * * WEEK_OF_MONTH - * + * * 0 *
      + * * DAY_OF_WEEK_IN_MONTH - * + * * 1 *
      + * * AM_PM - * + * * AM *
      + * * HOUR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND - * + * * 0 *
      * * - * + * * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * *
      Grandfathered tags with canonical replacements
      grandfathered tagmodern replacement
      grandfathered tagmodern replacement
      art-lojbanjbo
      i-amiami
      i-bnnbnn
      i-hakhak
      i-klingontlh
      i-luxlb
      i-navajonv
      i-pwnpwn
      i-taotao
      i-taytay
      i-tsutsu
      no-boknb
      no-nynnn
      sgn-BE-FRsfb
      sgn-BE-NLvgt
      sgn-CH-DEsgg
      zh-guoyucmn
      zh-hakkahak
      zh-min-nannan
      zh-xianghsn
      art-lojbanjbo
      i-amiami
      i-bnnbnn
      i-hakhak
      i-klingontlh
      i-luxlb
      i-navajonv
      i-pwnpwn
      i-taotao
      i-taytay
      i-tsutsu
      no-boknb
      no-nynnn
      sgn-BE-FRsfb
      sgn-BE-NLvgt
      sgn-CH-DEsgg
      zh-guoyucmn
      zh-hakkahak
      zh-min-nannan
      zh-xianghsn
      * @@ -1622,15 +1622,15 @@ public final class Locale implements Cloneable, Serializable { * * * - * + * * * - * - * - * - * - * - * + * + * + * + * + * + * * *
      Grandfathered tags with no modern replacement
      grandfathered tagconverts to
      grandfathered tagconverts to
      cel-gaulishxtg-x-cel-gaulish
      en-GB-oeden-GB-x-oed
      i-defaulten-x-i-default
      i-enochianund-x-i-enochian
      i-mingosee-x-i-mingo
      zh-minnan-x-zh-min
      cel-gaulishxtg-x-cel-gaulish
      en-GB-oeden-GB-x-oed
      i-defaulten-x-i-default
      i-enochianund-x-i-enochian
      i-mingosee-x-i-mingo
      zh-minnan-x-zh-min
      * @@ -2778,16 +2778,16 @@ public final class Locale implements Cloneable, Serializable { *
      Filtering method behavior
      Filtering ModeLanguage Priority List: {@code "de-DE"}Language Priority List: {@code "de-*-DE"}Filtering ModeLanguage Priority List: {@code "de-DE"}Language Priority List: {@code "de-*-DE"}
      + * * {@link FilteringMode#AUTOSELECT_FILTERING AUTOSELECT_FILTERING} - * + * * Performs basic filtering and returns {@code "de-DE"} and * {@code "de-DE-1996"}. @@ -2799,9 +2799,9 @@ public final class Locale implements Cloneable, Serializable { *
      + * * {@link FilteringMode#EXTENDED_FILTERING EXTENDED_FILTERING} - * + * * Performs extended filtering and returns {@code "de-DE"}, * {@code "de-Deva-DE"}, {@code "de-DE-1996"}, {@code "de-Latn-DE"}, and @@ -2810,9 +2810,9 @@ public final class Locale implements Cloneable, Serializable { * Same as above.
      + * * {@link FilteringMode#IGNORE_EXTENDED_RANGES IGNORE_EXTENDED_RANGES} - * + * * Performs basic filtering and returns {@code "de-DE"} and * {@code "de-DE-1996"}. @@ -2823,9 +2823,9 @@ public final class Locale implements Cloneable, Serializable { *
      + * * {@link FilteringMode#MAP_EXTENDED_RANGES MAP_EXTENDED_RANGES} - * + * Same as above. * Performs basic filtering and returns {@code "de-DE"} and @@ -2834,9 +2834,9 @@ public final class Locale implements Cloneable, Serializable { *
      + * * {@link FilteringMode#REJECT_EXTENDED_RANGES REJECT_EXTENDED_RANGES} - * + * Same as above. * Throws {@link IllegalArgumentException} because {@code "de-*-DE"} is @@ -3257,6 +3257,9 @@ public final class Locale implements Cloneable, Serializable { * Returns a list of matching {@code Locale} instances using the filtering * mechanism defined in RFC 4647. * + * This filter operation on the given {@code locales} ensures that only + * unique matching locale(s) are returned. + * * @param priorityList user's Language Priority List in which each language * tag is sorted in descending order based on priority or weight * @param locales {@code Locale} instances used for matching @@ -3284,6 +3287,9 @@ public final class Locale implements Cloneable, Serializable { * {@link #filter(List, Collection, FilteringMode)} when {@code mode} is * {@link FilteringMode#AUTOSELECT_FILTERING}. * + * This filter operation on the given {@code locales} ensures that only + * unique matching locale(s) are returned. + * * @param priorityList user's Language Priority List in which each language * tag is sorted in descending order based on priority or weight * @param locales {@code Locale} instances used for matching @@ -3304,6 +3310,17 @@ public final class Locale implements Cloneable, Serializable { * Returns a list of matching languages tags using the basic filtering * mechanism defined in RFC 4647. * + * This filter operation on the given {@code tags} ensures that only + * unique matching tag(s) are returned with preserved case. In case of + * duplicate matching tags with the case difference, the first matching + * tag with preserved case is returned. + * For example, "de-ch" is returned out of the duplicate matching tags + * "de-ch" and "de-CH", if "de-ch" is checked first for matching in the + * given {@code tags}. Note that if the given {@code tags} is an unordered + * {@code Collection}, the returned matching tag out of duplicate tags is + * subject to change, depending on the implementation of the + * {@code Collection}. + * * @param priorityList user's Language Priority List in which each language * tag is sorted in descending order based on priority or weight * @param tags language tags @@ -3331,6 +3348,17 @@ public final class Locale implements Cloneable, Serializable { * {@link #filterTags(List, Collection, FilteringMode)} when {@code mode} * is {@link FilteringMode#AUTOSELECT_FILTERING}. * + * This filter operation on the given {@code tags} ensures that only + * unique matching tag(s) are returned with preserved case. In case of + * duplicate matching tags with the case difference, the first matching + * tag with preserved case is returned. + * For example, "de-ch" is returned out of the duplicate matching tags + * "de-ch" and "de-CH", if "de-ch" is checked first for matching in the + * given {@code tags}. Note that if the given {@code tags} is an unordered + * {@code Collection}, the returned matching tag out of duplicate tags is + * subject to change, depending on the implementation of the + * {@code Collection}. + * * @param priorityList user's Language Priority List in which each language * tag is sorted in descending order based on priority or weight * @param tags language tags @@ -3370,6 +3398,9 @@ public final class Locale implements Cloneable, Serializable { * Returns the best-matching language tag using the lookup mechanism * defined in RFC 4647. * + * This lookup operation on the given {@code tags} ensures that the + * first matching tag with preserved case is returned. + * * @param priorityList user's Language Priority List in which each language * tag is sorted in descending order based on priority or weight * @param tags language tangs used for matching diff --git a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java index b79c850bebf..4390fb7ba1a 100644 --- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java @@ -3887,9 +3887,13 @@ loop: for(int x=0, offset=0; xpermission name, what it allows, and associated risks *
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      setHostnameVerifiersetHostnameVerifierThe ability to set a callback which can decide whether to * allow a mismatch between the host being connected to by * an HttpsURLConnection and the common name field in @@ -70,7 +70,7 @@ import java.security.*; *
      getSSLSessionContextgetSSLSessionContextThe ability to get the SSLSessionContext of an SSLSession. * Malicious code may monitor sessions which have been established @@ -79,7 +79,7 @@ import java.security.*; *
      setDefaultSSLContextsetDefaultSSLContextThe ability to set the default SSL context * Malicious code can set a context that monitors the opening of diff --git a/jdk/src/java.base/share/classes/module-info.java b/jdk/src/java.base/share/classes/module-info.java index 0a3c2eb82af..a74879d9311 100644 --- a/jdk/src/java.base/share/classes/module-info.java +++ b/jdk/src/java.base/share/classes/module-info.java @@ -26,8 +26,8 @@ /** * Defines the foundational APIs of the Java SE Platform. * - *
      - *
      Providers:
      + *
      + *
      Providers:
      *
      The JDK implementation of this module provides an implementation of * the {@index jrt jrt} {@linkplain java.nio.file.spi.FileSystemProvider * file system provider} to enumerate and read the class and resource @@ -36,8 +36,8 @@ * {@link java.nio.file.FileSystems#newFileSystem * FileSystems.newFileSystem(URI.create("jrt:/"))}. *

      - *
      Tool Guides:
      - *
      {@extLink java_tool_reference java launcher}, + *
      Tool Guides:
      + *
      {@extLink java_tool_reference java launcher}, * {@extLink keytool_tool_reference keytool}
      *
      * diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties index 34ae81b15d8..c311de2bcf1 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties @@ -35,7 +35,7 @@ java.launcher.opt.footer = \ -cp = oder\n-- verwenden.\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xbootclasspath/a: \n an Ende von Bootstrap Classpath anh\u00E4ngen\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n -Xcomp Erzwingt Kompilierung von Methoden beim ersten Aufruf\n -Xdebug Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xfuture Aktiviert strengste Pr\u00FCfungen, wird als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xinternalversion\n Zeigt detailliertere JVM-Versionsinformationen an als die\n Option "-version"\n -Xloggc: Protokolliert GC-Status in einer Datei mit Zeitstempeln\n -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xmn Legt die anf\u00E4ngliche und die maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n f\u00FCr die junge Generation (Nursery) fest\n -Xms Legt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe fest\n -Xmx Legt die maximale Java-Heap-Gr\u00F6\u00DFe fest\n -Xnoclassgc Deaktiviert die Klassen-Garbage Collection\n -Xprof Gibt CPU-Profilierungsdaten aus (veraltet)\n -Xrs Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xshare:auto Verwendet, wenn m\u00F6glich, freigegebene Klassendaten (Standard)\n -Xshare:off Versucht nicht, freigegebene Klassendaten zu verwenden\n -Xshare:on Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen an und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen an und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen an und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen an und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen an und f\u00E4hrt fort\n -Xss Legt Stack-Gr\u00F6\u00DFe des Java-Threads fest\n -Xverify Legt den Modus der Bytecodeverifizierung fest\n --add-reads =(,)*\n Aktualisiert , damit ungeachtet der\n Moduldeklaration gelesen wird. \n kann ALL-UNNAMED sein, um alle unbenannten\n Module zu lesen.\n --add-exports /=(,)*\n Aktualisiert , um ungeachtet der Moduldeklaration\n in zu exportieren.\n kann ALL-UNNAMED sein, um in alle \n unbenannten Module zu exportieren.\n --add-opens /=(,)*\n Aktualisiert , um ungeachtet der Moduldeklaration\n in zu \u00F6ffnen.\n --permit-illegal-access\n L\u00E4sst unzul\u00E4ssigen Zugriff f\u00FCr Mitglieder mit den Typen in den benannten Modulen\n nach Code in unbenannten Modulen zu. Diese Kompatibilit\u00E4tsoption wird\n im n\u00E4chsten Release entfernt.\n --limit-modules [,...]\n Grenzt die Gesamtmenge der beobachtbaren Module ein\n --patch-module =({0})*\n \u00DCberschreibt oder erweitert ein Modul in JAR-Dateien\n oder -Verzeichnissen mit \ +java.launcher.X.usage=\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xbootclasspath/a: \n an Ende von Bootstrap Classpath anh\u00E4ngen\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n -Xcomp Erzwingt Kompilierung von Methoden beim ersten Aufruf\n -Xdebug Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xfuture Aktiviert strengste Pr\u00FCfungen, wird als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xinternalversion\n Zeigt detailliertere JVM-Versionsinformationen an als die\n Option "-version"\n -Xloggc: Protokolliert GC-Status in einer Datei mit Zeitstempeln\n -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xmn Legt die anf\u00E4ngliche und die maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n f\u00FCr die junge Generation (Nursery) fest\n -Xms Legt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe fest\n -Xmx Legt die maximale Java-Heap-Gr\u00F6\u00DFe fest\n -Xnoclassgc Deaktiviert die Klassen-Garbage Collection\n -Xprof Gibt CPU-Profilierungsdaten aus (veraltet)\n -Xrs Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xshare:auto Verwendet, wenn m\u00F6glich, freigegebene Klassendaten (Standard)\n -Xshare:off Versucht nicht, freigegebene Klassendaten zu verwenden\n -Xshare:on Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen an und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen an und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen an und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen an und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen an und f\u00E4hrt fort\n -Xss Legt Stack-Gr\u00F6\u00DFe des Java-Threads fest\n -Xverify Legt den Modus der Bytecodeverifizierung fest\n --add-reads =(,)*\n Aktualisiert , damit ungeachtet der\n Moduldeklaration gelesen wird. \n kann ALL-UNNAMED sein, um alle unbenannten\n Module zu lesen.\n --add-exports /=(,)*\n Aktualisiert , um ungeachtet der Moduldeklaration\n in zu exportieren.\n kann ALL-UNNAMED sein, um in alle \n unbenannten Module zu exportieren.\n --add-opens /=(,)*\n Aktualisiert , um ungeachtet der Moduldeklaration\n in zu \u00F6ffnen.\n --limit-modules [,...]\n Grenzt die Gesamtmenge der beobachtbaren Module ein\n --patch-module =({0})*\n \u00DCberschreibt oder erweitert ein Modul in JAR-Dateien\n oder -Verzeichnissen mit \ Klassen und Ressourcen.\n --disable-@files Deaktiviert die weitere Erweiterung von Argumentdateien\n\nDiese zus\u00E4tzlichen Optionen k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden. # Translators please note do not translate the options themselves diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties index 07096c62efa..3fecb4c841a 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties @@ -35,7 +35,7 @@ java.launcher.opt.footer = \ -cp = o\n-- .\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\ -Xbatch desactivar compilaci\u00F3n de fondo\n -Xbootclasspath/a:\n agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xcomp fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n -Xdebug se proporciona para ofrecer compatibilidad con versiones anteriores\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xint solo ejecuci\u00F3n de modo interpretado\n -Xinternalversion\n muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n opci\u00F3n -version\n -Xloggc: registrar el estado de GC en un archivo con registros de hora\n -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xmn define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n -Xms define el tama\u00F1o inicial de la pila de Java\n -Xmx define el tama\u00F1o m\u00E1ximo de la pila de Java\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xprof datos de creaci\u00F3n de perfiles de CPU de salida (anticuados)\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n -XshowSettings mostrar toda la configuraci\u00F3n y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n -XshowSettings:properties\n mostrar todos los valores de propiedad y continuar\n -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n -Xss definir tama\u00F1o de la pila del thread de Java\n -Xverify define el modo del verificador de c\u00F3digo de bytes\n --add-reads =(,)*\n actualiza para leer , independientement\n de la declaraci\u00F3n del m\u00F3dulo. \n puede ser ALL-UNNAMED para leer todos los\n m\u00F3dulos sin nombre.\n --add-exports /=(,)*\n actualiza para exportar en ,\n independientemente de la declaraci\u00F3n del m\u00F3dulo.\n puede ser ALL-UNNAMED para exportar a todos los\n m\u00F3dulos sin nombre.\n --add-opens /=(,)*\n actualiza para abrir en\n , independientemente de la declaraci\u00F3n del m\u00F3dulo.\n --permit-illegal-access\n permitir el acceso no v\u00E1lido a miembros de tipos en m\u00F3dulos con nombre\n por c\u00F3digo en m\u00F3dulos sin nombre. Esta opci\u00F3n de compatibilidad\n se eliminar\u00E1 en la pr\u00F3xima versi\u00F3n.\n --limit-modules \n agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xcomp fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n -Xdebug se proporciona para ofrecer compatibilidad con versiones anteriores\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xint solo ejecuci\u00F3n de modo interpretado\n -Xinternalversion\n muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n opci\u00F3n -version\n -Xloggc: registrar el estado de GC en un archivo con registros de hora\n -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xmn define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n -Xms define el tama\u00F1o inicial de la pila de Java\n -Xmx define el tama\u00F1o m\u00E1ximo de la pila de Java\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xprof datos de creaci\u00F3n de perfiles de CPU de salida (anticuados)\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n -XshowSettings mostrar toda la configuraci\u00F3n y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n -XshowSettings:properties\n mostrar todos los valores de propiedad y continuar\n -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n -Xss definir tama\u00F1o de la pila del thread de Java\n -Xverify define el modo del verificador de c\u00F3digo de bytes\n --add-reads =(,)*\n actualiza para leer , independientement\n de la declaraci\u00F3n del m\u00F3dulo. \n puede ser ALL-UNNAMED para leer todos los\n m\u00F3dulos sin nombre.\n --add-exports /=(,)*\n actualiza para exportar en ,\n independientemente de la declaraci\u00F3n del m\u00F3dulo.\n puede ser ALL-UNNAMED para exportar a todos los\n m\u00F3dulos sin nombre.\n --add-opens /=(,)*\n actualiza para abrir en\n , independientemente de la declaraci\u00F3n del m\u00F3dulo.\n --limit-modules [,...]\n limitar el universo de m\u00F3dulos observables\n --patch-module =({0})*\n anular o aumentar un m\u00F3dulo con clases y recursos\n en directorios o archivos JAR.\n --disable-@files desactivar una mayor expansi\u00F3n del archivo de argumentos\n\nEstas opciones adicionales est\u00E1n sujetas a cambios sin previo aviso.\n # Translators please note do not translate the options themselves diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties index b1847c838d8..472d13b4baf 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties @@ -35,8 +35,7 @@ java.launcher.opt.footer = \ -cp \n afficher l'\u00E9cran d'accueil avec l'image indiqu\u00E9e\n Les images redimensionn\u00E9es HiDPI sont automatiquement prises en charge et utilis\u00E9es\n si elles sont disponibles. Le nom de fichier d'une image non redimensionn\u00E9e, par ex. image.ext,\n doit toujours \u00EAtre transmis comme argument \u00E0 l'option -splash.\n L'image redimensionn\u00E9e fournie la plus appropri\u00E9e sera automatiquement\n s\u00E9lectionn\u00E9e.\n Pour plus d'informations, reportez-vous \u00E0 la documentation relative \u00E0 l'API SplashScreen\n fichiers @argument\n fichiers d'arguments contenant des options\n -disable-@files\n emp\u00EAcher le d\u00E9veloppement suppl\u00E9mentaire de fichiers d'arguments\nAfin d'indiquer un argument pour une option longue, vous pouvez utiliser --= ou\n-- .\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a:\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc: journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xprof sortie des donn\u00E9es de profilage d''UC (en phase d''abandon)\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration.\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss d\u00E9finition de la taille de pile de threads Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads =(,)*\n met \u00E0 jour pour lire , sans tenir compte\n de la d\u00E9claration de module. \n peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n sans nom.\n --add-exports /=(,)*\n met \u00E0 jour pour exporter vers ,\n sans tenir compte de la d\u00E9claration de module.\n peut \u00EAtre ALL-UNNAMED pour exporter tous les\n modules sans nom.\n --add-opens /=(,)*\n met \u00E0 jour pour ouvrir dans\n , sans tenir compte de la d\u00E9claration de module.\n --permit-illegal-access\n autoriser l''acc\u00E8s non autoris\u00E9 \u00E0 des \ -membres de types dans des modules nomm\u00E9s\n par code dans des modules sans nom. Cette option de compatibilit\u00E9 sera\n enlev\u00E9e dans la prochaine version.\n --limit-modules [,...]\n limiter l''univers de modules observables\n --patch-module =({0})*\n Remplacement ou augmentation d''un module avec des classes et des ressources\n dans des fichiers ou des r\u00E9pertoires JAR.\n --disable-@files d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n\nCes options suppl\u00E9mentaires peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n +java.launcher.X.usage=\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a:\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc: journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xprof sortie des donn\u00E9es de profilage d''UC (en phase d''abandon)\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration.\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss d\u00E9finition de la taille de pile de threads Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads =(,)*\n met \u00E0 jour pour lire , sans tenir compte\n de la d\u00E9claration de module. \n peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n sans nom.\n --add-exports /=(,)*\n met \u00E0 jour pour exporter vers ,\n sans tenir compte de la d\u00E9claration de module.\n peut \u00EAtre ALL-UNNAMED pour exporter tous les\n modules sans nom.\n --add-opens /=(,)*\n met \u00E0 jour pour ouvrir dans\n , sans tenir compte de la d\u00E9claration de module.\n --limit-modules [,...]\n limiter l''univers de modules observables\n --patch-module =({0})*\n Remplacement ou augmentation d''un module avec des classes et des ressources\n dans des fichiers ou des r\u00E9pertoires JAR.\n --disable-@files d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n\nCes options suppl\u00E9mentaires peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\nLes options suivantes sont propres \u00E0 Mac OS X :\n -XstartOnFirstThread\n ex\u00E9cute la m\u00E9thode main() sur le premier thread (AppKit)\n -Xdock:name=\n remplace le nom d'application par d\u00E9faut affich\u00E9 dans l'ancrage\n -Xdock:icon=\n remplace l'ic\u00F4ne par d\u00E9faut affich\u00E9e dans l'ancrage\n\n diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties index 445d0ac9e41..9c590b3c538 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties @@ -35,7 +35,7 @@ java.launcher.opt.footer = \ -cp = oppure\n-- .\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\n -Xbatch Disabilita la compilazione in background.\n -Xbootclasspath/a:\n Aggiunge alla fine del classpath di bootstrap.\n -Xcheck:jni Esegue controlli aggiuntivi per le funzioni JNI.\n -Xcomp Forza la compilazione dei metodi al primo richiamo.\n -Xdebug Fornito per la compatibilit\u00E0 con le versioni precedenti.\n -Xdiag Mostra ulteriori messaggi diagnostici.\n -Xfuture Abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future.\n -Xint Esecuzione solo in modalit\u00E0 convertita.\n -Xinternalversion\n Visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n all''opzione -version.\n -Xloggc: Registra lo stato GC in un file con indicatori orari.\n -Xmixed Esecuzione in modalit\u00E0 mista (impostazione predefinita).\n -Xmn Imposta le dimensioni iniziale e massima (in byte) dell''heap\n per la young generation (nursery).\n -Xms Imposta la dimensione heap Java iniziale.\n -Xmx Imposta la dimensione heap Java massima.\n -Xnoclassgc Disabilta la garbage collection della classe.\n -Xprof Visualizza i dati di profilo della CPU (non pi\u00F9 valida).\n -Xrs Riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione).\n -Xshare:auto Utilizza i dati di classe condivisi se possibile (impostazione predefinita).\n -Xshare:off Non tenta di utilizzare i dati di classe condivisi.\n -Xshare:on Richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings Mostra tutte le impostazioni e continua.\n -XshowSettings:all\n Mostra tutte le impostazioni e continua.\n -XshowSettings:locale\n Mostra tutte le impostazioni correlate alle impostazioni nazionali e continua.\n -XshowSettings:properties\n Mostra tutte le impostazioni delle propriet\u00E0 e continua.\n -XshowSettings:vm Mostra tutte le impostazioni correlate alla VM e continua.\n -Xss Imposta la dimensione dello stack di thread Java.\n -Xverify Imposta la modalit\u00E0 del verificatore bytecode.\n --add-reads:=(,)*\n Aggiorna per leggere , indipendentemente\n dalla dichiarazione del modulo.\n pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n moduli senza nome.\n -add-exports:/=(,)*\n Aggiorna per esportare in ,\n indipendentemente dalla dichiarazione del modulo.\n pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n moduli senza nome.\n --add-opens /=(,)*\n Aggiorna per aprire in\n , indipendentemente dalla dichiarazione del modulo.\n --permit-illegal-access\n Permette l''accesso non consentito ai membri dei tipi nei moduli denominati\n mediante codice in moduli senza nome. Questa opzione di compatibilit\u00E0 verr\u00E0\n rimossa nella release successiva.\n --limit-modules [,...]\n Limita l''universo di moduli osservabili\n -patch-module =({0})*\n Sostituisce o migliora un modulo con \ +java.launcher.X.usage=\n -Xbatch Disabilita la compilazione in background.\n -Xbootclasspath/a:\n Aggiunge alla fine del classpath di bootstrap.\n -Xcheck:jni Esegue controlli aggiuntivi per le funzioni JNI.\n -Xcomp Forza la compilazione dei metodi al primo richiamo.\n -Xdebug Fornito per la compatibilit\u00E0 con le versioni precedenti.\n -Xdiag Mostra ulteriori messaggi diagnostici.\n -Xfuture Abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future.\n -Xint Esecuzione solo in modalit\u00E0 convertita.\n -Xinternalversion\n Visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n all''opzione -version.\n -Xloggc: Registra lo stato GC in un file con indicatori orari.\n -Xmixed Esecuzione in modalit\u00E0 mista (impostazione predefinita).\n -Xmn Imposta le dimensioni iniziale e massima (in byte) dell''heap\n per la young generation (nursery).\n -Xms Imposta la dimensione heap Java iniziale.\n -Xmx Imposta la dimensione heap Java massima.\n -Xnoclassgc Disabilta la garbage collection della classe.\n -Xprof Visualizza i dati di profilo della CPU (non pi\u00F9 valida).\n -Xrs Riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione).\n -Xshare:auto Utilizza i dati di classe condivisi se possibile (impostazione predefinita).\n -Xshare:off Non tenta di utilizzare i dati di classe condivisi.\n -Xshare:on Richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings Mostra tutte le impostazioni e continua.\n -XshowSettings:all\n Mostra tutte le impostazioni e continua.\n -XshowSettings:locale\n Mostra tutte le impostazioni correlate alle impostazioni nazionali e continua.\n -XshowSettings:properties\n Mostra tutte le impostazioni delle propriet\u00E0 e continua.\n -XshowSettings:vm Mostra tutte le impostazioni correlate alla VM e continua.\n -Xss Imposta la dimensione dello stack di thread Java.\n -Xverify Imposta la modalit\u00E0 del verificatore bytecode.\n --add-reads:=(,)*\n Aggiorna per leggere , indipendentemente\n dalla dichiarazione del modulo.\n pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n moduli senza nome.\n -add-exports:/=(,)*\n Aggiorna per esportare in ,\n indipendentemente dalla dichiarazione del modulo.\n pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n moduli senza nome.\n --add-opens /=(,)*\n Aggiorna per aprire in\n , indipendentemente dalla dichiarazione del modulo.\n --limit-modules [,...]\n Limita l''universo di moduli osservabili\n -patch-module =({0})*\n Sostituisce o migliora un modulo con \ classi e risorse\n in file JAR o directory.\n --disable-@files Disabilita l''ulteriore espansione di file argomenti.\n\nQueste opzioni non standard sono soggette a modifiche senza preavviso.\n # Translators please note do not translate the options themselves diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties index 891b8f0a09b..b8ef45ac9c4 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties @@ -37,7 +37,7 @@ java.launcher.opt.footer = \ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\ # Translators please note do not translate the options themselves java.launcher.X.usage=\n -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xcomp \u521D\u56DE\u547C\u51FA\u3057\u6642\u306B\u30E1\u30BD\u30C3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5F37\u5236\u3059\u308B\n -Xdebug \u4E0B\u4F4D\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u63D0\u4F9B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xinternalversion\n -version\u30AA\u30D7\u30B7\u30E7\u30F3\u3088\u308A\u8A73\u7D30\u306AJVM\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\n \u8868\u793A\u3059\u308B\n -Xloggc: \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xmn \u82E5\u3044\u4E16\u4EE3(\u30CA\u30FC\u30B5\u30EA)\u306E\u30D2\u30FC\u30D7\u306E\u521D\u671F\u304A\u3088\u3073\u6700\u5927\u30B5\u30A4\u30BA(\u30D0\u30A4\u30C8\u5358\u4F4D)\n \u3092\u8A2D\u5B9A\u3059\u308B\n -Xms Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n \ --Xss Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xverify \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n --add-reads =(,)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\u3092\u66F4\u65B0\u3057\u3066\n \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n \u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n --add-exports /=(,)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\u3092\u66F4\u65B0\u3057\u3066\u3092\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n \u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n --add-opens /=(,)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\u3092\u66F4\u65B0\u3057\u3066\n \u3092\u306B\u958B\u304D\u307E\u3059\u3002\n --permit-illegal-access\n \u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u5185\u306E\u30B3\u30FC\u30C9\u306B\u3088\u308B\u3001\u540D\u524D\u306E\u3042\u308B\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5185\u306E\u30BF\u30A4\u30D7\u306E\u30E1\u30F3\u30D0\u30FC\u3078\u306E\u4E0D\u6B63\u30A2\u30AF\u30BB\u30B9\u3092\n \u8A31\u53EF\u3057\u307E\u3059\u3002\u3053\u306E\u4E92\u63DB\u6027\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u6B21\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u307E\u3059\u3002\n --limit-modules [,...]\n \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3057\u307E\u3059\n --patch-module =({0})*\n JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\n \u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u62E1\u5F35\u3057\u307E\u3059\n --disable-@files \u3055\u3089\u306A\u308B\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3057\u307E\u3059\n\n\u3053\u308C\u3089\u306E\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n +-Xss Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xverify \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n --add-reads =(,)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\u3092\u66F4\u65B0\u3057\u3066\n \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n \u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n --add-exports /=(,)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\u3092\u66F4\u65B0\u3057\u3066\u3092\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n \u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n --add-opens /=(,)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\u3092\u66F4\u65B0\u3057\u3066\n \u3092\u306B\u958B\u304D\u307E\u3059\u3002\n --limit-modules [,...]\n \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3057\u307E\u3059\n --patch-module =({0})*\n JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\n \u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u62E1\u5F35\u3057\u307E\u3059\n --disable-@files \u3055\u3089\u306A\u308B\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3057\u307E\u3059\n\n\u3053\u308C\u3089\u306E\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059:\n -XstartOnFirstThread\n main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n -Xdock:name=\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -Xdock:icon=\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties index 49f590cb41b..5ee8ae9c2b1 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties @@ -36,7 +36,7 @@ java.launcher.opt.footer = \ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD # Translators please note do not translate the options themselves java.launcher.X.usage=\n -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xcomp \uCCAB\uBC88\uC9F8 \uD638\uCD9C\uC5D0\uC11C \uBA54\uC18C\uB4DC \uCEF4\uD30C\uC77C\uC744 \uAC15\uC81C\uD569\uB2C8\uB2E4.\n -Xdebug \uC5ED \uD638\uD658\uC131\uC744 \uC704\uD574 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xinternalversion\n -version \uC635\uC158\uBCF4\uB2E4 \uC0C1\uC138\uD55C JVM \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xloggc:<\uD30C\uC77C> \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xmn<\uD06C\uAE30> \uC80A\uC740 \uC138\uB300(Nursery)\uB97C \uC704\uD574 \uD799\uC758 \uCD08\uAE30 \uBC0F \uCD5C\uB300\n \uD06C\uAE30(\uBC14\uC774\uD2B8)\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms<\uD06C\uAE30> \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx<\uD06C\uAE30> \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4(\uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC74C).\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -Xss<\uD06C\uAE30> Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xverify \uBC14\uC774\uD2B8\uCF54\uB4DC \uAC80\uC99D\uC790\uC758 \uBAA8\uB4DC\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n \ - --add-reads <\uBAA8\uB4C8>=<\uB300\uC0C1-\uBAA8\uB4C8>(,<\uB300\uC0C1-\uBAA8\uB4C8>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <\uB300\uC0C1-\uBAA8\uB4C8>\uC744 \uC77D\uB3C4\uB85D\n <\uBAA8\uB4C8>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <\uB300\uC0C1-\uBAA8\uB4C8>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-exports <\uBAA8\uB4C8>/<\uD328\uD0A4\uC9C0>=<\uB300\uC0C1-\uBAA8\uB4C8>(,<\uB300\uC0C1-\uBAA8\uB4C8>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <\uD328\uD0A4\uC9C0>\uB97C <\uB300\uC0C1-\uBAA8\uB4C8>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n <\uBAA8\uB4C8>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <\uB300\uC0C1-\uBAA8\uB4C8>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-opens <\uBAA8\uB4C8>/<\uD328\uD0A4\uC9C0>=<\uB300\uC0C1-\uBAA8\uB4C8>(,<\uB300\uC0C1-\uBAA8\uB4C8>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <\uD328\uD0A4\uC9C0>\uB97C <\uB300\uC0C1-\uBAA8\uB4C8>\uB85C \uC5F4\uB3C4\uB85D\n <\uBAA8\uB4C8>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n --permit-illegal-access\n \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4C8\uC758 \uCF54\uB4DC\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC774\uB984\uC774 \uC9C0\uC815\uB41C\n \uBAA8\uB4C8\uC758 \uC720\uD615 \uBA64\uBC84\uC5D0 \uB300\uD55C \uC798\uBABB\uB41C \uC561\uC138\uC2A4\uB97C \uD5C8\uC6A9\uD569\uB2C8\uB2E4. \uC774 \uD638\uD658\uC131\n \uC635\uC158\uC740 \uB2E4\uC74C \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n --limit-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC758 \uACF5\uC6A9\uC744 \uC81C\uD55C\uD569\uB2C8\uB2E4.\n --patch-module <\uBAA8\uB4C8>=<\uD30C\uC77C>({0}<\uD30C\uC77C>)*\n JAR \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n --disable-@files \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\n\uC774\uB7EC\uD55C \uCD94\uAC00 \uC635\uC158\uC740 \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n + --add-reads <\uBAA8\uB4C8>=<\uB300\uC0C1-\uBAA8\uB4C8>(,<\uB300\uC0C1-\uBAA8\uB4C8>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <\uB300\uC0C1-\uBAA8\uB4C8>\uC744 \uC77D\uB3C4\uB85D\n <\uBAA8\uB4C8>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <\uB300\uC0C1-\uBAA8\uB4C8>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-exports <\uBAA8\uB4C8>/<\uD328\uD0A4\uC9C0>=<\uB300\uC0C1-\uBAA8\uB4C8>(,<\uB300\uC0C1-\uBAA8\uB4C8>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <\uD328\uD0A4\uC9C0>\uB97C <\uB300\uC0C1-\uBAA8\uB4C8>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n <\uBAA8\uB4C8>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <\uB300\uC0C1-\uBAA8\uB4C8>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-opens <\uBAA8\uB4C8>/<\uD328\uD0A4\uC9C0>=<\uB300\uC0C1-\uBAA8\uB4C8>(,<\uB300\uC0C1-\uBAA8\uB4C8>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <\uD328\uD0A4\uC9C0>\uB97C <\uB300\uC0C1-\uBAA8\uB4C8>\uB85C \uC5F4\uB3C4\uB85D\n <\uBAA8\uB4C8>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n --limit-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC758 \uACF5\uC6A9\uC744 \uC81C\uD55C\uD569\uB2C8\uB2E4.\n --patch-module <\uBAA8\uB4C8>=<\uD30C\uC77C>({0}<\uD30C\uC77C>)*\n JAR \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n --disable-@files \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\n\uC774\uB7EC\uD55C \uCD94\uAC00 \uC635\uC158\uC740 \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n -XstartOnFirstThread\n \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xdock:name=\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n -Xdock:icon=\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties index dd149aef2c8..cfe8507e56a 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties @@ -35,7 +35,7 @@ java.launcher.opt.footer = \ -cp = ou\n-- .\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\n -Xbatch desativa compila\u00E7\u00E3o em segundo plano\n -Xbootclasspath/a:\n anexa ao final do caminho de classe de bootstrap\n -Xcheck:jni executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n -Xcomp for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n -Xdebug fornecido para compatibilidade reversa\n -Xdiag mostra mensagens adicionais de diagn\u00F3stico\n -Xfuture ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo, antecipando padr\u00E3o futuro\n -Xint somente execu\u00E7\u00E3o de modo interpretado\n -Xinternalversion\n exibe informa\u00E7\u00F5es mais detalhadas da vers\u00E3o da JVM do que a\n op\u00E7\u00E3o -version\n -Xloggc: registra status de GC em um arquivo com timestamps\n -Xmixed execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n -Xmn define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n para a gera\u00E7\u00E3o jovem (infantil)\n -Xms define tamanho inicial do heap Java\n -Xmx define tamanho m\u00E1ximo do heap Java\n -Xnoclassgc desativa coleta de lixo de classe\n -Xprof gera dados de perfil de cpu (obsoleto)\n -Xrs reduz uso de sinais do SO por Java/VM (ver documenta\u00E7\u00E3o)\n -Xshare:auto usa dados de classe compartilhados se poss\u00EDvel (padr\u00E3o)\n -Xshare:off n\u00E3o tenta usar dados de classe compartilhados\n -Xshare:on exige o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n -XshowSettings mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:all\n mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:locale\n mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 configura\u00E7\u00E3o regional e continua\n -XshowSettings:properties\n mostra todas as defini\u00E7\u00F5es de propriedade e continua\n -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas a vm e continua\n -Xss define o tamanho da pilha de thread java\n -Xverify define o modo do verificador de c\u00F3digo de byte\n --add-reads =(,)*\n atualiza para ler , independentemente\n da declara\u00E7\u00E3o de m\u00F3dulo. \n pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n sem nome.\n --add-exports /=(,)*\n atualiza para exportar para ,\n independentemente da declara\u00E7\u00E3o de m\u00F3dulo.\n pode ser ALL-UNNAMED para exportar todos os\n m\u00F3dulos sem nome.\n --add-opens /=(,)*\n atualiza para abrir para\n , independentemente da declara\u00E7\u00E3o de m\u00F3dulo.\n --permit-illegal-access\n permite acesso inv\u00E1lido aos membros dos tipos nos m\u00F3dulos com nome\n por c\u00F3digo nos m\u00F3dulos sem nomes. Esta op\u00E7\u00E3o de compatibilidade ser\u00E1\n removida na pr\u00F3xima release.\n --limit-modules [,...]\n limita o universo de m\u00F3dulos observ\u00E1veis\n--patch-module =({0})*\n substitui ou amplia um m\u00F3dulo com classes e recursos\n em arquivos ou \ +java.launcher.X.usage=\n -Xbatch desativa compila\u00E7\u00E3o em segundo plano\n -Xbootclasspath/a:\n anexa ao final do caminho de classe de bootstrap\n -Xcheck:jni executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n -Xcomp for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n -Xdebug fornecido para compatibilidade reversa\n -Xdiag mostra mensagens adicionais de diagn\u00F3stico\n -Xfuture ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo, antecipando padr\u00E3o futuro\n -Xint somente execu\u00E7\u00E3o de modo interpretado\n -Xinternalversion\n exibe informa\u00E7\u00F5es mais detalhadas da vers\u00E3o da JVM do que a\n op\u00E7\u00E3o -version\n -Xloggc: registra status de GC em um arquivo com timestamps\n -Xmixed execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n -Xmn define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n para a gera\u00E7\u00E3o jovem (infantil)\n -Xms define tamanho inicial do heap Java\n -Xmx define tamanho m\u00E1ximo do heap Java\n -Xnoclassgc desativa coleta de lixo de classe\n -Xprof gera dados de perfil de cpu (obsoleto)\n -Xrs reduz uso de sinais do SO por Java/VM (ver documenta\u00E7\u00E3o)\n -Xshare:auto usa dados de classe compartilhados se poss\u00EDvel (padr\u00E3o)\n -Xshare:off n\u00E3o tenta usar dados de classe compartilhados\n -Xshare:on exige o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n -XshowSettings mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:all\n mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:locale\n mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 configura\u00E7\u00E3o regional e continua\n -XshowSettings:properties\n mostra todas as defini\u00E7\u00F5es de propriedade e continua\n -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas a vm e continua\n -Xss define o tamanho da pilha de thread java\n -Xverify define o modo do verificador de c\u00F3digo de byte\n --add-reads =(,)*\n atualiza para ler , independentemente\n da declara\u00E7\u00E3o de m\u00F3dulo. \n pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n sem nome.\n --add-exports /=(,)*\n atualiza para exportar para ,\n independentemente da declara\u00E7\u00E3o de m\u00F3dulo.\n pode ser ALL-UNNAMED para exportar todos os\n m\u00F3dulos sem nome.\n --add-opens /=(,)*\n atualiza para abrir para\n , independentemente da declara\u00E7\u00E3o de m\u00F3dulo.\n --limit-modules [,...]\n limita o universo de m\u00F3dulos observ\u00E1veis\n--patch-module =({0})*\n substitui ou amplia um m\u00F3dulo com classes e recursos\n em arquivos ou \ diret\u00F3rios JAR.\n\nEssas op\u00E7\u00F5es extras est\u00E3o sujeitas a altera\u00E7\u00E3o sem aviso.\n # Translators please note do not translate the options themselves diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties index c7c6c958799..885602e9a26 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties @@ -35,7 +35,7 @@ java.launcher.opt.footer = \ -cp = eller\n-- .\n # Translators please note do not translate the options themselves -java.launcher.X.usage=\n -Xbatch avaktivera bakgrundskompilering\n -Xbootclasspath/a:\n l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n -Xcheck:jni utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n -Xcomp tvingar kompilering av metoder vid det f\u00F6rsta anropet\n -Xdebug tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n -Xdiag visa fler diagnostiska meddelanden\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xint endast exekvering i tolkat l\u00E4ge\n -Xinternalversion\n visar mer detaljerad information om JVM-version \u00E4n\n alternativet -version\n -Xloggc: logga GC-status till en fil med tidsst\u00E4mplar\n -Xmixed exekvering i blandat l\u00E4ge (standard)\n -Xmn anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n -Xms ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n -Xmx ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n -Xnoclassgc avaktivera klasskr\u00E4pinsamling\n -Xprof utdata f\u00F6r processorprofilering (inaktuellt)\n -Xrs minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n -Xshare:auto anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n -Xshare:off f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n -Xshare:on kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -Xss ange storlek f\u00F6r java-tr\u00E5dsstacken\n -Xverify anger l\u00E4ge f\u00F6r bytekodverifieraren\n --add-reads =(,)*\n uppdaterar f\u00F6r att l\u00E4sa , oavsett\n moduldeklarationen. \n kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n ej namngivna moduler.\n --add-exports /=(,)*\n uppdaterar f\u00F6r att exportera till ,\n oavsett moduldeklarationen.\n kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n ej namngivna moduler.\n --add-opens /=(,)*\n uppdaterar f\u00F6r att \u00F6ppna till\n , oavsett moduldeklarationen.\n --permit-illegal-access\n till\u00E5t otill\u00E5ten \u00E5tkomst till medlemmar av typer i namngivna\n moduler av kod i ej namngivna moduler. Det h\u00E4r \n kompatibilitetsalternativet tas bort i n\u00E4sta utg\u00E5va.\n --limit-modules [,...]\n begr\u00E4nsar universumet med observerbara moduler\n --patch-module =({0})*\n \u00E5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n i JAR-filer eller kataloger.\n --disable-@files avaktivera ytterligare \ +java.launcher.X.usage=\n -Xbatch avaktivera bakgrundskompilering\n -Xbootclasspath/a:\n l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n -Xcheck:jni utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n -Xcomp tvingar kompilering av metoder vid det f\u00F6rsta anropet\n -Xdebug tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n -Xdiag visa fler diagnostiska meddelanden\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xint endast exekvering i tolkat l\u00E4ge\n -Xinternalversion\n visar mer detaljerad information om JVM-version \u00E4n\n alternativet -version\n -Xloggc: logga GC-status till en fil med tidsst\u00E4mplar\n -Xmixed exekvering i blandat l\u00E4ge (standard)\n -Xmn anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n -Xms ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n -Xmx ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n -Xnoclassgc avaktivera klasskr\u00E4pinsamling\n -Xprof utdata f\u00F6r processorprofilering (inaktuellt)\n -Xrs minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n -Xshare:auto anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n -Xshare:off f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n -Xshare:on kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -Xss ange storlek f\u00F6r java-tr\u00E5dsstacken\n -Xverify anger l\u00E4ge f\u00F6r bytekodverifieraren\n --add-reads =(,)*\n uppdaterar f\u00F6r att l\u00E4sa , oavsett\n moduldeklarationen. \n kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n ej namngivna moduler.\n --add-exports /=(,)*\n uppdaterar f\u00F6r att exportera till ,\n oavsett moduldeklarationen.\n kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n ej namngivna moduler.\n --add-opens /=(,)*\n uppdaterar f\u00F6r att \u00F6ppna till\n , oavsett moduldeklarationen.\n --limit-modules [,...]\n begr\u00E4nsar universumet med observerbara moduler\n --patch-module =({0})*\n \u00E5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n i JAR-filer eller kataloger.\n --disable-@files avaktivera ytterligare \ argumentfilsut\u00F6kning\n\nDe h\u00E4r extraalternativen kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n # Translators please note do not translate the options themselves diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties index 32d05c68ad2..574a3d26291 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties @@ -36,7 +36,7 @@ java.launcher.opt.footer = \ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u76 # Translators please note do not translate the options themselves java.launcher.X.usage=\n -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xcomp \u5728\u9996\u6B21\u8C03\u7528\u65F6\u5F3A\u5236\u4F7F\u7528\u7684\u7F16\u8BD1\u65B9\u6CD5\n -Xdebug \u4E3A\u5B9E\u73B0\u5411\u540E\u517C\u5BB9\u800C\u63D0\u4F9B\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xinternalversion\n \u663E\u793A\u6BD4 -version \u9009\u9879\u66F4\u8BE6\u7EC6\u7684 JVM\n \u7248\u672C\u4FE1\u606F\n -Xloggc:<\u6587\u4EF6> \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n -Xmn<\u5927\u5C0F> \u4E3A\u5E74\u8F7B\u4EE3 (\u65B0\u751F\u4EE3) \u8BBE\u7F6E\u521D\u59CB\u548C\u6700\u5927\u5806\u5927\u5C0F\n (\u4EE5\u5B57\u8282\u4E3A\u5355\u4F4D)\n -Xms<\u5927\u5C0F> \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx<\u5927\u5C0F> \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xprof \u8F93\u51FA cpu \u5206\u6790\u6570\u636E (\u5DF2\u8FC7\u65F6)\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EEDe\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -Xss<\u5927\u5C0F> \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xverify \u8BBE\u7F6E\u5B57\u8282\u7801\u9A8C\u8BC1\u5668\u7684\u6A21\u5F0F\n --add-reads <\u6A21\u5757>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u8BFB\u53D6 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u8BFB\u53D6\u6240\u6709\u672A\u547D\u540D\n \u6A21\u5757\u3002\n --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u5230\u6240\u6709\n \u672A\u547D\u540D\u6A21\u5757\u3002\n --add-opens <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \ -\u4EE5\u5728 <\u76EE\u6807\u6A21\u5757> \u4E2D\n \u6253\u5F00 <\u7A0B\u5E8F\u5305>, \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n --permit-illegal-access\n \u5141\u8BB8\u901A\u8FC7\u672A\u547D\u540D\u6A21\u5757\u4E2D\u7684\u4EE3\u7801\u5BF9\u547D\u540D\u6A21\u5757\u4E2D\u7684\n \u7C7B\u578B\u6210\u5458\u8FDB\u884C\u975E\u6CD5\u8BBF\u95EE\u3002\u5C06\u5728\u4E0B\u4E00\u4E2A\u53D1\u884C\u7248\u4E2D\n \u5220\u9664\u6B64\u517C\u5BB9\u6027\u9009\u9879\u3002\n --limit-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF\n --patch-module <\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n --disable-@files \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n\n\u8FD9\u4E9B\u989D\u5916\u9009\u9879\u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n +\u4EE5\u5728 <\u76EE\u6807\u6A21\u5757> \u4E2D\n \u6253\u5F00 <\u7A0B\u5E8F\u5305>, \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n --limit-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF\n --patch-module <\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n --disable-@files \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n\n\u8FD9\u4E9B\u989D\u5916\u9009\u9879\u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\n\u4EE5\u4E0B\u9009\u9879\u4E3A Mac OS X \u7279\u5B9A\u7684\u9009\u9879:\n -XstartOnFirstThread\n \u5728\u7B2C\u4E00\u4E2A (AppKit) \u7EBF\u7A0B\u4E0A\u8FD0\u884C main() \u65B9\u6CD5\n -Xdock:name=<\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>\n \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n -Xdock:icon=<\u56FE\u6807\u6587\u4EF6\u7684\u8DEF\u5F84>\n \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u56FE\u6807\n\n diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties index 4469b919403..5b9cafa63f7 100644 --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties @@ -36,7 +36,7 @@ java.launcher.opt.footer = \ -cp <\u76EE\u9304\u548C zip/jar \u6A94\u6848\u76 # Translators please note do not translate the options themselves java.launcher.X.usage=\n -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xbootclasspath/a:<\u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u81F3\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xcheck:jni \u57F7\u884C\u984D\u5916\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xcomp \u5F37\u5236\u7DE8\u8B6F\u7B2C\u4E00\u500B\u547C\u53EB\u7684\u65B9\u6CD5\n -Xdebug \u91DD\u5C0D\u56DE\u6EAF\u76F8\u5BB9\u6027\u63D0\u4F9B\n -Xdiag \u986F\u793A\u984D\u5916\u7684\u8A3A\u65B7\u8A0A\u606F\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xinternalversion\n \u986F\u793A\u6BD4 -version \u9078\u9805\u66F4\u70BA\u8A73\u7D30\u7684\n JVM \u7248\u672C\u8CC7\u8A0A\n -Xloggc: \u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E14\u9023\u540C\u6642\u6233\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xmn \u8A2D\u5B9A\u65B0\u751F\u4EE3 (\u990A\u6210\u5340) \u4E4B\u5806\u96C6\u7684\u8D77\u59CB\u5927\u5C0F\u548C\n \u5927\u5C0F\u4E0A\u9650 (\u4F4D\u5143\u7D44)\n -Xms \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xprof \u8F38\u51FA cpu \u5206\u6790\u8CC7\u6599 (\u5DF2\u4E0D\u518D\u4F7F\u7528)\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u7684\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u6CC1\u4E0B\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u6703\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\u9032\u884C\u4F5C\u696D\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\u9032\u884C\u4F5C\u696D\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\u9032\u884C\u4F5C\u696D\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\u9032\u884C\u4F5C\u696D\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\u9032\u884C\u4F5C\u696D\n -Xss \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xverify \u8A2D\u5B9A Bytecode \u9A57\u8B49\u7A0B\u5F0F\u7684\u6A21\u5F0F\n --add-reads =(,)*\n \u66F4\u65B0 \u4EE5\u8B80\u53D6 \uFF0C\u4E0D\u8AD6\n \u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002\n \u53EF\u5C07 \u8A2D\u70BA ALL-UNNAMED \u4EE5\u8B80\u53D6\u6240\u6709\u672A\u547D\u540D\u7684\n \u6A21\u7D44\u3002\n --add-exports /=(,)*\n \u66F4\u65B0 \u4EE5\u4FBF\u5C07 \u532F\u51FA\u81F3 \uFF0C\n \u4E0D\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002\n \u53EF\u5C07 \u8A2D\u70BA ALL-UNNAMED \u4EE5\u532F\u51FA\u81F3\u6240\u6709\n \u672A\u547D\u540D\u7684\u6A21\u7D44\u3002\n --add-opens /=(,)*\n \u66F4\u65B0 \ -\u4EE5\u4FBF\u5C07 \u958B\u555F\u81F3\n \uFF0C\u4E0D\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002\n --permit-illegal-access\n \u5141\u8A31\u672A\u547D\u540D\u6A21\u7D44\u4E2D\u7684\u7A0B\u5F0F\u78BC\u5C0D\u5DF2\u547D\u540D\u6A21\u7D44\u4E2D\u7684\n \u985E\u578B\u6210\u54E1\u9032\u884C\u975E\u6CD5\u5B58\u53D6\u3002\u6B64\u76F8\u5BB9\u6027\u9078\u9805\u5C07\u5728\n \u4E0B\u4E00\u500B\u7248\u672C\u4E2D\u79FB\u9664\u3002\n --limit-modules [,...]\n \u9650\u5236\u53EF\u76E3\u6E2C\u6A21\u7D44\u7684\u7BC4\u570D\n --patch-module =({0})*\n \u8986\u5BEB\u6216\u52A0\u5F37\u542B\u6709 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n \u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n --disable-@files \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n\n\u4E0A\u8FF0\u7684\u984D\u5916\u9078\u9805\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n +\u4EE5\u4FBF\u5C07 \u958B\u555F\u81F3\n \uFF0C\u4E0D\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002\n --limit-modules [,...]\n \u9650\u5236\u53EF\u76E3\u6E2C\u6A21\u7D44\u7684\u7BC4\u570D\n --patch-module =({0})*\n \u8986\u5BEB\u6216\u52A0\u5F37\u542B\u6709 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n \u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n --disable-@files \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n\n\u4E0A\u8FF0\u7684\u984D\u5916\u9078\u9805\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9805:\n -XstartOnFirstThread\n \u5728\u7B2C\u4E00\u500B (AppKit) \u57F7\u884C\u7DD2\u57F7\u884C main() \u65B9\u6CD5\n -Xdock:name=\n \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u61C9\u7528\u7A0B\u5F0F\u540D\u7A31\n -Xdock:icon=\n \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u5716\u793A\n\n diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java index f7bedb99ccb..8282d51c425 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java @@ -270,7 +270,7 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { AlgorithmParameters currSigAlgParams = algorithmId.getParameters(); PublicKey currPubKey = cert.getPublicKey(); - String currSigAlg = ((X509Certificate)cert).getSigAlgName(); + String currSigAlg = x509Cert.getSigAlgName(); // Check the signature algorithm and parameters against constraints. if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, currSigAlg, diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java index 51a31da5e17..ec5e59c07fc 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -302,6 +302,8 @@ public final class Main { Command.IMPORTPASS.setAltName("-importpassword"); } + // If an option is allowed multiple times, remember to record it + // in the optionsSet.contains() block in parseArgs(). enum Option { ALIAS("alias", "", "alias.name.of.the.entry.to.process"), DESTALIAS("destalias", "", "destination.alias"), @@ -423,9 +425,31 @@ public final class Main { String confFile = null; + // Records all commands and options set. Used to check dups. + Set optionsSet = new HashSet<>(); + for (i=0; i < args.length; i++) { String flags = args[i]; if (flags.startsWith("-")) { + String lowerFlags = flags.toLowerCase(Locale.ROOT); + if (optionsSet.contains(lowerFlags)) { + switch (lowerFlags) { + case "-ext": + case "-id": + case "-provider": + case "-addprovider": + case "-providerclass": + case "-providerarg": + // These options are allowed multiple times + break; + default: + weakWarnings.add(String.format( + rb.getString("option.1.set.twice"), + lowerFlags)); + } + } else { + optionsSet.add(lowerFlags); + } if (collator.compare(flags, "-conf") == 0) { if (i == args.length - 1) { errorNeedArgument(flags); @@ -433,7 +457,15 @@ public final class Main { confFile = args[++i]; } else { Command c = Command.getCommand(flags); - if (c != null) command = c; + if (c != null) { + if (command == null) { + command = c; + } else { + throw new Exception(String.format( + rb.getString("multiple.commands.1.2"), + command.name, c.name)); + } + } } } } diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java index 522449c366b..a78eb6bc3e6 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java @@ -42,6 +42,8 @@ public class Resources extends java.util.ListResourceBundle { // keytool: Help part {".OPTION.", " [OPTION]..."}, {"Options.", "Options:"}, + {"option.1.set.twice", "The %s option is specified multiple times. All except the last one will be ignored."}, + {"multiple.commands.1.2", "Only one command is allowed: both %1$s and %2$s were specified."}, {"Use.keytool.help.for.all.available.commands", "Use \"keytool -help\" for all available commands"}, {"Key.and.Certificate.Management.Tool", diff --git a/jdk/src/java.base/share/classes/sun/security/util/AuthResources.java b/jdk/src/java.base/share/classes/sun/security/util/AuthResources.java index 8821b87988a..b74677d9629 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/AuthResources.java +++ b/jdk/src/java.base/share/classes/sun/security/util/AuthResources.java @@ -103,6 +103,7 @@ public class AuthResources extends java.util.ListResourceBundle { {"COLON", ": "}, {".error.adding.Permission.", ": error adding Permission "}, {"SPACE", " "}, + {"NEWLINE", "\n"}, {".error.adding.Entry.", ": error adding Entry "}, {"LPARAM", "("}, {"RPARAM", ")"}, diff --git a/jdk/src/java.base/share/classes/sun/security/util/ECUtil.java b/jdk/src/java.base/share/classes/sun/security/util/ECUtil.java index dc6b02be611..a58cfc82c00 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/ECUtil.java +++ b/jdk/src/java.base/share/classes/sun/security/util/ECUtil.java @@ -130,7 +130,7 @@ public class ECUtil { return (ECPrivateKey)keyFactory.generatePrivate(keySpec); } - private static AlgorithmParameters getECParameters(Provider p) { + public static AlgorithmParameters getECParameters(Provider p) { try { if (p != null) { return AlgorithmParameters.getInstance("EC", p); diff --git a/jdk/src/java.base/share/classes/sun/security/util/Resources.java b/jdk/src/java.base/share/classes/sun/security/util/Resources.java index 5ddbab23140..59d82de40da 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/Resources.java +++ b/jdk/src/java.base/share/classes/sun/security/util/Resources.java @@ -115,6 +115,7 @@ public class Resources extends java.util.ListResourceBundle { "unable to perform substitution on alias, {0}"}, {"substitution.value.prefix.unsupported", "substitution value, {0}, unsupported"}, + {"SPACE", " "}, {"LPARAM", "("}, {"RPARAM", ")"}, {"type.can.t.be.null","type can't be null"}, diff --git a/jdk/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java b/jdk/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java index 8426b264621..4dbec843ea7 100644 --- a/jdk/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java +++ b/jdk/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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,6 +34,9 @@ import java.util.Locale.*; import static java.util.Locale.FilteringMode.*; import static java.util.Locale.LanguageRange.*; import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; /** * Implementation for BCP47 Locale matching @@ -126,12 +129,16 @@ public final class LocaleMatcher { return new ArrayList(tags); } else { for (String tag : tags) { - tag = tag.toLowerCase(Locale.ROOT); - if (tag.startsWith(range)) { + // change to lowercase for case-insensitive matching + String lowerCaseTag = tag.toLowerCase(Locale.ROOT); + if (lowerCaseTag.startsWith(range)) { int len = range.length(); - if ((tag.length() == len || tag.charAt(len) == '-') - && !list.contains(tag) - && !shouldIgnoreFilterBasicMatch(zeroRanges, tag)) { + if ((lowerCaseTag.length() == len + || lowerCaseTag.charAt(len) == '-') + && !caseInsensitiveMatch(list, lowerCaseTag) + && !shouldIgnoreFilterBasicMatch(zeroRanges, + lowerCaseTag)) { + // preserving the case of the input tag list.add(tag); } } @@ -152,20 +159,43 @@ public final class LocaleMatcher { private static Collection removeTagsMatchingBasicZeroRange( List zeroRange, Collection tags) { if (zeroRange.isEmpty()) { + tags = removeDuplicates(tags); return tags; } List matchingTags = new ArrayList<>(); for (String tag : tags) { - tag = tag.toLowerCase(Locale.ROOT); - if (!shouldIgnoreFilterBasicMatch(zeroRange, tag)) { - matchingTags.add(tag); + // change to lowercase for case-insensitive matching + String lowerCaseTag = tag.toLowerCase(Locale.ROOT); + if (!shouldIgnoreFilterBasicMatch(zeroRange, lowerCaseTag) + && !caseInsensitiveMatch(matchingTags, lowerCaseTag)) { + matchingTags.add(tag); // preserving the case of the input tag } } return matchingTags; } + /** + * Remove duplicate tags from the given {@code tags} by + * ignoring case considerations. + */ + private static Collection removeDuplicates( + Collection tags) { + Set distinctTags = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); + return tags.stream().filter(x -> distinctTags.add(x)) + .collect(Collectors.toList()); + } + + /** + * Returns true if the given {@code list} contains an element which matches + * with the given {@code tag} ignoring case considerations. + */ + private static boolean caseInsensitiveMatch(List list, String tag) { + return list.stream().anyMatch((element) + -> (element.equalsIgnoreCase(tag))); + } + /** * The tag which is falling in the basic exclusion range(s) should not * be considered as the matching tag. Ignores the tag matching with the @@ -216,8 +246,9 @@ public final class LocaleMatcher { } String[] rangeSubtags = range.split("-"); for (String tag : tags) { - tag = tag.toLowerCase(Locale.ROOT); - String[] tagSubtags = tag.split("-"); + // change to lowercase for case-insensitive matching + String lowerCaseTag = tag.toLowerCase(Locale.ROOT); + String[] tagSubtags = lowerCaseTag.split("-"); if (!rangeSubtags[0].equals(tagSubtags[0]) && !rangeSubtags[0].equals("*")) { continue; @@ -225,9 +256,11 @@ public final class LocaleMatcher { int rangeIndex = matchFilterExtendedSubtags(rangeSubtags, tagSubtags); - if (rangeSubtags.length == rangeIndex && !list.contains(tag) - && !shouldIgnoreFilterExtendedMatch(zeroRanges, tag)) { - list.add(tag); + if (rangeSubtags.length == rangeIndex + && !caseInsensitiveMatch(list, lowerCaseTag) + && !shouldIgnoreFilterExtendedMatch(zeroRanges, + lowerCaseTag)) { + list.add(tag); // preserve the case of the input tag } } } @@ -245,14 +278,17 @@ public final class LocaleMatcher { private static Collection removeTagsMatchingExtendedZeroRange( List zeroRange, Collection tags) { if (zeroRange.isEmpty()) { + tags = removeDuplicates(tags); return tags; } List matchingTags = new ArrayList<>(); for (String tag : tags) { - tag = tag.toLowerCase(Locale.ROOT); - if (!shouldIgnoreFilterExtendedMatch(zeroRange, tag)) { - matchingTags.add(tag); + // change to lowercase for case-insensitive matching + String lowerCaseTag = tag.toLowerCase(Locale.ROOT); + if (!shouldIgnoreFilterExtendedMatch(zeroRange, lowerCaseTag) + && !caseInsensitiveMatch(matchingTags, lowerCaseTag)) { + matchingTags.add(tag); // preserve the case of the input tag } } @@ -368,10 +404,11 @@ public final class LocaleMatcher { String rangeForRegex = range.replace("*", "\\p{Alnum}*"); while (rangeForRegex.length() > 0) { for (String tag : tags) { - tag = tag.toLowerCase(Locale.ROOT); - if (tag.matches(rangeForRegex) - && !shouldIgnoreLookupMatch(zeroRanges, tag)) { - return tag; + // change to lowercase for case-insensitive matching + String lowerCaseTag = tag.toLowerCase(Locale.ROOT); + if (lowerCaseTag.matches(rangeForRegex) + && !shouldIgnoreLookupMatch(zeroRanges, lowerCaseTag)) { + return tag; // preserve the case of the input tag } } diff --git a/jdk/src/java.management.rmi/share/classes/module-info.java b/jdk/src/java.management.rmi/share/classes/module-info.java index 48eae83f901..7a471066957 100644 --- a/jdk/src/java.management.rmi/share/classes/module-info.java +++ b/jdk/src/java.management.rmi/share/classes/module-info.java @@ -27,16 +27,16 @@ * Defines the {@linkplain javax.management.remote.rmi RMI connector} * for the Java Management Extensions (JMX) Remote API. * - *
      - *
      Providers:
      - *
      This module provides - * {@link javax.management.remote.JMXConnectorProvider} service - * that creates the JMX connector clients using RMI protocol. + *
      + *
      Providers:
      + *
      This module provides the + * {@link javax.management.remote.JMXConnectorProvider} service, + * which creates JMX connector clients using the RMI protocol. * Instances of {@code JMXConnector} can be obtained via the * {@link javax.management.remote.JMXConnectorFactory#newJMXConnector * JMXConnectorFactory.newJMXConnector} factory method. - * It also provides {@link javax.management.remote.JMXConnectorServerProvider} service - * that creates the JMX connector servers using RMI protocol. + * It also provides the {@link javax.management.remote.JMXConnectorServerProvider} service, + * which creates JMX connector servers using the RMI protocol. * Instances of {@code JMXConnectorServer} can be obtained via the * {@link javax.management.remote.JMXConnectorServerFactory#newJMXConnectorServer * JMXConnectorServerFactory.newJMXConnectorServer} factory method. diff --git a/jdk/src/java.se.ee/share/classes/module-info.java b/jdk/src/java.se.ee/share/classes/module-info.java index 7a6ee6500fc..08510b9400e 100644 --- a/jdk/src/java.se.ee/share/classes/module-info.java +++ b/jdk/src/java.se.ee/share/classes/module-info.java @@ -26,8 +26,9 @@ /** * Defines the full API of the Java SE Platform. *

      - * This module requires {@code java.se} and supplements it with modules - * that define CORBA and Java EE APIs. These modules are upgradeable. + * This module requires the {@code java.se} + * module and supplements it with modules that define the CORBA and Java EE + * APIs. These modules are upgradeable. * * @moduleGraph * @since 9 diff --git a/jdk/src/java.se/share/classes/module-info.java b/jdk/src/java.se/share/classes/module-info.java index 4ff78b70454..392260dd330 100644 --- a/jdk/src/java.se/share/classes/module-info.java +++ b/jdk/src/java.se/share/classes/module-info.java @@ -26,11 +26,12 @@ /** * Defines the core Java SE API. *

      - * The modules defining CORBA and Java EE APIs are not required by - * this module, but they are required by {@code java.se.ee}. + * The modules defining the CORBA and Java EE APIs are not required by + * this module, but they are required by the + * {@code java.se.ee} module. * - *

      - *
      Optional for Java SE Platform:
      + *
      + *
      Optional for the Java SE Platform:
      *
      * Java Native Interface (JNI)
      * Java Virtual Machine Tool Interface (JVM TI)
      diff --git a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html index e52d3c9ec99..12ee65c9b8e 100644 --- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html +++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html @@ -177,13 +177,13 @@ abstract class provides.
      Features in BaseRowSet
      FeatureDetailsFeatureDetails
      PropertiesProperties Provides standard JavaBeans property manipulation mechanisms to allow applications to get and set RowSet command and property values. Refer to the documentation of the javax.sql.RowSet @@ -191,7 +191,7 @@ interface (available in the JDBC 3.0 specification) for more details on the standard RowSet properties.
      Event notificationEvent notification Provides standard JavaBeans event notifications to registered event listeners. Refer to the documentation of javax.sql.RowSetEvent interface (available in the JDBC 3.0 specification) for @@ -199,12 +199,12 @@ more details on how to register and handle standard RowSet events generated by compliant implementations.
      Setters for a RowSet object's commandSetters for a RowSet object's command Provides a complete set of setter methods for setting RowSet command parameters.
      StreamsStreams Provides fields for storing of stream instances in addition to providing a set of constants for stream type designation.
      permission target name, what the permission allows, and associated risks
      Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
      setLogsetLogSetting of the logging streamThis is a dangerous permission to grant. * The contents of the log may contain usernames and passwords, * SQL statements, and SQL data.
      callAbortcallAbortAllows the invocation of the {@code Connection} method * {@code abort}Permits an application to terminate a physical connection to a * database.
      setSyncFactorysetSyncFactoryAllows the invocation of the {@code SyncFactory} methods * {@code setJNDIContext} and {@code setLogger}Permits an application to specify the JNDI context from which the @@ -93,7 +93,7 @@ import java.security.*; *
      setNetworkTimeoutsetNetworkTimeoutAllows the invocation of the {@code Connection} method * {@code setNetworkTimeout}Permits an application to specify the maximum period a @@ -101,7 +101,7 @@ import java.security.*; * objects created from the Connection * will wait for the database to reply to any one request.
      deregisterDriverderegisterDriverAllows the invocation of the {@code DriverManager} * method {@code deregisterDriver}Permits an application to remove a JDBC driver from the list of diff --git a/jdk/src/java.sql/share/classes/java/sql/Statement.java b/jdk/src/java.sql/share/classes/java/sql/Statement.java index 9e6e2d900b8..89828185508 100644 --- a/jdk/src/java.sql/share/classes/java/sql/Statement.java +++ b/jdk/src/java.sql/share/classes/java/sql/Statement.java @@ -1379,17 +1379,17 @@ public interface Statement extends Wrapper, AutoCloseable { * single quote within the string will be replaced by two single quotes. * *
      - * + *
      * * - * + * * * - * - * - * + * + * + * * - * + * * * * @@ -1454,48 +1454,48 @@ public interface Statement extends Wrapper, AutoCloseable { * * * - * - * - * + * + * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * @@ -1554,33 +1554,33 @@ public interface Statement extends Wrapper, AutoCloseable { * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * @@ -1613,17 +1613,17 @@ public interface Statement extends Wrapper, AutoCloseable { * * * - * - * + * + * * * * - * - * - * + * + * + * * - * - * + * + * * * *
      Examples of the conversion:
      ValueResult
      ValueResult
      Hello 'Hello'
      G'Day 'G''Day'
      'G''Day'
      Hello 'Hello'
      G'Day 'G''Day'
      'G''Day''''G''''Day'''
      I'''M 'I''''''M'
      I'''M 'I''''''M'
      Examples of the conversion:
      identifieralwaysQuoteResult
      identifieralwaysQuoteResult
      HelloHellofalseHello
      HelloHellotrue"Hello"
      G'DayG'Dayfalse"G'Day"
      "Bruce Wayne""Bruce Wayne"false"Bruce Wayne"
      "Bruce Wayne""Bruce Wayne"true"Bruce Wayne"
      GoodDay$GoodDay$false"GoodDay$"
      Hello"WorldHello"WorldfalseSQLException
      "Hello"World""Hello"World"falseSQLException
      Examples of the conversion:
      identifierSimple IdentifieridentifierSimple Identifier
      HelloHellotrue
      G'DayG'Dayfalse
      "Bruce Wayne""Bruce Wayne"false
      GoodDay$GoodDay$false
      Hello"WorldHello"Worldfalse
      "Hello"World""Hello"World"false
      Examples of the conversion:
      ValueResultValueResult
      Hello N'Hello'
      G'Day N'G''Day'
      'G''Day'
      Hello N'Hello'
      G'Day N'G''Day'
      'G''Day'N'''G''''Day'''
      I'''M N'I''''''M'
      N'Hello' N'N''Hello'''
      I'''M N'I''''''M'
      N'Hello' N'N''Hello'''
      diff --git a/jdk/src/java.sql/share/classes/javax/sql/package.html b/jdk/src/java.sql/share/classes/javax/sql/package.html index 75cb739d7cf..8ee4c44913b 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/package.html +++ b/jdk/src/java.sql/share/classes/javax/sql/package.html @@ -280,7 +280,6 @@ generally, a writer will do the following: The RowSet interface may be implemented in any number of ways, and anyone may write an implementation. Developers are encouraged to use their imaginations in coming up with new ways to use rowsets. -

      Package Specification

      diff --git a/jdk/src/java.transaction/share/classes/module-info.java b/jdk/src/java.transaction/share/classes/module-info.java index ac361c6e38d..7c3cc7021a6 100644 --- a/jdk/src/java.transaction/share/classes/module-info.java +++ b/jdk/src/java.transaction/share/classes/module-info.java @@ -24,10 +24,10 @@ */ /** - * Defines a subset of the Java Transaction API (JTA) to support CORBA interop. + * Defines a subset of the Java Transaction API (JTA) to support CORBA interoperation. *

      * The subset consists of RMI exception types which are mapped to CORBA system - * exceptions by the 'Java Language to IDL Mapping Specification'. + * exceptions by the Java Language to IDL Mapping Specification. * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java index 2df53fb60ed..9ffeff9d7d2 100644 --- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java +++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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,12 +25,14 @@ package sun.security.ec; +import java.io.IOException; import java.math.BigInteger; import java.security.*; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.ECGenParameterSpec; import java.security.spec.ECParameterSpec; import java.security.spec.ECPoint; +import java.security.spec.InvalidParameterSpecException; import sun.security.ec.ECPrivateKeyImpl; import sun.security.ec.ECPublicKeyImpl; @@ -85,17 +87,19 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi { public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException { + ECParameterSpec ecSpec = null; + if (params instanceof ECParameterSpec) { - this.params = ECUtil.getECParameterSpec(null, + ecSpec = ECUtil.getECParameterSpec(null, (ECParameterSpec)params); - if (this.params == null) { + if (ecSpec == null) { throw new InvalidAlgorithmParameterException( "Unsupported curve: " + params); } } else if (params instanceof ECGenParameterSpec) { String name = ((ECGenParameterSpec)params).getName(); - this.params = ECUtil.getECParameterSpec(null, name); - if (this.params == null) { + ecSpec = ECUtil.getECParameterSpec(null, name); + if (ecSpec == null) { throw new InvalidAlgorithmParameterException( "Unknown curve name: " + name); } @@ -103,11 +107,36 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi { throw new InvalidAlgorithmParameterException( "ECParameterSpec or ECGenParameterSpec required for EC"); } + + // Not all known curves are supported by the native implementation + ensureCurveIsSupported(ecSpec); + this.params = ecSpec; + this.keySize = ((ECParameterSpec)this.params).getCurve().getField().getFieldSize(); this.random = random; } + private static void ensureCurveIsSupported(ECParameterSpec ecSpec) + throws InvalidAlgorithmParameterException { + + AlgorithmParameters ecParams = ECUtil.getECParameters(null); + byte[] encodedParams; + try { + ecParams.init(ecSpec); + encodedParams = ecParams.getEncoded(); + } catch (InvalidParameterSpecException ex) { + throw new InvalidAlgorithmParameterException( + "Unsupported curve: " + ecSpec.toString()); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + if (!isCurveSupported(encodedParams)) { + throw new InvalidAlgorithmParameterException( + "Unsupported curve: " + ecParams.toString()); + } + } + // generate the keypair. See JCA doc @Override public KeyPair generateKeyPair() { @@ -159,6 +188,17 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi { this.keySize = keySize; } + /** + * Checks whether the curve in the encoded parameters is supported by the + * native implementation. + * + * @param encodedParams encoded parameters in the same form accepted + * by generateECKeyPair + * @return true if and only if generateECKeyPair will succeed for + * the supplied parameters + */ + private static native boolean isCurveSupported(byte[] encodedParams); + /* * Generates the keypair and returns a 2-element array of encoding bytes. * The first one is for the private key, the second for the public key. diff --git a/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp b/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp index 31c2d074897..8b72cc7e820 100644 --- a/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp +++ b/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -88,6 +88,50 @@ jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem) return jEncodedBytes; } +/* + * Class: sun_security_ec_ECKeyPairGenerator + * Method: isCurveSupported + * Signature: ([B)Z + */ +JNIEXPORT jboolean +JNICALL Java_sun_security_ec_ECKeyPairGenerator_isCurveSupported + (JNIEnv *env, jclass clazz, jbyteArray encodedParams) +{ + SECKEYECParams params_item; + ECParams *ecparams = NULL; + jboolean result = JNI_FALSE; + + // The curve is supported if we can get parameters for it + params_item.len = env->GetArrayLength(encodedParams); + params_item.data = + (unsigned char *) env->GetByteArrayElements(encodedParams, 0); + if (params_item.data == NULL) { + goto cleanup; + } + + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ + goto cleanup; + } + + // If we make it to here, then the curve is supported + result = JNI_TRUE; + +cleanup: + { + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); + } + if (ecparams) { + FreeECParams(ecparams, true); + } + } + + return result; +} + /* * Class: sun_security_ec_ECKeyPairGenerator * Method: generateECKeyPair diff --git a/jdk/src/jdk.httpserver/share/classes/module-info.java b/jdk/src/jdk.httpserver/share/classes/module-info.java index 199867e4d8b..015b9355d00 100644 --- a/jdk/src/jdk.httpserver/share/classes/module-info.java +++ b/jdk/src/jdk.httpserver/share/classes/module-info.java @@ -24,7 +24,7 @@ */ /** - * Defines the JDK-specific API for HTTP server. + * Defines the JDK-specific HTTP server API. * * @uses com.sun.net.httpserver.spi.HttpServerProvider * diff --git a/jdk/src/jdk.jartool/share/classes/module-info.java b/jdk/src/jdk.jartool/share/classes/module-info.java index b86e287ca89..53ba2b565ba 100644 --- a/jdk/src/jdk.jartool/share/classes/module-info.java +++ b/jdk/src/jdk.jartool/share/classes/module-info.java @@ -32,7 +32,7 @@ * jar via the {@link java.util.spi.ToolProvider ToolProvider} SPI. * Instances of the tool can be obtained by calling * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} - * or the {@link java.util.ServiceLoader service loader} with the name + * or the {@linkplain java.util.ServiceLoader service loader} with the name * {@code "jar"}. * *

      diff --git a/jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java b/jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java index f96227ce471..14c45fafe0c 100644 --- a/jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java +++ b/jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 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 @@ -33,6 +33,7 @@ import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.lang.UnsupportedOperationException; import sun.management.VMManagement; /** @@ -132,19 +133,11 @@ public final class JdpController { } // Get the process id of the current running Java process - private static Integer getProcessId() { + private static Long getProcessId() { try { - // Get the current process id using a reflection hack - RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); - Field jvm = runtime.getClass().getDeclaredField("jvm"); - jvm.setAccessible(true); - - VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime); - Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId"); - pid_method.setAccessible(true); - Integer pid = (Integer) pid_method.invoke(mgmt); - return pid; - } catch(Exception ex) { + // Get the current process id + return ProcessHandle.current().pid(); + } catch(UnsupportedOperationException ex) { return null; } } @@ -206,7 +199,7 @@ public final class JdpController { packet.setBroadcastInterval(Integer.toString(pause)); // Set process id - Integer pid = getProcessId(); + Long pid = getProcessId(); if (pid != null) { packet.setProcessId(pid.toString()); } diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java b/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java index a21daf29618..0af2f33e8c7 100644 --- a/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java @@ -24,10 +24,10 @@ */ /** - * This package contains Oracle Corporation's platform extension to - * the implementation of the + * This package contains the JDK's extension to + * the standard implementation of the * {@link java.lang.management} API and also defines the management - * interface for some other components for the platform. + * interface for some other components of the platform. * *

      * All platform MBeans are registered in the platform MBeanServer diff --git a/jdk/src/jdk.management/share/classes/module-info.java b/jdk/src/jdk.management/share/classes/module-info.java index bea31ddcadb..092480de9e5 100644 --- a/jdk/src/jdk.management/share/classes/module-info.java +++ b/jdk/src/jdk.management/share/classes/module-info.java @@ -24,7 +24,7 @@ */ /** - * Defines the JDK-specific Management Interfaces for JVM. + * Defines JDK-specific management interfaces for the JVM. * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java index 53647e0a10e..55e2afb79e9 100644 --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -59,65 +59,70 @@ import java.nio.channels.SelectionKey; * {@link #setOption(SctpSocketOption,Object) setOption} method. An SCTP * channel support the following options: *

      - * + *
      Socket options
      + * + * * - * - * + * + * * + * + * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * + * *
      Socket options
      Option NameDescriptionOption NameDescription
      {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS - * SCTP_DISABLE_FRAGMENTS} {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS + * SCTP_DISABLE_FRAGMENTS} Enables or disables message fragmentation
      {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE - * SCTP_EXPLICIT_COMPLETE} {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE + * SCTP_EXPLICIT_COMPLETE} Enables or disables explicit message completion
      {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE - * SCTP_FRAGMENT_INTERLEAVE} {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE + * SCTP_FRAGMENT_INTERLEAVE} Controls how the presentation of messages occur for the message * receiver
      {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS - * SCTP_INIT_MAXSTREAMS} {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS + * SCTP_INIT_MAXSTREAMS} The maximum number of streams requested by the local endpoint during * association initialization
      {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} Enables or disable a Nagle-like algorithm
      {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR - * SCTP_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR + * SCTP_PRIMARY_ADDR} Requests that the local SCTP stack use the given peer address as the * association primary
      {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR - * SCTP_SET_PEER_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR + * SCTP_SET_PEER_PRIMARY_ADDR} Requests that the peer mark the enclosed address as the association * primary
      {@link SctpStandardSocketOptions#SO_SNDBUF - * SO_SNDBUF} {@link SctpStandardSocketOptions#SO_SNDBUF + * SO_SNDBUF} The size of the socket send buffer
      {@link SctpStandardSocketOptions#SO_RCVBUF - * SO_RCVBUF} {@link SctpStandardSocketOptions#SO_RCVBUF + * SO_RCVBUF} The size of the socket receive buffer
      {@link SctpStandardSocketOptions#SO_LINGER - * SO_LINGER} {@link SctpStandardSocketOptions#SO_LINGER + * SO_LINGER} Linger on close if data is present (when configured in blocking mode * only)
      *
      * Additional (implementation specific) options may also be supported. The list diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index cb498c9017d..2300bbbe146 100644 --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -63,65 +63,70 @@ import java.nio.channels.SelectionKey; * {@link #setOption(SctpSocketOption,Object,Association) setOption} method. An * {@code SctpMultiChannel} supports the following options: *
      - * + *
      Socket options
      + * + * * - * - * + * + * * + * + * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * + * *
      Socket options
      Option NameDescriptionOption NameDescription
      {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS - * SCTP_DISABLE_FRAGMENTS} {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS + * SCTP_DISABLE_FRAGMENTS} Enables or disables message fragmentation
      {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE - * SCTP_EXPLICIT_COMPLETE} {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE + * SCTP_EXPLICIT_COMPLETE} Enables or disables explicit message completion
      {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE - * SCTP_FRAGMENT_INTERLEAVE} {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE + * SCTP_FRAGMENT_INTERLEAVE} Controls how the presentation of messages occur for the message * receiver
      {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS - * SCTP_INIT_MAXSTREAMS} {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS + * SCTP_INIT_MAXSTREAMS} The maximum number of streams requested by the local endpoint during * association initialization
      {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} Enables or disable a Nagle-like algorithm
      {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR - * SCTP_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR + * SCTP_PRIMARY_ADDR} Requests that the local SCTP stack use the given peer address as the * association primary
      {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR - * SCTP_SET_PEER_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR + * SCTP_SET_PEER_PRIMARY_ADDR} Requests that the peer mark the enclosed address as the association * primary
      {@link SctpStandardSocketOptions#SO_SNDBUF - * SO_SNDBUF} {@link SctpStandardSocketOptions#SO_SNDBUF + * SO_SNDBUF} The size of the socket send buffer
      {@link SctpStandardSocketOptions#SO_RCVBUF - * SO_RCVBUF} {@link SctpStandardSocketOptions#SO_RCVBUF + * SO_RCVBUF} The size of the socket receive buffer
      {@link SctpStandardSocketOptions#SO_LINGER - * SO_LINGER} {@link SctpStandardSocketOptions#SO_LINGER + * SO_LINGER} Linger on close if data is present (when configured in blocking mode * only)
      *
      * Additional (implementation specific) options may also be supported. The list diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java index cf56fd16c9f..212e111a930 100644 --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -47,17 +47,22 @@ import java.nio.channels.spi.AbstractSelectableChannel; * {@link #setOption(SctpSocketOption,Object) setOption} method. SCTP server socket * channels support the following options: *
      - * + *
      Socket options
      + * + * * - * - * + * + * * + * + * * - * + * * * + * *
      Socket options
      Option NameDescriptionOption NameDescription
      {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS - * SCTP_INIT_MAXSTREAMS} {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS + * SCTP_INIT_MAXSTREAMS} The maximum number of streams requested by the local endpoint during * association initialization
      *
      * Additional (implementation specific) options may also be supported. The list diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 35c2f21f907..c6948f03947 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -262,9 +262,6 @@ tools/jimage/JImageExtractTest.java 8170120 generic- tools/jimage/JImageListTest.java 8170120 generic-all tools/jimage/JImageVerifyTest.java 8170120 generic-all -tools/schemagen/MultiReleaseJarTest.java 8174692 generic-all -tools/wsgen/MultiReleaseJarTest.java 8174692 generic-all - ############################################################################ # jdk_jdi diff --git a/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java b/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java index 03468133ff1..698acd083b4 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java @@ -58,11 +58,15 @@ public class PerformanceTest { (byte)0xfe,(byte)0xdc,(byte)0xba,(byte)0x98, (byte)0x76,(byte)0x54,(byte)0x32,(byte)0x10}; - public static byte[] plain_data = "Isaiah, a little boy is dead. He fell from the roof of an apartment house, just a few days before Christmas. The only person who truly grieves for the boy is Smilla Jasperson, a polar researcher. Smilla was Isaiah's only friend. Isaiah came with his alcoholic mother from Greenland but never really got used to life in Copenhagen. Smilla's mother was also from Greenland. Smilla feels a particular affinity to the arctic landscape. She knows a lot about the snow and how to read its movements and is convinced that the boy's death was not accidental.".getBytes(); - - // The codemgrtool won't let me checkin this line, so I had to break it up. - - /* Smilla decides to embark upon her own investigations but soon finds herself running up against a brick wall. Isaiah's mother, Juliane, mistrusts her and the authorities also make life difficult for Smilla. But she won't let go. Then there's this mechanic ­ a reticent, inscrutable sort of guy ­ who lives in the same apartment building. He also knew the boy and even constructed a workbench for him in his cellar workshop. The mechanic tells Smilla that he'd like to help her, but then again, he may just be one of those who seem to want to dog her heels. End ".getBytes();*/ + public static byte[] plain_data = + ("Isaiah, a little boy is dead. He fell from the roof of an apartment house, " + + "just a few days before Christmas. The only person who truly grieves for " + + "the boy is Smilla Jasperson, a polar researcher. Smilla was Isaiah's " + + "only friend. Isaiah came with his alcoholic mother from Greenland but " + + "never really got used to life in Copenhagen. Smilla's mother was also " + + "from Greenland. Smilla feels a particular affinity to the arctic landscape. " + + "She knows a lot about the snow and how to read its movements and is " + + "convinced that the boy's death was not accidental.").getBytes(); static int[] dataSizes = {1024, 8192}; static String[] crypts = {"DES", "DESede"}; diff --git a/jdk/test/java/lang/System/MacEncoding/ExpectedEncoding.java b/jdk/test/java/lang/System/MacEncoding/ExpectedEncoding.java index 29e05b0f23e..c05ecf51c99 100644 --- a/jdk/test/java/lang/System/MacEncoding/ExpectedEncoding.java +++ b/jdk/test/java/lang/System/MacEncoding/ExpectedEncoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -43,9 +43,9 @@ public class ExpectedEncoding { if ("skip".equals(expectFileEnc)) { System.err.println("Expected file.encoding is \"skip\", ignoring"); } else { - System.err.println("Expected file.encoding: " + expectFileEnc); - System.err.println("Actual file.encoding: " + fileEnc); if (fileEnc == null || !fileEnc.equals(expectFileEnc)) { + System.err.println("Expected file.encoding: " + expectFileEnc); + System.err.println("Actual file.encoding: " + fileEnc); failed = true; } } diff --git a/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.java b/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.java new file mode 100644 index 00000000000..d1464ba4fd0 --- /dev/null +++ b/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.java @@ -0,0 +1,62 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8003228 + * @summary Test the value of sun.jnu.encoding on Mac + * @requires (os.family == "mac") + * @library /test/lib + * @build jdk.test.lib.process.* + * ExpectedEncoding + * @run main MacJNUEncoding US-ASCII UTF-8 C + * @run main MacJNUEncoding UTF-8 UTF-8 en_US.UTF-8 + */ + +import java.util.Map; + +import jdk.test.lib.process.ProcessTools; + +public class MacJNUEncoding { + + public static void main(String[] args) throws Exception { + if (args.length != 3) { + System.out.println("Usage:"); + System.out.println(" java MacJNUEncoding" + + " "); + throw new IllegalArgumentException("missing arguments"); + } + + final String locale = args[2]; + System.out.println("Running test for locale: " + locale); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, + ExpectedEncoding.class.getName(), args[0], args[1]); + Map env = pb.environment(); + env.put("LANG", locale); + env.put("LC_ALL", locale); + ProcessTools.executeProcess(pb) + .outputTo(System.out) + .errorTo(System.err) + .shouldHaveExitValue(0); + } +} diff --git a/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.sh b/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.sh deleted file mode 100644 index 4935a0cf044..00000000000 --- a/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. - -# @test -# @bug 8003228 -# @summary Test the value of sun.jnu.encoding on Mac -# @author Brent Christian -# -# @run shell MacJNUEncoding.sh - -# Only run test on Mac -OS=`uname -s` -case "$OS" in - Darwin ) ;; - * ) - exit 0 - ;; -esac - -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi - -if [ "${COMPILEJAVA}" = "" ]; then - COMPILEJAVA="${TESTJAVA}" -fi - - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi - -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi - -JAVAC="${COMPILEJAVA}"/bin/javac -JAVA="${TESTJAVA}"/bin/java - -echo "Building test classes..." -"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/ExpectedEncoding.java - -echo "" -echo "Running test for C locale" -export LANG=C -export LC_ALL=C -"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding US-ASCII UTF-8 -result1=$? - -echo "" -echo "Running test for en_US.UTF-8 locale" -export LANG=en_US.UTF-8 -export LC_ALL=en_US.UTF-8 -"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding UTF-8 UTF-8 -result2=$? - -echo "" -echo "Cleanup" -rm ${TESTCLASSES}/ExpectedEncoding.class - -if [ ${result1} -ne 0 ] ; then - echo "Test failed for C locale" - echo " LANG=\"${LANG}\"" - echo " LC_ALL=\"${LC_ALL}\"" - exit ${result1} -fi -if [ ${result2} -ne 0 ] ; then - echo "Test failed for en_US.UTF-8 locale" - echo " LANG=\"${LANG}\"" - echo " LC_ALL=\"${LC_ALL}\"" - exit ${result2} -fi -exit 0 - diff --git a/jdk/test/java/nio/channels/DatagramChannel/Disconnect.java b/jdk/test/java/nio/channels/DatagramChannel/Disconnect.java index e5a1d3a8130..1b6f2632bb6 100644 --- a/jdk/test/java/nio/channels/DatagramChannel/Disconnect.java +++ b/jdk/test/java/nio/channels/DatagramChannel/Disconnect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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,7 @@ /* @test * @bug 7132924 + * @key intermittent * @summary Test DatagramChannel.disconnect when DatagramChannel is connected to an IPv4 socket * @run main Disconnect * @run main/othervm -Djava.net.preferIPv4Stack=true Disconnect diff --git a/jdk/test/java/util/Locale/Bug7069824.java b/jdk/test/java/util/Locale/Bug7069824.java index 8e611aa4d60..6313d8b0f7d 100644 --- a/jdk/test/java/util/Locale/Bug7069824.java +++ b/jdk/test/java/util/Locale/Bug7069824.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 @@ -23,7 +23,7 @@ /* * @test - * @bug 7069824 8042360 + * @bug 7069824 8042360 8032842 8175539 * @summary Verify implementation for Locale matching. * @run main Bug7069824 */ @@ -747,7 +747,7 @@ public class Bug7069824 { priorityList = LanguageRange.parse(ranges); tagList = generateLanguageTags(tags); actualTags = showLanguageTags(Locale.filterTags(priorityList, tagList)); - expectedTags = "ja-jp-hepburn, en"; + expectedTags = "ja-JP-hepburn, en"; if (!expectedTags.equals(actualTags)) { error = true; @@ -763,7 +763,7 @@ public class Bug7069824 { priorityList = LanguageRange.parse(ranges); tagList = generateLanguageTags(tags); actualTags = showLanguageTags(Locale.filterTags(priorityList, tagList, mode)); - expectedTags = "de-de, de-de-x-goethe"; + expectedTags = "de-DE, de-DE-x-goethe"; if (!expectedTags.equals(actualTags)) { error = true; @@ -779,8 +779,8 @@ public class Bug7069824 { priorityList = LanguageRange.parse(ranges); tagList = generateLanguageTags(tags); actualTags = showLanguageTags(Locale.filterTags(priorityList, tagList, mode)); - expectedTags = "de-de, de-latn-de, de-latf-de, de-de-x-goethe, " - + "de-latn-de-1996, de-deva-de"; + expectedTags = "de-DE, de-Latn-DE, de-Latf-DE, de-DE-x-goethe, " + + "de-Latn-DE-1996, de-Deva-DE"; if (!expectedTags.equals(actualTags)) { error = true; @@ -796,8 +796,8 @@ public class Bug7069824 { priorityList = LanguageRange.parse(ranges); tagList = generateLanguageTags(tags); actualTags = showLanguageTags(Locale.filterTags(priorityList, tagList, mode)); - expectedTags = "de-de, de-latn-de, de-latf-de, de-de-x-goethe, " - + "de-latn-de-1996, de-deva-de"; + expectedTags = "de-DE, de-Latn-DE, de-Latf-DE, de-DE-x-goethe, " + + "de-Latn-DE-1996, de-Deva-DE"; if (!expectedTags.equals(actualTags)) { error = true; @@ -884,7 +884,7 @@ public class Bug7069824 { priorityList = LanguageRange.parse(ranges); tagList = generateLanguageTags(tags); actualTag = Locale.lookupTag(priorityList, tagList); - expectedTag = "fr-jp"; + expectedTag = "fr-JP"; if (!expectedTag.equals(actualTag)) { error = true; diff --git a/jdk/test/java/util/Locale/Bug8032842.java b/jdk/test/java/util/Locale/Bug8032842.java new file mode 100644 index 00000000000..92f36a6dcfd --- /dev/null +++ b/jdk/test/java/util/Locale/Bug8032842.java @@ -0,0 +1,99 @@ +/* + * 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. + */ +/* + * @test + * @bug 8032842 8175539 + * @summary Checks that the filterTags() and lookup() methods + * preserve the case of matching language tag(s). + * Before 8032842 fix these methods return the matching + * language tag(s) in lowercase. + * Also, checks the filterTags() to return only unique + * (ignoring case considerations) matching tags. + * + */ + +import java.util.List; +import java.util.Locale; +import java.util.Locale.FilteringMode; +import java.util.Locale.LanguageRange; + +public class Bug8032842 { + + public static void main(String[] args) { + + // test filterBasic() for preserving the case of matching tags for + // the language range '*', with no duplicates in the matching tags + testFilter("*", List.of("de-CH", "hi-in", "En-GB", "ja-Latn-JP", + "JA-JP", "en-GB"), + List.of("de-CH", "hi-in", "En-GB", "ja-Latn-JP", "JA-JP"), + FilteringMode.AUTOSELECT_FILTERING); + + // test filterBasic() for preserving the case of matching tags for + // basic ranges other than *, with no duplicates in the matching tags + testFilter("mtm-RU, en-GB", List.of("En-Gb", "mTm-RU", "en-US", + "en-latn", "en-GB"), + List.of("mTm-RU", "En-Gb"), FilteringMode.AUTOSELECT_FILTERING); + + // test filterExtended() for preserving the case of matching tags for + // the language range '*', with no duplicates in the matching tags + testFilter("*", List.of("de-CH", "hi-in", "En-GB", "hi-IN", + "ja-Latn-JP", "JA-JP"), + List.of("de-CH", "hi-in", "En-GB", "ja-Latn-JP", "JA-JP"), + FilteringMode.EXTENDED_FILTERING); + + // test filterExtended() for preserving the case of matching tags for + // extended ranges other than *, with no duplicates in the matching tags + testFilter("*-ch;q=0.5, *-Latn;q=0.4", List.of("fr-CH", "de-Ch", + "en-latn", "en-US", "en-Latn"), + List.of("fr-CH", "de-Ch", "en-latn"), + FilteringMode.EXTENDED_FILTERING); + + // test lookupTag() for preserving the case of matching tag + testLookup("*-ch;q=0.5", List.of("en", "fR-cH"), "fR-cH"); + + } + + public static void testFilter(String ranges, List tags, + List expected, FilteringMode mode) { + List priorityList = LanguageRange.parse(ranges); + List actual = Locale.filterTags(priorityList, tags, mode); + if (!actual.equals(expected)) { + throw new RuntimeException("[filterTags() failed for the language" + + " range: " + ranges + ", Expected: " + expected + + ", Found: " + actual + "]"); + } + } + + public static void testLookup(String ranges, List tags, + String expected) { + List priorityList = LanguageRange.parse(ranges); + String actual = Locale.lookupTag(priorityList, tags); + if (!actual.equals(expected)) { + throw new RuntimeException("[lookupTag() failed for the language" + + " range: " + ranges + ", Expected: " + expected + + ", Found: " + actual + "]"); + } + } + +} + diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java index b61ea07e577..4de8496f1f1 100644 --- a/jdk/test/java/util/regex/RegExTest.java +++ b/jdk/test/java/util/regex/RegExTest.java @@ -33,9 +33,8 @@ * 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066 * 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590 * 8027645 8035076 8039124 8035975 8074678 6854417 8143854 8147531 7071819 - * 8151481 4867170 7080302 6728861 6995635 6736245 4916384 - * 6328855 6192895 6345469 6988218 6693451 7006761 8140212 8143282 8158482 - * 8176029 + * 8151481 4867170 7080302 6728861 6995635 6736245 4916384 6328855 6192895 + * 6345469 6988218 6693451 7006761 8140212 8143282 8158482 8176029 8184706 * * @library /test/lib * @build jdk.test.lib.RandomFactory @@ -470,7 +469,25 @@ public class RegExTest { m.find(); if (!m.hitEnd()) failCount++; - report("hitEnd from a Slice"); + + // 8184706: Matching u+0d at EOL against \R should hit-end + p = Pattern.compile("...\\R"); + m = p.matcher("cat" + (char)0x0a); + m.find(); + if (m.hitEnd()) + failCount++; + + m = p.matcher("cat" + (char)0x0d); + m.find(); + if (!m.hitEnd()) + failCount++; + + m = p.matcher("cat" + (char)0x0d + (char)0x0a); + m.find(); + if (m.hitEnd()) + failCount++; + + report("hitEnd"); } // This is for bug 4997476 diff --git a/jdk/test/sun/management/jdp/JdpOnTestCase.java b/jdk/test/sun/management/jdp/JdpOnTestCase.java index 107ca5a9397..80abcebc83e 100644 --- a/jdk/test/sun/management/jdp/JdpOnTestCase.java +++ b/jdk/test/sun/management/jdp/JdpOnTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 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 @@ -31,6 +31,7 @@ import java.net.SocketTimeoutException; import java.util.Map; +import static jdk.testlibrary.Asserts.assertNotEquals; public class JdpOnTestCase extends JdpTestCase { @@ -58,6 +59,7 @@ public class JdpOnTestCase extends JdpTestCase { final String jdpName = payload.get("INSTANCE_NAME"); log.fine("Received correct JDP packet #" + String.valueOf(receivedJDPpackets) + ", jdp.name=" + jdpName); + assertNotEquals(null, payload.get("PROCESS_ID"), "Expected payload.get(\"PROCESS_ID\") to be not null."); } /** diff --git a/jdk/test/sun/security/ec/InvalidCurve.java b/jdk/test/sun/security/ec/InvalidCurve.java new file mode 100644 index 00000000000..9321c2617c8 --- /dev/null +++ b/jdk/test/sun/security/ec/InvalidCurve.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8182999 + * @summary Ensure that SunEC behaves correctly for unsupported curves. + * @run main InvalidCurve + */ + +import java.security.*; +import java.security.spec.*; +import java.math.*; + +public class InvalidCurve { + + public static void main(String[] args) { + + KeyPairGenerator keyGen; + try { + keyGen = KeyPairGenerator.getInstance("EC", "SunEC"); + ECGenParameterSpec brainpoolSpec = + new ECGenParameterSpec("brainpoolP256r1"); + keyGen.initialize(brainpoolSpec); + } catch (InvalidAlgorithmParameterException ex) { + System.out.println(ex.getMessage()); + // this is expected + return; + } catch (NoSuchAlgorithmException | NoSuchProviderException ex) { + throw new RuntimeException(ex); + } + + keyGen.generateKeyPair(); + + // If we make it to here, then the test is not working correctly. + throw new RuntimeException("The expected exception was not thrown."); + + } + +} + diff --git a/jdk/test/sun/security/tools/keytool/DupCommands.java b/jdk/test/sun/security/tools/keytool/DupCommands.java new file mode 100644 index 00000000000..bf3faf8aaab --- /dev/null +++ b/jdk/test/sun/security/tools/keytool/DupCommands.java @@ -0,0 +1,66 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8183509 + * @summary keytool should not allow multiple commands + * @library /test/lib + * @build jdk.test.lib.SecurityTools + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * @run main/othervm DupCommands + */ + +import jdk.test.lib.SecurityTools; +import jdk.test.lib.process.OutputAnalyzer; + +public class DupCommands { + + public static void main(String[] args) throws Throwable { + + kt("-list -printcert") + .shouldHaveExitValue(1) + .shouldContain("Only one command is allowed"); + + kt("-import -importcert") // command with different names + .shouldHaveExitValue(1) + .shouldContain("Only one command is allowed"); + + kt("-help -v -v") + .shouldHaveExitValue(0) + .shouldContain("The -v option is specified multiple times."); + + kt("-help -id 1 -id 2") // some options are allowed multiple times + .shouldHaveExitValue(0) + .shouldNotContain("specified multiple times."); + } + + static OutputAnalyzer kt(String arg) throws Exception { + return SecurityTools.keytool(arg); + } +} diff --git a/jdk/test/sun/security/tools/keytool/WeakAlg.java b/jdk/test/sun/security/tools/keytool/WeakAlg.java index d570a79e800..c9cefb1a4a7 100644 --- a/jdk/test/sun/security/tools/keytool/WeakAlg.java +++ b/jdk/test/sun/security/tools/keytool/WeakAlg.java @@ -571,7 +571,7 @@ public class WeakAlg { static OutputAnalyzer genkeypair(String alias, String options) { return kt("-genkeypair -alias " + alias + " -dname CN=" + alias - + " -keyalg RSA -storetype JKS " + options); + + " -storetype JKS " + options); } static OutputAnalyzer certreq(String alias, String options) { diff --git a/jdk/test/tools/schemagen/MultiReleaseJarTest.java b/jdk/test/tools/schemagen/MultiReleaseJarTest.java index 26aa230680a..659d057d4e0 100644 --- a/jdk/test/tools/schemagen/MultiReleaseJarTest.java +++ b/jdk/test/tools/schemagen/MultiReleaseJarTest.java @@ -56,7 +56,7 @@ public class MultiReleaseJarTest { @DataProvider(name = "jarFiles") public Object[][] jarFiles() { - return new Object[][]{{"MV_BOTH.jar", 9}, + return new Object[][]{{"MV_BOTH.jar", Math.min(10, Runtime.version().major())}, {"MV_ONLY_9.jar", 9}, {"NON_MV.jar", 8}}; } diff --git a/jdk/test/tools/wsgen/MultiReleaseJarTest.java b/jdk/test/tools/wsgen/MultiReleaseJarTest.java index c6953416d9b..a0d3ec02900 100644 --- a/jdk/test/tools/wsgen/MultiReleaseJarTest.java +++ b/jdk/test/tools/wsgen/MultiReleaseJarTest.java @@ -56,7 +56,7 @@ public class MultiReleaseJarTest { @DataProvider(name = "jarFiles") public Object[][] jarFiles() { - return new Object[][]{{"MV_BOTH.jar", 9}, + return new Object[][]{{"MV_BOTH.jar", Math.min(10, Runtime.version().major())}, {"MV_ONLY_9.jar", 9}, {"NON_MV.jar", 8}}; } diff --git a/langtools/.hgtags b/langtools/.hgtags index 8e1bd72d64a..86a6ed128de 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -432,3 +432,6 @@ daa70bfed35ecf0575884c954dc95135e0f94b29 jdk-10+11 2bd34895dda246cff9e713401f3544260dfbe80f jdk-10+12 83f6eb009d8f6e94fd348c7d23e4b00754d745db jdk-9+175 123f40b60a18225b1485fad891e3fa173a10e5af jdk-10+13 +add6717b655efa3aa9350e917175f3965cfc0729 jdk-10+14 +0d0ac75b0f6cbe218362e3fac4bb443496e7258f jdk-9+176 +2f01728210c1405ef459e69d9c7247b5df6abb78 jdk-9+177 diff --git a/langtools/src/java.compiler/share/classes/module-info.java b/langtools/src/java.compiler/share/classes/module-info.java index 561e02dbfda..3d937e09f0c 100644 --- a/langtools/src/java.compiler/share/classes/module-info.java +++ b/langtools/src/java.compiler/share/classes/module-info.java @@ -30,7 +30,7 @@ * and define interfaces for tools such as compilers which can be invoked * from a program. *

      - * This module is upgradeble. + * This module is upgradeable. * * @moduleGraph * @since 9 diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java index 291c0852743..84fd1dedeff 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java @@ -25,6 +25,8 @@ package com.sun.tools.javac.comp; +import java.util.ArrayList; + import com.sun.source.tree.LambdaExpressionTree; import com.sun.tools.javac.code.Source; import com.sun.tools.javac.code.Type; @@ -69,13 +71,24 @@ import java.util.HashMap; import java.util.Map; import java.util.function.Predicate; +import com.sun.source.tree.NewClassTree; +import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.code.Kinds.Kind; +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.tree.JCTree.JCTry; +import com.sun.tools.javac.tree.JCTree.JCUnary; +import com.sun.tools.javac.util.Assert; +import com.sun.tools.javac.util.DiagnosticSource; + import static com.sun.tools.javac.code.Flags.GENERATEDCONSTR; -import static com.sun.tools.javac.code.Flags.SYNTHETIC; import static com.sun.tools.javac.code.TypeTag.CLASS; import static com.sun.tools.javac.tree.JCTree.Tag.APPLY; +import static com.sun.tools.javac.tree.JCTree.Tag.LABELLED; import static com.sun.tools.javac.tree.JCTree.Tag.METHODDEF; import static com.sun.tools.javac.tree.JCTree.Tag.NEWCLASS; +import static com.sun.tools.javac.tree.JCTree.Tag.NULLCHK; import static com.sun.tools.javac.tree.JCTree.Tag.TYPEAPPLY; +import static com.sun.tools.javac.tree.JCTree.Tag.VARDEF; /** * Helper class for defining custom code analysis, such as finding instance creation expression @@ -341,7 +354,8 @@ public class Analyzer { Env copyEnvIfNeeded(JCTree tree, Env env) { if (!analyzerModes.isEmpty() && !env.info.isSpeculative && - TreeInfo.isStatement(tree)) { + TreeInfo.isStatement(tree) && + !tree.hasTag(LABELLED)) { Env analyzeEnv = env.dup(env.tree, env.info.dup(env.info.scope.dupUnshared(env.info.scope.owner))); analyzeEnv.info.returnResult = analyzeEnv.info.returnResult != null ? @@ -368,27 +382,109 @@ public class Analyzer { * and speculatively type-check the rewritten code to compare results against previously attributed code. */ void analyze(JCStatement statement, Env env) { - AnalysisContext context = new AnalysisContext(); + AnalysisContext context = new AnalysisContext(statement, env); StatementScanner statementScanner = new StatementScanner(context); statementScanner.scan(statement); if (!context.treesToAnalyzer.isEmpty()) { + deferredAnalysisHelper.queue(context); + } + } - //add a block to hoist potential dangling variable declarations - JCBlock fakeBlock = make.Block(SYNTHETIC, List.of(statement)); + /** + * Helper interface to handle deferral of analysis tasks. + */ + interface DeferredAnalysisHelper { + /** + * Add a new analysis task to the queue. + */ + void queue(AnalysisContext context); + /** + * Flush queue with given attribution env. + */ + void flush(Env flushEnv); + } + + /** + * Dummy deferral handler. + */ + DeferredAnalysisHelper flushDeferredHelper = new DeferredAnalysisHelper() { + @Override + public void queue(AnalysisContext context) { + //do nothing + } + + @Override + public void flush(Env flushEnv) { + //do nothing + } + }; + + /** + * Simple deferral handler. All tasks belonging to the same outermost class are added to + * the same queue. The queue is flushed after flow analysis (only if no error occurred). + */ + DeferredAnalysisHelper queueDeferredHelper = new DeferredAnalysisHelper() { + + Map> Q = new HashMap<>(); + + @Override + public void queue(AnalysisContext context) { + ArrayList s = Q.computeIfAbsent(context.env.enclClass.sym.outermostClass(), k -> new ArrayList<>()); + s.add(context); + } + + @Override + public void flush(Env flushEnv) { + if (!Q.isEmpty()) { + DeferredAnalysisHelper prevHelper = deferredAnalysisHelper; + try { + deferredAnalysisHelper = flushDeferredHelper; + ArrayList s = Q.get(flushEnv.enclClass.sym.outermostClass()); + while (s != null && !s.isEmpty()) { + doAnalysis(s.remove(0)); + } + } finally { + deferredAnalysisHelper = prevHelper; + } + } + } + }; + + DeferredAnalysisHelper deferredAnalysisHelper = queueDeferredHelper; + + void doAnalysis(AnalysisContext context) { + DiagnosticSource prevSource = log.currentSource(); + LocalCacheContext localCacheContext = argumentAttr.withLocalCacheContext(); + try { + log.useSource(context.env.toplevel.getSourceFile()); + + JCStatement treeToAnalyze = (JCStatement)context.tree; + if (context.env.info.scope.owner.kind == Kind.TYP) { + //add a block to hoist potential dangling variable declarations + treeToAnalyze = make.Block(Flags.SYNTHETIC, List.of((JCStatement)context.tree)); + } TreeMapper treeMapper = new TreeMapper(context); //TODO: to further refine the analysis, try all rewriting combinations - deferredAttr.attribSpeculative(fakeBlock, env, attr.statInfo, treeMapper, - t -> new AnalyzeDeferredDiagHandler(context), - argumentAttr.withLocalCacheContext()); + deferredAttr.attribSpeculative(treeToAnalyze, context.env, attr.statInfo, treeMapper, + t -> new AnalyzeDeferredDiagHandler(context), argumentAttr.withLocalCacheContext()); context.treeMap.entrySet().forEach(e -> { context.treesToAnalyzer.get(e.getKey()) .process(e.getKey(), e.getValue(), context.errors.nonEmpty()); }); + } catch (Throwable ex) { + Assert.error("Analyzer error when processing: " + context.tree); + } finally { + log.useSource(prevSource.getFile()); + localCacheContext.leave(); } } + public void flush(Env flushEnv) { + deferredAnalysisHelper.flush(flushEnv); + } + /** * Simple deferred diagnostic handler which filters out all messages and keep track of errors. */ @@ -411,6 +507,23 @@ public class Analyzer { * trees to be rewritten, errors occurred during the speculative attribution step, etc. */ class AnalysisContext { + + JCTree tree; + + Env env; + + AnalysisContext(JCTree tree, Env env) { + this.tree = tree; + this.env = attr.copyEnv(env); + /* this is a temporary workaround that should be removed once we have a truly independent + * clone operation + */ + if (tree.hasTag(VARDEF)) { + // avoid redefinition clashes + this.env.info.scope.remove(((JCVariableDecl)tree).sym); + } + } + /** Map from trees to analyzers. */ Map> treesToAnalyzer = new HashMap<>(); @@ -452,17 +565,17 @@ public class Analyzer { @Override public void visitClassDef(JCClassDecl tree) { - //do nothing (prevents seeing same stuff twice + //do nothing (prevents seeing same stuff twice) } @Override public void visitMethodDef(JCMethodDecl tree) { - //do nothing (prevents seeing same stuff twice + //do nothing (prevents seeing same stuff twice) } @Override public void visitBlock(JCBlock tree) { - //do nothing (prevents seeing same stuff twice + //do nothing (prevents seeing same stuff twice) } @Override @@ -472,28 +585,40 @@ public class Analyzer { @Override public void visitForLoop(JCForLoop tree) { - scan(tree.getInitializer()); + //skip body and var decl (to prevents same statements to be analyzed twice) scan(tree.getCondition()); scan(tree.getUpdate()); } + @Override + public void visitTry(JCTry tree) { + //skip resources (to prevents same statements to be analyzed twice) + scan(tree.getBlock()); + scan(tree.getCatches()); + scan(tree.getFinallyBlock()); + } + @Override public void visitForeachLoop(JCEnhancedForLoop tree) { + //skip body (to prevents same statements to be analyzed twice) scan(tree.getExpression()); } @Override public void visitWhileLoop(JCWhileLoop tree) { + //skip body (to prevents same statements to be analyzed twice) scan(tree.getCondition()); } @Override public void visitDoLoop(JCDoWhileLoop tree) { + //skip body (to prevents same statements to be analyzed twice) scan(tree.getCondition()); } @Override public void visitIf(JCIf tree) { + //skip body (to prevents same statements to be analyzed twice) scan(tree.getCondition()); } } @@ -533,5 +658,17 @@ public class Analyzer { } return newLambda; } + + @Override @DefinedBy(Api.COMPILER_TREE) + public JCTree visitNewClass(NewClassTree node, Void aVoid) { + JCNewClass oldNewClazz = (JCNewClass)node; + JCNewClass newNewClazz = (JCNewClass)super.visitNewClass(node, aVoid); + if (!oldNewClazz.args.isEmpty() && oldNewClazz.args.head.hasTag(NULLCHK)) { + //workaround to Attr generating trees + newNewClazz.encl = ((JCUnary)newNewClazz.args.head).arg; + newNewClazz.args = newNewClazz.args.tail; + } + return newNewClazz; + } } } diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index 375838df8c1..9279a046329 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -1207,7 +1207,7 @@ public class Check { long illegal = flags & ExtendedStandardFlags & ~mask; if (illegal != 0) { if ((illegal & INTERFACE) != 0) { - log.error(pos, Errors.IntfNotAllowedHere); + log.error(pos, ((flags & ANNOTATION) != 0) ? Errors.AnnotationDeclNotAllowedHere : Errors.IntfNotAllowedHere); mask |= INTERFACE; } else { diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java index cc47923de1f..11698ad3260 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -286,6 +286,10 @@ public class JavaCompiler { */ protected Attr attr; + /** The analyzer + */ + protected Analyzer analyzer; + /** The attributor. */ protected Check chk; @@ -401,6 +405,7 @@ public class JavaCompiler { } source = Source.instance(context); attr = Attr.instance(context); + analyzer = Analyzer.instance(context); chk = Check.instance(context); gen = Gen.instance(context); flow = Flow.instance(context); @@ -1392,6 +1397,8 @@ public class JavaCompiler { if (shouldStop(CompileState.FLOW)) return; + analyzer.flush(env); + results.add(env); } finally { diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index b60961873eb..83e2c98956c 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -311,6 +311,9 @@ compiler.err.cant.deref=\ compiler.err.cant.extend.intf.annotation=\ ''extends'' not allowed for @interfaces +compiler.err.annotation.decl.not.allowed.here=\ + annotation type declaration not allowed here + # 0: symbol compiler.err.cant.inherit.from.final=\ cannot inherit from final {0} diff --git a/langtools/src/jdk.compiler/share/classes/module-info.java b/langtools/src/jdk.compiler/share/classes/module-info.java index c2603662e8c..8283f5a0acc 100644 --- a/langtools/src/jdk.compiler/share/classes/module-info.java +++ b/langtools/src/jdk.compiler/share/classes/module-info.java @@ -25,7 +25,7 @@ /** * Defines the implementation of the - * {@link javax.tools.ToolProvider#getSystemJavaCompiler system Java compiler} + * {@linkplain javax.tools.ToolProvider#getSystemJavaCompiler system Java compiler} * and its command line equivalent, {@index javac javac tool}, * as well as {@index javah javah tool}. * @@ -40,7 +40,7 @@ * *

      Instances of the tools can be obtained by calling * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} - * or the {@link java.util.ServiceLoader service loader} with the name + * or the {@linkplain java.util.ServiceLoader service loader} with the name * {@code "javac"}. * *

      diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java b/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java index 610497585ae..ad9ce0cde9a 100644 --- a/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/Tag.java @@ -78,16 +78,20 @@ public interface Tag { * the following table lists those cases where there is more * than one tag of a given kind: * - * + *
      * - * - * - * - * - * - * - * - * + * + * + * + * *
      Related Tags
      {@code kind() } {@code name() }
      {@code @throws } {@code @throws }
      {@code @throws } {@code @exception }
      {@code @see } {@code @see }
      {@code @see } {@code @link }
      {@code @see } {@code @linkplain }
      {@code @serial } {@code @serial }
      {@code @serial } {@code @serialData }
      {@code name() } {@code kind() } + *
      {@code @exception } {@code @throws } + *
      {@code @link } {@code @see } + *
      {@code @linkplain } {@code @see } + *
      {@code @see } {@code @see } + *
      {@code @serial } {@code @serial } + *
      {@code @serialData } {@code @serial } + *
      {@code @throws } {@code @throws } + *
      * * @return the kind of this tag. diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java index 040f89dd90e..e4c7413684f 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java @@ -135,18 +135,44 @@ *

      Interactions with older options.

      * * The new {@code --show-*} options provide a more detailed replacement - * for the older options -public, -protected, -package, -private. + * for the older options {@code -public}, {@code -protected}, {@code -package}, {@code -private}. * Alternatively, the older options can continue to be used as shorter * forms for combinations of the new options, as described below: - - -
      Short form options mapping
      Older optionEquivalent to these values with the new option -
      {@code --show-members}{@code --show-types}{@code --show-packages}{@code --show-module-contents} -
      {@code -public}publicpublicexportedapi -
      {@code -protected}protectedprotectedexportedapi -
      {@code -package}packagepackageallall -
      {@code -private}privateprivateallall -
      + * + * + * + * + * + * + *
      Short form options mapping
      + * Older option + * + * Equivalent to these values with the new option + *
      {@code --show-members} + * {@code --show-types} + * {@code --show-packages} + * {@code --show-module-contents} + *
      {@code -public} + * public + * public + * exported + * api + *
      {@code -protected} + * protected + * protected + * exported + * api + *
      {@code -package} + * package + * package + * all + * all + *
      {@code -private} + * private + * private + * all + * all + *
      *

      * * A qualified element name is one that has its package @@ -283,39 +309,44 @@ *

      The following table gives a guide to the mapping from old types to their replacements. * In some cases, there is no direct equivalent. * - * - -
      Guide for mapping old types to new types
      Old TypeNew Type -
      AnnotatedTypejavax.lang.model.type.Type -
      AnnotationDescjavax.lang.model.element.AnnotationMirror -
      AnnotationDesc.ElementValuePairjavax.lang.model.element.AnnotationValue -
      AnnotationTypeDocjavax.lang.model.element.TypeElement -
      AnnotationTypeElementDocjavax.lang.model.element.ExecutableElement -
      AnnotationValuejavax.lang.model.element.AnnotationValue -
      ClassDocjavax.lang.model.element.TypeElement -
      ConstructorDocjavax.lang.model.element.ExecutableElement -
      Docjavax.lang.model.element.Element -
      DocErrorReporterjdk.javadoc.doclet.Reporter -
      Docletjdk.javadoc.doclet.Doclet -
      ExecutableMemberDocjavax.lang.model.element.ExecutableElement -
      FieldDocjavax.lang.model.element.VariableElement -
      LanguageVersionjavax.lang.model.SourceVersion -
      MemberDocjavax.lang.model.element.Element -
      MethodDocjavax.lang.model.element.ExecutableElement -
      PackageDocjavax.lang.model.element.PackageElement -
      Parameterjavax.lang.model.element.VariableElement -
      ParameterizedTypejavax.lang.model.type.DeclaredType -
      ParamTagcom.sun.source.doctree.ParamTree -
      ProgramElementDocjavax.lang.model.element.Element -
      RootDocjdk.javadoc.doclet.DocletEnvironment -
      SeeTagcom.sun.source.doctree.LinkTree
      com.sun.source.doctree.SeeTree -
      SerialFieldTagcom.sun.source.doctree.SerialFieldTree -
      SourcePositioncom.sun.source.util.SourcePositions -
      Tagcom.sun.source.doctree.DocTree -
      ThrowsTagcom.sun.source.doctree.ThrowsTree -
      Typejavax.lang.model.type.Type -
      TypeVariablejavax.lang.model.type.TypeVariable -
      WildcardTypejavax.lang.model.type.WildcardType + * + * + * + * + * + * *
      Guide for mapping old types to new types
      Old TypeNew Type + *
      {@code AnnotatedType} {@link javax.lang.model.type.TypeMirror javax.lang.model.type.TypeMirror} + *
      {@code AnnotationDesc} {@link javax.lang.model.element.AnnotationMirror javax.lang.model.element.AnnotationMirror} + *
      {@code AnnotationDesc.ElementValuePair}{@link javax.lang.model.element.AnnotationValue javax.lang.model.element.AnnotationValue} + *
      {@code AnnotationTypeDoc} {@link javax.lang.model.element.TypeElement javax.lang.model.element.TypeElement} + *
      {@code AnnotationTypeElementDoc} {@link javax.lang.model.element.ExecutableElement javax.lang.model.element.ExecutableElement} + *
      {@code AnnotationValue} {@link javax.lang.model.element.AnnotationValue javax.lang.model.element.AnnotationValue} + *
      {@code ClassDoc} {@link javax.lang.model.element.TypeElement javax.lang.model.element.TypeElement} + *
      {@code ConstructorDoc} {@link javax.lang.model.element.ExecutableElement javax.lang.model.element.ExecutableElement} + *
      {@code Doc} {@link javax.lang.model.element.Element javax.lang.model.element.Element} + *
      {@code DocErrorReporter} {@link jdk.javadoc.doclet.Reporter jdk.javadoc.doclet.Reporter} + *
      {@code Doclet} {@link jdk.javadoc.doclet.Doclet jdk.javadoc.doclet.Doclet} + *
      {@code ExecutableMemberDoc} {@link javax.lang.model.element.ExecutableElement javax.lang.model.element.ExecutableElement} + *
      {@code FieldDoc} {@link javax.lang.model.element.VariableElement javax.lang.model.element.VariableElement} + *
      {@code LanguageVersion} {@link javax.lang.model.SourceVersion javax.lang.model.SourceVersion} + *
      {@code MemberDoc} {@link javax.lang.model.element.Element javax.lang.model.element.Element} + *
      {@code MethodDoc} {@link javax.lang.model.element.ExecutableElement javax.lang.model.element.ExecutableElement} + *
      {@code PackageDoc} {@link javax.lang.model.element.PackageElement javax.lang.model.element.PackageElement} + *
      {@code Parameter} {@link javax.lang.model.element.VariableElement javax.lang.model.element.VariableElement} + *
      {@code ParameterizedType} {@link javax.lang.model.type.DeclaredType javax.lang.model.type.DeclaredType} + *
      {@code ParamTag} {@link com.sun.source.doctree.ParamTree com.sun.source.doctree.ParamTree} + *
      {@code ProgramElementDoc} {@link javax.lang.model.element.Element javax.lang.model.element.Element} + *
      {@code RootDoc} {@link jdk.javadoc.doclet.DocletEnvironment jdk.javadoc.doclet.DocletEnvironment} + *
      {@code SeeTag} {@link com.sun.source.doctree.LinkTree com.sun.source.doctree.LinkTree}
      + * {@link com.sun.source.doctree.SeeTree com.sun.source.doctree.SeeTree} + *
      {@code SerialFieldTag} {@link com.sun.source.doctree.SerialFieldTree com.sun.source.doctree.SerialFieldTree} + *
      {@code SourcePosition} {@link com.sun.source.util.SourcePositions com.sun.source.util.SourcePositions} + *
      {@code Tag} {@link com.sun.source.doctree.DocTree com.sun.source.doctree.DocTree} + *
      {@code ThrowsTag} {@link com.sun.source.doctree.ThrowsTree com.sun.source.doctree.ThrowsTree} + *
      {@code Type} {@link javax.lang.model.type.TypeMirror javax.lang.model.type.TypeMirror} + *
      {@code TypeVariable} {@link javax.lang.model.type.TypeVariable javax.lang.model.type.TypeVariable} + *
      {@code WildcardType} {@link javax.lang.model.type.WildcardType javax.lang.model.type.WildcardType} + *
      * * @see jdk.javadoc.doclet.Doclet diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java index 2b06737c12e..e5665ccb7ad 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java @@ -140,7 +140,9 @@ public class AbstractIndexWriter extends HtmlDocletWriter { int j = 0; Content dl = new HtmlTree(HtmlTag.DL); while (i < memberListSize && j < searchListSize) { - String name = utils.getSimpleName(memberlist.get(i)); + Element elem = memberlist.get(i); + String name = (utils.isModule(elem)) + ? utils.getFullyQualifiedName(elem) : utils.getSimpleName(elem); if (name.compareTo(searchList.get(j).getLabel()) < 0) { addDescription(dl, memberlist.get(i)); i++; @@ -222,7 +224,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter { * @param dlTree the content tree to which the description will be added */ protected void addDescription(ModuleElement mdle, Content dlTree, SearchIndexItem si) { - String moduleName = utils.getSimpleName(mdle); + String moduleName = utils.getFullyQualifiedName(mdle); Content link = getModuleLink(mdle, new StringContent(moduleName)); si.setLabel(moduleName); si.setCategory(resources.getText("doclet.Modules")); @@ -246,7 +248,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter { protected void addDescription(PackageElement pkg, Content dlTree, SearchIndexItem si) { Content link = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); if (configuration.showModules) { - si.setContainingModule(utils.getSimpleName(utils.containingModule(pkg))); + si.setContainingModule(utils.getFullyQualifiedName(utils.containingModule(pkg))); } si.setLabel(utils.getPackageName(pkg)); si.setCategory(resources.getText("doclet.Packages")); diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index 9dbcff1bf8b..451afee2bdf 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -1757,6 +1757,9 @@ public class HtmlDocletWriter extends HtmlDocWriter { return true; } + // Notify the next DocTree handler to take necessary action + private boolean commentRemoved = false; + /** * Converts inline tags and text to text strings, expanding the * inline tags along the way. Called wherever text can contain @@ -1782,27 +1785,32 @@ public class HtmlDocletWriter extends HtmlDocWriter { CommentHelper ch = utils.getCommentHelper(element); // Array of all possible inline tags for this javadoc run configuration.tagletManager.checkTags(utils, element, tags, true); - for (ListIterator iterator = tags.listIterator(); iterator.hasNext();) { - DocTree tag = iterator.next(); - // zap block tags - if (isFirstSentence && ignoreNonInlineTag(tag)) - continue; + commentRemoved = false; - if (isFirstSentence && iterator.nextIndex() == tags.size() && - (tag.getKind() == TEXT && isAllWhiteSpace(ch.getText(tag)))) - continue; + for (ListIterator iterator = tags.listIterator(); iterator.hasNext();) { + boolean isFirstNode = !iterator.hasPrevious(); + DocTree tag = iterator.next(); + boolean isLastNode = !iterator.hasNext(); + + if (isFirstSentence) { + // Ignore block tags + if (ignoreNonInlineTag(tag)) + continue; + + // Ignore any trailing whitespace OR whitespace after removed html comment + if ((isLastNode || commentRemoved) + && tag.getKind() == TEXT + && isAllWhiteSpace(ch.getText(tag))) + continue; + + // Ignore any leading html comments + if ((isFirstNode || commentRemoved) && tag.getKind() == COMMENT) { + commentRemoved = true; + continue; + } + } boolean allDone = new SimpleDocTreeVisitor() { - // notify the next DocTree handler to take necessary action - boolean commentRemoved = false; - - private boolean isLast(DocTree node) { - return node.equals(tags.get(tags.size() - 1)); - } - - private boolean isFirst(DocTree node) { - return node.equals(tags.get(0)); - } private boolean inAnAtag() { if (utils.isStartElement(tag)) { @@ -1847,14 +1855,14 @@ public class HtmlDocletWriter extends HtmlDocWriter { if (text.startsWith("/..") && !configuration.docrootparent.isEmpty()) { result.addContent(configuration.docrootparent); docRootContent = new ContentBuilder(); - result.addContent(textCleanup(text.substring(3), isLast(node))); + result.addContent(textCleanup(text.substring(3), isLastNode)); } else { if (!docRootContent.isEmpty()) { docRootContent = copyDocRootContent(docRootContent); } else { text = redirectRelativeLinks(element, (TextTree) dt); } - result.addContent(textCleanup(text, isLast(node))); + result.addContent(textCleanup(text, isLastNode)); } } else { docRootContent = copyDocRootContent(docRootContent); @@ -1868,10 +1876,6 @@ public class HtmlDocletWriter extends HtmlDocWriter { @Override public Boolean visitComment(CommentTree node, Content c) { - if (isFirstSentence && isFirst(node)) { - commentRemoved = true; - return this.visit(iterator.next(), c); - } result.addContent(new RawHtml(node.getBody())); return false; } @@ -1996,8 +2000,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { @Override public Boolean visitText(TextTree node, Content c) { String text = node.getBody(); - result.addContent(new RawHtml(textCleanup(text, isLast(node), commentRemoved))); - commentRemoved = false; + result.addContent(new RawHtml(textCleanup(text, isLastNode, commentRemoved))); return false; } @@ -2013,6 +2016,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { } }.visit(tag, null); + commentRemoved = false; if (allDone) break; } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index 2ac4411b607..df7ae910be8 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -115,7 +115,7 @@ public class TagletWriterImpl extends TagletWriter { @Override public Void visitModule(ModuleElement e, Void p) { si.setUrl(DocPaths.moduleSummary(e).getPath() + "#" + anchorName); - si.setHolder(utils.getSimpleName(element)); + si.setHolder(utils.getFullyQualifiedName(element)); return null; } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java index efe280e6329..7c562be6e0c 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java @@ -111,7 +111,7 @@ public class ModuleSummaryBuilder extends AbstractBuilder { * @throws DocletException if there is a problem while building the documentation */ protected void buildModuleDoc(Content contentTree) throws DocletException { - contentTree = moduleWriter.getModuleHeader(mdle.getSimpleName().toString()); + contentTree = moduleWriter.getModuleHeader(mdle.getQualifiedName().toString()); buildContent(contentTree); diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index 03a59487f8c..d3e5dd41761 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -867,3 +867,7 @@ table.striped > tbody > tr > td, table.striped > tbody > tr > td { border-left: 1px solid black; border-right: 1px solid black; } +table.striped > tbody > tr > th { + font-weight: normal; +} + diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java index c32acf9fc8b..b12805e9e4d 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java @@ -199,7 +199,7 @@ public class IndexBuilder { */ protected void addModulesToIndexMap() { for (ModuleElement mdle : configuration.modules) { - String mdleName = mdle.getSimpleName().toString(); + String mdleName = mdle.getQualifiedName().toString(); char ch = (mdleName.length() == 0) ? '*' : Character.toUpperCase(mdleName.charAt(0)); diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java index ded9a85f789..ac6e4ec8a7c 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java @@ -1682,7 +1682,7 @@ public class Utils { return new Utils.ElementComparator() { @Override public int compare(Element mod1, Element mod2) { - return compareNames(mod1, mod2); + return compareFullyQualifiedNames(mod1, mod2); } }; } @@ -1772,9 +1772,8 @@ public class Utils { /** * Returns a Comparator for index file presentations, and are sorted as follows. - * If comparing modules then simply compare the simple names, - * comparing packages then simply compare the qualified names, if comparing a package with a - * module/type/member then compare the FullyQualifiedName of the package + * If comparing modules and packages then simply compare the qualified names, if comparing a module + * or a package with a type/member then compare the FullyQualifiedName of the module or a package * with the SimpleName of the entity, otherwise * 1. compare the ElementKind ex: Module, Package, Interface etc. * 2a. if equal and if the type is of ExecutableElement(Constructor, Methods), @@ -1786,10 +1785,9 @@ public class Utils { public Comparator makeIndexUseComparator() { return new Utils.ElementComparator() { /** - * Compare two given elements, if comparing two modules, return the - * comparison of SimpleName, if comparing two packages, return the - * comparison of FullyQualifiedName, if comparing a package with a - * module/type/member then compare the FullyQualifiedName of the package + * Compare two given elements, if comparing two modules or two packages, return the + * comparison of FullyQualifiedName, if comparing a module or a package with a + * type/member then compare the FullyQualifiedName of the module or the package * with the SimpleName of the entity, then sort on the kinds, then on * the parameters only if the type is an ExecutableElement, * the parameters are compared and finally the qualified names. @@ -1802,16 +1800,17 @@ public class Utils { @Override public int compare(Element e1, Element e2) { int result = 0; - if (isModule(e1) && isModule(e2)) { - return compareNames(e1, e2); + if ((isModule(e1) || isPackage(e1)) && (isModule(e2) || isPackage(e2))) { + result = compareFullyQualifiedNames(e1, e2); + if (result != 0) { + return result; + } + return compareElementTypeKinds(e1, e2); } - if (isPackage(e1) && isPackage(e2)) { - return compareFullyQualifiedNames(e1, e2); - } - if (isPackage(e1) || isPackage(e2)) { - result = (isPackage(e1)) - ? compareStrings(getFullyQualifiedName(e1), getSimpleName(e2)) - : compareStrings(getSimpleName(e1), getFullyQualifiedName(e2)); + if (isModule(e1) || isPackage(e1)) { + result = compareStrings(getFullyQualifiedName(e1), getSimpleName(e2)); + } else if (isModule(e2) || isPackage(e2)) { + result = compareStrings(getSimpleName(e1), getFullyQualifiedName(e2)); } else { result = compareNames(e1, e2); } @@ -1915,6 +1914,11 @@ public class Utils { public String getFullyQualifiedName(Element e, final boolean outer) { return new SimpleElementVisitor9() { + @Override + public String visitModule(ModuleElement e, Void p) { + return e.getQualifiedName().toString(); + } + @Override public String visitPackage(PackageElement e, Void p) { return e.getQualifiedName().toString(); @@ -2527,7 +2531,7 @@ public class Utils { snvisitor = new SimpleElementVisitor9() { @Override public String visitModule(ModuleElement e, Void p) { - return e.getSimpleName().toString(); + return e.getQualifiedName().toString(); // temp fix for 8182736 } @Override diff --git a/langtools/src/jdk.javadoc/share/classes/module-info.java b/langtools/src/jdk.javadoc/share/classes/module-info.java index 06afd272f3c..a6029cdc5c8 100644 --- a/langtools/src/jdk.javadoc/share/classes/module-info.java +++ b/langtools/src/jdk.javadoc/share/classes/module-info.java @@ -25,7 +25,7 @@ /** * Defines the implementation of the - * {@link javax.tools.ToolProvider#getSystemDocumentationTool system documentation tool} + * {@linkplain javax.tools.ToolProvider#getSystemDocumentationTool system documentation tool} * and its command line equivalent, {@index javadoc javadoc tool}. * *

      javadoc

      @@ -39,7 +39,7 @@ * *

      Instances of the tools can be obtained by calling * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} - * or the {@link java.util.ServiceLoader service loader} with the name + * or the {@linkplain java.util.ServiceLoader service loader} with the name * {@code "javadoc"}. * *

      diff --git a/langtools/src/jdk.jdeps/share/classes/module-info.java b/langtools/src/jdk.jdeps/share/classes/module-info.java index 55e202b9cb0..0a061df8211 100644 --- a/langtools/src/jdk.jdeps/share/classes/module-info.java +++ b/langtools/src/jdk.jdeps/share/classes/module-info.java @@ -26,7 +26,7 @@ /** * Defines tools for analysing dependencies in Java libraries and programs, * including the {@index jdeps jdeps tool}, - * {@index javap javap tool} and + * {@index javap javap tool}, and * {@index jdeprscan jdeprscan tool} tools. * *

      @@ -37,7 +37,7 @@ * *

      Instances of the tools can be obtained by calling * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} - * or the {@link java.util.ServiceLoader service loader} with the name + * or the {@linkplain java.util.ServiceLoader service loader} with the name * {@code "javap"} or {@code "jdeps"} as appropriate. * *

      diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java index 116245ba6af..255c8c92a6a 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.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 @@ -72,7 +72,7 @@ public abstract class Snippet { * or a static on-demand type import * ({@link jdk.jshell.Snippet.SubKind#SINGLE_STATIC_IMPORT_SUBKIND}) -- * use {@link jdk.jshell.Snippet#subKind()} to distinguish. - *

      + * * @jls 8.3: importDeclaration. *

      * An import declaration is {@linkplain Kind#isPersistent() persistent}. @@ -90,7 +90,7 @@ public abstract class Snippet { * classes {@link jdk.jshell.Snippet.SubKind#CLASS_SUBKIND}, enums, and * annotation interfaces -- see {@link jdk.jshell.Snippet.SubKind} to * differentiate. - *

      + * * @jls 7.6: TypeDeclaration. *

      * A type declaration is {@linkplain Kind#isPersistent() persistent}. @@ -100,7 +100,7 @@ public abstract class Snippet { /** * A method declaration. * The snippet is an instance of {@link jdk.jshell.MethodSnippet}. - *

      + * * @jls 8.4: MethodDeclaration. *

      * A method declaration is {@linkplain Kind#isPersistent() persistent}. @@ -115,7 +115,7 @@ public abstract class Snippet { * The variable may be with or without initializer, or be a temporary * variable representing an expression -- see * {@link jdk.jshell.Snippet.SubKind}to differentiate. - *

      + * * @jls 8.3: FieldDeclaration. *

      * A variable declaration is {@linkplain Kind#isPersistent() persistent}. @@ -132,7 +132,7 @@ public abstract class Snippet { * names) -- see {@link jdk.jshell.Snippet.SubKind} to differentiate. * All other expression forms (operators, method calls, ...) generate a * scratch variable and so are instead of the VAR Kind. - *

      + * * @jls 15: Expression. */ EXPRESSION(false), @@ -140,7 +140,7 @@ public abstract class Snippet { /** * A statement. * The snippet is an instance of {@link jdk.jshell.StatementSnippet}. - *

      + * * @jls 14.5: Statement. */ STATEMENT(false), diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java index 58922610026..7d3db170ec4 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java @@ -90,33 +90,37 @@ public class JdiExecutionControlProvider implements ExecutionControlProvider { * {@code ExecutionControlProvider}. The map can optionally be modified; * Modified or unmodified it can be passed to * {@link #generate(jdk.jshell.spi.ExecutionEnv, java.util.Map) }. - * + *
      * + * * - * - * - * + * + * + * * + * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * + * *
      Parameters
      ParameterDescriptionConstant FieldParameterDescriptionConstant Field
      remoteAgentremoteAgentthe remote agent to launch{@link #PARAM_REMOTE_AGENT}
      timeouttimeoutmilliseconds before connect timeout{@link #PARAM_TIMEOUT}
      launchlaunch"true" for JDI controlled launch{@link #PARAM_LAUNCH}
      hostnamehostnameconnect to the named of the local host ("" for discovered){@link #PARAM_HOST_NAME}
      * * @return the default parameter map diff --git a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java index 950211fad63..316d8b60d51 100644 --- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java +++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java @@ -372,7 +372,20 @@ public class TestModules extends JavadocTester { "--module", "moduleB", "testpkg2mdlB", "testpkgmdlB"); checkExit(Exit.OK); - //checkOverviewSummaryPackages(); + checkGroupOptionSingleModule(); + } + + /** + * Test -group option for a single module. + */ + @Test + void testModuleName() { + javadoc("-d", "out-modulename", "-use", + "--module-source-path", testSrc, + "--module", "moduleB,test.moduleFullName", + "testpkg2mdlB", "testpkgmdlB", "testpkgmdlfullname"); + checkExit(Exit.OK); + checkModuleName(true); } void checkDescription(boolean found) { @@ -1089,4 +1102,35 @@ public class TestModules extends JavadocTester { "\n" + ""); } + + void checkModuleName(boolean found) { + checkOutput("test.moduleFullName-summary.html", found, + "
      \n" + + "

      Module test.moduleFullName

      \n" + + "
      "); + checkOutput("index-all.html", found, + "

      T

      \n" + + "
      \n" + + "
      test.moduleFullName - module test.moduleFullName
      \n" + + "
      \n" + + "
      This is a test description for the test.moduleFullName.
      \n" + + "
      "); + checkOutput("module-overview-frame.html", found, + "

      Modules

      \n" + + ""); + checkOutput("test.moduleFullName-summary.html", !found, + "
      \n" + + "

      Module moduleFullName

      \n" + + "
      "); + checkOutput("index-all.html", !found, + "
      \n" + + "
      moduleFullName - module moduleFullName
      \n" + + "
      \n" + + "
      This is a test description for the test.moduleFullName.
      \n" + + "
      \n" + + "
      "); +} } diff --git a/langtools/test/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java b/langtools/test/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java new file mode 100644 index 00000000000..c162ca085fe --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testModules/test.moduleFullName/module-info.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * This is a test description for the test.moduleFullName. + * + */ +module test.moduleFullName { + exports testpkgmdlfullname; +} diff --git a/langtools/test/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.java b/langtools/test/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.java new file mode 100644 index 00000000000..947033a42b7 --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testModules/test.moduleFullName/testpkgmdlfullname/TestClassInTestModuleFullName.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. + */ +package testpkgmdlfullname; + +public class TestClassInTestModuleFullName { + public void testMethod() { } +} diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java b/langtools/test/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java index b3762e639d0..9c037b7436f 100644 --- a/langtools/test/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,8 +23,8 @@ /* * @test - * @bug 8150096 - * @summary Make sure package.html is recognized by doclint + * @bug 8150096 8179704 + * @summary test package.html handling * @library ../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool * @build JavadocTester @@ -37,12 +37,36 @@ public class TestPackageHtml extends JavadocTester { tester.runTests(); } + // Make sure package.html is recognized by doclint @Test void testPackageHtml() { - javadoc("-d", "out-pkg-html", + javadoc("-d", "out-pkg-html-1", "-sourcepath", testSrc, "pkg1"); checkExit(Exit.ERROR); checkOutput(Output.OUT, true, "package.html:10: error: bad use of '>'"); } + + // Doclet must handle empty body in package.html, must + // ignore html comment in the first sentence and must + // ignore trailing whitespace in a first sentence. + @Test + void testPackageHtmlWithEmptyBody() { + javadoc("-d", "out-pkg-html-2", + "-sourcepath", testSrc, + "pkg2", "pkg3", "pkg4"); + checkExit(Exit.OK); + checkOutput("index-all.html", true, + "
      \n" + + "
      pkg2 - package pkg2
      \n" + + "
      pkg3 - package pkg3
      \n" + + "
      \n" + + "
      This is a documentation for pkg3
      \n" + + "
      \n" + + "
      pkg4 - package pkg4
      \n" + + "
      \n" + + "
      This is a documentation for pkg4
      \n" + + "
      \n" + + "
      \n"); + } } diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg2/X.java b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg2/X.java new file mode 100644 index 00000000000..a17a707a9e5 --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg2/X.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. + * + * 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 pkg2; + +/** + * An empty class. + */ +public class X {} diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg2/package.html b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg2/package.html new file mode 100644 index 00000000000..c89c25a1f76 --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg2/package.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg3/X.java b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg3/X.java new file mode 100644 index 00000000000..ea873eddc09 --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg3/X.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. + * + * 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 pkg3; + +/** + * An empty class. + */ +public class X {} diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg3/package.html b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg3/package.html new file mode 100644 index 00000000000..b9bfe63704a --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg3/package.html @@ -0,0 +1,9 @@ + + + + This is a documentation for {@link pkg3} + +

      Next para

      + + + diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg4/X.java b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg4/X.java new file mode 100644 index 00000000000..51caeeea737 --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg4/X.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. + * + * 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 pkg4; + +/** + * An empty class. + */ +public class X {} diff --git a/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg4/package.html b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg4/package.html new file mode 100644 index 00000000000..2263adf84bc --- /dev/null +++ b/langtools/test/jdk/javadoc/doclet/testPackageHtml/pkg4/package.html @@ -0,0 +1,9 @@ + + + + This is a documentation for {@link pkg4} + +

      Next para

      + + + diff --git a/langtools/test/tools/javac/IllegalAnnotation.java b/langtools/test/tools/javac/IllegalAnnotation.java index 7d786e0d22a..acd88f71cf2 100644 --- a/langtools/test/tools/javac/IllegalAnnotation.java +++ b/langtools/test/tools/javac/IllegalAnnotation.java @@ -1,6 +1,6 @@ /** * @test /nodynamiccopyright/ - * @bug 5012028 6384539 + * @bug 5012028 6384539 8074364 * @summary javac crash when declare an annotation type illegally * * @compile/fail/ref=IllegalAnnotation.out -XDrawDiagnostics IllegalAnnotation.java diff --git a/langtools/test/tools/javac/IllegalAnnotation.out b/langtools/test/tools/javac/IllegalAnnotation.out index aa0fdf40c01..00d7fd4e2a3 100644 --- a/langtools/test/tools/javac/IllegalAnnotation.out +++ b/langtools/test/tools/javac/IllegalAnnotation.out @@ -1,2 +1,2 @@ -IllegalAnnotation.java:10:10: compiler.err.intf.not.allowed.here +IllegalAnnotation.java:10:10: compiler.err.annotation.decl.not.allowed.here 1 error diff --git a/langtools/test/tools/javac/diags/examples/IllegalAnnotationDeclaration.java b/langtools/test/tools/javac/diags/examples/IllegalAnnotationDeclaration.java new file mode 100644 index 00000000000..4bb4433e6e6 --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/IllegalAnnotationDeclaration.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// key: compiler.err.annotation.decl.not.allowed.here + +class IllegalAnnotationDeclaration { + { + @interface SomeAnnotation { } + } +} diff --git a/langtools/test/tools/javac/lambda/LambdaConv18.java b/langtools/test/tools/javac/lambda/LambdaConv18.java index 3a8efb206fc..a7c3415305f 100644 --- a/langtools/test/tools/javac/lambda/LambdaConv18.java +++ b/langtools/test/tools/javac/lambda/LambdaConv18.java @@ -1,24 +1,19 @@ /* * @test /nodynamiccopyright/ - * @bug 8003280 8064365 + * @bug 8003280 8064365 8183126 * @summary Add lambda tests * simple test for lambda candidate check - * @compile/fail/ref=LambdaConv18.out -XDrawDiagnostics -XDfind=lambda LambdaConv18.java + * @compile/fail/ref=LambdaConv18.out -XDrawDiagnostics LambdaConv18.java */ class LambdaConv18 { - interface SAM { - void m(); - } - interface NonSAM { void m1(); void m2(); } - SAM s1 = new SAM() { public void m() {} }; - NonSAM s2 = new NonSAM() { public void m1() {} + NonSAM s1 = new NonSAM() { public void m1() {} public void m2() {} }; - NonExistent s3 = new NonExistent() { public void m() {} }; + NonExistent s2 = new NonExistent() { public void m() {} }; } diff --git a/langtools/test/tools/javac/lambda/LambdaConv18.out b/langtools/test/tools/javac/lambda/LambdaConv18.out index 2213718ab3c..bed09dd5a2f 100644 --- a/langtools/test/tools/javac/lambda/LambdaConv18.out +++ b/langtools/test/tools/javac/lambda/LambdaConv18.out @@ -1,5 +1,3 @@ -LambdaConv18.java:23:5: compiler.err.cant.resolve.location: kindname.class, NonExistent, , , (compiler.misc.location: kindname.class, LambdaConv18, null) -LambdaConv18.java:20:24: compiler.warn.potential.lambda.found -LambdaConv18.java:23:26: compiler.err.cant.resolve.location: kindname.class, NonExistent, , , (compiler.misc.location: kindname.class, LambdaConv18, null) +LambdaConv18.java:18:5: compiler.err.cant.resolve.location: kindname.class, NonExistent, , , (compiler.misc.location: kindname.class, LambdaConv18, null) +LambdaConv18.java:18:26: compiler.err.cant.resolve.location: kindname.class, NonExistent, , , (compiler.misc.location: kindname.class, LambdaConv18, null) 2 errors -1 warning diff --git a/langtools/test/tools/javac/lambda/LambdaConv29.java b/langtools/test/tools/javac/lambda/LambdaConv29.java new file mode 100644 index 00000000000..7f834677031 --- /dev/null +++ b/langtools/test/tools/javac/lambda/LambdaConv29.java @@ -0,0 +1,15 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8183126 + * @summary test for lambda finder + * @compile/fail/ref=LambdaConv29.out -XDrawDiagnostics -Werror -XDfind=lambda LambdaConv29.java + */ + +class LambdaConv29 { + + interface SAM { + void m(); + } + + SAM s1 = new SAM() { public void m() {} }; +} diff --git a/langtools/test/tools/javac/lambda/LambdaConv29.out b/langtools/test/tools/javac/lambda/LambdaConv29.out new file mode 100644 index 00000000000..5df635a9273 --- /dev/null +++ b/langtools/test/tools/javac/lambda/LambdaConv29.out @@ -0,0 +1,4 @@ +LambdaConv29.java:14:24: compiler.warn.potential.lambda.found +- compiler.err.warnings.and.werror +1 error +1 warning diff --git a/langtools/test/tools/javadoc/8147801/T8147801.java b/langtools/test/tools/javadoc/8147801/T8147801.java index 9ff3072d105..10bdc951a25 100644 --- a/langtools/test/tools/javadoc/8147801/T8147801.java +++ b/langtools/test/tools/javadoc/8147801/T8147801.java @@ -31,6 +31,7 @@ * @run main T8147801 */ +import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; @@ -42,6 +43,7 @@ import java.util.ArrayList; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; +import java.util.stream.Stream; import com.sun.javadoc.ClassDoc; import com.sun.javadoc.FieldDoc; @@ -143,13 +145,18 @@ public class T8147801 { } void initJar() throws IOException { - Path testClasses = Paths.get(System.getProperty("test.classes")); + String testClassPath = System.getProperty("test.class.path", ""); + Path jarsrc = Stream.of(testClassPath.split(File.pathSeparator)) + .map(Paths::get) + .filter(e -> e.endsWith("jarsrc")) + .findAny() + .orElseThrow(() -> new InternalError("jarsrc not found")); jarPath = Paths.get("lib.jar"); try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(jarPath))) { String[] classNames = {"Lib1.class", "Lib2.class"}; for (String cn : classNames) { out.putNextEntry(new JarEntry("lib/" + cn)); - Path libClass = testClasses.resolve("jarsrc").resolve("lib").resolve(cn); + Path libClass = jarsrc.resolve("lib").resolve(cn); out.write(Files.readAllBytes(libClass)); } } diff --git a/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestLoad.java b/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestLoad.java index 3440689f5cd..81d6284cc07 100644 --- a/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestLoad.java +++ b/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestLoad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -37,6 +37,7 @@ package jdk.jdeprscan; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; @@ -48,6 +49,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; +import java.util.stream.Stream; import com.sun.tools.jdeprscan.Main; @@ -63,8 +65,11 @@ public class TestLoad { @Test public void test1() throws IOException, UnsupportedEncodingException { - String testclasses = System.getProperty("test.classes"); - String deprcases = testclasses + "/../../../cases"; + String testClassPath = System.getProperty("test.class.path", ""); + String deprcases = Stream.of(testClassPath.split(File.pathSeparator)) + .filter(e -> e.endsWith("cases")) + .findAny() + .orElseThrow(() -> new InternalError("cases not found")); boolean rval; System.out.println("test.src = " + System.getProperty("test.src")); diff --git a/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestScan.java b/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestScan.java index 230ccb91a59..1edda1cceee 100644 --- a/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestScan.java +++ b/langtools/test/tools/jdeprscan/tests/jdk/jdeprscan/TestScan.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,7 @@ import com.sun.tools.jdeprscan.Main; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; @@ -50,6 +51,7 @@ import java.nio.file.Paths; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.testng.Assert; import org.testng.annotations.Test; @@ -65,9 +67,16 @@ public class TestScan { @Test public void testScanAgainstReferenceFile() throws IOException { - String testclasses = System.getProperty("test.classes"); - String deprcases = testclasses + "/../../../cases"; - String deprusage = testclasses + "/../../../usage"; + String[] testClassPath = System.getProperty("test.class.path", "") + .split(File.pathSeparator); + String deprcases = Stream.of(testClassPath) + .filter(e -> e.endsWith("cases")) + .findAny() + .orElseThrow(() -> new InternalError("cases not found")); + String deprusage = Stream.of(testClassPath) + .filter(e -> e.endsWith("usage")) + .findAny() + .orElseThrow(() -> new InternalError("usage not found")); Set expected = loadExpected(); System.out.println("expected = " + expected); diff --git a/langtools/test/tools/jdeps/MultiReleaseJar.java b/langtools/test/tools/jdeps/MultiReleaseJar.java index c1ecb83d532..b1646f7d7ea 100644 --- a/langtools/test/tools/jdeps/MultiReleaseJar.java +++ b/langtools/test/tools/jdeps/MultiReleaseJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,11 +36,13 @@ import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; public class MultiReleaseJar { Path mrjar; @@ -50,7 +52,12 @@ public class MultiReleaseJar { @BeforeClass public void initialize() throws Exception { - mrjar = Paths.get(System.getProperty("test.classes", "."), "mrjar"); + String testClassPath = System.getProperty("test.class.path", ""); + mrjar = Stream.of(testClassPath.split(File.pathSeparator)) + .map(Paths::get) + .filter(e -> e.endsWith("mrjar")) + .findAny() + .orElseThrow(() -> new InternalError("mrjar not found")); testJdk = System.getProperty("test.jdk"); fileSep = System.getProperty("file.separator"); cmdPath = Paths.get(testJdk, "bin"); diff --git a/make/Docs.gmk b/make/Docs.gmk index 662606ee1b5..b997881805c 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -158,7 +158,7 @@ JAVADOC_TOP := \ JDK_SHORT_NAME := Java SE $(VERSION_SPECIFICATION) & JDK $(VERSION_SPECIFICATION) JDK_LONG_NAME := Java® Platform, Standard Edition \ - & Java Development Kit + & Java Development Kit ################################################################################ # Java SE javadoc titles/text snippets @@ -206,10 +206,10 @@ define create_overview_file # $1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
      $$($$g_GROUP_NAME)
      \ -
      $$($$g_GROUP_DESCRIPTION) \ +
      $$($$g_GROUP_DESCRIPTION)
      \ ) $1_OVERVIEW_TEXT += \ -
      \ +
      \ # endif $1_OVERVIEW_TEXT += \ diff --git a/make/Init.gmk b/make/Init.gmk index 79779e1f119..aeda160f14f 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -329,7 +329,7 @@ else # HAS_SPEC=true $(call PrintFailureReports) $(call PrintBuildLogFailures) $(call ReportProfileTimes) - $(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n" + $(PRINTF) "Hint: See common/doc/building.html#troubleshooting for assistance.\n\n" ifneq ($(COMPARE_BUILD), ) $(call CleanupCompareBuild) endif diff --git a/make/UpdateBuildDocs.gmk b/make/UpdateBuildDocs.gmk index e1008c42e93..edcd6485a09 100644 --- a/make/UpdateBuildDocs.gmk +++ b/make/UpdateBuildDocs.gmk @@ -39,7 +39,7 @@ ifeq ($(PANDOC), ) $(error Cannot continue) endif -GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JDK_TOPDIR)/make/data/docs-resources/specs/resources/jdk-default.css +GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JDK_TOPDIR)/make/data/docs-resources/resources/jdk-default.css ################################################################################ @@ -49,6 +49,7 @@ $(eval $(call SetupProcessMarkdown, building, \ FILES := $(DOCS_DIR)/building.md, \ DEST := $(DOCS_DIR), \ CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \ + OPTIONS := --toc, \ )) TARGETS += $(building) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index 5ef13db40c9..a36e2862e9c 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -423,3 +423,6 @@ fa8e4de50e821eed876388c84f7129a6739268be jdk-9+173 de571c0a93258599054f18184cbdeae42cd95265 jdk-10+12 734b3209b6edeb57e482c97793ae9c066af72871 jdk-9+175 2ab4a2055c2e309872f648fa7ab4daae0bf8994c jdk-10+13 +fed3f329875710c74f3ec1a0c4714046a79af100 jdk-10+14 +3c6fbdf6e785aaf18d35ce9c6684369952fd22ec jdk-9+176 +aa7404e062b95f679018f25eaaf933dcf0cf3f2b jdk-9+177 diff --git a/nashorn/src/jdk.dynalink/share/classes/module-info.java b/nashorn/src/jdk.dynalink/share/classes/module-info.java index fe534406e17..3a79c4b8e60 100644 --- a/nashorn/src/jdk.dynalink/share/classes/module-info.java +++ b/nashorn/src/jdk.dynalink/share/classes/module-info.java @@ -32,8 +32,8 @@ * useful for implementing programming languages where at least some expressions * have dynamic types (that is, types that can not be decided statically), and * the operations on dynamic types are expressed as - * {@link java.lang.invoke.CallSite call sites}. These call sites will be - * linked to appropriate target {@link java.lang.invoke.MethodHandle method handles} + * {@linkplain java.lang.invoke.CallSite call sites}. These call sites will be + * linked to appropriate target {@linkplain java.lang.invoke.MethodHandle method handles} * at run time based on actual types of the values the expressions evaluated to. * These can change between invocations, necessitating relinking the call site * multiple times to accommodate new types; Dynalink handles all that and more. @@ -205,7 +205,7 @@ * on how it links the various operations. *

      Cross-language interoperability

      * A {@code DynamicLinkerFactory} can be configured with a - * {@link jdk.dynalink.DynamicLinkerFactory#setClassLoader(ClassLoader) class + * {@linkplain jdk.dynalink.DynamicLinkerFactory#setClassLoader(ClassLoader) class * loader}. It will try to instantiate all * {@link jdk.dynalink.linker.GuardingDynamicLinkerExporter} classes visible to * that class loader and compose the linkers they provide into the diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 8ac981d28b2..c2896348e9e 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -72,6 +72,19 @@ public class VMProps implements Callable> { return map; } + /** + * Prints a stack trace before returning null. + * Used by the various helper functions which parse information from + * VM properties in the case where they don't find an expected property + * or a propoerty doesn't conform to an expected format. + * + * @return null + */ + private String nullWithException(String message) { + new Exception(message).printStackTrace(); + return null; + } + /** * @return vm.simpleArch value of "os.simpleArch" property of tested JDK. */ @@ -96,7 +109,7 @@ public class VMProps implements Callable> { // E.g. "Java HotSpot(TM) 64-Bit Server VM" String vmName = System.getProperty("java.vm.name"); if (vmName == null) { - return null; + return nullWithException("Can't get 'java.vm.name' property"); } Pattern startP = Pattern.compile(".* (\\S+) VM"); @@ -104,7 +117,7 @@ public class VMProps implements Callable> { if (m.matches()) { return m.group(1).toLowerCase(); } - return null; + return nullWithException("Can't get VM flavor from 'java.vm.name'"); } /** @@ -114,18 +127,16 @@ public class VMProps implements Callable> { // E.g. "mixed mode" String vmInfo = System.getProperty("java.vm.info"); if (vmInfo == null) { - return null; + return nullWithException("Can't get 'java.vm.info' property"); } - int k = vmInfo.toLowerCase().indexOf(" mode"); - if (k < 0) { - return null; - } - vmInfo = vmInfo.substring(0, k); - switch (vmInfo) { - case "mixed" : return "Xmixed"; - case "compiled" : return "Xcomp"; - case "interpreted" : return "Xint"; - default: return null; + if (vmInfo.toLowerCase().indexOf("mixed mode") != -1) { + return "Xmixed"; + } else if (vmInfo.toLowerCase().indexOf("compiled mode") != -1) { + return "Xcomp"; + } else if (vmInfo.toLowerCase().indexOf("interpreted mode") != -1) { + return "Xint"; + } else { + return nullWithException("Can't get compilation mode from 'java.vm.info'"); } } @@ -133,7 +144,12 @@ public class VMProps implements Callable> { * @return VM bitness, the value of the "sun.arch.data.model" property. */ protected String vmBits() { - return System.getProperty("sun.arch.data.model"); + String dataModel = System.getProperty("sun.arch.data.model"); + if (dataModel != null) { + return dataModel; + } else { + return nullWithException("Can't get 'sun.arch.data.model' property"); + } } /** @@ -158,7 +174,12 @@ public class VMProps implements Callable> { * @return debug level value extracted from the "jdk.debug" property. */ protected String vmDebug() { - return "" + System.getProperty("jdk.debug").contains("debug"); + String debug = System.getProperty("jdk.debug"); + if (debug != null) { + return "" + debug.contains("debug"); + } else { + return nullWithException("Can't get 'jdk.debug' property"); + } } /**
      Modules