This commit is contained in:
J. Duke 2017-07-05 23:33:24 +02:00
commit 64e7f36bb0
280 changed files with 3395 additions and 3826 deletions

View File

@ -420,6 +420,7 @@ ba5b16c9c6d80632b61959a33d424b1c3398ce62 jdk-9+166
03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6
b25838a28195f4b6dab34668411eedd2d366a16c jdk-9+169
4d163ec59d989a9261ed7f848bc6303f90869af5 jdk-9+170
aa3c97810d7c484c93a2fd75d3c76ff574deb6d8 jdk-10+7
df33ef1dc163f994177fd97d4d0e73a1e3cb5d85 jdk-10+8
b94be69cbb1d2943b886bf2d458745756df146e4 jdk-10+9
4c12464a907db4656c1033f56fa49cba643ac629 jdk-9+171

View File

@ -651,7 +651,7 @@ MKDIR:=@MKDIR@
MV:=@MV@
NAWK:=@NAWK@
NICE:=@NICE@
PANDOC:=@PANDOC@
PANDOC:=@FIXPATH@ @PANDOC@
PATCH:=@PATCH@
PRINTF:=@PRINTF@
RM:=@RM@

View File

@ -1,21 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>OpenJDK Build README</title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href=" ../../jdk/make/data/docs-resources/specs/resources/jdk-default.css" type="text/css" />
<link rel="stylesheet" href="../../jdk/make/data/docs-resources/specs/resources/jdk-default.css">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<div id="header">
<header>
<h1 class="title">OpenJDK Build README</h1>
</div>
<div class="figure">
<img src="http://openjdk.java.net/images/openjdk.png" alt="OpenJDK" />
<p class="caption">OpenJDK</p>
</div>
</header>
<figure>
<img src="http://openjdk.java.net/images/openjdk.png" alt="OpenJDK" /><figcaption>OpenJDK</figcaption>
</figure>
<hr />
<h2 id="introduction">Introduction</h2>
<p>This README file contains build instructions for the <a href="http://openjdk.java.net">OpenJDK</a>. Building the source code for the OpenJDK requires a certain degree of technical expertise.</p>
@ -149,50 +151,50 @@
<table>
<thead>
<tr class="header">
<th align="left">Package</th>
<th align="left">Version</th>
<th style="text-align: left;">Package</th>
<th style="text-align: left;">Version</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">developer/solarisstudio-124/backend</td>
<td align="left">12.4-1.0.6.0</td>
<td style="text-align: left;">developer/solarisstudio-124/backend</td>
<td style="text-align: left;">12.4-1.0.6.0</td>
</tr>
<tr class="even">
<td align="left">developer/solarisstudio-124/c++</td>
<td align="left">12.4-1.0.10.0</td>
<td style="text-align: left;">developer/solarisstudio-124/c++</td>
<td style="text-align: left;">12.4-1.0.10.0</td>
</tr>
<tr class="odd">
<td align="left">developer/solarisstudio-124/cc</td>
<td align="left">12.4-1.0.4.0</td>
<td style="text-align: left;">developer/solarisstudio-124/cc</td>
<td style="text-align: left;">12.4-1.0.4.0</td>
</tr>
<tr class="even">
<td align="left">developer/solarisstudio-124/library/c++-libs</td>
<td align="left">12.4-1.0.10.0</td>
<td style="text-align: left;">developer/solarisstudio-124/library/c++-libs</td>
<td style="text-align: left;">12.4-1.0.10.0</td>
</tr>
<tr class="odd">
<td align="left">developer/solarisstudio-124/library/math-libs</td>
<td align="left">12.4-1.0.0.1</td>
<td style="text-align: left;">developer/solarisstudio-124/library/math-libs</td>
<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="even">
<td align="left">developer/solarisstudio-124/library/studio-gccrt</td>
<td align="left">12.4-1.0.0.1</td>
<td style="text-align: left;">developer/solarisstudio-124/library/studio-gccrt</td>
<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="odd">
<td align="left">developer/solarisstudio-124/studio-common</td>
<td align="left">12.4-1.0.0.1</td>
<td style="text-align: left;">developer/solarisstudio-124/studio-common</td>
<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="even">
<td align="left">developer/solarisstudio-124/studio-ja</td>
<td align="left">12.4-1.0.0.1</td>
<td style="text-align: left;">developer/solarisstudio-124/studio-ja</td>
<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="odd">
<td align="left">developer/solarisstudio-124/studio-legal</td>
<td align="left">12.4-1.0.0.1</td>
<td style="text-align: left;">developer/solarisstudio-124/studio-legal</td>
<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
<tr class="even">
<td align="left">developer/solarisstudio-124/studio-zhCN</td>
<td align="left">12.4-1.0.0.1</td>
<td style="text-align: left;">developer/solarisstudio-124/studio-zhCN</td>
<td style="text-align: left;">12.4-1.0.0.1</td>
</tr>
</tbody>
</table>
@ -211,66 +213,66 @@
<table>
<thead>
<tr class="header">
<th align="left">Binary Name</th>
<th align="left">Category</th>
<th align="left">Package</th>
<th align="left">Description</th>
<th style="text-align: left;">Binary Name</th>
<th style="text-align: left;">Category</th>
<th style="text-align: left;">Package</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">ar.exe</td>
<td align="left">Devel</td>
<td align="left">binutils</td>
<td align="left">The GNU assembler, linker and binary utilities</td>
<td style="text-align: left;">ar.exe</td>
<td style="text-align: left;">Devel</td>
<td style="text-align: left;">binutils</td>
<td style="text-align: left;">The GNU assembler, linker and binary utilities</td>
</tr>
<tr class="even">
<td align="left">make.exe</td>
<td align="left">Devel</td>
<td align="left">make</td>
<td align="left">The GNU version of the 'make' utility built for CYGWIN</td>
<td style="text-align: left;">make.exe</td>
<td style="text-align: left;">Devel</td>
<td style="text-align: left;">make</td>
<td style="text-align: left;">The GNU version of the 'make' utility built for CYGWIN</td>
</tr>
<tr class="odd">
<td align="left">m4.exe</td>
<td align="left">Interpreters</td>
<td align="left">m4</td>
<td align="left">GNU implementation of the traditional Unix macro processor</td>
<td style="text-align: left;">m4.exe</td>
<td style="text-align: left;">Interpreters</td>
<td style="text-align: left;">m4</td>
<td style="text-align: left;">GNU implementation of the traditional Unix macro processor</td>
</tr>
<tr class="even">
<td align="left">cpio.exe</td>
<td align="left">Utils</td>
<td align="left">cpio</td>
<td align="left">A program to manage archives of files</td>
<td style="text-align: left;">cpio.exe</td>
<td style="text-align: left;">Utils</td>
<td style="text-align: left;">cpio</td>
<td style="text-align: left;">A program to manage archives of files</td>
</tr>
<tr class="odd">
<td align="left">gawk.exe</td>
<td align="left">Utils</td>
<td align="left">awk</td>
<td align="left">Pattern-directed scanning and processing language</td>
<td style="text-align: left;">gawk.exe</td>
<td style="text-align: left;">Utils</td>
<td style="text-align: left;">awk</td>
<td style="text-align: left;">Pattern-directed scanning and processing language</td>
</tr>
<tr class="even">
<td align="left">file.exe</td>
<td align="left">Utils</td>
<td align="left">file</td>
<td align="left">Determines file type using 'magic' numbers</td>
<td style="text-align: left;">file.exe</td>
<td style="text-align: left;">Utils</td>
<td style="text-align: left;">file</td>
<td style="text-align: left;">Determines file type using 'magic' numbers</td>
</tr>
<tr class="odd">
<td align="left">zip.exe</td>
<td align="left">Archive</td>
<td align="left">zip</td>
<td align="left">Package and compress (archive) files</td>
<td style="text-align: left;">zip.exe</td>
<td style="text-align: left;">Archive</td>
<td style="text-align: left;">zip</td>
<td style="text-align: left;">Package and compress (archive) files</td>
</tr>
<tr class="even">
<td align="left">unzip.exe</td>
<td align="left">Archive</td>
<td align="left">unzip</td>
<td align="left">Extract compressed files in a ZIP archive</td>
<td style="text-align: left;">unzip.exe</td>
<td style="text-align: left;">Archive</td>
<td style="text-align: left;">unzip</td>
<td style="text-align: left;">Extract compressed files in a ZIP archive</td>
</tr>
<tr class="odd">
<td align="left">free.exe</td>
<td align="left">System</td>
<td align="left">procps</td>
<td align="left">Display amount of free and used memory in the system</td>
<td style="text-align: left;">free.exe</td>
<td style="text-align: left;">System</td>
<td style="text-align: left;">procps</td>
<td style="text-align: left;">Display amount of free and used memory in the system</td>
</tr>
</tbody>
</table>
@ -561,14 +563,14 @@ This is caused by a missing libstdc++.a library. This is installed as part of a
This is probably an issue with SELinux (See <a href="http://en.wikipedia.org/wiki/SELinux">SELinux on Wikipedia</a>). Parts of the VM is built without the <code>-fPIC</code> for performance reasons.</p></li>
</ul>
<p>To completely disable SELinux:</p>
<ol style="list-style-type: decimal">
<ol type="1">
<li><code>$ su root</code></li>
<li><code># system-config-securitylevel</code></li>
<li><code>In the window that appears, select the SELinux tab</code></li>
<li><code>Disable SELinux</code></li>
</ol>
<p>Alternatively, instead of completely disabling it you could disable just this one check.</p>
<ol style="list-style-type: decimal">
<ol type="1">
<li>Select System-&gt;Administration-&gt;SELinux Management</li>
<li>In the SELinux Management Tool which appears, select &quot;Boolean&quot; from the menu on the left</li>
<li>Expand the &quot;Memory Protection&quot; group</li>
@ -616,62 +618,62 @@ Try rebooting the system, or there could be some kind of issue with the disk or
<table>
<thead>
<tr class="header">
<th align="left">Base OS and Architecture</th>
<th align="left">OS</th>
<th align="left">C/C++ Compiler</th>
<th align="left">Processors</th>
<th align="left">RAM Minimum</th>
<th align="left">DISK Needs</th>
<th style="text-align: left;">Base OS and Architecture</th>
<th style="text-align: left;">OS</th>
<th style="text-align: left;">C/C++ Compiler</th>
<th style="text-align: left;">Processors</th>
<th style="text-align: left;">RAM Minimum</th>
<th style="text-align: left;">DISK Needs</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Linux X86 (32-bit) and X64 (64-bit)</td>
<td align="left">Oracle Enterprise Linux 6.4</td>
<td align="left">gcc 4.9.2</td>
<td align="left">2 or more</td>
<td align="left">1 GB</td>
<td align="left">6 GB</td>
<td style="text-align: left;">Linux X86 (32-bit) and X64 (64-bit)</td>
<td style="text-align: left;">Oracle Enterprise Linux 6.4</td>
<td style="text-align: left;">gcc 4.9.2</td>
<td style="text-align: left;">2 or more</td>
<td style="text-align: left;">1 GB</td>
<td style="text-align: left;">6 GB</td>
</tr>
<tr class="even">
<td align="left">Solaris SPARCV9 (64-bit)</td>
<td align="left">Solaris 11 Update 1</td>
<td align="left">Studio 12 Update 4 + patches</td>
<td align="left">4 or more</td>
<td align="left">4 GB</td>
<td align="left">8 GB</td>
<td style="text-align: left;">Solaris SPARCV9 (64-bit)</td>
<td style="text-align: left;">Solaris 11 Update 1</td>
<td style="text-align: left;">Studio 12 Update 4 + patches</td>
<td style="text-align: left;">4 or more</td>
<td style="text-align: left;">4 GB</td>
<td style="text-align: left;">8 GB</td>
</tr>
<tr class="odd">
<td align="left">Solaris X64 (64-bit)</td>
<td align="left">Solaris 11 Update 1</td>
<td align="left">Studio 12 Update 4 + patches</td>
<td align="left">4 or more</td>
<td align="left">4 GB</td>
<td align="left">8 GB</td>
<td style="text-align: left;">Solaris X64 (64-bit)</td>
<td style="text-align: left;">Solaris 11 Update 1</td>
<td style="text-align: left;">Studio 12 Update 4 + patches</td>
<td style="text-align: left;">4 or more</td>
<td style="text-align: left;">4 GB</td>
<td style="text-align: left;">8 GB</td>
</tr>
<tr class="even">
<td align="left">Windows X86 (32-bit)</td>
<td align="left">Windows Server 2012 R2 x64</td>
<td align="left">Microsoft Visual Studio C++ 2013 Professional Edition</td>
<td align="left">2 or more</td>
<td align="left">2 GB</td>
<td align="left">6 GB</td>
<td style="text-align: left;">Windows X86 (32-bit)</td>
<td style="text-align: left;">Windows Server 2012 R2 x64</td>
<td style="text-align: left;">Microsoft Visual Studio C++ 2013 Professional Edition</td>
<td style="text-align: left;">2 or more</td>
<td style="text-align: left;">2 GB</td>
<td style="text-align: left;">6 GB</td>
</tr>
<tr class="odd">
<td align="left">Windows X64 (64-bit)</td>
<td align="left">Windows Server 2012 R2 x64</td>
<td align="left">Microsoft Visual Studio C++ 2013 Professional Edition</td>
<td align="left">2 or more</td>
<td align="left">2 GB</td>
<td align="left">6 GB</td>
<td style="text-align: left;">Windows X64 (64-bit)</td>
<td style="text-align: left;">Windows Server 2012 R2 x64</td>
<td style="text-align: left;">Microsoft Visual Studio C++ 2013 Professional Edition</td>
<td style="text-align: left;">2 or more</td>
<td style="text-align: left;">2 GB</td>
<td style="text-align: left;">6 GB</td>
</tr>
<tr class="even">
<td align="left">Mac OS X X64 (64-bit)</td>
<td align="left">Mac OS X 10.9 &quot;Mavericks&quot;</td>
<td align="left">Xcode 6.3 or newer</td>
<td align="left">2 or more</td>
<td align="left">4 GB</td>
<td align="left">6 GB</td>
<td style="text-align: left;">Mac OS X X64 (64-bit)</td>
<td style="text-align: left;">Mac OS X 10.9 &quot;Mavericks&quot;</td>
<td style="text-align: left;">Xcode 6.3 or newer</td>
<td style="text-align: left;">2 or more</td>
<td style="text-align: left;">4 GB</td>
<td style="text-align: left;">6 GB</td>
</tr>
</tbody>
</table>

View File

@ -1,19 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Testing OpenJDK</title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href=" ../../jdk/make/data/docs-resources/specs/resources/jdk-default.css" type="text/css" />
<link rel="stylesheet" href="../../jdk/make/data/docs-resources/specs/resources/jdk-default.css">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
</head>
<body>
<div id="header">
<header>
<h1 class="title">Testing OpenJDK</h1>
</div>
<div id="TOC">
</header>
<nav id="TOC">
<ul>
<li><a href="#using-the-run-test-framework">Using the run-test framework</a></li>
<li><a href="#test-selection">Test selection</a><ul>
@ -26,16 +29,18 @@
<li><a href="#gtest-keywords">Gtest keywords</a></li>
</ul></li>
</ul>
</div>
</nav>
<h2 id="using-the-run-test-framework">Using the run-test framework</h2>
<p>This new way of running tests is developer-centric. It assumes that you have built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
<p>The main target &quot;run-test&quot; uses the jdk-image as the tested product. There is also an alternate target &quot;exploded-run-test&quot; that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.</p>
<p>Some example command-lines:</p>
<pre><code>$ make run-test-tier1
$ make run-test-jdk_lang JTREG=&quot;JOBS=8&quot;
$ make run-test TEST=jdk_lang
$ make run-test-only TEST=&quot;gtest:LogTagSet gtest:LogTagSetDescriptions&quot; GTEST=&quot;REPEAT=-1&quot;
$ make run-test TEST=&quot;hotspot/test:hotspot_gc&quot; JTREG=&quot;JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;
$ make run-test TEST=&quot;jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java&quot;</code></pre>
$ make run-test TEST=&quot;jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java&quot;
$ make exploded-run-test TEST=hotspot_tier1</code></pre>
<h2 id="test-selection">Test selection</h2>
<p>All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.</p>
<p>For some common top-level tests, direct make targets have been generated. This includes all JTreg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make run-test-tier1</code> is equivalent to <code>make run-test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>run-test TEST=&quot;x&quot;</code> solution needs to be used.</p>

View File

@ -7,6 +7,11 @@ built a jdk locally and want to test it. Running common test targets is simple,
and more complex ad-hoc combination of tests is possible. The user interface is
forgiving, and clearly report errors it cannot resolve.
The main target "run-test" uses the jdk-image as the tested product. There is
also an alternate target "exploded-run-test" that uses the exploded image
instead. Not all tests will run successfully on the exploded image, but using
this target can greatly improve rebuild times for certain workflows.
Some example command-lines:
$ make run-test-tier1
@ -15,6 +20,7 @@ Some example command-lines:
$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
$ make exploded-run-test TEST=hotspot_tier1
## Test selection

View File

@ -422,3 +422,5 @@ b2218d41edef02ee8f94bb438f885b2ba79bfa08 jdk-9+169
8a4ab3b0ab9a86df73d9a1e337134f2dbe006725 jdk-9+170
aed5a4edc8275c1c50195503756ff92bfe0197f5 jdk-10+7
648b0a00824eb29e71936bc3258d309a25e3b8c0 jdk-10+8
54c6621f7b34cc6ce6c0882d047f61fe0962c257 jdk-10+9
c62e5964cfcf144d8f72e9ba69757897785349a9 jdk-9+171

View File

@ -582,3 +582,5 @@ fbb9c802649585d19f6d7e81b4a519d44806225a jdk-9+168
38a240fd58a287acb1963920b92ed4d9c2fd39e3 jdk-9+170
9d4746eca95aec3e5a344bf2520745dcc1d17eed jdk-10+7
f5ded0cf954c770deeecb80f2ba1ba6a05cd979b jdk-10+8
233647e3d3800e76d7612014b745b37a88098f63 jdk-10+9
d53171650a2cc6c6f699c966c533b914ca9c0602 jdk-9+171

View File

@ -303,9 +303,9 @@ class HotSpotProject(mx.NativeProject):
out.close('link')
out.open('link')
out.element('name', data='generated')
out.element('name', data='gensrc')
out.element('type', data='2')
generated = join(_get_hotspot_build_dir(jvmVariant, debugLevel), 'generated')
generated = join(_get_hotspot_build_dir(jvmVariant, debugLevel), 'gensrc')
out.element('locationURI', data=mx.get_eclipse_project_rel_locationURI(generated, eclProjectDir))
out.close('link')
@ -620,18 +620,12 @@ _jvmci_bootclasspath_prepends = []
def _get_hotspot_build_dir(jvmVariant=None, debugLevel=None):
"""
Gets the directory in which a particular HotSpot configuration is built
(e.g., <JDK_REPO_ROOT>/build/macosx-x86_64-normal-server-release/hotspot/bsd_amd64_compiler2)
(e.g., <JDK_REPO_ROOT>/build/macosx-x86_64-normal-server-release/hotspot/variant-<variant>)
"""
if jvmVariant is None:
jvmVariant = _vm.jvmVariant
os = mx.get_os()
if os == 'darwin':
os = 'bsd'
arch = mx.get_arch()
buildname = {'client': 'compiler1', 'server': 'compiler2'}.get(jvmVariant, jvmVariant)
name = '{}_{}_{}'.format(os, arch, buildname)
name = 'variant-{}'.format(jvmVariant)
return join(_get_jdk_build_dir(debugLevel=debugLevel), 'hotspot', name)
class JVMCI9JDKConfig(mx.JDKConfig):

View File

@ -4134,28 +4134,33 @@ void MacroAssembler::vabsss(XMMRegister dst, XMMRegister nds, XMMRegister src, A
if ((dst_enc < 16) && (nds_enc < 16)) {
vandps(dst, nds, negate_field, vector_len);
} else if ((src_enc < 16) && (dst_enc < 16)) {
movss(src, nds);
evmovdqul(src, nds, Assembler::AVX_512bit);
vandps(dst, src, negate_field, vector_len);
} else if (src_enc < 16) {
movss(src, nds);
evmovdqul(src, nds, Assembler::AVX_512bit);
vandps(src, src, negate_field, vector_len);
movss(dst, src);
evmovdqul(dst, src, Assembler::AVX_512bit);
} else if (dst_enc < 16) {
movdqu(src, xmm0);
movss(xmm0, nds);
evmovdqul(src, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandps(dst, xmm0, negate_field, vector_len);
movdqu(xmm0, src);
} else if (nds_enc < 16) {
movdqu(src, xmm0);
vandps(xmm0, nds, negate_field, vector_len);
movss(dst, xmm0);
movdqu(xmm0, src);
evmovdqul(xmm0, src, Assembler::AVX_512bit);
} else {
movdqu(src, xmm0);
movss(xmm0, nds);
vandps(xmm0, xmm0, negate_field, vector_len);
movss(dst, xmm0);
movdqu(xmm0, src);
if (src_enc != dst_enc) {
evmovdqul(src, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandps(xmm0, xmm0, negate_field, vector_len);
evmovdqul(dst, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, src, Assembler::AVX_512bit);
} else {
subptr(rsp, 64);
evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandps(xmm0, xmm0, negate_field, vector_len);
evmovdqul(dst, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
addptr(rsp, 64);
}
}
}
@ -4166,28 +4171,33 @@ void MacroAssembler::vabssd(XMMRegister dst, XMMRegister nds, XMMRegister src, A
if ((dst_enc < 16) && (nds_enc < 16)) {
vandpd(dst, nds, negate_field, vector_len);
} else if ((src_enc < 16) && (dst_enc < 16)) {
movsd(src, nds);
evmovdqul(src, nds, Assembler::AVX_512bit);
vandpd(dst, src, negate_field, vector_len);
} else if (src_enc < 16) {
movsd(src, nds);
evmovdqul(src, nds, Assembler::AVX_512bit);
vandpd(src, src, negate_field, vector_len);
movsd(dst, src);
evmovdqul(dst, src, Assembler::AVX_512bit);
} else if (dst_enc < 16) {
movdqu(src, xmm0);
movsd(xmm0, nds);
evmovdqul(src, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandpd(dst, xmm0, negate_field, vector_len);
movdqu(xmm0, src);
} else if (nds_enc < 16) {
movdqu(src, xmm0);
vandpd(xmm0, nds, negate_field, vector_len);
movsd(dst, xmm0);
movdqu(xmm0, src);
evmovdqul(xmm0, src, Assembler::AVX_512bit);
} else {
movdqu(src, xmm0);
movsd(xmm0, nds);
vandpd(xmm0, xmm0, negate_field, vector_len);
movsd(dst, xmm0);
movdqu(xmm0, src);
if (src_enc != dst_enc) {
evmovdqul(src, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandpd(xmm0, xmm0, negate_field, vector_len);
evmovdqul(dst, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, src, Assembler::AVX_512bit);
} else {
subptr(rsp, 64);
evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, nds, Assembler::AVX_512bit);
vandpd(xmm0, xmm0, negate_field, vector_len);
evmovdqul(dst, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
addptr(rsp, 64);
}
}
}
@ -4934,6 +4944,24 @@ void MacroAssembler::punpcklbw(XMMRegister dst, XMMRegister src) {
}
}
void MacroAssembler::pshufd(XMMRegister dst, Address src, int mode) {
if (VM_Version::supports_avx512vl()) {
Assembler::pshufd(dst, src, mode);
} else {
int dst_enc = dst->encoding();
if (dst_enc < 16) {
Assembler::pshufd(dst, src, mode);
} else {
subptr(rsp, 64);
evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
Assembler::pshufd(xmm0, src, mode);
evmovdqul(dst, xmm0, Assembler::AVX_512bit);
evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
addptr(rsp, 64);
}
}
}
// This instruction exists within macros, ergo we cannot control its input
// when emitted through those patterns.
void MacroAssembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) {

View File

@ -1232,6 +1232,9 @@ public:
void punpcklbw(XMMRegister dst, XMMRegister src);
void punpcklbw(XMMRegister dst, Address src) { Assembler::punpcklbw(dst, src); }
void pshufd(XMMRegister dst, Address src, int mode);
void pshufd(XMMRegister dst, XMMRegister src, int mode) { Assembler::pshufd(dst, src, mode); }
void pshuflw(XMMRegister dst, XMMRegister src, int mode);
void pshuflw(XMMRegister dst, Address src, int mode) { Assembler::pshuflw(dst, src, mode); }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,12 @@
* questions.
*/
/**
* Defines the implementation of the HotSpot Serviceability Agent.
*
* @moduleGraph
* @since 9
*/
module jdk.hotspot.agent {
requires java.datatransfer;
requires java.desktop;

View File

@ -407,8 +407,12 @@ void ConstMethod::print_on(outputStream* st) const {
ResourceMark rm;
assert(is_constMethod(), "must be constMethod");
st->print_cr("%s", internal_name());
st->print(" - method: " INTPTR_FORMAT " ", p2i((address)method()));
method()->print_value_on(st); st->cr();
Method* m = method();
st->print(" - method: " INTPTR_FORMAT " ", p2i((address)m));
if (m != NULL) {
m->print_value_on(st);
}
st->cr();
if (has_stackmap_table()) {
st->print(" - stackmap data: ");
stackmap_data()->print_value_on(st);
@ -421,7 +425,12 @@ void ConstMethod::print_on(outputStream* st) const {
void ConstMethod::print_value_on(outputStream* st) const {
assert(is_constMethod(), "must be constMethod");
st->print(" const part of method " );
method()->print_value_on(st);
Method* m = method();
if (m != NULL) {
m->print_value_on(st);
} else {
st->print("NULL");
}
}
#if INCLUDE_SERVICES
@ -461,7 +470,7 @@ void ConstMethod::verify_on(outputStream* st) {
// Verification can occur during oop construction before the method or
// other fields have been initialized.
guarantee(method()->is_method(), "should be method");
guarantee(method() != NULL && method()->is_method(), "should be method");
address m_end = (address)((intptr_t) this + size());
address compressed_table_start = code_end();

View File

@ -1000,7 +1000,7 @@ Node *Matcher::xform( Node *n, int max_stack ) {
if (C->failing()) return NULL;
if (m == NULL) { Matcher::soft_match_failure(); return NULL; }
} else { // Nothing the matcher cares about
if( n->is_Proj() && n->in(0)->is_Multi()) { // Projections?
if (n->is_Proj() && n->in(0) != NULL && n->in(0)->is_Multi()) { // Projections?
// Convert to machine-dependent projection
m = n->in(0)->as_Multi()->match( n->as_Proj(), this );
#ifdef ASSERT
@ -1645,6 +1645,7 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) {
// Build the object to represent this state & prepare for recursive calls
MachNode *mach = s->MachNodeGenerator(rule);
guarantee(mach != NULL, "Missing MachNode");
mach->_opnds[0] = s->MachOperGenerator(_reduceOp[rule]);
assert( mach->_opnds[0] != NULL, "Missing result operand" );
Node *leaf = s->_leaf;

View File

@ -1123,6 +1123,9 @@ Node* LoadNode::Identity(PhaseGVN* phase) {
// Use _idx of address base (could be Phi node) for boxed values.
intptr_t ignore = 0;
Node* base = AddPNode::Ideal_base_and_offset(in(Address), phase, ignore);
if (base == NULL) {
return this;
}
this_iid = base->_idx;
}
const Type* this_type = bottom_type();
@ -3947,9 +3950,10 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
// if it is the last unused 4 bytes of an instance, forget about it
intptr_t size_limit = phase->find_intptr_t_con(size_in_bytes, max_jint);
if (zeroes_done + BytesPerLong >= size_limit) {
assert(allocation() != NULL, "");
if (allocation()->Opcode() == Op_Allocate) {
Node* klass_node = allocation()->in(AllocateNode::KlassNode);
AllocateNode* alloc = allocation();
assert(alloc != NULL, "must be present");
if (alloc != NULL && alloc->Opcode() == Op_Allocate) {
Node* klass_node = alloc->in(AllocateNode::KlassNode);
ciKlass* k = phase->type(klass_node)->is_klassptr()->klass();
if (zeroes_done == k->layout_helper())
zeroes_done = size_limit;

View File

@ -64,14 +64,14 @@ gc/g1/logging/TestG1LoggingFailure.java 8169634 generic-all
runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
# This test is disabled since it will stress NMT and timeout during normal testing
runtime/NMT/MallocStressTest.java 8166548 generic-all
runtime/SharedArchiveFile/BootAppendTests.java 8150683 generic-all
runtime/SharedArchiveFile/BootAppendTests.java 8179103 generic-all
runtime/SharedArchiveFile/DefaultUseWithClient.java 8154204 generic-all
#############################################################################
# :hotspot_serviceability
serviceability/jdwp/AllModulesCommandTest.java 8168478 generic-all
serviceability/jdwp/AllModulesCommandTest.java 8170541 generic-all
serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all
serviceability/jvmti/ModuleAwareAgents/ClassFileLoadHook/MAAClassFileLoadHook.java 8173936 generic-all

View File

@ -23,7 +23,7 @@
package compiler.codecache.stress;
import jdk.test.lib.wrappers.TimeLimitedRunner;
import jdk.test.lib.TimeLimitedRunner;
import jdk.test.lib.Utils;
public class CodeCacheStressRunner {

View File

@ -25,7 +25,7 @@ package compiler.codecache.stress;
import jdk.test.lib.Asserts;
import jdk.test.lib.ByteCodeLoader;
import jdk.test.lib.wrappers.InfiniteLoop;
import jdk.test.lib.InfiniteLoop;
import jdk.test.lib.Utils;
import sun.hotspot.WhiteBox;

View File

@ -29,7 +29,7 @@ import compiler.compilercontrol.share.method.MethodDescriptor;
import compiler.compilercontrol.share.pool.PoolHelper;
import compiler.compilercontrol.share.scenario.Executor;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.wrappers.TimeLimitedRunner;
import jdk.test.lib.TimeLimitedRunner;
import jdk.test.lib.Utils;
import java.util.ArrayList;

View File

@ -44,7 +44,7 @@
package compiler.whitebox;
import jdk.test.lib.Asserts;
import jdk.test.lib.wrappers.InfiniteLoop;
import jdk.test.lib.InfiniteLoop;
import sun.hotspot.WhiteBox;
import sun.hotspot.code.BlobType;

View File

@ -32,7 +32,6 @@ import static jdk.test.lib.Asserts.assertTrue;
* @test
* @summary Tests the modules-related JDWP commands
* @library /test/lib
* @ignore 8170541
* @modules jdk.jdwp.agent
* @modules java.base/jdk.internal.misc
* @compile AllModulesCommandTestDebuggee.java

View File

@ -422,3 +422,5 @@ ac697b2bdf486ef18caad2092bd24036e14946ac jdk-10+5
6e78f902f477a093afca85a1042f97410d01eb69 jdk-9+170
09cae4c36242734f5450de739b8264523a030809 jdk-10+7
856998840907b67b7e1fc49259f785ac085a189b jdk-10+8
3c75f07b2a49cb0a4f4eb5df8bbcbc64dda3153f jdk-10+9
c27321c889cf4c8e465a61b84572c00ef7ee6004 jdk-9+171

View File

@ -34,9 +34,9 @@ import jdk.xml.internal.SecuritySupport;
* The CatalogFeatures holds a collection of features and properties.
* <p>
*
* <center><h2><a name="CatalogFeatures">Catalog Features</a></h2></center></p>
*
* <table border="1">
* <table class="plain">
* <caption>Catalog Features</caption>
* <thead>
* <tr>
* <th rowspan="2">Feature</th>
@ -44,7 +44,7 @@ import jdk.xml.internal.SecuritySupport;
* <th rowspan="2">Property Name</th>
* <th rowspan="2">System Property [1]</th>
* <th rowspan="2">jaxp.properties [1]</th>
* <th colspan="2" align="center">Value [2]</th>
* <th colspan="2" style="text-align:center">Value [2]</th>
* <th rowspan="2">Action</th>
* </tr>
* <tr>
@ -55,7 +55,7 @@ import jdk.xml.internal.SecuritySupport;
* <tbody>
*
* <tr>
* <td><a name="FILES">FILES</a></td>
* <td><a id="FILES">FILES</a></td>
* <td>A 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.
* </td>
@ -71,7 +71,7 @@ import jdk.xml.internal.SecuritySupport;
* </tr>
*
* <tr>
* <td rowspan="2"><a name="PREFER">PREFER</a></td>
* <td rowspan="2"><a id="PREFER">PREFER</a></td>
* <td rowspan="2">Indicates the preference between the public and system
* identifiers. The default value is public [3].</td>
* <td rowspan="2">javax.xml.catalog.prefer</td>
@ -89,7 +89,7 @@ import jdk.xml.internal.SecuritySupport;
* </tr>
*
* <tr>
* <td rowspan="2"><a name="DEFER">DEFER</a></td>
* <td rowspan="2"><a id="DEFER">DEFER</a></td>
* <td rowspan="2">Indicates that the alternative catalogs including those
* specified in delegate entries or nextCatalog are not read until they are
* needed. The default value is true.</td>
@ -107,7 +107,7 @@ import jdk.xml.internal.SecuritySupport;
* </tr>
*
* <tr>
* <td rowspan="3"><a name="RESOLVE">RESOLVE</a></td>
* <td rowspan="3"><a id="RESOLVE">RESOLVE</a></td>
* <td rowspan="3">Determines the action if there is no matching entry found after
* all of the specified catalogs are exhausted. The default is strict.</td>
* <td rowspan="3">javax.xml.catalog.resolve [4]</td>
@ -241,9 +241,10 @@ import jdk.xml.internal.SecuritySupport;
* supports a resolver. The following table lists all such processes.
*
* <p>
* <center><h3><a name="CatalogFeatures">Processes with Catalog Support</a></h3></center></p>
* <h3><a id="ProcessesWithCatalogSupport">Processes with Catalog Support</a></h3>
*
* <table border="1">
* <table class="striped">
* <caption>Processes with Catalog Support</caption>
* <thead>
* <tr>
* <th>Process</th>

View File

@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!DOCTYPE HTML>
<html>
<head>
<!--
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
@ -26,7 +26,7 @@ or visit www.oracle.com if you need additional information or have any
questions.
-->
</head>
<body bgcolor="white">
<body>
Provides the classes for implementing
<a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">
@ -35,7 +35,7 @@ questions.
<p>
Unless otherwise noted, passing a null argument to
a constructor or method in any class or interface in this package will
cause a <tt>NullPointerException</tt> to be thrown.
cause a <code>NullPointerException</code> to be thrown.
</p>
@since 9

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2015, 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
@ -774,15 +774,11 @@ public abstract class DatatypeFactory {
/**
* Create an {@code XMLGregorianCalendar} from a {@link GregorianCalendar}.
*
* <table border="2" rules="all" cellpadding="2">
* <table class="striped">
* <caption>Field by Field Conversion from
* {@link GregorianCalendar} to an {@link XMLGregorianCalendar}</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">
* Field by Field Conversion from
* {@link GregorianCalendar} to an {@link XMLGregorianCalendar}
* </th>
* </tr>
* <tr>
* <th>{@code java.util.GregorianCalendar} field</th>
* <th>{@code javax.xml.datatype.XMLGregorianCalendar} field</th>
* </tr>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, 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
@ -120,26 +120,22 @@ public abstract class Duration {
* maps to. Type is computed based on fields that are set,
* i.e. {@link #isSet(DatatypeConstants.Field field)} == {@code true}.
*
* <table border="2" rules="all" cellpadding="2">
* <table class="striped">
* <caption>Required fields for XML Schema 1.0 Date/Time Datatypes.<br>
* <i>(timezone is optional for all date/time datatypes)</i></caption>
* <thead>
* <tr>
* <th align="center" colspan="7">
* Required fields for XML Schema 1.0 Date/Time Datatypes.<br>
* <i>(timezone is optional for all date/time datatypes)</i>
* </th>
* <th>Datatype</th>
* <th>year</th>
* <th>month</th>
* <th>day</th>
* <th>hour</th>
* <th>minute</th>
* <th>second</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>Datatype</td>
* <td>year</td>
* <td>month</td>
* <td>day</td>
* <td>hour</td>
* <td>minute</td>
* <td>second</td>
* </tr>
* <tr>
* <td>{@link DatatypeConstants#DURATION}</td>
* <td>X</td>
* <td>X</td>

View File

@ -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
@ -53,25 +53,21 @@ import java.util.GregorianCalendar;
* <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D,
* <i>ISO 8601 Date and Time Formats</i></a>.
*
* <a name="datetimefieldmapping"></a>
* <table border="2" rules="all" cellpadding="2">
* <a id="datetimefieldmapping"></a>
* <table class="striped">
* <caption>Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</caption>
* <thead>
* <tr>
* <th align="center" colspan="3">
* Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>XML Schema 1.0<br>
* datatype<br>
* field</th>
* <th>Related<br>XMLGregorianCalendar<br>Accessor(s)</th>
* <th>Value Range</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td><a name="datetimefield-year">year</a></td>
* <td><a id="datetimefield-year">year</a></td>
* <td> {@link #getYear()} + {@link #getEon()} or<br>
* {@link #getEonAndYear}
* </td>
@ -89,12 +85,12 @@ import java.util.GregorianCalendar;
* </td>
* </tr>
* <tr>
* <td><a name="datetimefield-month">month</a></td>
* <td><a id="datetimefield-month">month</a></td>
* <td> {@link #getMonth()} </td>
* <td> 1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
* </tr>
* <tr>
* <td><a name="datetimefield-day">day</a></td>
* <td><a id="datetimefield-day">day</a></td>
* <td> {@link #getDay()} </td>
* <td> Independent of month, max range is 1 to 31 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br>
* The normative value constraint stated relative to month
@ -102,7 +98,7 @@ import java.util.GregorianCalendar;
* </td>
* </tr>
* <tr>
* <td><a name="datetimefield-hour">hour</a></td>
* <td><a id="datetimefield-hour">hour</a></td>
* <td>{@link #getHour()}</td>
* <td>
* 0 to 23 or {@link DatatypeConstants#FIELD_UNDEFINED}.
@ -114,12 +110,12 @@ import java.util.GregorianCalendar;
* </td>
* </tr>
* <tr>
* <td><a name="datetimefield-minute">minute</a></td>
* <td><a id="datetimefield-minute">minute</a></td>
* <td> {@link #getMinute()} </td>
* <td> 0 to 59 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
* </tr>
* <tr>
* <td><a name="datetimefield-second">second</a></td>
* <td><a id="datetimefield-second">second</a></td>
* <td>
* {@link #getSecond()} + {@link #getMillisecond()}/1000 or<br>
* {@link #getSecond()} + {@link #getFractionalSecond()}
@ -135,7 +131,7 @@ import java.util.GregorianCalendar;
* </td>
* </tr>
* <tr>
* <td><a name="datetimefield-timezone">timezone</a></td>
* <td><a id="datetimefield-timezone">timezone</a></td>
* <td> {@link #getTimezone()} </td>
* <td> Number of minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.
* Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes).
@ -748,26 +744,22 @@ public abstract class XMLGregorianCalendar
* Return the name of the XML Schema date/time type that this instance
* maps to. Type is computed based on fields that are set.
*
* <table border="2" rules="all" cellpadding="2">
* <table class="striped">
* <caption>Required fields for XML Schema 1.0 Date/Time Datatypes.<br>
* <i>(timezone is optional for all date/time datatypes)</i></caption>
* <thead>
* <tr>
* <th align="center" colspan="7">
* Required fields for XML Schema 1.0 Date/Time Datatypes.<br>
* <i>(timezone is optional for all date/time datatypes)</i>
* </th>
* <th>Datatype</th>
* <th>year</th>
* <th>month</th>
* <th>day</th>
* <th>hour</th>
* <th>minute</th>
* <th>second</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>Datatype</td>
* <td>year</td>
* <td>month</td>
* <td>day</td>
* <td>hour</td>
* <td>minute</td>
* <td>second</td>
* </tr>
* <tr>
* <td>{@link DatatypeConstants#DATETIME}</td>
* <td>X</td>
* <td>X</td>
@ -911,21 +903,17 @@ public abstract class XMLGregorianCalendar
* instance, see
* {@link #toGregorianCalendar(TimeZone, Locale, XMLGregorianCalendar)}.
*
* <table border="2" rules="all" cellpadding="2">
* <table class="striped">
* <caption>Field by Field Conversion from this class to
* {@code java.util.GregorianCalendar}</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">
* Field by Field Conversion from this class to
* {@code java.util.GregorianCalendar}
* </th>
* <th>{@code java.util.GregorianCalendar} field</th>
* <th>{@code javax.xml.datatype.XMLGregorianCalendar} field</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>{@code java.util.GregorianCalendar} field</td>
* <td>{@code javax.xml.datatype.XMLGregorianCalendar} field</td>
* </tr>
* <tr>
* <td>{@code ERA}</td>
* <td>{@link #getEonAndYear()}{@code .signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD}</td>
* </tr>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!doctype html>
<!--
Copyright (c) 2004, 2005, 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
@ -24,8 +24,7 @@ or visit www.oracle.com if you need additional information or have any
questions.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>javax.xml.xpath</title>
@ -50,9 +49,10 @@ questions.
<li><a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li>
</ul>
<hr />
<hr>
<table border="1" cellpadding="2">
<table class="striped">
<caption> W3C XML Schema/Java Type Mappings</caption>
<thead>
<tr>
<th>W3C XML Schema Data Type</th>
@ -101,10 +101,11 @@ questions.
</tbody>
</table>
<hr />
<hr>
<table border="1" cellpadding="2">
<table class="striped">
<caption>XQuery and XPath/Java Type Mappings</caption>
<thead>
<tr>
<th>XQuery 1.0 and XPath 2.0 Data Model</th>
@ -124,7 +125,7 @@ questions.
</tbody>
</table>
<hr />
<hr>
<p>
W3C XML Schema data types that have a "<em>natural</em>" mapping to Java types are defined by
@ -151,7 +152,7 @@ questions.
<li>xs:unsignedShort</li>
</ul>
<hr />
<hr>
<ul>
@ -162,7 +163,7 @@ questions.
<li>Since 1.5</li>
</ul>
<hr />
<hr>
</body>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,17 +88,12 @@ public interface NamespaceContext {
* table describes the returned Namespace URI value for all
* possible prefix values:
*
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Return value for specified prefixes</caption>
* <thead>
* <tr>
* <td align="center" colspan="2">
* {@code getNamespaceURI(prefix)}
* return value for specified prefixes
* </td>
* </tr>
* <tr>
* <td>prefix parameter</td>
* <td>Namespace URI return value</td>
* <th>prefix parameter</th>
* <th>Namespace URI return value</th>
* </tr>
* </thead>
* <tbody>
@ -158,15 +153,10 @@ public interface NamespaceContext {
* table describes the returned prefix value for all Namespace URI
* values:
*
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Return value for specified Namespace URIs</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">
* {@code getPrefix(namespaceURI)} return value for
* specified Namespace URIs
* </th>
* </tr>
* <tr>
* <th>Namespace URI parameter</th>
* <th>prefix value returned</th>
* </tr>
@ -230,14 +220,10 @@ public interface NamespaceContext {
* table describes the returned prefixes value for all Namespace
* URI values:
*
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Return value for specified Namespace URIs</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">{@code
* getPrefixes(namespaceURI)} return value for
* specified Namespace URIs</th>
* </tr>
* <tr>
* <th>Namespace URI parameter</th>
* <th>prefixes value returned</th>
* </tr>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 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
@ -64,21 +64,17 @@ public interface XMLEventWriter extends XMLEventConsumer {
* Add an event to the output stream
* Adding a START_ELEMENT will open a new namespace scope that
* will be closed when the corresponding END_ELEMENT is written.
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Required and optional fields for events added to the writer</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">
* Required and optional fields for events added to the writer
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>Event Type</th>
* <th>Required Fields</th>
* <th>Optional Fields</th>
* <th>Required Behavior</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td> START_ELEMENT </td>
* <td> QName name </td>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2016, 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
@ -36,22 +36,18 @@ import javax.xml.transform.Source;
* Each property varies in the level of support required by each implementation.
* The level of support required is described in the 'Required' column.
*
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Configuration Parameters</caption>
* <thead>
* <tr>
* <th align="center" colspan="5">
* Configuration parameters
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>Property Name</th>
* <th>Behavior</th>
* <th>Return type</th>
* <th>Default Value</th>
* <th>Required</th>
* </tr>
* </thead>
* <tbody>
* <tr><td>javax.xml.stream.isValidating</td><td>Turns on/off implementation specific DTD validation</td><td>Boolean</td><td>False</td><td>No</td></tr>
* <tr><td>javax.xml.stream.isNamespaceAware</td><td>Turns on/off namespace processing for XML 1.0 support</td><td>Boolean</td><td>True</td><td>True (required) / False (optional)</td></tr>
* <tr><td>javax.xml.stream.isCoalescing</td><td>Requires the processor to coalesce adjacent character data</td><td>Boolean</td><td>False</td><td>Yes</td></tr>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2016, 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
@ -36,22 +36,18 @@ import javax.xml.transform.Result;
* Each property varies in the level of support required by each implementation.
* The level of support required is described in the 'Required' column.
*
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Configuration Parameters</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">
* Configuration parameters
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>Property Name</th>
* <th>Behavior</th>
* <th>Return type</th>
* <th>Default Value</th>
* <th>Required</th>
* </tr>
* </thead>
* <tbody>
* <tr><td>javax.xml.stream.isRepairingNamespaces</td><td>defaults prefixes
* on the output side</td><td>Boolean</td><td>False</td><td>Yes</td></tr>
* </tbody>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 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
@ -71,19 +71,15 @@ import javax.xml.namespace.QName;
* If a method is called in an invalid state the method will throw a
* java.lang.IllegalStateException.
*
* <table border="2" rules="all" cellpadding="4">
* <table class="striped">
* <caption>Valid methods for each state</caption>
* <thead>
* <tr>
* <th align="center" colspan="2">
* Valid methods for each state
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>Event Type</th>
* <th>Valid Methods</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td> All States </td>
* <td> getProperty(), hasNext(), require(), close(),

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 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
@ -38,12 +38,10 @@ import javax.xml.namespace.NamespaceContext;
* Each NAMESPACE
* and ATTRIBUTE must be individually written.
*
* <table border="1" cellpadding="2" cellspacing="0">
* <table class="striped">
* <caption>XML Namespaces, {@code javax.xml.stream.isRepairingNamespaces} and write method behaviour</caption>
* <thead>
* <tr>
* <th colspan="5">XML Namespaces, {@code javax.xml.stream.isRepairingNamespaces} and write method behaviour</th>
* </tr>
* <tr>
* <tr style="border-bottom: 1px solid black">
* <th>Method</th> <!-- method -->
* <th colspan="2">{@code isRepairingNamespaces} == true</th>
* <th colspan="2">{@code isRepairingNamespaces} == false</th>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!doctype html>
<!--
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
@ -24,11 +24,7 @@ or visit www.oracle.com if you need additional information or have any
questions.
-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>javax.xml.transform</title>
@ -97,7 +93,7 @@ if (tfactory.getFeature(DOMSource.FEATURE) &amp;&amp; tfactory.getFeature(Stream
<h3>
<a name="qname-delimiter">Qualified Name Representation</a>
<a id="qname-delimiter">Qualified Name Representation</a>
</h3>
<p><a href="http://www.w3.org/TR/REC-xml-names">Namespaces</a>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, 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
@ -58,7 +58,7 @@ import org.xml.sax.SAXParseException;
* may not attempt to recursively invoke the {@code newSchema} method,
* even from the same thread.
*
* <h2><a name="schemaLanguage"></a>Schema Language</h2>
* <h2><a id="schemaLanguage"></a>Schema Language</h2>
* <p>
* This spec uses a namespace URI to designate a schema language.
* The following table shows the values defined by this specification.
@ -84,7 +84,8 @@ import org.xml.sax.SAXParseException;
* validation implemented on this interface necessarily deviate from
* the XML DTD semantics as defined in the XML 1.0</em>.
*
* <table border="1" cellpadding="2">
* <table class="striped">
* <caption>URIs for Supported Schema languages</caption>
* <thead>
* <tr>
* <th>value</th>

View File

@ -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
@ -60,7 +60,7 @@ public abstract class SchemaFactoryLoader {
* the list of available schema languages</a>.
*
* @throws NullPointerException
* If the <tt>schemaLanguage</tt> parameter is null.
* If the <code>schemaLanguage</code> parameter is null.
*
* @return <code>null</code> if the callee fails to create one.
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, 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
@ -131,12 +131,10 @@ public abstract class Validator {
* <p>This method places the following restrictions on the types of
* the {@link Source}/{@link Result} accepted.
*
* <table border=1>
* <table class="plain">
* <caption>{@code Source} / {@code Result} Accepted</caption>
* <thead>
* <tr>
* <th colspan="5">{@code Source} / {@code Result} Accepted</th>
* </tr>
* <tr>
* <th></th>
* <th>{@link javax.xml.transform.stream.StreamSource}</th>
* <th>{@link javax.xml.transform.sax.SAXSource}</th>
@ -144,7 +142,7 @@ public abstract class Validator {
* <th>{@link javax.xml.transform.stax.StAXSource}</th>
* </tr>
* </thead>
* <tbody align="center">
* <tbody style="text-align:center">
* <tr>
* <td>{@code null}</td>
* <td>OK</td>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!doctype html>
<!--
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
@ -24,11 +24,7 @@ or visit www.oracle.com if you need additional information or have any
questions.
-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>javax.xml.validation</title>
@ -86,7 +82,7 @@ questions.
process simple (see <a href="#example-1">example</a> below).</li>
</ul>
<p>
<a name="example-1"><strong>Usage example</strong>.</a> The following example demonstrates validating
<a id="example-1"><strong>Usage example</strong>.</a> The following example demonstrates validating
an XML document with the Validation API (for readability, some exception handling is not shown):
</p>
<pre>

View File

@ -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
@ -31,14 +31,18 @@ import org.xml.sax.InputSource;
/**
* {@code XPath} provides access to the XPath evaluation environment and expressions.
* The XPath evaluation is affected by the factors described in the following table.
*
* <a name="XPath-evaluation"></a>
* <table border="1" cellpadding="2">
* <a id="XPath-evaluation"></a>
* <table class="striped">
* <caption>Evaluation of XPath Expressions</caption>
* <thead>
* <tr>
* <th colspan="2">Evaluation of XPath Expressions.</th>
* <th>Factor</th>
* <th>Behavior</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>context</td>
* <td>
@ -84,6 +88,7 @@ import org.xml.sax.InputSource;
* Conversion to the return type follows XPath conversion rules.
* </td>
* </tr>
* </tbody>
* </table>
*
* <p>An XPath object is not thread-safe and not reentrant.

View File

@ -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
@ -30,14 +30,18 @@ import org.xml.sax.InputSource;
/**
* {@code XPathExpression} provides access to compiled XPath expressions.
* The XPath evaluation is affected by the factors described in the following table.
*
* <a name="XPathExpression-evaluation"></a>
* <table border="1" cellpadding="2">
* <a id="XPathExpression-evaluation"></a>
* <table class="striped">
* <caption>Evaluation of XPath Expressions</caption>
* <thead>
* <tr>
* <th colspan="2">Evaluation of XPath Expressions.</th>
* <th>Factor</th>
* <th>Behavior</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>context</td>
* <td>

View File

@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!doctype html>
<html>
<head>
<!--
Copyright (c) 2003, 2015, 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,7 +26,7 @@ or visit www.oracle.com if you need additional information or have any
questions.
-->
</head>
<body bgcolor="white">
<body>
This package provides an <em>object-model neutral</em> API for the
evaluation of XPath expressions and access to the evaluation
@ -36,7 +36,7 @@ environment.
The XPath API supports <a href="http://www.w3.org/TR/xpath">
XML Path Language (XPath) Version 1.0</a>
<hr />
<hr>
<ul>
<li><a href='#XPath.Overview'>1. XPath Overview</a></li>
@ -52,7 +52,7 @@ The XPath API supports <a href="http://www.w3.org/TR/xpath">
<li><a href='#XPath.Use'>5. Using the XPath API</a></li>
</ul>
<p>
<a name="XPath.Overview"></a>
<a id="XPath.Overview"></a>
<h3>1. XPath Overview</h3>
<p>The XPath language provides a simple, concise syntax for selecting
@ -69,7 +69,7 @@ stand-alone language, as a single XPath expression can be used to
replace many lines of DOM API code.
</p>
<a name="XPath.Expressions"></a>
<a id="XPath.Expressions"></a>
<h3>2. XPath Expressions</h3>
<p>An XPath <em>expression</em> is composed of a <em>location
@ -139,11 +139,15 @@ attribute nodes, text nodes, comment nodes, and processing instruction
nodes. The following table gives examples of location paths for each
of these node types:</p>
<table border="1">
<table class="striped">
<caption>Examples of Location Path</caption>
<thead>
<tr>
<td>Location Path</td>
<td>Description</td>
<th>Location Path</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>/foo/bar/<strong>@id</strong></code>
@ -171,6 +175,7 @@ distinction is made between escaped and non-escaped character data.
<code>&lt;bar&gt;</code> element.
</td>
</tr>
</tbody>
</table>
<p>Predicates allow for refining the nodes selected by an XPath
@ -194,7 +199,7 @@ expression, such as:</p>
</pre>
</blockquote>
<a name="XPath.Datatypes"></a>
<a id="XPath.Datatypes"></a>
<h3>3. XPath Data Types</h3>
<p>While XPath expressions select nodes in the XML document, the XPath
@ -207,7 +212,7 @@ following data types:</p>
<li><code>String</code></li>
</ul>
<a name="XPath.Datatypes.QName"></a>
<a id="XPath.Datatypes.QName"></a>
<h3>3.1 QName types</h3>
The XPath API defines the following {@link javax.xml.namespace.QName} types to
represent return types of an XPath evaluation:
@ -236,7 +241,7 @@ of the child text nodes is returned.
<p>The <code>Number</code> return type attempts to coalesce the text
of a node to a <code>double</code> data type.
<a name="XPath.Datatypes.Class"></a>
<a id="XPath.Datatypes.Class"></a>
<h3>3.2 Class types</h3>
In addition to the QName types, the XPath API supports the use of Class types
through the <code>XPathExpression.evaluteExpression(...)</code> or
@ -254,14 +259,14 @@ The XPath data types are mapped to Class types as follows:
<p>
Of the subtypes of Number, only Double, Integer and Long are supported.
<a name="XPath.Datatypes.Enum"></a>
<a id="XPath.Datatypes.Enum"></a>
<h3>3.3 Enum types</h3>
Enum types are defined in {@link javax.xml.xpath.XPathEvaluationResult.XPathResultType}
that provide mappings between the QName and Class types above. The result of
evaluating an expression using the <code>XPathExpression.evaluteExpression(...)</code>
or <code>XPath.evaluateExpression(...)</code> methods will be of one of these types.
<a name="XPath.Context"></a>
<a id="XPath.Context"></a>
<h3>4. XPath Context</h3>
<p>XPath location paths may be relative to a particular node in the
@ -278,7 +283,7 @@ document, known as the <code>context</code>. A context consists of:
It is an XML document tree represented as a hierarchy of nodes, a
{@link org.w3c.dom.Node} for example, in the JDK implementation.
<a name="XPath.Use"></a>
<a id="XPath.Use"></a>
<h3>5. Using the XPath API</h3>
Consider the following XML document:

View File

@ -111,7 +111,9 @@ package org.w3c.dom;
* <p>The following table gives some examples of the relations between the
* attribute value in the original document (parsed attribute), the value as
* exposed in the DOM, and the serialization of the value:
* <table border='1' cellpadding='3'>
* <table class="striped">
* <caption>Examples of the Original, Normalized and Serialized Values </caption>
* <thead>
* <tr>
* <th>Examples</th>
* <th>Parsed
@ -119,6 +121,8 @@ package org.w3c.dom;
* <th>Initial <code>Attr.value</code></th>
* <th>Serialized attribute value</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* Character reference</td>
@ -126,7 +130,7 @@ package org.w3c.dom;
* <pre>"x&amp;#178;=5"</pre>
* </td>
* <td valign='top' rowspan='1' colspan='1'>
* <pre>"x\u00b2=5"</pre>
* <pre>"x&#178;=5"</pre>
* </td>
* <td valign='top' rowspan='1' colspan='1'>
* <pre>"x&amp;#178;=5"</pre>
@ -180,6 +184,7 @@ package org.w3c.dom;
* <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load Options</em></td>
* <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load/Save Options</em></td>
* </tr>
* </tbody>
* </table>
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*/

View File

@ -353,37 +353,42 @@ public interface Document extends Node {
* instantiate.
* @return A new <code>Element</code> object with the following
* attributes:
* <table border='1' cellpadding='3'>
* <table class="striped">
* <caption>Attributes of the {@code Element} object</caption>
* <thead>
* <tr>
* <th>Attribute</th>
* <th>Value</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.nodeName</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Node.nodeName</code></td>
* <td>
* <code>qualifiedName</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.namespaceURI</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Node.namespaceURI</code></td>
* <td>
* <code>namespaceURI</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.prefix</code></td>
* <td valign='top' rowspan='1' colspan='1'>prefix, extracted
* <td><code>Node.prefix</code></td>
* <td>prefix, extracted
* from <code>qualifiedName</code>, or <code>null</code> if there is
* no prefix</td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.localName</code></td>
* <td valign='top' rowspan='1' colspan='1'>local name, extracted from
* <td><code>Node.localName</code></td>
* <td>local name, extracted from
* <code>qualifiedName</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Element.tagName</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Element.tagName</code></td>
* <td>
* <code>qualifiedName</code></td>
* </tr>
* </tbody>
* </table>
* @exception DOMException
* INVALID_CHARACTER_ERR: Raised if the specified
@ -417,43 +422,48 @@ public interface Document extends Node {
* @param qualifiedName The qualified name of the attribute to
* instantiate.
* @return A new <code>Attr</code> object with the following attributes:
* <table border='1' cellpadding='3'>
* <table class="striped">
* <caption>Attributes of the {@code Attr} object </caption>
* <thead>
* <tr>
* <th>
* Attribute</th>
* <th>Value</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.nodeName</code></td>
* <td valign='top' rowspan='1' colspan='1'>qualifiedName</td>
* <td><code>Node.nodeName</code></td>
* <td>qualifiedName</td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* <code>Node.namespaceURI</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>namespaceURI</code></td>
* <td><code>namespaceURI</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* <code>Node.prefix</code></td>
* <td valign='top' rowspan='1' colspan='1'>prefix, extracted from
* <td>prefix, extracted from
* <code>qualifiedName</code>, or <code>null</code> if there is no
* prefix</td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.localName</code></td>
* <td valign='top' rowspan='1' colspan='1'>local name, extracted from
* <td><code>Node.localName</code></td>
* <td>local name, extracted from
* <code>qualifiedName</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Attr.name</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Attr.name</code></td>
* <td>
* <code>qualifiedName</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Node.nodeValue</code></td>
* <td valign='top' rowspan='1' colspan='1'>the empty
* <td><code>Node.nodeValue</code></td>
* <td>the empty
* string</td>
* </tr>
* </tbody>
* </table>
* @exception DOMException
* INVALID_CHARACTER_ERR: Raised if the specified

View File

@ -61,104 +61,109 @@ package org.w3c.dom;
* <p>The values of <code>nodeName</code>,
* <code>nodeValue</code>, and <code>attributes</code> vary according to the
* node type as follows:
* <table border='1' cellpadding='3'>
* <table class="striped">
* <caption style="display:none">Interface table</caption>
* <thead>
* <tr>
* <th>Interface</th>
* <th>nodeName</th>
* <th>nodeValue</th>
* <th>attributes</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* <code>Attr</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as <code>Attr.name</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as
* <td>same as <code>Attr.name</code></td>
* <td>same as
* <code>Attr.value</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>CDATASection</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>CDATASection</code></td>
* <td>
* <code>"#cdata-section"</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the
* <td>same as <code>CharacterData.data</code>, the
* content of the CDATA Section</td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Comment</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Comment</code></td>
* <td>
* <code>"#comment"</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the
* <td>same as <code>CharacterData.data</code>, the
* content of the comment</td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Document</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Document</code></td>
* <td>
* <code>"#document"</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* <code>DocumentFragment</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>"#document-fragment"</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>"#document-fragment"</code></td>
* <td>
* <code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>DocumentType</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as
* <td><code>DocumentType</code></td>
* <td>same as
* <code>DocumentType.name</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* <code>Element</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as <code>Element.tagName</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td>same as <code>Element.tagName</code></td>
* <td><code>null</code></td>
* <td>
* <code>NamedNodeMap</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Entity</code></td>
* <td valign='top' rowspan='1' colspan='1'>entity name</td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Entity</code></td>
* <td>entity name</td>
* <td><code>null</code></td>
* <td>
* <code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>EntityReference</code></td>
* <td valign='top' rowspan='1' colspan='1'>name of entity referenced</td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>EntityReference</code></td>
* <td>name of entity referenced</td>
* <td>
* <code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Notation</code></td>
* <td valign='top' rowspan='1' colspan='1'>notation name</td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Notation</code></td>
* <td>notation name</td>
* <td>
* <code>null</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>ProcessingInstruction</code></td>
* <td valign='top' rowspan='1' colspan='1'>same
* <td><code>ProcessingInstruction</code></td>
* <td>same
* as <code>ProcessingInstruction.target</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as
* <td>same as
* <code>ProcessingInstruction.data</code></td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'><code>Text</code></td>
* <td valign='top' rowspan='1' colspan='1'>
* <td><code>Text</code></td>
* <td>
* <code>"#text"</code></td>
* <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the content
* <td>same as <code>CharacterData.data</code>, the content
* of the text node</td>
* <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
* <td><code>null</code></td>
* </tr>
* </tbody>
* </table>
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
*/
@ -687,30 +692,35 @@ public interface Node {
* textual content.
* <br>The string returned is made of the text content of this node
* depending on its type, as defined below:
* <table border='1' cellpadding='3'>
* <table class="striped">
* <caption style="display:none">Node/Content table</caption>
* <thead>
* <tr>
* <th>Node type</th>
* <th>Content</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
* DOCUMENT_FRAGMENT_NODE</td>
* <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
* <td>concatenation of the <code>textContent</code>
* 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.</td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
* <td>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
* PROCESSING_INSTRUCTION_NODE</td>
* <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
* <td><code>nodeValue</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
* <td>DOCUMENT_NODE,
* DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
* <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
* <td><em>null</em></td>
* </tr>
* </tbody>
* </table>
* @exception DOMException
* DOMSTRING_SIZE_ERR: Raised when it would return more characters than
@ -737,30 +747,35 @@ public interface Node {
* textual content.
* <br>The string returned is made of the text content of this node
* depending on its type, as defined below:
* <table border='1' cellpadding='3'>
* <table class="striped">
* <caption style="display:none">Node/Content table</caption>
* <thead>
* <tr>
* <th>Node type</th>
* <th>Content</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>
* <td>
* ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
* DOCUMENT_FRAGMENT_NODE</td>
* <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
* <td>concatenation of the <code>textContent</code>
* 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.</td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
* <td>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
* PROCESSING_INSTRUCTION_NODE</td>
* <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
* <td><code>nodeValue</code></td>
* </tr>
* <tr>
* <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
* <td>DOCUMENT_NODE,
* DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
* <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
* <td><em>null</em></td>
* </tr>
* </tbody>
* </table>
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

View File

@ -2,7 +2,7 @@
<head>
<title>W3C IPR SOFTWARE NOTICE</title>
</head>
<body bgcolor="white">
<body>
<p>
Document Object Model Level 2 Traversal and Range is a
platform and language-neutral interfaces that allow programs
@ -20,14 +20,14 @@
<h1>
W3C IPR SOFTWARE NOTICE
</h1>
<h3>
<h2>
Copyright &copy; 2000 <a href="http://www.w3.org/">World Wide Web
Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
National de Recherche en Informatique et en Automatique</a>, <a
href="http://www.keio.ac.jp/">Keio University</a>). All Rights
Reserved.
</h3>
</h2>
<p>
The DOM bindings are published under the W3C Software Copyright Notice
and License. The software license requires "Notice of any changes or
@ -42,14 +42,14 @@
and License could be found at <a
href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
</p>
<h3>
<h2>
Copyright &copy; 1994-2000 <a href="http://www.w3.org/">World Wide Web
Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
National de Recherche en Informatique et en Automatique</a>, <a
href="http://www.keio.ac.jp/">Keio University</a>). All Rights
Reserved. http://www.w3.org/Consortium/Legal/
</h3>
</h2>
<p>
This W3C work (including software, documents, or other related items) is
being provided by the copyright holders under the following license. By

View File

@ -24,14 +24,18 @@ Currently defined standard feature URIs have the prefix
<em>setFeature</em>. Those standard identifiers are: </p>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr align="center" bgcolor="#ccccff">
<table class="striped">
<caption>SAX2 Standard Features </caption>
<thead>
<tr>
<th>Feature ID</th>
<th>Access</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>external-general-entities</td>
<td><em>read/write</em></td>
@ -208,7 +212,7 @@ Currently defined standard feature URIs have the prefix
Returns "false" if the parser supports only XML 1.0.
</td>
</tr>
</tbody>
</table>
<p> Support for the default values of the
@ -236,11 +240,15 @@ the standard property URIs have the prefix
<code>dom-node</code>. Manage those properties using
<em>setProperty()</em>. Those identifiers are: </p>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr align="center" bgcolor="#ccccff">
<table class="striped">
<caption>SAX2 Standard Properties </caption>
<thead>
<tr>
<th>Property ID</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>declaration-handler</td>
@ -287,7 +295,7 @@ the standard property URIs have the prefix
<td> Readable only during a parser callback, this exposes a <b>TBS</b>
chunk of characters responsible for the current event. </td>
</tr>
</tbody>
</table>
<p> All of these standard properties are optional;

View File

@ -422,3 +422,5 @@ e78da9db6299b3fcba49300d52e2359e82fdd218 jdk-9+168
ef9954f6896bb0b95ac62bf769f68b59a7a56ccd jdk-9+170
cbd65760a005766610583949b3b5c9ace92e74b3 jdk-10+7
f0adc10ed8316e6cf316e3208c5ecf6835d22bc4 jdk-10+8
b9409a7daa6c793dd631e52fe6ef79d08a3b337a jdk-10+9
29bbedd4cce8e14742bdb22118c057b877c02f0f jdk-9+171

View File

@ -116,11 +116,11 @@ caption {
margin-bottom:10px;
}
tr:nth-child(even) {
tr:nth-child(even), tr:nth-child(even) th[scope=row] {
background: #DDD;
}
tr:nth-child(odd) {
tr:nth-child(odd), tr:nth-child(odd) th[scope=row] {
background: #FFF;
}

View File

@ -31,18 +31,23 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.function.Predicate;
import java.util.stream.Stream;
import static java.util.stream.Collectors.*;
/**
* Build tool to generate the docs bundle index page.
@ -104,59 +109,33 @@ public class GenDocsBundlePage {
}
private static final String HEADER_TITLE = "@HEADER_TITLE@";
final Path outputfile;
final String title;
final Map<String, String> moduleGroups;
final Map<String, Set<ModuleDescriptor>> moduleGroups = new HashMap<>();
GenDocsBundlePage(String title, Path outputfile) throws IOException
{
this.outputfile = outputfile;
this.title = title;
this.moduleGroups = moduleGroups();
}
static Map<String, String> moduleGroups() throws IOException {
// read module groups
ModuleFinder finder = ModuleFinder.ofSystem();
Map<String, String> groups = new HashMap<>();
try (InputStream in = GenDocsBundlePage.class.getResourceAsStream(MODULE_GROUPS_PROPS)) {
Properties props = new Properties();
props.load(in);
for (String key: props.stringPropertyNames()) {
Set<String> mods = Stream.of(props.getProperty(key).split("\\s+"))
.filter(mn -> finder.find(mn).isPresent())
.map(String::trim)
.collect(Collectors.toSet());
Set<ModuleDescriptor> mods =
Stream.of(props.getProperty(key).split("\\s+"))
.map(String::trim)
.flatMap(mn -> finder.find(mn).stream())
.map(ModuleReference::descriptor)
.collect(toSet());
// divide into 3 columns: Java SE, JDK, JavaFX
StringBuilder sb = new StringBuilder();
sb.append(mods.stream()
.filter(mn -> mn.startsWith("java."))
.sorted()
.map(GenDocsBundlePage::toHRef)
.collect(Collectors.joining("\n")));
sb.append("</td>\n<td>")
.append(mods.stream()
.filter(mn -> mn.startsWith("jdk."))
.sorted()
.map(GenDocsBundlePage::toHRef)
.collect(Collectors.joining("\n")));
sb.append("</td>\n<td>");
if (mods.stream().anyMatch(mn -> mn.startsWith("javafx."))) {
sb.append(mods.stream()
.filter(mn -> mn.startsWith("javafx."))
.sorted()
.map(GenDocsBundlePage::toHRef)
.collect(Collectors.joining("\n")));
}
String name = "@" + key.toUpperCase(Locale.ENGLISH) + "@";
groups.put(name, sb.toString());
}
moduleGroups.put(name, mods);
};
}
return groups;
}
static String toHRef(String mn) {
return String.format("<a href=\"api/%s-summary.html\">%s</a><br>", mn, mn);
}
void run(BufferedReader reader) throws IOException {
@ -174,13 +153,95 @@ public class GenDocsBundlePage {
if (line.contains(HEADER_TITLE)) {
line = line.replace(HEADER_TITLE, title);
}
if (line.contains("@")) {
for (Map.Entry<String,String> e: moduleGroups.entrySet()) {
if (line.contains(e.getKey())) {
line = line.replace(e.getKey(), e.getValue());
}
int i = line.indexOf('@');
int j = line.indexOf('@', i+1);
if (i >= 0 && i < j) {
String name = line.substring(i, j+1);
if (moduleGroups.containsKey(name)) {
line = line.replace(name, formatModuleGroup(name));
}
}
return line;
}
String toHRef(ModuleDescriptor md) {
String mn = md.name();
String formattedName;
if (hasExportedAPIs(md)) {
// has exported APIs
formattedName = mn;
} else if (!md.provides().isEmpty()) {
// a provider
formattedName = "<i>" + mn + "</i>";
} else {
// a tool
formattedName = "<i>" + mn + "</i>";
}
return String.format("<a href=\"api/%s-summary.html\">%s</a>",
mn, formattedName);
}
String formatModuleGroup(String groupName) {
StringBuilder sb = new StringBuilder();
// organize in Java SE, JDK, JavaFX, JCP groups
Set<ModuleDescriptor> modules = moduleGroups.get(groupName);
Arrays.stream(ModuleGroup.values())
.forEach(g -> {
Set<ModuleDescriptor> mods = modules.stream()
.filter(md -> g.predicate.test(md.name()))
.collect(toSet());
if (!mods.isEmpty()) {
sb.append("<div class=" + g.cssClass + ">\n");
// modules with exported API
mods.stream()
.filter(this::hasExportedAPIs)
.sorted(Comparator.comparing(ModuleDescriptor::name))
.map(this::toHRef)
.forEach(m -> sb.append(m).append("\n"));
// tools and providers
mods.stream()
.filter(md -> !hasExportedAPIs(md))
.sorted(Comparator.comparing(ModuleDescriptor::name))
.map(this::toHRef)
.forEach(m -> sb.append(m).append("\n"));
sb.append("</div>");
}
});
return sb.toString();
}
private boolean hasExportedAPIs(ModuleDescriptor md) {
if (md.exports().stream().anyMatch(e -> !e.isQualified())) {
return true;
}
// this should check if any indirect exports
// checking requires transitive would be sufficient for JDK modules
if (md.requires().stream()
.map(ModuleDescriptor.Requires::modifiers)
.anyMatch(mods -> mods.contains(ModuleDescriptor.Requires.Modifier.TRANSITIVE))) {
return true;
}
return false;
}
private static final Set<String> NON_JAVA_SE_MODULES =
Set.of("java.jnlp", "java.smartcardio");
/**
* CSS class names are defined in docs-bundle-page.html
*/
enum ModuleGroup {
JAVA_SE("javase", mn -> mn.startsWith("java.") && !NON_JAVA_SE_MODULES.contains(mn)),
JDK("jdk", mn -> mn.startsWith("jdk.")),
JAVAFX("javafx", mn -> mn.startsWith("javafx.")),
NON_JAVA_SE("jcp", NON_JAVA_SE_MODULES::contains);
final String cssClass;
final Predicate<String> predicate;
ModuleGroup(String cssClass, Predicate<String> predicate) {
this.cssClass = cssClass;
this.predicate = predicate;
}
}
}

View File

@ -26,121 +26,146 @@ questions.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;" charset="utf-8">
<style type="text/css">
table {
border-collapse: collapse;
}
table {
border: 1px solid black;
}
th ,td {
border: 0px solid black;
}
thead th {
background-color: #DDD;
}
tbody > tr:nth-child(even) {
background-color: #EEE
}
tbody > tr:nth-child(odd) {
background-color: #FFF
}
th, td {
font-family: sans-serif; /* could eventually be DejaVu */
font-size: small;
padding: 5px 10px;
vertical-align:top;
}
td a {
text-decoration: none;
}
tr th {
text-align:left;
}
caption {
font-size: smaller;
font-weight: bold;
}
</style>
<title>@HEADER_TITLE@</title>
<meta http-equiv="content-type" content="text/html;" charset="utf-8">
<link rel="stylesheet" href="resources/jdk-default.css" type="text/css" />
<style type="text/css">
table a { text-decoration: none }
table { border: none }
th, td { border: 2px solid white; }
thead th { background-color: #DDD }
tbody th { background-color: #EEE }
table div.javase, ul.key span.javase { background-color: #C6E7F3 }
table div.jdk, ul.key span.jdk { background-color: #ECE1C5 }
table div.javafx, ul.key span.javafx { background-color: #ECEDCC }
table div.jcp, ul.key span.jcp { background-color: #E9E9E9 }
td div { padding: 3px 5px; color: blue }
table tbody td div a { padding: 0 .5em; margin: 0: 1em; }
table tbody td div a:link { color: black }
table tbody td div a:visited { color: black }
table tbody td div a[href]:hover { color: black; text-decoration: underline }
td { padding: 0 }
table tbody td div a { padding: 0 .5em; margin: 0: 1em }
.key { font-size: smaller; }
ul.key li { display:inline-block; padding: 0 1em }
ul.key span {
border: 1px solid black;
font-family: DejaVu Sans Mono, monospace;
}
ul.key span:before { content: " " }
ul.key span:after { content: " " }
caption {
text-align: center;
}
tr:nth-child(even), tr:nth-child(even) th[scope=row] {
background-color: #EEE;
}
tr:nth-child(odd), tr:nth-child(odd) th[scope=row] {
background-color: #EEE;
}
</style>
</head>
<body>
<h1>@HEADER_TITLE@</h1>
<ul>
<li><a href="api/index.html">JDK API Specification</a></li>
<li>Java Language Specification</li>
<li>Java Virtual Machine Specification</li>
<li><a href="https://docs.oracle.com/javase/specs/">
Java Language and Virtual Machine Specifications</a></li>
<li><a href="https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=tools_reference_overview">
Tools Reference</a></li>
</ul>
<table>
<caption>Modules</caption>
<caption style="display:none">JDK Modules</caption>
<thead>
<tr>
<th scope="col">Group</th>
<th scope="col">Java SE</th>
<th scope="col">JDK</th>
<th scope="col">JavaFX</th>
<th scope="col">Modules</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Foundation</th>
<td>@CORE_MODULES@</td>
<td>@JAVA_BASE@</td>
</tr>
<tr>
<th scope="row">Security</th>
<td>@SECURITY_MODULES@</td>
</tr>
<tr>
<th scope="row">Instrumentation and<br>Management</th>
<td>@INSTRUMENT_MGMT_MODULES@</td>
</tr>
<tr>
<th scope="row">Integration</th>
<th scope="row">Integration</th>
<td>@INTEGRATION_MODULES@</td>
</tr>
<tr>
<th scope="row">User Interface</th>
<td>@UI_TOOLKITS_MODULES@</td>
<td>@UI_MODULES@</td>
</tr>
<tr>
<th scope="row">Compiler and Scripting</th>
<td>@COMPILER_SCRIPTING_MODULES@</td>
<th scope="row">Compilation</th>
<td>@COMPILER_MODULES@</td>
</tr>
<tr>
<th scope="row">Debugging</th>
<td>@DEBUG_MODULES@</td>
<th scope="row">Scripting</th>
<td>@SCRIPTING_MODULES@</td>
</tr>
<tr>
<th scope="row">Tools and Tool APIs</th>
<td>@TOOL_MODULES@</td>
<th scope="row">Security</th>
<td>@SECURITY_MODULES@</td>
</tr>
<tr>
<th scope="row">Incubating Features</th>
<th scope="row">Management</th>
<td>@MANAGEMENT_MODULES@</td>
</tr>
<tr>
<th scope="row">Instrumentation</th>
<td>@INSTRUMENT_MODULES@</td>
</tr>
<tr>
<th scope="row">Serviceability</th>
<td>@SVC_MODULES@</td>
</tr>
<tr>
<th scope="row">Packaging</th>
<td>@PACKAGING_MODULES@</td>
</tr>
<tr>
<th scope="row">Incubator</th>
<td>@INCUBATOR_MODULES@</td>
</tr>
<tr>
<th scope="row">Non-Java SE</th>
<td>@OTHER_MODULES@</td>
</tr>
<tr>
<th scope="row">Java EE</th>
<td>@JAVA_EE_MODULES@</td>
</tr>
<tr>
<th scope="row"></th>
<th scope="row">Outside Java SE</th>
<th scope="row">JDK</th>
<th scope="row">JavaFX</th>
</tr>
<tr>
<th scope="row">Others</th>
<td>@OTHER_MODULES@</td>
<th scope="row">Aggregator</th>
<td>@AGGREGATOR_MODULES@</td>
</tr>
</tbody>
</table>
<p class="key">Key:
<ul class="key">
<li><span class="javase">&nbsp;</span>&nbsp; Java SE
<li><span class="jdk">&nbsp;</span>&nbsp; JDK
<li><span class="javafx">&nbsp;</span>&nbsp; JavaFX
<li><span class="jcp">&nbsp;</span>&nbsp; Non-Java SE
<li><i>italic</i> No Exported API (e.g. a tool or provider)</li>
</ul>
<p>
<hr/>
<a href="legal/cpyr.html">Copyright</a>&copy; 1993, 2017, Oracle and/or its affiliates. All rights reserved.</p>
<hr>
<a href="legal/cpyr.html">Copyright</a> &copy 1993, 2017, Oracle and/or its affiliates. All rights reserved.</p>
</body>
</html>

View File

@ -1,13 +1,8 @@
# Module Grouping for the docs bundle page
#
core_modules=\
java.base \
jdk.charsets \
jdk.localedata \
jdk.net \
jdk.sctp \
jdk.zipfs
java_base=\
java.base
java_ee_modules=\
java.activation \
@ -17,6 +12,10 @@ java.xml.bind \
java.xml.ws \
java.xml.ws.annotation
aggregator_modules=\
java.se \
java.se.ee
security_modules=\
java.security.jgss \
java.security.sasl \
@ -26,18 +25,22 @@ jdk.security.jgss \
jdk.crypto.cryptoki \
jdk.crypto.ec \
jdk.crypto.mscapi \
jdk.crypto.ucrypto
jdk.crypto.ucrypto \
jdk.policytool
instrument_mgmt_modules=\
java.instrument \
instrument_modules=\
java.instrument
management_modules=\
java.management \
java.management.rmi \
jdk.jfr \
jdk.management \
jdk.management.agent \
jdk.management.cmm \
jdk.management.jfr \
jdk.management.resource \
jdk.snmp \
jdk.jconsole
integration_modules=\
java.logging \
@ -47,11 +50,18 @@ java.rmi \
java.sql \
java.sql.rowset \
java.xml \
jdk.charsets \
jdk.localedata \
jdk.net \
jdk.sctp \
jdk.jsobject \
jdk.httpserver \
jdk.naming.dns \
jdk.naming.rmi
jdk.naming.rmi \
jdk.xml.dom \
jdk.zipfs
ui_toolkits_modules=\
ui_modules=\
java.datatransfer \
java.desktop \
javafx.base \
@ -63,39 +73,40 @@ javafx.swing \
javafx.web \
jdk.accessibility
other_modules=\
java.jnlp \
java.smartcardio \
jdk.jsobject \
jdk.xml.dom
debug_modules=\
jdk.jdi \
jdk.jdwp.agent
tool_modules=\
svc_modules=\
jdk.jfr \
jdk.attach \
jdk.editpad \
jdk.jartool \
jdk.javadoc \
jdk.jcmd \
jdk.jconsole \
jdk.jdeps \
jdk.jlink \
jdk.jshell \
jdk.jdi \
jdk.jdwp.agent \
jdk.jstatd \
jdk.hotspot.agent
packaging_modules=\
jdk.jartool \
jdk.jlink \
jdk.pack \
jdk.policytool \
jdk.packager.services \
jdk.packager.services
compiler_modules=\
java.compiler \
jdk.compiler \
jdk.javadoc \
jdk.jdeps \
jdk.editpad \
jdk.jshell \
jdk.rmic
compiler_scripting_modules=\
java.compiler \
scripting_modules=\
java.scripting \
jdk.compiler \
jdk.dynalink \
jdk.scripting.nashorn \
jdk.scripting.nashorn.shell
other_modules=\
java.jnlp \
java.smartcardio
incubator_modules=\
jdk.incubator.httpclient

View File

@ -56,7 +56,7 @@ public class ExtLink implements Taglet {
static final String TAG_NAME = "extLink";
static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=";
static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase9&amp;id=";
static final Pattern TAG_PATTERN = Pattern.compile("(\\s*)(?<name>\\w+)(\\s+)(?<desc>.*)");

View File

@ -421,10 +421,8 @@ int NET_ReadV(int s, const struct iovec * vector, int count) {
}
int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
struct sockaddr *from, int *fromlen) {
socklen_t socklen = *fromlen;
BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) );
*fromlen = socklen;
struct sockaddr *from, socklen_t *fromlen) {
BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) );
}
int NET_Send(int s, void *msg, int len, unsigned int flags) {
@ -440,10 +438,8 @@ int NET_SendTo(int s, const void *msg, int len, unsigned int
BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) );
}
int NET_Accept(int s, struct sockaddr *addr, int *addrlen) {
socklen_t socklen = *addrlen;
BLOCKING_IO_RETURN_INT( s, accept(s, addr, &socklen) );
*addrlen = socklen;
int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) {
BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) );
}
int NET_Connect(int s, struct sockaddr *addr, int addrlen) {

View File

@ -923,6 +923,12 @@ public class File
* java.nio.file.Files#readAttributes(Path,Class,LinkOption[])
* Files.readAttributes} method may be used.
*
* @apiNote
* While the unit of time of the return value is milliseconds,
* the granularity of the value depends on the underlying
* file system and may be larger. For example, some
* file systems use time stamps in units of seconds.
*
* @return A <code>long</code> value representing the time the file was
* last modified, measured in milliseconds since the epoch
* (00:00:00 GMT, January 1, 1970), or <code>0L</code> if the

View File

@ -137,6 +137,7 @@ import sun.security.jca.*;
* <li>{@code AES/CBC/PKCS5Padding} (128)</li>
* <li>{@code AES/ECB/NoPadding} (128)</li>
* <li>{@code AES/ECB/PKCS5Padding} (128)</li>
* <li>{@code AES/GCM/NoPadding} (128)</li>
* <li>{@code DES/CBC/NoPadding} (56)</li>
* <li>{@code DES/CBC/PKCS5Padding} (56)</li>
* <li>{@code DES/ECB/NoPadding} (56)</li>

View File

@ -363,10 +363,6 @@ public final class LauncherHelper {
static void initHelpMessage(String progname) {
outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.header",
(progname == null) ? "java" : progname ));
outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.datamodel",
32));
outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.datamodel",
64));
}
/**

View File

@ -34,7 +34,6 @@ java.launcher.opt.header = Usage: {0} [options] <mainclass> [args...]\n\
\ <module>/<mainclass> are passed as the arguments to main class.\n\n\
\ where options include:\n\n
java.launcher.opt.datamodel =\ -d{0}\t Deprecated, will be removed in a future release\n
java.launcher.opt.vmselect =\ {0}\t to select the "{1}" VM\n
java.launcher.opt.hotspot =\ {0}\t is a synonym for the "{1}" VM [deprecated]\n

View File

@ -456,6 +456,11 @@ jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
env++;
}
// Trailing space
if (*env == '\0') {
break;
}
arg = p;
while (*env != '\0' && !isspace(*env)) {
if (*env == '"' || *env == '\'') {

View File

@ -36,7 +36,7 @@
#define JNI_ERROR "Error: A JNI error has occurred, please check your installation and try again"
#define JNI_ERROR1 "Error: can't find JNI interfaces in: %s"
#define ARG_INFO_ENVVAR "NOTE: Picked up the following options via %s:\n %s"
#define ARG_INFO_ENVVAR "NOTE: Picked up %s: %s"
#define ARG_WARN "Warning: %s option is no longer supported."
#define ARG_ERROR1 "Error: %s requires class path specification"

View File

@ -229,12 +229,15 @@ Java_java_io_UnixFileSystem_getLastModifiedTime(JNIEnv *env, jobject this,
WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
struct stat64 sb;
if (stat64(path, &sb) == 0) {
#ifndef MACOSX
rv = (jlong)sb.st_mtim.tv_sec * 1000;
rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
#else
#if defined(_AIX)
rv = (jlong)sb.st_mtime * 1000;
rv += (jlong)sb.st_mtime_n / 1000000;
#elif defined(MACOSX)
rv = (jlong)sb.st_mtimespec.tv_sec * 1000;
rv += (jlong)sb.st_mtimespec.tv_nsec / 1000000;
#else
rv = (jlong)sb.st_mtim.tv_sec * 1000;
rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
#endif
}
} END_PLATFORM_STRING(env, path);
@ -419,14 +422,16 @@ Java_java_io_UnixFileSystem_setLastModifiedTime(JNIEnv *env, jobject this,
struct timeval tv[2];
/* Preserve access time */
#ifndef MACOSX
tv[0].tv_sec = sb.st_atim.tv_sec;
tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
#else
#if defined(_AIX)
tv[0].tv_sec = sb.st_atime;
tv[0].tv_usec = sb.st_atime_n / 1000;
#elif defined(MACOSX)
tv[0].tv_sec = sb.st_atimespec.tv_sec;
tv[0].tv_usec = sb.st_atimespec.tv_nsec / 1000;
#else
tv[0].tv_sec = sb.st_atim.tv_sec;
tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
#endif
/* Change last-modified time */
tv[1].tv_sec = time / 1000;
tv[1].tv_usec = (time % 1000) * 1000;

View File

@ -160,7 +160,7 @@ class KrbAsRep extends KrbKdcRep {
creds = new Credentials(
rep.ticket,
req.reqBody.cname,
rep.ticket.sname,
enc_part.sname,
enc_part.key,
enc_part.flags,
enc_part.authtime,

View File

@ -88,7 +88,7 @@ public class KrbTgsRep extends KrbKdcRep {
this.creds = new Credentials(rep.ticket,
rep.cname,
rep.ticket.sname,
enc_part.sname,
enc_part.key,
enc_part.flags,
enc_part.authtime,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -189,11 +189,6 @@ class AsyncSSLConnection extends HttpConnection
throw new UnsupportedOperationException("Not supported.");
}
@Override
protected int readImpl(ByteBuffer buffer) throws IOException {
throw new UnsupportedOperationException("Not supported.");
}
@Override
CompletableFuture<Void> whenReceivingResponse() {
throw new UnsupportedOperationException("Not supported.");

View File

@ -33,7 +33,6 @@ import java.net.SocketPermission;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLPermission;
import java.nio.ByteBuffer;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
@ -76,9 +75,6 @@ final class Exchange<T> {
boolean upgrading; // to HTTP/2
final PushGroup<?,T> pushGroup;
// buffer for receiving response headers
private volatile ByteBuffer rxBuffer;
Exchange(HttpRequestImpl request, MultiExchange<?,T> multi) {
this.request = request;
this.upgrading = false;
@ -121,17 +117,6 @@ final class Exchange<T> {
return client;
}
ByteBuffer getBuffer() {
if(rxBuffer == null) {
synchronized (this) {
if(rxBuffer == null) {
rxBuffer = Utils.getExchangeBuffer();
}
}
}
return rxBuffer;
}
public Response response() throws IOException, InterruptedException {
return responseImpl(null);
}

View File

@ -55,7 +55,7 @@ class Http1Exchange<T> extends ExchangeImpl<T> {
final HttpConnection connection;
final HttpClientImpl client;
final Executor executor;
final ByteBuffer buffer; // used for receiving
volatile ByteBuffer buffer; // used for receiving
@Override
public String toString() {
@ -74,7 +74,7 @@ class Http1Exchange<T> extends ExchangeImpl<T> {
this.client = exchange.client();
this.executor = exchange.executor();
this.operations = new LinkedList<>();
this.buffer = exchange.getBuffer();
this.buffer = Utils.EMPTY_BYTEBUFFER;
if (connection != null) {
this.connection = connection;
} else {
@ -157,7 +157,9 @@ class Http1Exchange<T> extends ExchangeImpl<T> {
try {
response = new Http1Response<>(connection, this);
response.readHeaders();
return response.response();
Response r = response.response();
buffer = response.getBuffer();
return r;
} catch (Throwable t) {
connection.close();
throw t;
@ -213,7 +215,9 @@ class Http1Exchange<T> extends ExchangeImpl<T> {
return MinimalFuture.supply( () -> {
response = new Http1Response<>(connection, Http1Exchange.this);
response.readHeaders();
return response.response();
Response r = response.response();
buffer = response.getBuffer();
return r;
}, executor);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ class Http1Response<T> {
private final HttpConnection connection;
private ResponseHeaders headers;
private int responseCode;
private final ByteBuffer buffer; // same buffer used for reading status line and headers
private ByteBuffer buffer;
private final Http1Exchange<T> exchange;
private final boolean redirecting; // redirecting
private boolean return2Cache; // return connection to cache when finished
@ -96,6 +96,10 @@ class Http1Response<T> {
return finished;
}
ByteBuffer getBuffer() {
return buffer;
}
int fixupContentLen(int clen) {
if (request.method().equalsIgnoreCase("HEAD")) {
return 0;
@ -194,12 +198,15 @@ class Http1Response<T> {
static final char CR = '\r';
static final char LF = '\n';
private int getBuffer() throws IOException {
private int obtainBuffer() throws IOException {
int n = buffer.remaining();
if (n == 0) {
buffer.clear();
return connection.read(buffer);
buffer = connection.read();
if (buffer == null) {
return -1;
}
n = buffer.remaining();
}
return n;
}
@ -207,18 +214,17 @@ class Http1Response<T> {
String readStatusLine() throws IOException {
boolean cr = false;
StringBuilder statusLine = new StringBuilder(128);
ByteBuffer b = buffer;
while (getBuffer() != -1) {
byte[] buf = b.array();
int offset = b.position();
int len = b.limit() - offset;
while ((obtainBuffer()) != -1) {
byte[] buf = buffer.array();
int offset = buffer.position();
int len = buffer.limit() - offset;
for (int i = 0; i < len; i++) {
char c = (char) buf[i+offset];
if (cr) {
if (c == LF) {
b.position(i + 1 + offset);
buffer.position(i + 1 + offset);
return statusLine.toString();
} else {
throw new IOException("invalid status line");
@ -231,7 +237,7 @@ class Http1Response<T> {
}
}
// unlikely, but possible, that multiple reads required
b.position(b.limit());
buffer.position(buffer.limit());
}
return null;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -323,12 +323,9 @@ abstract class HttpConnection implements Closeable {
}
}
final int read(ByteBuffer buffer) throws IOException {
return readImpl(buffer);
}
final ByteBuffer read() throws IOException {
return readImpl();
ByteBuffer b = readImpl();
return b;
}
/*
@ -337,9 +334,6 @@ abstract class HttpConnection implements Closeable {
*/
protected abstract ByteBuffer readImpl() throws IOException;
/** Reads as much as possible into given buffer and returns amount read. */
protected abstract int readImpl(ByteBuffer buffer) throws IOException;
@Override
public String toString() {
return "HttpConnection: " + channel().toString();

View File

@ -311,8 +311,7 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection {
}
}
@Override
protected int readImpl(ByteBuffer buf) throws IOException {
private int readImpl(ByteBuffer buf) throws IOException {
int mark = buf.position();
int n;
// FIXME: this hack works in conjunction with the corresponding change

View File

@ -156,11 +156,6 @@ class PlainTunnelingConnection extends HttpConnection {
return delegate.readImpl();
}
@Override
protected int readImpl(ByteBuffer buffer) throws IOException {
return delegate.readImpl(buffer);
}
@Override
boolean isSecure() {
return false;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -148,11 +148,7 @@ class ResponseContent {
// make sure we have at least 1 byte to look at
private void getHunk() throws IOException {
if (chunkbuf == null || !chunkbuf.hasRemaining()) {
if (chunkbuf == null) {
chunkbuf = Utils.getBuffer();
}
chunkbuf.clear();
connection.read(chunkbuf);
chunkbuf = connection.read();
}
}
@ -256,7 +252,6 @@ class ResponseContent {
private void pushBodyFixed(ByteBuffer b) throws IOException {
int remaining = contentLength;
//lastBufferUsed = b;
while (b.hasRemaining() && remaining > 0) {
ByteBuffer buffer = Utils.getBuffer();
int amount = Math.min(b.remaining(), remaining);
@ -265,22 +260,14 @@ class ResponseContent {
buffer.flip();
dataConsumer.accept(Optional.of(buffer));
}
//client.returnBuffer(b);
while (remaining > 0) {
ByteBuffer buffer = Utils.getBuffer();
int xx = connection.read(buffer);
if (xx == -1)
ByteBuffer buffer = connection.read();
if (buffer == null)
throw new IOException("connection closed");
int bytesread = buffer.remaining();
// assume for now that pipelining not implemented
if (bytesread > remaining) {
System.err.println("xx = " + xx);
System.err.println("bytesread = " + bytesread);
System.err.println("remaining = " + remaining);
for (int i=0; i<remaining; i++) {
System.err.printf("%x ", buffer.get());
}
throw new IOException("too many bytes read");
}
remaining -= bytesread;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -72,7 +72,7 @@ final class ResponseHeaders implements HttpHeaders {
static final class InputStreamWrapper extends InputStream {
final HttpConnection connection;
final ByteBuffer buffer;
ByteBuffer buffer;
int lastRead = -1; // last byte read from the buffer
int consumed = 0; // number of bytes consumed.
InputStreamWrapper(HttpConnection connection, ByteBuffer buffer) {
@ -83,9 +83,8 @@ final class ResponseHeaders implements HttpHeaders {
@Override
public int read() throws IOException {
if (!buffer.hasRemaining()) {
buffer.clear();
int n = connection.read(buffer);
if (n == -1) {
buffer = connection.read();
if (buffer == null) {
return lastRead = -1;
}
}
@ -97,6 +96,16 @@ final class ResponseHeaders implements HttpHeaders {
}
}
private static void display(Map<String, List<String>> map) {
map.forEach((k,v) -> {
System.out.print (k + ": ");
for (String val : v) {
System.out.print(val + ", ");
}
System.out.println("");
});
}
private Map<String, List<String>> parse(InputStreamWrapper input)
throws IOException
{
@ -114,7 +123,6 @@ final class ResponseHeaders implements HttpHeaders {
// finds is CR. This only happens if there are no headers, and
// only one byte will be consumed from the buffer. In this case
// the next byte MUST be LF
//System.err.println("Last character read is: " + (byte)lastRead);
if (input.read() != LF) {
throw new IOException("Unexpected byte sequence when no headers: "
+ ((int)CR) + " " + input.lastRead

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -162,10 +162,11 @@ class SSLConnection extends HttpConnection {
@Override
protected ByteBuffer readImpl() throws IOException {
ByteBuffer dst = ByteBuffer.allocate(8192);
int n = readImpl(dst);
WrapperResult r = sslDelegate.recvData(ByteBuffer.allocate(8192));
// TODO: check for closure
int n = r.result.bytesProduced();
if (n > 0) {
return dst;
return r.buf;
} else if (n == 0) {
return Utils.EMPTY_BYTEBUFFER;
} else {
@ -173,19 +174,6 @@ class SSLConnection extends HttpConnection {
}
}
@Override
protected int readImpl(ByteBuffer buf) throws IOException {
// TODO: need to ensure that buf is big enough for application data
WrapperResult r = sslDelegate.recvData(buf);
// TODO: check for closure
String s = "Receive) ";
//debugPrint(s, r.buf);
if (r.result.bytesProduced() > 0) {
assert buf == r.buf;
}
return r.result.bytesProduced();
}
@Override
boolean connected() {
return delegate.connected();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -104,9 +104,7 @@ class SSLDelegate {
}
SSLEngineResult result;
/* if passed in buffer was not big enough then the a reallocated buffer
* is returned here */
ByteBuffer buf;
ByteBuffer buf; // buffer containing result data
}
int app_buf_size;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -164,19 +164,10 @@ class SSLTunnelConnection extends HttpConnection {
@Override
protected ByteBuffer readImpl() throws IOException {
return sslDelegate.recvData(Utils.EMPTY_BYTEBUFFER).buf; // fix this, make the read normal
}
ByteBuffer buf = Utils.getBuffer();
@Override
protected int readImpl(ByteBuffer buf) throws IOException {
WrapperResult r = sslDelegate.recvData(buf);
// TODO: check for closure
String s = "Receive) ";
//debugPrint(s, r.buf);
if (r.result.bytesProduced() > 0) {
assert buf == r.buf;
}
return r.result.bytesProduced();
return r.buf;
}
@Override

View File

@ -258,8 +258,6 @@ tools/jimage/JImageExtractTest.java 8170120 generic-
tools/jimage/JImageListTest.java 8170120 generic-all
tools/jimage/JImageVerifyTest.java 8170120 generic-all
tools/jar/multiRelease/RuntimeTest.java 8173905 generic-all
tools/schemagen/MultiReleaseJarTest.java 8174692 generic-all
tools/wsgen/MultiReleaseJarTest.java 8174692 generic-all

View File

@ -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
@ -25,7 +25,7 @@
* @test
* @bug 7130985
* @summary Four helper classes missing in Sun JDK
* @library /lib/testlibrary
* @library /lib/testlibrary /test/lib
* @build jdk.testlibrary.*
* @modules java.corba
* @run main CorbaExceptionsCompileTest
@ -35,12 +35,12 @@ import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.rmi.RemoteException;
import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.TypeCodePackage.Bounds;
import jdk.testlibrary.FileUtils;
import jdk.test.lib.util.FileUtils;
import jdk.testlibrary.JDKToolLauncher;
public class CorbaExceptionsCompileTest implements CorbaExceptionsTest {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2015, 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
@ -20,20 +20,22 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8048604
* @library ../ /lib/testlibrary
* @library ../ /test/lib
* @summary This test verifies the assertion "There should be no transformation
* on the plaintext/ciphertext in encryption/decryption mechanism" for
* feature "NullCipher".
* on the plaintext/ciphertext in encryption/decryption mechanism" for
* feature "NullCipher".
*/
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NullCipher;
import javax.crypto.ShortBufferException;
import jdk.testlibrary.RandomFactory;
import jdk.test.lib.RandomFactory;
public class CipherNCFuncTest {
public static void main(String[] args) throws ShortBufferException,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,22 +21,27 @@
* questions.
*/
/*
* @bug 4413434
* @summary Verify that class loaded outside of application class loader is
* correctly resolved during deserialization when read in by custom
* readObject() method of a bootstrap class (in this case,
* java.util.Vector).
/* @test
* @bug 4138064
* @build SecurityTest
* @run main/othervm/policy=java.policy SecurityTest
*/
import java.io.*;
import java.net.*;
import java.io.File;
public class SecurityTest {
public class Test {
public static void main(String[] args) throws Exception {
ClassLoader ldr =
new URLClassLoader(new URL[]{ new URL("file:cb.jar") });
Runnable r = (Runnable) Class.forName("Foo", true, ldr).newInstance();
r.run();
try {
File f = File.createTempFile("foo", null);
} catch (java.security.AccessControlException x) {
throw x;
} catch (SecurityException x) {
if (x.getMessage().equals("Unable to create temporary file")) {
return;
}
throw x;
}
throw new Exception("SecurityException not thrown");
}
}

View File

@ -0,0 +1,2 @@
grant {
};

View File

@ -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
@ -27,13 +27,12 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Random;
import jdk.testlibrary.RandomFactory;
import jdk.test.lib.RandomFactory;
/*
* @test
* @bug 8080835
* @library /lib/testlibrary
* @build jdk.testlibrary.*
* @library /test/lib
* @run main ReadAllBytes
* @summary Basic test for InputStream.readAllBytes
* @key randomness

View File

@ -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
@ -27,13 +27,12 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Random;
import jdk.testlibrary.RandomFactory;
import jdk.test.lib.RandomFactory;
/*
* @test
* @bug 8080835
* @library /lib/testlibrary
* @build jdk.testlibrary.*
* @library /test/lib
* @run main ReadNBytes
* @summary Basic test for InputStream.readNBytes
* @key randomness

View File

@ -1,33 +0,0 @@
#
# Copyright (c) 1998, 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.
#
#
# @bug 4088176
# @summary Test reading an evolved class serialization into the original class
rm *.class tmp.ser
javac WriteAddedField.java
java ${TESTVMOPTS} WriteAddedField
rm *.class
javac ReadAddedField.java
java ${TESTVMOPTS} ReadAddedField

View File

@ -0,0 +1,107 @@
/*
* 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 4087295 4785472
* @library /test/lib
* @build jdk.test.lib.compiler.CompilerUtils
* @build jdk.test.lib.process.ProcessTools
* @build RenamePackageTest
* @run main RenamePackageTest
* @summary Enable resolveClass() to accommodate package renaming.
* This fix enables one to implement a resolveClass method that maps a
* Serialiazable class within a serialization stream to the same class
* in a different package within the JVM runtime. See run shell script
* for instructions on how to run this test.
*/
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import jdk.test.lib.compiler.CompilerUtils;
import jdk.test.lib.process.ProcessTools;
public class RenamePackageTest {
public static void main(String args[]) throws Exception {
setup();
runTestSerialDriver();
runInstallSerialDriver();
runInstallSerialDriver();
runTestSerialDriver();
}
private static final Path SHARE = Paths.get(System.getProperty("test.classes"), "share");
private static final Path OCLASSES = Paths.get(System.getProperty("test.classes"), "oclasses");
private static final Path NCLASSES = Paths.get(System.getProperty("test.classes"), "nclasses");
private static void setup() throws Exception {
boolean b = CompilerUtils.compile(Paths.get(System.getProperty("test.src"), "extension"),
SHARE);
assertTrue(b);
b = CompilerUtils.compile(Paths.get(System.getProperty("test.src"), "test"),
OCLASSES,
"-classpath",
SHARE.toString());
assertTrue(b);
b = CompilerUtils.compile(Paths.get(System.getProperty("test.src"), "install"),
NCLASSES,
"-classpath",
SHARE.toString());
assertTrue(b);
}
private static void runTestSerialDriver() throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
"-classpath",
SHARE.toString()
+ File.pathSeparator
+ OCLASSES.toString(),
"test.SerialDriver", "-s");
Process p = ProcessTools.startProcess("test SerialDriver", pb);
p.waitFor();
assertTrue(p.exitValue() == 0);
}
private static void runInstallSerialDriver() throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
"-classpath",
SHARE.toString()
+ File.pathSeparator
+ NCLASSES.toString(),
"install.SerialDriver", "-d");
Process p = ProcessTools.startProcess("install SerialDriver", pb);
p.waitFor();
assertTrue(p.exitValue() == 0);
}
private static void assertTrue(boolean b) {
if (!b) {
throw new RuntimeException("expected true, get false");
}
}
}

View File

@ -1,105 +0,0 @@
#
# Copyright (c) 1998, 2013, 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 4087295 4785472
# @summary Enable resolveClass() to accommodate package renaming.
# This fix enables one to implement a resolveClass method that maps a
# Serialiazable class within a serialization stream to the same class
# in a different package within the JVM runtime. See run shell script
# for instructions on how to run this test.
if [ "${TESTJAVA}" = "" ]
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
if [ "${COMPILEJAVA}" = "" ] ; then
COMPILEJAVA="${TESTJAVA}"
fi
OS=`uname -s`
# Need to determine the classpath separator and filepath separator based on the
# operating system.
case "$OS" in
SunOS | Linux | Darwin | AIX )
PS=":" ;;
Windows* | CYGWIN* )
PS=";" ;;
* )
echo "Unrecognized system!"
exit 1 ;;
esac
JAVA=${TESTJAVA}/bin/java
JAVAC=${COMPILEJAVA}/bin/javac
MKDIR=mkdir
RDEL="rm -r"
if [ -d ${TESTCLASSES}/oclasses ]
then
${RDEL} ${TESTCLASSES}/oclasses
fi
if [ -d ${TESTCLASSES}/nclasses ]
then
${RDEL} ${TESTCLASSES}/nclasses
fi
if [ -d ${TESTCLASSES}/share ]
then
${RDEL} ${TESTCLASSES}/share
fi
if [ -f ${TESTCLASSES}/stream.ser ]
then
${RDEL} ${TESTCLASSES}/stream.ser
fi
mkdir ${TESTCLASSES}/oclasses
mkdir ${TESTCLASSES}/share
mkdir ${TESTCLASSES}/nclasses
# Build sources
set -e
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/share \
${TESTSRC}/extension/ExtendedObjectInputStream.java
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/oclasses \
${TESTSRC}/test/SerialDriver.java
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/nclasses \
${TESTSRC}/install/SerialDriver.java
# Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
${JAVA} ${TESTVMOPTS} test.SerialDriver -s
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
${JAVA} ${TESTVMOPTS} install.SerialDriver -d
rm stream.ser
# Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
${JAVA} ${TESTVMOPTS} install.SerialDriver -s
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
${JAVA} ${TESTVMOPTS} test.SerialDriver -d

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,8 +26,7 @@
* @bug 8071474
* @summary Better failure atomicity for default read object.
* @modules jdk.compiler
* @library /lib/testlibrary
* @build jdk.testlibrary.FileUtils
* @library /test/lib
* @compile FailureAtomicity.java SerialRef.java
* @run main failureAtomicity.FailureAtomicity
*/
@ -59,7 +58,7 @@ import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
import jdk.testlibrary.FileUtils;
import jdk.test.lib.util.FileUtils;
@SuppressWarnings("unchecked")
public class FailureAtomicity {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 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
@ -22,19 +22,31 @@
*/
/*
* @test
* @bug 4897937
* @run main MaskSyntheticModifierTest
* @summary Verify that the presence of the JVM_ACC_SYNTHETIC bit in the
* modifiers of fields and methods does not affect default
* serialVersionUID calculation.
*/
import java.io.ObjectStreamClass;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
public class MaskSyntheticModifierTest {
public static void main(String[] args) throws Exception {
setup();
public class Test {
public static void main(String[] args) {
long suid = ObjectStreamClass.lookup(Foo.class).getSerialVersionUID();
if (suid != 8027844768744011556L) {
throw new Error("incorrect serialVersionUID: " + suid);
}
}
private static void setup() throws Exception {
Files.copy(Paths.get(System.getProperty("test.src"), "Foo.class"),
Paths.get("Foo.class"), StandardCopyOption.REPLACE_EXISTING);
}
}

View File

@ -1,49 +0,0 @@
#
# Copyright (c) 2003, 2013, 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 4897937
# @summary Verify that the presence of the JVM_ACC_SYNTHETIC bit in the
# modifiers of fields and methods does not affect default
# serialVersionUID calculation.
if [ "${TESTJAVA}" = "" ]
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
if [ "${COMPILEJAVA}" = "" ] ; then
COMPILEJAVA="${TESTJAVA}"
fi
if [ "${TESTSRC}" = "" ]
then
TESTSRC="."
fi
set -ex
cp ${TESTSRC}/Foo.class .
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Test.java
${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -22,41 +22,59 @@
*/
/*
* @test
* @bug 4765255
* @library /lib/testlibrary
* @build JarUtils A B C D PackageAccessTest
* @run main PackageAccessTest
* @summary Verify proper functioning of package equality checks used to
* determine accessibility of superclass constructor and inherited
* writeReplace/readResolve methods.
*/
import java.io.*;
import java.net.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
import java.io.InvalidClassException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Test {
public class PackageAccessTest {
static Class bcl;
static Class dcl;
public static void main(String[] args) throws Exception {
ClassLoader ldr =
setup();
try (URLClassLoader ldr =
new URLClassLoader(new URL[]{ new URL("file:foo.jar") },
Test.class.getClassLoader());
bcl = Class.forName("B", true, ldr);
dcl = Class.forName("D", true, ldr);
PackageAccessTest.class.getClassLoader())) {
bcl = Class.forName("B", true, ldr);
dcl = Class.forName("D", true, ldr);
Object b = bcl.newInstance();
try {
swizzle(b);
throw new Error("expected InvalidClassException for class B");
} catch (InvalidClassException e) {
System.out.println("caught " + e);
e.printStackTrace();
}
if (A.packagePrivateConstructorInvoked) {
throw new Error("package private constructor of A invoked");
}
Object b = bcl.newInstance();
try {
swizzle(b);
throw new Error("expected InvalidClassException for class B");
} catch (InvalidClassException e) {
System.out.println("caught " + e);
e.printStackTrace();
}
if (A.packagePrivateConstructorInvoked) {
throw new Error("package private constructor of A invoked");
}
Object d = dcl.newInstance();
swizzle(d);
Object d = dcl.newInstance();
swizzle(d);
}
}
static void swizzle(Object obj) throws Exception {
@ -68,6 +86,14 @@ public class Test {
new ByteArrayInputStream(bout.toByteArray());
new TestObjectInputStream(bin).readObject();
}
static void setup() throws Exception {
Path classes = Paths.get(System.getProperty("test.classes", ""));
JarUtils.createJarFile(Paths.get("foo.jar"), classes,
classes.resolve("B.class"), classes.resolve("D.class"));
Files.delete(classes.resolve("B.class"));
Files.delete(classes.resolve("D.class"));
}
}
class TestObjectInputStream extends ObjectInputStream {
@ -80,9 +106,9 @@ class TestObjectInputStream extends ObjectInputStream {
{
String n = desc.getName();
if (n.equals("B")) {
return Test.bcl;
return PackageAccessTest.bcl;
} else if (n.equals("D")) {
return Test.dcl;
return PackageAccessTest.dcl;
} else {
return super.resolveClass(desc);
}

View File

@ -1,54 +0,0 @@
#
# Copyright (c) 2002, 2013, 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 4765255
# @summary Verify proper functioning of package equality checks used to
# determine accessibility of superclass constructor and inherited
# writeReplace/readResolve methods.
if [ "${TESTJAVA}" = "" ]
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
if [ "${COMPILEJAVA}" = "" ] ; then
COMPILEJAVA="${TESTJAVA}"
fi
if [ "${TESTSRC}" = "" ]
then
TESTSRC="."
fi
set -ex
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
${TESTSRC}/A.java ${TESTSRC}/B.java ${TESTSRC}/C.java ${TESTSRC}/D.java \
${TESTSRC}/Test.java
${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf foo.jar B.class D.class
rm -f B.class D.class
${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class *.jar

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 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
@ -22,21 +22,30 @@
*/
/*
* @test
* @bug 4413434
* @library /lib/testlibrary
* @build JarUtils SetupJar Boot
* @run driver SetupJar
* @run main/othervm -Xbootclasspath/a:boot.jar ConsTest
* @summary Verify that generated java.lang.reflect implementation classes do
* not interfere with serialization's class resolution mechanism.
*/
import java.io.*;
import java.lang.reflect.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Constructor;
public class Test implements Serializable {
public class ConsTest implements Serializable {
public static void main(String[] args) throws Exception {
Constructor cons = Boot.class.getConstructor(
new Class[] { ObjectInputStream.class });
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream oout = new ObjectOutputStream(bout);
oout.writeObject(new Test());
oout.writeObject(new ConsTest());
oout.close();
for (int i = 0; i < 100; i++) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,13 +21,14 @@
* questions.
*/
package testpackage;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Helper {
public class SetupJar {
private static final int HELPER_VERSION = 8;
public static int getHelperVersion() {
return HELPER_VERSION;
public static void main(String args[]) throws Exception {
Path classes = Paths.get(System.getProperty("test.classes", ""));
JarUtils.createJarFile(Paths.get("boot.jar"), classes,
classes.resolve("Boot.class"));
}
}

View File

@ -1,53 +0,0 @@
#
# Copyright (c) 2001, 2013, 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 4413434
# @summary Verify that generated java.lang.reflect implementation classes do
# not interfere with serialization's class resolution mechanism.
if [ "${TESTJAVA}" = "" ]
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
if [ "${COMPILEJAVA}" = "" ] ; then
COMPILEJAVA="${TESTJAVA}"
fi
if [ "${TESTSRC}" = "" ]
then
TESTSRC="."
fi
set -ex
rm -f *.class *.jar
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Boot.java
${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf boot.jar *.class
rm -f *.class
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath boot.jar -d . \
${TESTSRC}/Test.java
${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbootclasspath/a:boot.jar Test
rm -f *.class *.jar

View File

@ -0,0 +1,59 @@
/*
* 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
* 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 4413434
* @library /lib/testlibrary
* @build JarUtils Foo
* @run main DeserializeButtonTest
* @summary Verify that class loaded outside of application class loader is
* correctly resolved during deserialization when read in by custom
* readObject() method of a bootstrap class (in this case,
* java.util.Vector).
*/
import java.net.URLClassLoader;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
public class DeserializeButtonTest {
public static void main(String[] args) throws Exception {
setup();
try (URLClassLoader ldr =
new URLClassLoader(new URL[]{ new URL("file:cb.jar") })) {
Runnable r = (Runnable) Class.forName("Foo", true, ldr).newInstance();
r.run();
}
}
private static void setup() throws Exception {
Path classes = Paths.get(System.getProperty("test.classes", ""));
JarUtils.createJarFile(Paths.get("cb.jar"),
classes,
classes.resolve("Foo.class"),
classes.resolve("Foo$TestElement.class"));
}
}

View File

@ -1,54 +0,0 @@
#
# Copyright (c) 2001, 2013, 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 4413434
# @summary Verify that class loaded outside of application class loader is
# correctly resolved during deserialization when read in by custom
# readObject() method of a bootstrap class (in this case,
# java.util.Vector).
if [ "${TESTJAVA}" = "" ]
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
if [ "${COMPILEJAVA}" = "" ] ; then
COMPILEJAVA="${TESTJAVA}"
fi
if [ "${TESTSRC}" = "" ]
then
TESTSRC="."
fi
set -ex
rm -f *.class *.jar
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Foo.java
${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf cb.jar *.class
rm -f *.class
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Test.java
${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class *.jar

View File

@ -0,0 +1,59 @@
/*
* 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
* 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 4035147 4785472
* @library /test/lib
* @build jdk.test.lib.JDKToolLauncher
* @build jdk.test.lib.process.ProcessTools
* @build ClasspathTest
* @run main serialver.ClasspathTest
* @summary Test the use of the -classpath switch in the serialver application.
*/
package serialver;
import java.io.File;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.ProcessTools;
public class ClasspathTest implements java.io.Serializable {
int a;
int b;
public static void main(String args[]) throws Exception {
JDKToolLauncher serialver =
JDKToolLauncher.create("serialver")
.addToolArg("-classpath")
.addToolArg(System.getProperty("test.class.path"))
.addToolArg("serialver.ClasspathTest");
Process p = ProcessTools.startProcess("serialver",
new ProcessBuilder(serialver.getCommand()));
p.waitFor();
if (p.exitValue() != 0) {
throw new RuntimeException("error occurs in serialver");
}
}
}

View File

@ -1,64 +0,0 @@
#
# Copyright (c) 2000, 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 4035147 4785472
# @summary Test the use of the -classpath switch in the serialver application.
# @author Naveen Sanjeeva
#
# @build Test
# @run shell run.sh
# set a few environment variables so that the shell-script can run stand-alone
# in the source directory
if [ "${TESTSRC}" = "" ] ; then
TESTSRC="."
fi
if [ "${TESTCLASSES}" = "" ] ; then
TESTCLASSES="."
fi
if [ "${TESTJAVA}" = "" ] ; then
echo "TESTJAVA not set. Test cannot execute."
echo "FAILED!!!"
exit 1
fi
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
SunOS | Linux | Darwin | AIX )
PS=":" ;;
Windows* | CYGWIN* )
PS=";" ;;
* )
echo "Unrecognized system!"
exit 1 ;;
esac
# the test code
echo "Using the classpath .${PS}${TESTCLASSES}"
${TESTJAVA}/bin/serialver -classpath ".${PS}${TESTCLASSES}" serialver.Test
exit $?

View File

@ -0,0 +1,63 @@
/*
* 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
* 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 4312217 4785473
* @library /test/lib
* @build jdk.test.lib.JDKToolLauncher
* @build jdk.test.lib.process.ProcessTools
* @build NestedTest
* @run main serialver.NestedTest
* @summary To test the use of nested class specification using the '.'
* notation instead of the '$' notation.
*/
package serialver;
import java.io.Serializable;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.ProcessTools;
public class NestedTest implements Serializable {
public static class Test1 implements Serializable {
public static class Test2 implements Serializable{
private static final long serialVersionUID = 100L;
}
}
public static void main(String args[]) throws Exception {
JDKToolLauncher serialver =
JDKToolLauncher.create("serialver")
.addToolArg("-classpath")
.addToolArg(System.getProperty("test.class.path"))
.addToolArg("serialver.NestedTest.Test1.Test2");
Process p = ProcessTools.startProcess("serialver",
new ProcessBuilder(serialver.getCommand()));
p.waitFor();
if (p.exitValue() != 0) {
throw new RuntimeException("error occurs in serialver.");
}
}
}

View File

@ -1,64 +0,0 @@
#
# Copyright (c) 2000, 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 4312217 4785473
# @summary Test the use of the -classpath switch in the serialver application.
# @author Naveen Sanjeeva
#
# @build Test
# @run shell run.sh
# set a few environment variables so that the shell-script can run stand-alone
# in the source directory
if [ "${TESTSRC}" = "" ] ; then
TESTSRC="."
fi
if [ "${TESTCLASSES}" = "" ] ; then
TESTCLASSES="."
fi
if [ "${TESTJAVA}" = "" ] ; then
echo "TESTJAVA not set. Test cannot execute."
echo "FAILED!!!"
exit 1
fi
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
SunOS | Linux | Darwin | AIX )
PS=":" ;;
Windows* | CYGWIN* )
PS=";" ;;
* )
echo "Unrecognized system!"
exit 1 ;;
esac
# the test code
echo "Using the classpath .${PS}${TESTCLASSES}"
${TESTJAVA}/bin/serialver -classpath ".${PS}${TESTCLASSES}" 'serialver.Test.Test1.Test2'
exit $?

View File

@ -2,7 +2,6 @@ grant {
// "standard" properies that can be read by anyone
permission java.io.FilePermission "-","read,write,execute";
permission java.io.SerializablePermission "enableSubstitution";
permission java.io.SerializablePermission "enableSubclassImplementation";
// Needed to get access to private writeObjectMethod and
// to be able to call it.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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,23 +26,32 @@
* @bug 4100915
* @summary Verify that [write/read]ObjectOverride methods get called.
* Test verifies that ALL methods to write an object can
* be overridden. Howver, the testing for reading an object
* be overridden. However, the testing for reading an object
* is incomplete. Only test that readObjectOverride is called.
* An entire protocol would need to be implemented and written
* out before being able to test the input side of the API.
*
* Also, would be appropriate that this program verify
* that if SerializablePermission "enableSubclassImplamentation"
* that if SerializablePermission "enableSubclassImplementation"
* is not in the security policy and security is enabled, that
* a security excepiton is thrown when constructing the
* a security exception is thrown when constructing the
* ObjectOutputStream subclass.
*
*
* @compile AbstractObjectInputStream.java AbstractObjectOutputStream.java XObjectInputStream.java XObjectOutputStream.java Test.java
* @run main Test
* @compile AbstractObjectInputStream.java AbstractObjectOutputStream.java
* @compile XObjectInputStream.java XObjectOutputStream.java
* @compile SubclassTest.java
* @run main SubclassTest
* @run main/othervm/policy=Allow.policy SubclassTest -expectSecurityException
*/
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.io.Serializable;
/**
* Test if customized readObject and writeObject are called.
@ -111,7 +120,7 @@ class A implements Serializable {
}
};
public class Test {
public class SubclassTest {
public static void main(String argv[])
throws IOException, ClassNotFoundException
{
@ -129,10 +138,11 @@ public class Test {
throw new Error("Assertion failure. " +
"Expected a security exception on previous line.");
} catch (SecurityException e) {
if (expectSecurityException)
if (expectSecurityException) {
System.err.println("Caught expected security exception.");
return;
else
throw e;
}
throw e;
}
os.writeObject(new A());
os.close();

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