This commit is contained in:
Lana Steuck 2008-08-05 17:44:17 -07:00
commit bd39fefcf9
180 changed files with 2240 additions and 2957 deletions

View file

@ -5,3 +5,4 @@ bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25
18dc4ba4739a537fd146f77da51db16efce28da2 jdk7-b28 18dc4ba4739a537fd146f77da51db16efce28da2 jdk7-b28
bfe4572fd301a6fcd120373cdb2eff5d2da0c72c jdk7-b29 bfe4572fd301a6fcd120373cdb2eff5d2da0c72c jdk7-b29
bee4731164a06ddece1297ae58db24aca6a1c626 jdk7-b30 bee4731164a06ddece1297ae58db24aca6a1c626 jdk7-b30
cd8b8f500face60d1566d850857a7fccadbd383a jdk7-b31

View file

@ -5,3 +5,4 @@ cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25
56652b46f328937f6b9b5130f1e4cd80f48868ef jdk7-b28 56652b46f328937f6b9b5130f1e4cd80f48868ef jdk7-b28
31e08f70e88d77c2053f91c21b49a04296bdc59a jdk7-b29 31e08f70e88d77c2053f91c21b49a04296bdc59a jdk7-b29
2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30 2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30
3300a35a0bd56d695b92fe0b34f03ebbfc939064 jdk7-b31

View file

@ -5,15 +5,12 @@
</head> </head>
<body style="background-color:lightcyan"> <body style="background-color:lightcyan">
<!-- ====================================================== --> <!-- ====================================================== -->
<table width="100%" style="background-color:white"> + <table width="100%">
<tr> <tr>
<td align="center"> <td align="center">
<a href="http://openjdk.java.net" border="0"> <img alt="OpenJDK"
<img alt="OpenJDK" src="http://openjdk.java.net/images/openjdk.png"
src="http://openjdk.java.net/images/openjdk.png" width=256 />
width=256
style="border-style: none"/>
</a>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -54,6 +51,7 @@
<li><a href="#bootjdk">Bootstrap JDK</a> </li> <li><a href="#bootjdk">Bootstrap JDK</a> </li>
<li><a href="#binaryplugs">Binary Plugs</a> </li> <li><a href="#binaryplugs">Binary Plugs</a> </li>
<li><a href="#importjdk">Optional Import JDK</a> </li> <li><a href="#importjdk">Optional Import JDK</a> </li>
<li><a href="#ant">Ant</a> </li>
<li><a href="#cacerts">Certificate Authority File (cacert)</a> </li> <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
<li><a href="#compilers">Compilers</a> <li><a href="#compilers">Compilers</a>
<ul> <ul>
@ -424,24 +422,37 @@
you should use <tt>gmake</tt> you should use <tt>gmake</tt>
which will be located in either the <tt>/opt/sfw/bin</tt> or which will be located in either the <tt>/opt/sfw/bin</tt> or
<tt>/usr/sfw/bin</tt> directory. <tt>/usr/sfw/bin</tt> directory.
In more recent versions of Solaris GNU make can be found
at <tt>/usr/bin/gmake</tt>.
</li> </li>
<li> <li>
<strong>Windows:</strong> <strong>Windows:</strong>
Make sure you start your build inside a bash/sh/ksh shell. Make sure you start your build inside a bash/sh/ksh shell.
<br> <br>
<b>WARNING:</b> Watch out for make version 3.81, it may <b>WARNING:</b> Watch out for make version 3.81, it may
not work due to a lack of support for drive letter paths not work due to a lack of support for MS-DOS drive letter paths
like <tt>C:/</tt>. See like <tt>C:/</tt> or <tt>C:\</tt>.
<a href="#gmake">section on gmake</a>.
Use a 3.80 version, or find a newer Use a 3.80 version, or find a newer
version that has this problem fixed. version that has this problem fixed, like 3.82.
The older 3.80 version of make.exe can be downloaded with this The older 3.80 version of make.exe can be downloaded with this
<a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2" target="_blank"> <a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2" target="_blank">
link</a>. link</a>.
Use of this older 3.80 make.exe may require that you install the
libintl2.dll library or libintl2 cygwin package which is
no longer installed by default by the cygwin installer.
<br>
Also see the Also see the
<a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank"> <a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
mozilla developer center</a> mozilla developer center</a>
on this topic. on this topic.
<br>
It's hoped that when make 3.82 starts shipping in a future cygwin
release that this MS-DOS path issue will be fixed.
In addition to the above 3.80 make.exe you can download
this
<a href="http://www.cmake.org/files/cygwin/make.exe">
www.cmake.org make.exe</a> which will not have a libintl2.dll
dependency.
</li> </li>
</ul> </ul>
<p> <p>
@ -507,6 +518,11 @@
Install or upgrade the <a href="#freetype">FreeType development Install or upgrade the <a href="#freetype">FreeType development
package</a>. package</a>.
</li> </li>
<li>
Install
<a href="#ant">Ant</a>, set
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
</li>
</ol> </ol>
</blockquote> </blockquote>
<!-- ------------------------------------------------------ --> <!-- ------------------------------------------------------ -->
@ -567,6 +583,11 @@
<a href="#cups">CUPS Include files</a>, set <a href="#cups">CUPS Include files</a>, set
<tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>. <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
</li> </li>
<li>
Install
<a href="#ant">Ant</a>, set
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
</li>
</ol> </ol>
</blockquote> </blockquote>
<!-- ------------------------------------------------------ --> <!-- ------------------------------------------------------ -->
@ -654,6 +675,11 @@
Install Install
<a href="#dxsdk">Microsoft DirectX SDK</a>. <a href="#dxsdk">Microsoft DirectX SDK</a>.
</li> </li>
<li>
Install
<a href="#ant">Ant</a>, set
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
</li>
</ol> </ol>
</blockquote> </blockquote>
<!-- ------------------------------------------------------ --> <!-- ------------------------------------------------------ -->
@ -736,6 +762,22 @@
and the build will copy the needed files from this import area. and the build will copy the needed files from this import area.
</blockquote> </blockquote>
<!-- ------------------------------------------------------ --> <!-- ------------------------------------------------------ -->
<h4><a name="ant">Ant</a></h4>
<blockquote>
All OpenJDK builds require access to least Ant 1.6.5.
The Ant tool is available from the
<a href="http://ant.apache.org/antlibs/bindownload.cgi" target="_blank">
Ant download site</a>.
You should always set
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>
to point to the location of
the Ant installation, this is the directory pathname
that contains a <tt>bin and lib</tt>.
It's also a good idea to also place its <tt>bin</tt> directory
in the <tt>PATH</tt> environment variable, although it's
not absolutely required.
</blockquote>
<!-- ------------------------------------------------------ -->
<h4><a name="cacerts">Certificate Authority File (cacert)</a></h4> <h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
<blockquote> <blockquote>
See <a href="http://en.wikipedia.org/wiki/Certificate_Authority" target="_blank"> See <a href="http://en.wikipedia.org/wiki/Certificate_Authority" target="_blank">
@ -915,6 +957,21 @@
and and
<tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt> <tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt>
to refer to place where library and header files are installed. to refer to place where library and header files are installed.
<p>
Building the freetype 2 libraries from scratch is also possible,
however on Windows refer to the
<a href="http://freetype.freedesktop.org/wiki/FreeType_DLL">
Windows FreeType DLL build instructions</a>.
<p>
Note that by default FreeType is built with byte code hinting
support disabled due to licensing restrictions.
In this case, text appearance and metrics are expected to
differ from Sun's official JDK build.
See
<a href="http://freetype.sourceforge.net/freetype2/index.html">
the SourceForge FreeType2 Home Page
</a>
for more information.
</blockquote> </blockquote>
<!-- ------------------------------------------------------ --> <!-- ------------------------------------------------------ -->
<h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4> <h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4>
@ -1036,7 +1093,8 @@
<tr> <tr>
<td>make.exe</td> <td>make.exe</td>
<td>Devel</td> <td>Devel</td>
<td>make: The GNU version of the 'make' utility</td> <td>make: The GNU version of the 'make' utility<br>
<b>NOTE</b>: See <a href="#gmake">the GNU make section</a></td>
</tr> </tr>
<tr> <tr>
<td>m4.exe</td> <td>m4.exe</td>
@ -1050,7 +1108,7 @@
<td>cpio: A program to manage archives of files</td> <td>cpio: A program to manage archives of files</td>
</tr> </tr>
<tr> <tr>
<td>awk.exe</td> <td>gawk.exe</td>
<td>Utils</td> <td>Utils</td>
<td>awk: Pattern-directed scanning and processing language</td> <td>awk: Pattern-directed scanning and processing language</td>
</tr> </tr>
@ -1061,17 +1119,17 @@
</tr> </tr>
<tr> <tr>
<td>zip.exe</td> <td>zip.exe</td>
<td>Utils</td> <td>Archive</td>
<td>zip: Package and compress (archive) files</td> <td>zip: Package and compress (archive) files</td>
</tr> </tr>
<tr> <tr>
<td>unzip.exe</td> <td>unzip.exe</td>
<td>Utils</td> <td>Archive</td>
<td>unzip: Extract compressed files in a ZIP archive</td> <td>unzip: Extract compressed files in a ZIP archive</td>
</tr> </tr>
<tr> <tr>
<td>free.exe</td> <td>free.exe</td>
<td>Utils</td> <td>Procps</td>
<td>free: Display amount of free and used memory in the system</td> <td>free: Display amount of free and used memory in the system</td>
</tr> </tr>
</tbody> </tbody>
@ -1224,46 +1282,6 @@
document) that can impact the build are: document) that can impact the build are:
<blockquote> <blockquote>
<dl> <dl>
<dt><a name="path"><tt>PATH</tt></a> </dt>
<dd>Typically you want to set the <tt>PATH</tt> to include:
<ul>
<li>The location of the GNU make binary</li>
<li>The location of the Bootstrap JDK <tt>java</tt>
(see <a href="#bootjdk">Bootstrap JDK</a>)</li>
<li>The location of the C/C++ compilers
(see <a href="#compilers"><tt>compilers</tt></a>)</li>
<li>The location or locations for the Unix command utilities
(e.g. <tt>/usr/bin</tt>)</li>
</ul>
</dd>
<dt><tt>MILESTONE</tt> </dt>
<dd>
The milestone name for the build (<i>e.g.</i>"beta").
The default value is "internal".
</dd>
<dt><tt>BUILD_NUMBER</tt> </dt>
<dd>
The build number for the build (<i>e.g.</i> "b27").
The default value is "b00".
</dd>
<dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
<dd>The <tt>ARCH_DATA_MODEL</tt> variable
is used to specify whether the build is to generate 32-bit or 64-bit
binaries.
The Solaris build supports either 32-bit or 64-bit builds, but
Windows and Linux will support only one, depending on the specific
OS being used.
Normally, setting this variable is only necessary on Solaris.
Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries,
or to <tt>64</tt> for generating 64-bit binaries.
</dd>
<dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
<dd>
The location of the bootstrap JDK installation.
See <a href="#bootjdk">Bootstrap JDK</a> for more information.
You should always install your own local Bootstrap JDK and
always set <tt>ALT_BOOTDIR</tt> explicitly.
</dd>
<dt><a name="ALT_BINARY_PLUGS_PATH"><tt>ALT_BINARY_PLUGS_PATH</tt></a></dt> <dt><a name="ALT_BINARY_PLUGS_PATH"><tt>ALT_BINARY_PLUGS_PATH</tt></a></dt>
<dd> <dd>
The location of the binary plugs installation. The location of the binary plugs installation.
@ -1272,118 +1290,12 @@
recent Binary Plugs install image recent Binary Plugs install image
and set this variable to that location. and set this variable to that location.
</dd> </dd>
<dt><a name="ALT_JDK_IMPORT_PATH"><tt>ALT_JDK_IMPORT_PATH</tt></a></dt> <dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
<dd> <dd>
The location of a previously built JDK installation. The location of the bootstrap JDK installation.
See <a href="#importjdk">Optional Import JDK</a> for more information. See <a href="#bootjdk">Bootstrap JDK</a> for more information.
</dd> You should always install your own local Bootstrap JDK and
<dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt> always set <tt>ALT_BOOTDIR</tt> explicitly.
<dd>
An override for specifying the (absolute) path of where the
build output is to go.
The default output directory will be build/<i>platform</i>.
</dd>
<dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
<dd>
The location of the C/C++ compiler.
The default varies depending on the platform.
</dd>
<dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
<dd>
The location of the <a href="#cacerts">cacerts</a> file.
The default will refer to
<tt>jdk/src/share/lib/security/cacerts</tt>.
</dd>
<dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
<dd>
The location of the CUPS header files.
See <a href="#cups">CUPS information</a> for more information.
If this path does not exist the fallback path is
<tt>/usr/include</tt>.
</dd>
<dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
<dd>
The location of the FreeType shared library.
See <a href="#freetype">FreeType information</a> for details.
</dd>
<dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
<dd>
The location of the FreeType header files.
See <a href="#freetype">FreeType information</a> for details.
</dd>
<dt><a name="ALT_JDK_DEVTOOLS_PATH"><tt>ALT_JDK_DEVTOOLS_PATH</tt></a></dt>
<dd>
The default root location of the devtools.
The default value is
<tt>$(ALT_SLASH_JAVA)/devtools</tt>.
</dd>
<dt><tt><a name="ALT_DEVTOOLS_PATH">ALT_DEVTOOLS_PATH</a></tt> </dt>
<dd>
The location of tools like the
<a href="#zip"><tt>zip</tt> and <tt>unzip</tt></a>
binaries, but might also contain the GNU make utility
(<tt><i>gmake</i></tt>).
So this area is a bit of a grab bag, especially on Windows.
The default value depends on the platform and
Unix Commands being used.
On Linux the default will be
<tt>$(ALT_JDK_DEVTOOLS_PATH)/linux/bin</tt>,
on Solaris
<tt>$(ALT_JDK_DEVTOOLS_PATH)/<i>{sparc,i386}</i>/bin</tt>,
on Windows with MKS
<tt>%SYSTEMDRIVE%/UTILS</tt>,
and on Windows with CYGWIN
<tt>/usr/bin</tt>.
</dd>
<dt><a name="ALT_UNIXCOMMAND_PATH"><tt>ALT_UNIXCOMMAND_PATH</tt></a> </dt>
<dd>
An override for specifying where the
Unix command set are located.
The default location varies depending on the platform,
<tt>"%SYSTEMDRIVE%/MKSNT"</tt> or
<tt>$(ROOTDIR)</tt> on Windows with MKS, otherwise it's
<tt>"/bin"</tt> or <tt>/usr/bin</tt>.
</dd>
<dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
<dd>
<strong>Solaris only:</strong>
An override for specifying where the Unix CCS
command set are located.
The default location is <tt>/usr/ccs/bin</tt>
</dd>
<dt><a name="ALT_USRBIN_PATH"><tt>ALT_USRBIN_PATH</tt></a></dt>
<dd>
An override for specifying where the
Unix <tt>/usr/bin</tt> commands are located. You usually do not need
to set this variable: the default location is <tt>/usr/bin</tt>)
</dd>
<dt><a name="ALT_SLASHJAVA"><tt>ALT_SLASHJAVA</tt></a></dt>
<dd>
The default root location for many of the ALT path locations
of the following ALT variables.
The default value is
<tt>"/java"</tt> on Solaris and Linux,
<tt>"J:"</tt> on Windows.
</dd>
<dt><a name="ALT_BUILD_JDK_IMPORT_PATH"><tt>ALT_BUILD_JDK_IMPORT_PATH</tt></a></dt>
<dd>
These are useful in managing builds on multiple platforms.
The default network location for all of the import JDK images
for all platforms.
If <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
is not set, this directory will be used and should contain
the following directories:
<tt>solaris-sparc</tt>,
<tt>solaris-i586</tt>,
<tt>solaris-sparcv9</tt>,
<tt>solaris-amd64</tt>,
<tt>linux-i586</tt>,
<tt>linux-amd64</tt>,
<tt>windows-i586</tt>,
and
<tt>windows-amd64</tt>.
Where each of these directories contain the import JDK image
for that platform.
</dd> </dd>
<dt><a name="ALT_BUILD_BINARY_PLUGS_PATH"><tt>ALT_BUILD_BINARY_PLUGS_PATH</tt></a></dt> <dt><a name="ALT_BUILD_BINARY_PLUGS_PATH"><tt>ALT_BUILD_BINARY_PLUGS_PATH</tt></a></dt>
<dd> <dd>
@ -1405,36 +1317,186 @@
Where each of these directories contain the binary plugs image Where each of these directories contain the binary plugs image
for that platform. for that platform.
</dd> </dd>
<dt><strong>Windows specific:</strong></dt> <dt><a name="ALT_BUILD_JDK_IMPORT_PATH"><tt>ALT_BUILD_JDK_IMPORT_PATH</tt></a></dt>
<dd> <dd>
<dl> These are useful in managing builds on multiple platforms.
<dt><a name="ALT_MSDEVTOOLS_PATH"><tt>ALT_MSDEVTOOLS_PATH</tt></a> </dt> The default network location for all of the import JDK images
<dd> for all platforms.
The location of the Microsoft Visual Studio .NET 2003 If <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
tools 'bin' directory. is not set, this directory will be used and should contain
The default is usually derived from the following directories:
<a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>. <tt>solaris-sparc</tt>,
</dd> <tt>solaris-i586</tt>,
<dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt> <tt>solaris-sparcv9</tt>,
<dd> <tt>solaris-amd64</tt>,
The location of the <tt>linux-i586</tt>,
<a href="#dxsdk">Microsoft DirectX 9 SDK</a>. <tt>linux-amd64</tt>,
The default will be to try and use the DirectX environment <tt>windows-i586</tt>,
variable <tt>DXSDK_DIR</tt>, and
failing that, look in <tt>C:/DXSDK</tt>. <tt>windows-amd64</tt>.
</dd> Where each of these directories contain the import JDK image
<dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt> for that platform.
<dd> </dd>
The location of the <dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
<a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>. <dd>
</dd> The location of the <a href="#cacerts">cacerts</a> file.
<dt><tt><a name="ALT_MSVCR71_DLL_PATH">ALT_MSVCR71_DLL_PATH</a></tt> </dt> The default will refer to
<dd> <tt>jdk/src/share/lib/security/cacerts</tt>.
<strong>i586 only:</strong> </dd>
The location of the <dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
<a href="#msvcr71"><tt>MSVCR71.DLL</tt></a>. <dd>
</dd> The location of the C/C++ compiler.
</dl> The default varies depending on the platform.
</dd>
<dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
<dd>
The location of the CUPS header files.
See <a href="#cups">CUPS information</a> for more information.
If this path does not exist the fallback path is
<tt>/usr/include</tt>.
</dd>
<dt><tt><a name="ALT_DEVTOOLS_PATH">ALT_DEVTOOLS_PATH</a></tt> </dt>
<dd>
The location of tools like the
<a href="#zip"><tt>zip</tt> and <tt>unzip</tt></a>
binaries, but might also contain the GNU make utility
(<tt><i>gmake</i></tt>).
So this area is a bit of a grab bag, especially on Windows.
The default value depends on the platform and
Unix Commands being used.
On Linux the default will be
<tt>$(ALT_JDK_DEVTOOLS_PATH)/linux/bin</tt>,
on Solaris
<tt>$(ALT_JDK_DEVTOOLS_PATH)/<i>{sparc,i386}</i>/bin</tt>,
on Windows with MKS
<tt>%SYSTEMDRIVE%/UTILS</tt>,
and on Windows with CYGWIN
<tt>/usr/bin</tt>.
</dd>
<dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
<dd>
<strong>Windows Only:</strong>
The location of the
<a href="#dxsdk">Microsoft DirectX 9 SDK</a>.
The default will be to try and use the DirectX environment
variable <tt>DXSDK_DIR</tt>,
failing that, look in <tt>C:/DXSDK</tt>.
</dd>
<dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
<dd>
The location of the FreeType header files.
See <a href="#freetype">FreeType information</a> for details.
</dd>
<dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
<dd>
The location of the FreeType shared library.
See <a href="#freetype">FreeType information</a> for details.
</dd>
<dt><a name="ALT_JDK_DEVTOOLS_PATH"><tt>ALT_JDK_DEVTOOLS_PATH</tt></a></dt>
<dd>
The default root location of the devtools.
The default value is
<tt>$(ALT_SLASH_JAVA)/devtools</tt>.
</dd>
<dt><a name="ALT_JDK_IMPORT_PATH"><tt>ALT_JDK_IMPORT_PATH</tt></a></dt>
<dd>
The location of a previously built JDK installation.
See <a href="#importjdk">Optional Import JDK</a> for more information.
</dd>
<dt><a name="ALT_MSDEVTOOLS_PATH"><tt>ALT_MSDEVTOOLS_PATH</tt></a> </dt>
<dd>
<strong>Windows Only:</strong>
The location of the Microsoft Visual Studio .NET 2003
tools 'bin' directory.
The default is usually derived from
<a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
</dd>
<dt><tt><a name="ALT_MSVCR71_DLL_PATH">ALT_MSVCR71_DLL_PATH</a></tt> </dt>
<dd>
<strong>Windows i586 only:</strong>
The location of the
<a href="#msvcr71"><tt>MSVCR71.DLL</tt></a>.
</dd>
<dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt>
<dd>
<strong>Windows Only:</strong>
The location of the
<a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>.
</dd>
<dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt>
<dd>
An override for specifying the (absolute) path of where the
build output is to go.
The default output directory will be build/<i>platform</i>.
</dd>
<dt><a name="ALT_SLASHJAVA"><tt>ALT_SLASHJAVA</tt></a></dt>
<dd>
The default root location for many of the ALT path locations
of the following ALT variables.
The default value is
<tt>"/java"</tt> on Solaris and Linux,
<tt>"J:"</tt> on Windows.
</dd>
<dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
<dd>
<strong>Solaris only:</strong>
An override for specifying where the Unix CCS
command set are located.
The default location is <tt>/usr/ccs/bin</tt>
</dd>
<dt><a name="ALT_UNIXCOMMAND_PATH"><tt>ALT_UNIXCOMMAND_PATH</tt></a> </dt>
<dd>
An override for specifying where the
Unix command set are located.
The default location varies depending on the platform,
<tt>"%SYSTEMDRIVE%/MKSNT"</tt> or
<tt>$(ROOTDIR)</tt> on Windows with MKS, otherwise it's
<tt>"/bin"</tt> or <tt>/usr/bin</tt>.
</dd>
<dt><a name="ALT_USRBIN_PATH"><tt>ALT_USRBIN_PATH</tt></a></dt>
<dd>
An override for specifying where the
Unix <tt>/usr/bin</tt> commands are located. You usually do not need
to set this variable: the default location is <tt>/usr/bin</tt>)
</dd>
<dt><a name="ANT_HOME"><tt>ANT_HOME</tt></a></dt>
<dd>
The location of the Ant installation.
See <a href="#ant">Ant</a> for more information.
You should always set <tt>ANT_HOME</tt> explicitly.
</dd>
<dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
<dd>The <tt>ARCH_DATA_MODEL</tt> variable
is used to specify whether the build is to generate 32-bit or 64-bit
binaries.
The Solaris build supports either 32-bit or 64-bit builds, but
Windows and Linux will support only one, depending on the specific
OS being used.
Normally, setting this variable is only necessary on Solaris.
Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries,
or to <tt>64</tt> for generating 64-bit binaries.
</dd>
<dt><tt>BUILD_NUMBER</tt> </dt>
<dd>
The build number for the build (<i>e.g.</i> "b27").
The default value is "b00".
</dd>
<dt><tt>MILESTONE</tt> </dt>
<dd>
The milestone name for the build (<i>e.g.</i>"beta").
The default value is "internal".
</dd>
<dt><a name="path"><tt>PATH</tt></a> </dt>
<dd>Typically you want to set the <tt>PATH</tt> to include:
<ul>
<li>The location of the GNU make binary</li>
<li>The location of the Bootstrap JDK <tt>java</tt>
(see <a href="#bootjdk">Bootstrap JDK</a>)</li>
<li>The location of the C/C++ compilers
(see <a href="#compilers"><tt>compilers</tt></a>)</li>
<li>The location or locations for the Unix command utilities
(e.g. <tt>/usr/bin</tt>)</li>
</ul>
</dd> </dd>
</dl> </dl>
</blockquote> </blockquote>

View file

@ -5,3 +5,4 @@ e84e9018bebbf3e5bafc5706e7882a15cb1c7d99 jdk7-b27
27509b7d21ed783b3f6eb7b7612781c675a30c2f jdk7-b28 27509b7d21ed783b3f6eb7b7612781c675a30c2f jdk7-b28
8b71960f79ce0a6fb8ddfeec03f03d400a361747 jdk7-b29 8b71960f79ce0a6fb8ddfeec03f03d400a361747 jdk7-b29
c0252adbb2abbfdd6c35595429ac6fbdd98e20ac jdk7-b30 c0252adbb2abbfdd6c35595429ac6fbdd98e20ac jdk7-b30
ef6af34d75a7b44e77083f1d4ee47631fa09d3b4 jdk7-b31

View file

@ -5,3 +5,4 @@ e3d2692f8442e2d951166dc9bd9a330684754438 jdk7-b27
c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28 c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28
4f91c08b3e4498213a9c5a24898f7d9c38cf86fb jdk7-b29 4f91c08b3e4498213a9c5a24898f7d9c38cf86fb jdk7-b29
d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30 d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30
9c2ecc2ffb125f14fab3857fe7689598956348a0 jdk7-b31

View file

@ -2414,8 +2414,20 @@ static bool linux_mprotect(char* addr, size_t size, int prot) {
return ::mprotect(bottom, size, prot) == 0; return ::mprotect(bottom, size, prot) == 0;
} }
bool os::protect_memory(char* addr, size_t size) { // Set protections specified
return linux_mprotect(addr, size, PROT_READ); bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
bool is_committed) {
unsigned int p = 0;
switch (prot) {
case MEM_PROT_NONE: p = PROT_NONE; break;
case MEM_PROT_READ: p = PROT_READ; break;
case MEM_PROT_RW: p = PROT_READ|PROT_WRITE; break;
case MEM_PROT_RWX: p = PROT_READ|PROT_WRITE|PROT_EXEC; break;
default:
ShouldNotReachHere();
}
// is_committed is unused.
return linux_mprotect(addr, bytes, p);
} }
bool os::guard_memory(char* addr, size_t size) { bool os::guard_memory(char* addr, size_t size) {
@ -3704,8 +3716,9 @@ void os::make_polling_page_unreadable(void) {
// Mark the polling page as readable // Mark the polling page as readable
void os::make_polling_page_readable(void) { void os::make_polling_page_readable(void) {
if( !protect_memory((char *)_polling_page, Linux::page_size()) ) if( !linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
fatal("Could not enable polling page"); fatal("Could not enable polling page");
}
}; };
int os::active_processor_count() { int os::active_processor_count() {

View file

@ -2965,10 +2965,21 @@ static bool solaris_mprotect(char* addr, size_t bytes, int prot) {
return retVal == 0; return retVal == 0;
} }
// Protect memory (make it read-only. (Used to pass readonly pages through // Protect memory (Used to pass readonly pages through
// JNI GetArray<type>Elements with empty arrays.) // JNI GetArray<type>Elements with empty arrays.)
bool os::protect_memory(char* addr, size_t bytes) { bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
return solaris_mprotect(addr, bytes, PROT_READ); bool is_committed) {
unsigned int p = 0;
switch (prot) {
case MEM_PROT_NONE: p = PROT_NONE; break;
case MEM_PROT_READ: p = PROT_READ; break;
case MEM_PROT_RW: p = PROT_READ|PROT_WRITE; break;
case MEM_PROT_RWX: p = PROT_READ|PROT_WRITE|PROT_EXEC; break;
default:
ShouldNotReachHere();
}
// is_committed is unused.
return solaris_mprotect(addr, bytes, p);
} }
// guard_memory and unguard_memory only happens within stack guard pages. // guard_memory and unguard_memory only happens within stack guard pages.

View file

@ -2170,6 +2170,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
// Windows 98 reports faulting addresses incorrectly // Windows 98 reports faulting addresses incorrectly
if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) || if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) ||
!os::win32::is_nt()) { !os::win32::is_nt()) {
return Handle_Exception(exceptionInfo, return Handle_Exception(exceptionInfo,
SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL)); SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL));
} }
@ -2563,9 +2564,33 @@ bool os::release_memory(char* addr, size_t bytes) {
return VirtualFree(addr, 0, MEM_RELEASE) != 0; return VirtualFree(addr, 0, MEM_RELEASE) != 0;
} }
bool os::protect_memory(char* addr, size_t bytes) { // Set protections specified
bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
bool is_committed) {
unsigned int p = 0;
switch (prot) {
case MEM_PROT_NONE: p = PAGE_NOACCESS; break;
case MEM_PROT_READ: p = PAGE_READONLY; break;
case MEM_PROT_RW: p = PAGE_READWRITE; break;
case MEM_PROT_RWX: p = PAGE_EXECUTE_READWRITE; break;
default:
ShouldNotReachHere();
}
DWORD old_status; DWORD old_status;
return VirtualProtect(addr, bytes, PAGE_READONLY, &old_status) != 0;
// Strange enough, but on Win32 one can change protection only for committed
// memory, not a big deal anyway, as bytes less or equal than 64K
if (!is_committed && !commit_memory(addr, bytes)) {
fatal("cannot commit protection page");
}
// One cannot use os::guard_memory() here, as on Win32 guard page
// have different (one-shot) semantics, from MSDN on PAGE_GUARD:
//
// Pages in the region become guard pages. Any attempt to access a guard page
// causes the system to raise a STATUS_GUARD_PAGE exception and turn off
// the guard page status. Guard pages thus act as a one-time access alarm.
return VirtualProtect(addr, bytes, p, &old_status) != 0;
} }
bool os::guard_memory(char* addr, size_t bytes) { bool os::guard_memory(char* addr, size_t bytes) {

View file

@ -27,12 +27,6 @@
#include <asm-sparc/traps.h> #include <asm-sparc/traps.h>
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Since the linux kernel resides at the low end of
// user address space, no null pointer check is needed.
return offset < 0 || offset >= 0x100000;
}
void MacroAssembler::read_ccr_trap(Register ccr_save) { void MacroAssembler::read_ccr_trap(Register ccr_save) {
// No implementation // No implementation
breakpoint_trap(); breakpoint_trap();

View file

@ -39,10 +39,3 @@ void MacroAssembler::get_thread(Register thread) {
movptr(thread, tls); movptr(thread, tls);
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Linux kernel guarantees that the first page is always unmapped. Don't
// assume anything more than that.
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
return !offset_in_first_page;
}

View file

@ -65,22 +65,3 @@ void MacroAssembler::get_thread(Register thread) {
popq(rax); popq(rax);
} }
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Exception handler checks the nmethod's implicit null checks table
// only when this method returns false.
if (UseCompressedOops) {
// The first page after heap_base is unmapped and
// the 'offset' is equal to [heap_base + offset] for
// narrow oop implicit null checks.
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
if ((uintptr_t)offset >= heap_base) {
// Normalize offset for the next check.
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
}
}
// Linux kernel guarantees that the first page is always unmapped. Don't
// assume anything more than that.
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
return !offset_in_first_page;
}

View file

@ -28,18 +28,6 @@
#include <sys/trap.h> // For trap numbers #include <sys/trap.h> // For trap numbers
#include <v9/sys/psr_compat.h> // For V8 compatibility #include <v9/sys/psr_compat.h> // For V8 compatibility
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// The first page of virtual addresses is unmapped on SPARC.
// Thus, any access the VM makes through a null pointer with an offset of
// less than 4K will get a recognizable SIGSEGV, which the signal handler
// will transform into a NullPointerException.
// (Actually, the first 64K or so is unmapped, but it's simpler
// to depend only on the first 4K or so.)
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
return !offset_in_first_page;
}
void MacroAssembler::read_ccr_trap(Register ccr_save) { void MacroAssembler::read_ccr_trap(Register ccr_save) {
// Execute a trap to get the PSR, mask and shift // Execute a trap to get the PSR, mask and shift
// to get the condition codes. // to get the condition codes.

View file

@ -79,9 +79,3 @@ void MacroAssembler::get_thread(Register thread) {
if (thread != rax) popl(rax); if (thread != rax) popl(rax);
popl(thread); popl(thread);
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Identical to Sparc/Solaris code
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
return !offset_in_first_page;
}

View file

@ -85,22 +85,3 @@ void MacroAssembler::get_thread(Register thread) {
popq(rax); popq(rax);
} }
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Identical to Sparc/Solaris code
// Exception handler checks the nmethod's implicit null checks table
// only when this method returns false.
if (UseCompressedOops) {
// The first page after heap_base is unmapped and
// the 'offset' is equal to [heap_base + offset] for
// narrow oop implicit null checks.
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
if ((uintptr_t)offset >= heap_base) {
// Normalize offset for the next check.
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
}
}
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
return !offset_in_first_page;
}

View file

@ -58,7 +58,3 @@ void MacroAssembler::get_thread(Register thread) {
"Thread Pointer Offset has not been initialized"); "Thread Pointer Offset has not been initialized");
movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset())); movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset()));
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
return offset < 0 || (int)os::vm_page_size() <= offset;
}

View file

@ -65,19 +65,3 @@ void MacroAssembler::get_thread(Register thread) {
popq(rax); popq(rax);
} }
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Exception handler checks the nmethod's implicit null checks table
// only when this method returns false.
if (UseCompressedOops) {
// The first page after heap_base is unmapped and
// the 'offset' is equal to [heap_base + offset] for
// narrow oop implicit null checks.
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
if ((uintptr_t)offset >= heap_base) {
// Normalize offset for the next check.
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
}
}
return offset < 0 || os::vm_page_size() <= offset;
}

View file

@ -246,6 +246,24 @@ void AbstractAssembler::block_comment(const char* comment) {
} }
} }
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Exception handler checks the nmethod's implicit null checks table
// only when this method returns false.
#ifndef SPARC
// Sparc does not have based addressing
if (UseCompressedOops) {
// The first page after heap_base is unmapped and
// the 'offset' is equal to [heap_base + offset] for
// narrow oop implicit null checks.
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
if ((uintptr_t)offset >= heap_base) {
// Normalize offset for the next check.
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
}
}
#endif // SPARC
return offset < 0 || os::vm_page_size() <= offset;
}
#ifndef PRODUCT #ifndef PRODUCT
void Label::print_instructions(MacroAssembler* masm) const { void Label::print_instructions(MacroAssembler* masm) const {

View file

@ -61,6 +61,8 @@ ParMarkBitMap::initialize(MemRegion covered_region)
if (_virtual_space != NULL) { if (_virtual_space != NULL) {
delete _virtual_space; delete _virtual_space;
_virtual_space = NULL; _virtual_space = NULL;
// Release memory reserved in the space.
rs.release();
} }
return false; return false;
} }

View file

@ -108,8 +108,8 @@ jint ParallelScavengeHeap::initialize() {
// size than is needed or wanted for the perm gen. Use the "compound // size than is needed or wanted for the perm gen. Use the "compound
// alignment" ReservedSpace ctor to avoid having to use the same page size for // alignment" ReservedSpace ctor to avoid having to use the same page size for
// all gens. // all gens.
ReservedSpace heap_rs(pg_max_size, pg_align, og_max_size + yg_max_size, ReservedHeapSpace heap_rs(pg_max_size, pg_align, og_max_size + yg_max_size,
og_align); og_align);
os::trace_page_sizes("ps perm", pg_min_size, pg_max_size, pg_page_sz, os::trace_page_sizes("ps perm", pg_min_size, pg_max_size, pg_page_sz,
heap_rs.base(), pg_max_size); heap_rs.base(), pg_max_size);
os::trace_page_sizes("ps main", og_min_size + yg_min_size, os::trace_page_sizes("ps main", og_min_size + yg_min_size,

View file

@ -422,6 +422,8 @@ ParallelCompactData::create_vspace(size_t count, size_t element_size)
return vspace; return vspace;
} }
delete vspace; delete vspace;
// Release memory reserved in the space.
rs.release();
} }
return 0; return 0;

View file

@ -71,13 +71,8 @@ bool PSVirtualSpace::contains(void* p) const {
void PSVirtualSpace::release() { void PSVirtualSpace::release() {
DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this)); DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this));
if (reserved_low_addr() != NULL) { // This may not release memory it didn't reserve.
if (special()) { // Use rs.release() to release the underlying memory instead.
os::release_memory_special(reserved_low_addr(), reserved_size());
} else {
(void)os::release_memory(reserved_low_addr(), reserved_size());
}
}
_reserved_low_addr = _reserved_high_addr = NULL; _reserved_low_addr = _reserved_high_addr = NULL;
_committed_low_addr = _committed_high_addr = NULL; _committed_low_addr = _committed_high_addr = NULL;
_special = false; _special = false;

View file

@ -222,8 +222,8 @@ char* GenCollectedHeap::allocate(size_t alignment,
*_total_reserved = total_reserved; *_total_reserved = total_reserved;
*_n_covered_regions = n_covered_regions; *_n_covered_regions = n_covered_regions;
*heap_rs = ReservedSpace(total_reserved, alignment, *heap_rs = ReservedHeapSpace(total_reserved, alignment,
UseLargePages, heap_address); UseLargePages, heap_address);
return heap_address; return heap_address;
} }

View file

@ -2173,8 +2173,7 @@ static char* get_bad_address() {
size_t size = os::vm_allocation_granularity(); size_t size = os::vm_allocation_granularity();
bad_address = os::reserve_memory(size); bad_address = os::reserve_memory(size);
if (bad_address != NULL) { if (bad_address != NULL) {
os::commit_memory(bad_address, size); os::protect_memory(bad_address, size, os::MEM_PROT_READ);
os::protect_memory(bad_address, size);
} }
} }
return bad_address; return bad_address;

View file

@ -1176,8 +1176,7 @@ void Arguments::set_ergonomics_flags() {
// by ergonomics. // by ergonomics.
if (MaxHeapSize <= max_heap_for_compressed_oops()) { if (MaxHeapSize <= max_heap_for_compressed_oops()) {
if (FLAG_IS_DEFAULT(UseCompressedOops)) { if (FLAG_IS_DEFAULT(UseCompressedOops)) {
// Leave compressed oops off by default. Uncomment // Turn off until bug is fixed.
// the following line to return it to default status.
// FLAG_SET_ERGO(bool, UseCompressedOops, true); // FLAG_SET_ERGO(bool, UseCompressedOops, true);
} }
} else { } else {

View file

@ -922,8 +922,9 @@ void os::serialize_thread_states() {
// time and expensive page trap spinning, 'SerializePageLock' is used to block // time and expensive page trap spinning, 'SerializePageLock' is used to block
// the mutator thread if such case is encountered. See bug 6546278 for details. // the mutator thread if such case is encountered. See bug 6546278 for details.
Thread::muxAcquire(&SerializePageLock, "serialize_thread_states"); Thread::muxAcquire(&SerializePageLock, "serialize_thread_states");
os::protect_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() ); os::protect_memory((char *)os::get_memory_serialize_page(),
os::unguard_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() ); os::vm_page_size(), MEM_PROT_READ, /*is_committed*/true );
os::unguard_memory((char *)os::get_memory_serialize_page(), os::vm_page_size());
Thread::muxRelease(&SerializePageLock); Thread::muxRelease(&SerializePageLock);
} }

View file

@ -193,7 +193,11 @@ class os: AllStatic {
static bool commit_memory(char* addr, size_t size, size_t alignment_hint); static bool commit_memory(char* addr, size_t size, size_t alignment_hint);
static bool uncommit_memory(char* addr, size_t bytes); static bool uncommit_memory(char* addr, size_t bytes);
static bool release_memory(char* addr, size_t bytes); static bool release_memory(char* addr, size_t bytes);
static bool protect_memory(char* addr, size_t bytes);
enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
static bool protect_memory(char* addr, size_t bytes, ProtType prot,
bool is_committed = false);
static bool guard_memory(char* addr, size_t bytes); static bool guard_memory(char* addr, size_t bytes);
static bool unguard_memory(char* addr, size_t bytes); static bool unguard_memory(char* addr, size_t bytes);
static char* map_memory(int fd, const char* file_name, size_t file_offset, static char* map_memory(int fd, const char* file_name, size_t file_offset,

View file

@ -28,12 +28,15 @@
// ReservedSpace // ReservedSpace
ReservedSpace::ReservedSpace(size_t size) { ReservedSpace::ReservedSpace(size_t size) {
initialize(size, 0, false, NULL); initialize(size, 0, false, NULL, 0);
} }
ReservedSpace::ReservedSpace(size_t size, size_t alignment, ReservedSpace::ReservedSpace(size_t size, size_t alignment,
bool large, char* requested_address) { bool large,
initialize(size, alignment, large, requested_address); char* requested_address,
const size_t noaccess_prefix) {
initialize(size+noaccess_prefix, alignment, large, requested_address,
noaccess_prefix);
} }
char * char *
@ -105,7 +108,8 @@ char* ReservedSpace::reserve_and_align(const size_t reserve_size,
ReservedSpace::ReservedSpace(const size_t prefix_size, ReservedSpace::ReservedSpace(const size_t prefix_size,
const size_t prefix_align, const size_t prefix_align,
const size_t suffix_size, const size_t suffix_size,
const size_t suffix_align) const size_t suffix_align,
const size_t noaccess_prefix)
{ {
assert(prefix_size != 0, "sanity"); assert(prefix_size != 0, "sanity");
assert(prefix_align != 0, "sanity"); assert(prefix_align != 0, "sanity");
@ -118,12 +122,16 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
assert((suffix_align & prefix_align - 1) == 0, assert((suffix_align & prefix_align - 1) == 0,
"suffix_align not divisible by prefix_align"); "suffix_align not divisible by prefix_align");
// Add in noaccess_prefix to prefix_size;
const size_t adjusted_prefix_size = prefix_size + noaccess_prefix;
const size_t size = adjusted_prefix_size + suffix_size;
// On systems where the entire region has to be reserved and committed up // On systems where the entire region has to be reserved and committed up
// front, the compound alignment normally done by this method is unnecessary. // front, the compound alignment normally done by this method is unnecessary.
const bool try_reserve_special = UseLargePages && const bool try_reserve_special = UseLargePages &&
prefix_align == os::large_page_size(); prefix_align == os::large_page_size();
if (!os::can_commit_large_page_memory() && try_reserve_special) { if (!os::can_commit_large_page_memory() && try_reserve_special) {
initialize(prefix_size + suffix_size, prefix_align, true); initialize(size, prefix_align, true, NULL, noaccess_prefix);
return; return;
} }
@ -131,15 +139,19 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
_size = 0; _size = 0;
_alignment = 0; _alignment = 0;
_special = false; _special = false;
_noaccess_prefix = 0;
// Assert that if noaccess_prefix is used, it is the same as prefix_align.
assert(noaccess_prefix == 0 ||
noaccess_prefix == prefix_align, "noaccess prefix wrong");
// Optimistically try to reserve the exact size needed. // Optimistically try to reserve the exact size needed.
const size_t size = prefix_size + suffix_size;
char* addr = os::reserve_memory(size, NULL, prefix_align); char* addr = os::reserve_memory(size, NULL, prefix_align);
if (addr == NULL) return; if (addr == NULL) return;
// Check whether the result has the needed alignment (unlikely unless // Check whether the result has the needed alignment (unlikely unless
// prefix_align == suffix_align). // prefix_align == suffix_align).
const size_t ofs = size_t(addr) + prefix_size & suffix_align - 1; const size_t ofs = size_t(addr) + adjusted_prefix_size & suffix_align - 1;
if (ofs != 0) { if (ofs != 0) {
// Wrong alignment. Release, allocate more space and do manual alignment. // Wrong alignment. Release, allocate more space and do manual alignment.
// //
@ -153,11 +165,11 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
} }
const size_t extra = MAX2(ofs, suffix_align - ofs); const size_t extra = MAX2(ofs, suffix_align - ofs);
addr = reserve_and_align(size + extra, prefix_size, prefix_align, addr = reserve_and_align(size + extra, adjusted_prefix_size, prefix_align,
suffix_size, suffix_align); suffix_size, suffix_align);
if (addr == NULL) { if (addr == NULL) {
// Try an even larger region. If this fails, address space is exhausted. // Try an even larger region. If this fails, address space is exhausted.
addr = reserve_and_align(size + suffix_align, prefix_size, addr = reserve_and_align(size + suffix_align, adjusted_prefix_size,
prefix_align, suffix_size, suffix_align); prefix_align, suffix_size, suffix_align);
} }
} }
@ -165,10 +177,12 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
_base = addr; _base = addr;
_size = size; _size = size;
_alignment = prefix_align; _alignment = prefix_align;
_noaccess_prefix = noaccess_prefix;
} }
void ReservedSpace::initialize(size_t size, size_t alignment, bool large, void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
char* requested_address) { char* requested_address,
const size_t noaccess_prefix) {
const size_t granularity = os::vm_allocation_granularity(); const size_t granularity = os::vm_allocation_granularity();
assert((size & granularity - 1) == 0, assert((size & granularity - 1) == 0,
"size not aligned to os::vm_allocation_granularity()"); "size not aligned to os::vm_allocation_granularity()");
@ -181,6 +195,7 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
_size = 0; _size = 0;
_special = false; _special = false;
_alignment = 0; _alignment = 0;
_noaccess_prefix = 0;
if (size == 0) { if (size == 0) {
return; return;
} }
@ -220,7 +235,8 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
// important. If available space is not detected, return NULL. // important. If available space is not detected, return NULL.
if (requested_address != 0) { if (requested_address != 0) {
base = os::attempt_reserve_memory_at(size, requested_address); base = os::attempt_reserve_memory_at(size,
requested_address-noaccess_prefix);
} else { } else {
base = os::reserve_memory(size, NULL, alignment); base = os::reserve_memory(size, NULL, alignment);
} }
@ -259,6 +275,11 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
_base = base; _base = base;
_size = size; _size = size;
_alignment = MAX2(alignment, (size_t) os::vm_page_size()); _alignment = MAX2(alignment, (size_t) os::vm_page_size());
_noaccess_prefix = noaccess_prefix;
// Assert that if noaccess_prefix is used, it is the same as alignment.
assert(noaccess_prefix == 0 ||
noaccess_prefix == _alignment, "noaccess prefix wrong");
assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base, assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base,
"area must be distinguisable from marks for mark-sweep"); "area must be distinguisable from marks for mark-sweep");
@ -274,6 +295,7 @@ ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment,
_base = base; _base = base;
_size = size; _size = size;
_alignment = alignment; _alignment = alignment;
_noaccess_prefix = 0;
_special = special; _special = special;
} }
@ -320,17 +342,58 @@ size_t ReservedSpace::allocation_align_size_down(size_t size) {
void ReservedSpace::release() { void ReservedSpace::release() {
if (is_reserved()) { if (is_reserved()) {
char *real_base = _base - _noaccess_prefix;
const size_t real_size = _size + _noaccess_prefix;
if (special()) { if (special()) {
os::release_memory_special(_base, _size); os::release_memory_special(real_base, real_size);
} else{ } else{
os::release_memory(_base, _size); os::release_memory(real_base, real_size);
} }
_base = NULL; _base = NULL;
_size = 0; _size = 0;
_noaccess_prefix = 0;
_special = false; _special = false;
} }
} }
void ReservedSpace::protect_noaccess_prefix(const size_t size) {
// If there is noaccess prefix, return.
if (_noaccess_prefix == 0) return;
assert(_noaccess_prefix >= (size_t)os::vm_page_size(),
"must be at least page size big");
// Protect memory at the base of the allocated region.
// If special, the page was committed (only matters on windows)
if (!os::protect_memory(_base, _noaccess_prefix, os::MEM_PROT_NONE,
_special)) {
fatal("cannot protect protection page");
}
_base += _noaccess_prefix;
_size -= _noaccess_prefix;
assert((size == _size) && ((uintptr_t)_base % _alignment == 0),
"must be exactly of required size and alignment");
}
ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment,
bool large, char* requested_address) :
ReservedSpace(size, alignment, large,
requested_address,
UseCompressedOops ? lcm(os::vm_page_size(), alignment) : 0) {
// Only reserved space for the java heap should have a noaccess_prefix
// if using compressed oops.
protect_noaccess_prefix(size);
}
ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size,
const size_t prefix_align,
const size_t suffix_size,
const size_t suffix_align) :
ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align,
UseCompressedOops ? lcm(os::vm_page_size(), prefix_align) : 0) {
protect_noaccess_prefix(prefix_size+suffix_size);
}
// VirtualSpace // VirtualSpace
@ -348,6 +411,7 @@ VirtualSpace::VirtualSpace() {
_lower_alignment = 0; _lower_alignment = 0;
_middle_alignment = 0; _middle_alignment = 0;
_upper_alignment = 0; _upper_alignment = 0;
_special = false;
} }
@ -402,7 +466,8 @@ VirtualSpace::~VirtualSpace() {
void VirtualSpace::release() { void VirtualSpace::release() {
(void)os::release_memory(low_boundary(), reserved_size()); // This does not release memory it never reserved.
// Caller must release via rs.release();
_low_boundary = NULL; _low_boundary = NULL;
_high_boundary = NULL; _high_boundary = NULL;
_low = NULL; _low = NULL;

View file

@ -29,13 +29,15 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
private: private:
char* _base; char* _base;
size_t _size; size_t _size;
size_t _noaccess_prefix;
size_t _alignment; size_t _alignment;
bool _special; bool _special;
// ReservedSpace // ReservedSpace
ReservedSpace(char* base, size_t size, size_t alignment, bool special); ReservedSpace(char* base, size_t size, size_t alignment, bool special);
void initialize(size_t size, size_t alignment, bool large, void initialize(size_t size, size_t alignment, bool large,
char* requested_address = NULL); char* requested_address,
const size_t noaccess_prefix);
// Release parts of an already-reserved memory region [addr, addr + len) to // Release parts of an already-reserved memory region [addr, addr + len) to
// get a new region that has "compound alignment." Return the start of the // get a new region that has "compound alignment." Return the start of the
@ -59,13 +61,19 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
const size_t suffix_size, const size_t suffix_size,
const size_t suffix_align); const size_t suffix_align);
protected:
// Create protection page at the beginning of the space.
void protect_noaccess_prefix(const size_t size);
public: public:
// Constructor // Constructor
ReservedSpace(size_t size); ReservedSpace(size_t size);
ReservedSpace(size_t size, size_t alignment, bool large, ReservedSpace(size_t size, size_t alignment, bool large,
char* requested_address = NULL); char* requested_address = NULL,
const size_t noaccess_prefix = 0);
ReservedSpace(const size_t prefix_size, const size_t prefix_align, ReservedSpace(const size_t prefix_size, const size_t prefix_align,
const size_t suffix_size, const size_t suffix_align); const size_t suffix_size, const size_t suffix_align,
const size_t noaccess_prefix);
// Accessors // Accessors
char* base() const { return _base; } char* base() const { return _base; }
@ -73,6 +81,8 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
size_t alignment() const { return _alignment; } size_t alignment() const { return _alignment; }
bool special() const { return _special; } bool special() const { return _special; }
size_t noaccess_prefix() const { return _noaccess_prefix; }
bool is_reserved() const { return _base != NULL; } bool is_reserved() const { return _base != NULL; }
void release(); void release();
@ -104,6 +114,16 @@ ReservedSpace ReservedSpace::last_part(size_t partition_size)
return last_part(partition_size, alignment()); return last_part(partition_size, alignment());
} }
// Class encapsulating behavior specific of memory space reserved for Java heap
class ReservedHeapSpace : public ReservedSpace {
public:
// Constructor
ReservedHeapSpace(size_t size, size_t forced_base_alignment,
bool large, char* requested_address);
ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align,
const size_t suffix_size, const size_t suffix_align);
};
// VirtualSpace is data structure for committing a previously reserved address range in smaller chunks. // VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
class VirtualSpace VALUE_OBJ_CLASS_SPEC { class VirtualSpace VALUE_OBJ_CLASS_SPEC {

View file

@ -5,3 +5,4 @@ bafed478d67c3acf7744aaad88b9404261ea6739 jdk7-b27
b996318955c0ad8e9fa0ffb56c74f626786e863f jdk7-b28 b996318955c0ad8e9fa0ffb56c74f626786e863f jdk7-b28
617ee8607cfd5fd81f233f3c0b690f85084687a0 jdk7-b29 617ee8607cfd5fd81f233f3c0b690f85084687a0 jdk7-b29
2d94a238a1641d074e6032dcdceed461d6f85d6a jdk7-b30 2d94a238a1641d074e6032dcdceed461d6f85d6a jdk7-b30
255d64ee287e926e8629dd80bc67690e65eeba30 jdk7-b31

View file

@ -5,3 +5,4 @@ debd37e1a422e580edb086c95d6e89199133a39c jdk7-b26
eefcd5204500a11d6aa802dca9f961cf10ab64c2 jdk7-b28 eefcd5204500a11d6aa802dca9f961cf10ab64c2 jdk7-b28
836c55713abab186e4de0c6eabd06ff008c7b8d0 jdk7-b29 836c55713abab186e4de0c6eabd06ff008c7b8d0 jdk7-b29
7f2466f8cc7009702e548d1a763254f546024d7e jdk7-b30 7f2466f8cc7009702e548d1a763254f546024d7e jdk7-b30
f978623825364a2ad9c6f51d02fc9424a8b0bc86 jdk7-b31

View file

@ -6,3 +6,4 @@ fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26
e21f4266466cd1306b176aaa08b2cd8337a9be3d jdk7-b29 e21f4266466cd1306b176aaa08b2cd8337a9be3d jdk7-b29
b6d6877c1155621a175dccd12dc14c54f938fb8b jdk7-b30 b6d6877c1155621a175dccd12dc14c54f938fb8b jdk7-b30
b7474b739d13bacd9972f88ac91f6350b7b0be12 jdk7-b31 b7474b739d13bacd9972f88ac91f6350b7b0be12 jdk7-b31
c51121419e30eac5f0fbbce45ff1711c4ce0de28 jdk7-b32

View file

@ -97,9 +97,6 @@ ifeq ($(PLATFORM), windows)
/D "J2SE_FTYPE=0x1L" /D "J2SE_FTYPE=0x1L"
RES = $(OBJDIR)/$(PGRM).res RES = $(OBJDIR)/$(PGRM).res
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
else else
LDOUTPUT = -o #Have a space LDOUTPUT = -o #Have a space
LDDFLAGS += -lc LDDFLAGS += -lc

View file

@ -55,9 +55,6 @@ LIBRARY = jaas_nt
EXTRA_LIBS += netapi32.lib user32.lib mpr.lib EXTRA_LIBS += netapi32.lib user32.lib mpr.lib
endif #fdlibm endif #fdlibm
# code generates errors when compiled at warning level 3 and warnings are fatal # code generates errors when compiled at warning level 3 and warnings are fatal
ifeq ($(ARCH_DATA_MODEL), 64)
COMPILER_WARNINGS_FATAL=false
endif # ARCH_DATA_MODEL
endif # windows endif # windows
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)

View file

@ -149,10 +149,9 @@ endif # ARCH
PIC_CODE_LARGE = -fPIC PIC_CODE_LARGE = -fPIC
PIC_CODE_SMALL = -fpic PIC_CODE_SMALL = -fpic
GLOBAL_KPIC = $(PIC_CODE_LARGE) GLOBAL_KPIC = $(PIC_CODE_LARGE)
CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS)
ifeq ($(ARCH), amd64) ifeq ($(ARCH), amd64)
CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) -pipe CFLAGS_COMMON += -pipe
else
CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS)
endif endif
# Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 # Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1

View file

@ -40,6 +40,9 @@
# LDLIBS (set $(EXTRA_LIBS) instead) # LDLIBS (set $(EXTRA_LIBS) instead)
# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) # LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
# LINTFLAGS (set $(OTHER_LINTFLAGS) instead) # LINTFLAGS (set $(OTHER_LINTFLAGS) instead)
#
# Note: CPPFLAGS are used in C and C++ compiles.
#
# Get shared JDK settings # Get shared JDK settings
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
@ -112,6 +115,10 @@ endif
# Required with many of the source files. # Required with many of the source files.
# -mt Assume multi-threaded (important) # -mt Assume multi-threaded (important)
# #
# The more unusual options to the Sun C compiler:
# +w Print more warnings
# +w2 Maximum warnings
#
# #
# Debug flag for C and C++ compiler # Debug flag for C and C++ compiler
@ -140,15 +147,34 @@ ifeq ($(FASTDEBUG), true)
CXXFLAGS_DEBUG_OPTION = -g0 $(CC_FASTDEBUG_OPT) CXXFLAGS_DEBUG_OPTION = -g0 $(CC_FASTDEBUG_OPT)
endif endif
CFLAGS_COMMON = -v -mt -L$(OBJDIR) -xc99=%none CFLAGS_COMMON = -L$(OBJDIR)
# Do not allow C99 language features like declarations in code etc.
CFLAGS_COMMON += -xc99=%none
# Allow C++ comments in C code
CFLAGS_COMMON += -xCC CFLAGS_COMMON += -xCC
CFLAGS_COMMON += -errshort=tags
# Show error message tags on errors
CFLAGS_COMMON += -errshort=tags
CXXFLAGS_COMMON += -errtags=yes
# Optimization flags
CFLAGS_OPT = $(POPT) CFLAGS_OPT = $(POPT)
# Debug version flags
CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION)
CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED)
# Required C compiler flags
CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED)
# Maximum warnings all the time
CXXFLAGS_COMMON += +w
CFLAGS_COMMON += -v
# Assume MT behavior all the time (important) # Assume MT behavior all the time (important)
CXXFLAGS_COMMON = -mt CXXFLAGS_COMMON += -mt
CFLAGS_COMMON += -mt
# Assume no C++ exceptions are used # Assume no C++ exceptions are used
CXXFLAGS_COMMON += -features=no%except -DCC_NOEX CXXFLAGS_COMMON += -features=no%except -DCC_NOEX
@ -237,8 +263,8 @@ LINTFLAGS_COMMON += $(LINT_XARCH_OPTION)
# OTHER_CFLAGS += -DPERTURBALOT # OTHER_CFLAGS += -DPERTURBALOT
# #
CPPFLAGS_COMMON = -D$(ARCH_FAMILY) -D__solaris__ -D_REENTRANT CPPFLAGS_COMMON = -D__solaris__ -D$(ARCH_FAMILY)
CPPFLAGS_OPT = CPPFLAGS_OPT = -DNDEBUG
CPPFLAGS_DBG = -DDEBUG CPPFLAGS_DBG = -DDEBUG
ifeq ($(ARCH_FAMILY), i586) ifeq ($(ARCH_FAMILY), i586)

View file

@ -283,7 +283,7 @@ CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
ifeq ($(ARCH), amd64) ifeq ($(ARCH), amd64)
CPPFLAGS_COMMON += -D_AMD64_ -Damd64 CPPFLAGS_COMMON += -D_AMD64_ -Damd64
else else
CPPFLAGS_COMMON += -DWIN32 -D_X86_ -Dx86 CPPFLAGS_COMMON += -D_X86_ -Dx86
endif endif
CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
@ -292,17 +292,24 @@ CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
# #
CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map
#
# Use -wdNNNN to disable warning NNNN.
# C4800 is a warning about bool performance casts (can't make go away)
#
COMPILER_WARNINGS_TO_IGNORE = 4800
CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%)
# #
# Add warnings and extra on 64bit issues # Add warnings and extra on 64bit issues
# #
ifeq ($(ARCH_DATA_MODEL), 64) ifeq ($(ARCH_DATA_MODEL), 64)
CFLAGS_COMMON += -Wp64 CFLAGS_COMMON += -Wp64
endif endif
CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
# #
# Treat compiler warnings as errors, if requested # Treat compiler warnings as errors, if requested
# #
CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
ifeq ($(COMPILER_WARNINGS_FATAL),true) ifeq ($(COMPILER_WARNINGS_FATAL),true)
CFLAGS_COMMON += -WX CFLAGS_COMMON += -WX
endif endif
@ -352,17 +359,9 @@ else
# BUILD_WIN_SA=1 # BUILD_WIN_SA=1
# on the make command. # on the make command.
ifdef BUILD_WIN_SA ifdef BUILD_WIN_SA
ifeq ($(ARCH), amd64) INCLUDE_SA = true
INCLUDE_SA = true
else
INCLUDE_SA = true
endif
else else
ifeq ($(ARCH), amd64) INCLUDE_SA = false
INCLUDE_SA = false
else
INCLUDE_SA = false
endif
endif endif
endif endif
@ -404,7 +403,6 @@ ifdef JDK_UPDATE_VERSION
else else
JDK_UPDATE_VER := 0 JDK_UPDATE_VER := 0
endif endif
JDK_VER = $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER)
RC_FLAGS = /l 0x409 /r RC_FLAGS = /l 0x409 /r
@ -414,15 +412,23 @@ else
RC_FLAGS += $(MS_RC_DEBUG_OPTION) RC_FLAGS += $(MS_RC_DEBUG_OPTION)
endif endif
ifndef COPYRIGHT_YEAR # Values for the RC variables defined in RC_FLAGS
COPYRIGHT_YEAR = 2007 JDK_RC_BUILD_ID = $(FULL_VERSION)
endif JDK_RC_COMPANY = $(COMPANY_NAME)
JDK_RC_COMPONENT = $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) binary
JDK_RC_VER = \
$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
JDK_RC_COPYRIGHT = Copyright \xA9 $(COPYRIGHT_YEAR)
JDK_RC_NAME = \
$(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)
JDK_RC_FVER = \
$(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER)
# J2SE name required here # J2SE name required here
RC_FLAGS += -d "J2SE_BUILD_ID=$(FULL_VERSION)" \ RC_FLAGS += -d "J2SE_BUILD_ID=$(JDK_RC_BUILD_ID)" \
-d "J2SE_COMPANY=$(COMPANY_NAME)" \ -d "J2SE_COMPANY=$(JDK_RC_COMPANY)" \
-d "J2SE_COMPONENT=$(PRODUCT_NAME) Platform SE binary" \ -d "J2SE_COMPONENT=$(JDK_RC_COMPONENT)" \
-d "J2SE_VER=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)" \ -d "J2SE_VER=$(JDK_RC_VER)" \
-d "J2SE_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \ -d "J2SE_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
-d "J2SE_NAME=$(PRODUCT_NAME) Platform SE $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)" \ -d "J2SE_NAME=$(JDK_RC_NAME)" \
-d "J2SE_FVER=$(JDK_VER)" -d "J2SE_FVER=$(JDK_RC_FVER)"

View file

@ -703,7 +703,7 @@ endif
ifdef ALT_COPYRIGHT_YEAR ifdef ALT_COPYRIGHT_YEAR
COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
else else
COPYRIGHT_YEAR = $(shell $(DATE) '+%Y') COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
endif endif
# Install of imported file (JDK_IMPORT_PATH, or some other external location) # Install of imported file (JDK_IMPORT_PATH, or some other external location)

View file

@ -73,23 +73,18 @@ ifeq ($(PLATFORM), linux)
REQUIRED_CC_VER = 4.0 REQUIRED_CC_VER = 4.0
REQUIRED_GCC_VER = 4.0.* REQUIRED_GCC_VER = 4.0.*
else else
ifeq ($(ARCH_DATA_MODEL), 32)
# i586
REQUIRED_CC_VER = 3.2 REQUIRED_CC_VER = 3.2
REQUIRED_GCC_VER = 3.2.1* ifeq ($(ARCH_DATA_MODEL), 32)
REQUIRED_GCC_VER_INT = 3.2.1-7a REQUIRED_GCC_VER = 3.2.1*
else REQUIRED_GCC_VER_INT = 3.2.1-7a
ifeq ($(ARCH), amd64) else
# amd64 ifeq ($(ARCH), amd64)
REQUIRED_CC_VER = 3.2 REQUIRED_GCC_VER = 3.2.*
REQUIRED_GCC_VER = 3.2.* endif
endif ifeq ($(ARCH), ia64)
ifeq ($(ARCH), ia64) REQUIRED_GCC_VER = 2.9[56789].*
# ia64 endif
REQUIRED_CC_VER = 3.2 endif
REQUIRED_GCC_VER = 2.9[56789].*
endif
endif
endif endif
# Option used to create a shared library # Option used to create a shared library
SHARED_LIBRARY_FLAG = -shared -mimpure-text SHARED_LIBRARY_FLAG = -shared -mimpure-text

View file

@ -107,7 +107,10 @@ JAVACFLAGS =
ifeq ($(DEBUG_CLASSFILES),true) ifeq ($(DEBUG_CLASSFILES),true)
JAVACFLAGS += -g JAVACFLAGS += -g
endif endif
ifeq ($(COMPILER_WARNINGS_FATAL), true) ifeq ($(JAVAC_MAX_WARNINGS), true)
JAVACFLAGS += -Xlint:all
endif
ifeq ($(JAVAC_WARNINGS_FATAL), true)
JAVACFLAGS += -Werror JAVACFLAGS += -Werror
endif endif
@ -180,7 +183,10 @@ endif
# The javac options supplied to the boot javac is limited. This compiler # The javac options supplied to the boot javac is limited. This compiler
# should only be used to build the 'make/tools' sources, which are not # should only be used to build the 'make/tools' sources, which are not
# class files that end up in the classes directory. # class files that end up in the classes directory.
ifeq ($(COMPILER_WARNINGS_FATAL), true) ifeq ($(JAVAC_MAX_WARNINGS), true)
BOOT_JAVACFLAGS += -Xlint:all
endif
ifeq ($(JAVAC_WARNINGS_FATAL), true)
BOOT_JAVACFLAGS += -Werror BOOT_JAVACFLAGS += -Werror
endif endif
BOOT_JAVACFLAGS += -encoding ascii BOOT_JAVACFLAGS += -encoding ascii

View file

@ -188,16 +188,18 @@ ifndef MILESTONE
endif endif
# Default names # Default names
LAUNCHER_NAME = java
PRODUCT_NAME = Java(TM)
PRODUCT_SUFFIX = SE Runtime Environment
COMPANY_NAME = Sun Microsystems, Inc.
ifdef OPENJDK ifdef OPENJDK
LAUNCHER_NAME = openjdk LAUNCHER_NAME = openjdk
PRODUCT_NAME = OpenJDK PRODUCT_NAME = OpenJDK
PRODUCT_SUFFIX = Runtime Environment PRODUCT_SUFFIX = Runtime Environment
COMPANY_NAME = JDK_RC_PLATFORM_NAME = Platform
COMPANY_NAME = N/A
else
LAUNCHER_NAME = java
PRODUCT_NAME = Java(TM)
PRODUCT_SUFFIX = SE Runtime Environment
JDK_RC_PLATFORM_NAME = Platform SE
COMPANY_NAME = Sun Microsystems, Inc.
endif endif
RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX) RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)

View file

@ -373,34 +373,40 @@ ifeq ($(PLATFORM), windows)
REQUIRED_DXSDK_VER = 0x0900 REQUIRED_DXSDK_VER = 0x0900
OS_VENDOR = Microsoft OS_VENDOR = Microsoft
# How much RAM does this machine have: # How much RAM does this machine have:
ifeq ($(USING_CYGWIN),true) ifeq ($(JDK_HAS_MEM_INFO),)
# CYGWIN has the 'free' utility ifeq ($(USING_CYGWIN),true)
_MB_OF_MEMORY := \ # CYGWIN has the 'free' utility
$(shell free -m | grep Mem: | awk '{print $$2;}' )
else
# Windows 2000 has the mem utility, but two memory areas
# extended memory is what is beyond 1024M
_B_OF_EXT_MEMORY := \
$(shell mem 2> $(DEV_NULL) | grep 'total contiguous extended memory' | awk '{print $$1;}')
ifeq ($(_B_OF_EXT_MEMORY),)
_B_OF_MEMORY := \
$(shell mem 2> $(DEV_NULL) | grep 'total conventional memory' | awk '{print $$1;}')
else
_B_OF_MEMORY := \
$(shell expr 1048576 '+' $(_B_OF_EXT_MEMORY) 2> $(DEV_NULL))
endif
ifeq ($(_B_OF_MEMORY),)
# Windows 2003 has the systeminfo utility use it if mem doesn't work
_MB_OF_MEMORY := \ _MB_OF_MEMORY := \
$(shell systeminfo 2> $(DEV_NULL) | grep 'Total Physical Memory:' | awk '{print $$4;}' | sed -e 's@,@@') $(shell free -m | grep Mem: | awk '{print $$2;}' )
else else
_MB_OF_MEMORY := $(shell expr $(_B_OF_MEMORY) '/' 1024 2> $(DEV_NULL)) # Windows 2000 has the mem utility, but two memory areas
# extended memory is what is beyond 1024M
_B_OF_EXT_MEMORY := \
$(shell mem 2> $(DEV_NULL) | \
grep 'total contiguous extended memory' | awk '{print $$1;}')
ifeq ($(_B_OF_EXT_MEMORY),)
_B_OF_MEMORY := \
$(shell mem 2> $(DEV_NULL) | \
grep 'total conventional memory' | awk '{print $$1;}')
else
_B_OF_MEMORY := \
$(shell expr 1048576 '+' $(_B_OF_EXT_MEMORY) 2> $(DEV_NULL))
endif
ifeq ($(_B_OF_MEMORY),)
# Windows 2003 has the systeminfo utility use it if mem doesn't work
_MB_OF_MEMORY := \
$(shell systeminfo 2> $(DEV_NULL) | \
grep 'Total Physical Memory:' | \
awk '{print $$4;}' | sed -e 's@,@@')
else
_MB_OF_MEMORY := $(shell expr $(_B_OF_MEMORY) '/' 1024 2> $(DEV_NULL))
endif
endif
ifeq ($(shell expr $(_MB_OF_MEMORY) '+' 0 2> $(DEV_NULL)), $(_MB_OF_MEMORY))
MB_OF_MEMORY := $(_MB_OF_MEMORY)
else
MB_OF_MEMORY := 512
endif endif
endif
ifeq ($(shell expr $(_MB_OF_MEMORY) '+' 0 2> $(DEV_NULL)), $(_MB_OF_MEMORY))
MB_OF_MEMORY := $(_MB_OF_MEMORY)
else
MB_OF_MEMORY := 512
endif endif
endif endif
@ -446,30 +452,38 @@ endif
# system swapping during the build. # system swapping during the build.
# If we don't know, assume 512. Subtract 128 from MB for VM MAX. # If we don't know, assume 512. Subtract 128 from MB for VM MAX.
# Don't set VM max over 1024-128=896. # Don't set VM max over 1024-128=896.
ifneq ($(MB_OF_MEMORY),) ifeq ($(JDK_HAS_MEM_INFO),)
LOW_MEMORY_MACHINE := $(shell \ JDK_HAS_MEM_INFO=true
if [ $(MB_OF_MEMORY) -le 512 ] ; then \ export JDK_HAS_MEM_INFO
echo "true"; \ ifneq ($(MB_OF_MEMORY),)
else \ LOW_MEMORY_MACHINE := $(shell \
echo "false"; \ if [ $(MB_OF_MEMORY) -le 512 ] ; then \
fi) echo "true"; \
MAX_VM_MEMORY := $(shell \ else \
if [ $(MB_OF_MEMORY) -le 1024 ] ; then \ echo "false"; \
expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \ fi)
else \ MAX_VM_MEMORY := $(shell \
echo "896"; \ if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
fi) expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \
MIN_VM_MEMORY := $(shell \ else \
if [ $(MAX_VM_MEMORY) -le 128 ] ; then \ echo "896"; \
expr $(MAX_VM_MEMORY) '-' 8 2> $(DEV_NULL) ; \ fi)
else \ MIN_VM_MEMORY := $(shell \
echo "128"; \ if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
fi) expr $(MAX_VM_MEMORY) '-' 8 2> $(DEV_NULL) ; \
else else \
MB_OF_MEMORY := unknown echo "128"; \
LOW_MEMORY_MACHINE := true fi)
MAX_VM_MEMORY := 384 else
MIN_VM_MEMORY := 128 MB_OF_MEMORY := unknown
LOW_MEMORY_MACHINE := true
MAX_VM_MEMORY := 384
MIN_VM_MEMORY := 128
endif
export MB_OF_MEMORY
export LOW_MEMORY_MACHINE
export MAX_VM_MEMORY
export MIN_VM_MEMORY
endif endif
# If blanks in the username, use the first 4 words and pack them together # If blanks in the username, use the first 4 words and pack them together

View file

@ -46,8 +46,6 @@ ifeq ($(PLATFORM),windows)
_OPT = $(CC_NO_OPT) _OPT = $(CC_NO_OPT)
OTHER_CFLAGS = OTHER_CFLAGS =
CPPFLAGS_DBG += -DLOGGING CPPFLAGS_DBG += -DLOGGING
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif endif
# #

View file

@ -37,8 +37,6 @@ include $(BUILDDIR)/common/Defs.gmk
# windows compiler flags # windows compiler flags
ifeq ($(PLATFORM),windows) ifeq ($(PLATFORM),windows)
CPPFLAGS_DBG += -DLOGGING CPPFLAGS_DBG += -DLOGGING
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif endif
FILES_c = \ FILES_c = \

View file

@ -37,8 +37,6 @@ include $(BUILDDIR)/common/Defs.gmk
# windows compiler flags # windows compiler flags
ifeq ($(PLATFORM),windows) ifeq ($(PLATFORM),windows)
OTHER_CFLAGS = OTHER_CFLAGS =
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
# build directly into BINDIR... # build directly into BINDIR...
LIB_LOCATION = $(BINDIR) LIB_LOCATION = $(BINDIR)
# Exported functions # Exported functions

View file

@ -47,11 +47,6 @@ FILES_c = java_crw_demo.c
OTHER_INCLUDES = -I$(SRCDIR) OTHER_INCLUDES = -I$(SRCDIR)
#
# This removes all asserts in the optimized version
#
CPPFLAGS_OPT += -DNDEBUG
# #
# Library to compile. # Library to compile.
# #

View file

@ -91,11 +91,6 @@ endif
# #
INIT += $(LIBDIR)/jvm.hprof.txt INIT += $(LIBDIR)/jvm.hprof.txt
#
# This removes all asserts in the optimized version
#
CPPFLAGS_OPT += -DNDEBUG
# #
# This puts logging code in # This puts logging code in
# #

View file

@ -115,9 +115,6 @@ ifeq ($(PLATFORM), windows)
-export:JLI_ManifestIterate \ -export:JLI_ManifestIterate \
-export:JLI_SetTraceLauncher -export:JLI_SetTraceLauncher
# Files from zlib built here do not compile with warning level 3
# if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif endif
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC) OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)

View file

@ -94,8 +94,6 @@ include $(BUILDDIR)/common/Library.gmk
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
OTHER_LDLIBS = ws2_32.lib $(JVMLIB) OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
# Will not compile at warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
else else
OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB) OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB)
endif endif

View file

@ -134,7 +134,6 @@ ifeq ($(PLATFORM),windows)
$(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj
endif endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
COMPILER_WARNINGS_FATAL=true
OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl
endif endif
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)

View file

@ -52,11 +52,6 @@ FILES_c = \
OTHER_INCLUDES = -I$(SRCDIR) -I$(PSRCDIR) OTHER_INCLUDES = -I$(SRCDIR) -I$(PSRCDIR)
#
# This removes all asserts in the optimized version
#
CPPFLAGS_OPT += -DNDEBUG
# #
# Library to compile. # Library to compile.
# #

View file

@ -43,8 +43,6 @@ ifeq ($(PLATFORM), windows)
# #
JAVALIB = JAVALIB =
EXTRA_LIBS = EXTRA_LIBS =
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif endif
# #

View file

@ -49,9 +49,6 @@ FILES_export = \
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
OTHER_CFLAGS += -DUSE_MMAP OTHER_CFLAGS += -DUSE_MMAP
else
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif endif
# #

View file

@ -52,11 +52,6 @@ ifneq ($(PLATFORM), windows)
OTHER_LDLIBS += -ldl OTHER_LDLIBS += -ldl
endif # PLATFORM endif # PLATFORM
#
# This turns off all assert() checking in the optimized library
#
CPPFLAGS_OPT += -DNDEBUG
# #
# This controls the ability to do logging in the library. # This controls the ability to do logging in the library.
# #

View file

@ -36,13 +36,6 @@ FILES_m = mapfile-vers
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# 64-bit windows does not build at -W3 if warnings are fatal
ifeq ($(PLATFORM), windows)
ifeq ($(ARCH_DATA_MODEL), 64)
COMPILER_WARNINGS_FATAL=false
endif
endif
FILES_c = \ FILES_c = \
SharedMemoryTransport.c \ SharedMemoryTransport.c \
SharedMemoryConnection.c \ SharedMemoryConnection.c \

View file

@ -36,11 +36,6 @@ FILES_m = mapfile-vers
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
ifeq ($(PLATFORM), windows)
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread
endif endif

View file

@ -47,8 +47,6 @@ FILES_export = \
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
# Override the default version info with our own resource file (see 5043594) # Override the default version info with our own resource file (see 5043594)
VERSIONINFO_RESOURCE = $(CLOSED_SRC)/share/native/sun/java2d/cmm/kcms/cmm.rc VERSIONINFO_RESOURCE = $(CLOSED_SRC)/share/native/sun/java2d/cmm/kcms/cmm.rc
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif endif
# Rules # Rules

View file

@ -77,9 +77,6 @@ FILES_export = \
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
OTHER_CFLAGS += -DCC_NOEX OTHER_CFLAGS += -DCC_NOEX

View file

@ -64,9 +64,6 @@ FILES_export = \
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
# t2k imports several shared methods from fontmanager.dll # t2k imports several shared methods from fontmanager.dll
LDLIBS += user32.lib $(OBJDIR)/../../../sun.font/fontmanager/$(OBJDIRNAME)/fontmanager.lib LDLIBS += user32.lib $(OBJDIR)/../../../sun.font/fontmanager/$(OBJDIRNAME)/fontmanager.lib

View file

@ -69,11 +69,6 @@ ifneq ($(PLATFORM), windows)
INIT += $(ODBC_FAKE_LIBRARIES) INIT += $(ODBC_FAKE_LIBRARIES)
endif endif
ifeq ($(PLATFORM),windows)
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif
# #
# Rules # Rules
# #

View file

@ -73,10 +73,5 @@ include $(BUILDDIR)/common/Library.gmk
# #
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg
ifeq ($(PLATFORM), windows)
# Files built here do not compile with warning level 3 if warnings are fatal
COMPILER_WARNINGS_FATAL=false
endif # PLATFORM
CLASSES.export += java.io.InputStream CLASSES.export += java.io.InputStream

View file

@ -5,3 +5,4 @@ a17265993253d61becd04fe7d96d1fe8b4bd6dff jdk7-b27
4ef4bd31856949554967fbf22783babb21a62a0e jdk7-b28 4ef4bd31856949554967fbf22783babb21a62a0e jdk7-b28
dec081837b01d509dcc2b9de86a4299c1ec17e04 jdk7-b29 dec081837b01d509dcc2b9de86a4299c1ec17e04 jdk7-b29
eaf608c64fecf70f955dc9f29f94c055b183aeec jdk7-b30 eaf608c64fecf70f955dc9f29f94c055b183aeec jdk7-b30
07c916ecfc71f6bf432e4ff09bfbfb6290b5703c jdk7-b31

View file

@ -78,6 +78,19 @@ public class Attributes implements Iterable<Attribute> {
return map.get(name); return map.get(name);
} }
public int getIndex(ConstantPool constant_pool, String name) {
for (int i = 0; i < attrs.length; i++) {
Attribute attr = attrs[i];
try {
if (attr != null && attr.getName(constant_pool).equals(name))
return i;
} catch (ConstantPoolException e) {
// ignore invalid entries
}
}
return -1;
}
public int size() { public int size() {
return attrs.length; return attrs.length;
} }

View file

@ -36,10 +36,6 @@ import java.util.List;
public class Type { public class Type {
protected Type() { } protected Type() { }
public boolean isObject() {
return false;
}
protected static void append(StringBuilder sb, String prefix, List<? extends Type> types, String suffix) { protected static void append(StringBuilder sb, String prefix, List<? extends Type> types, String suffix) {
sb.append(prefix); sb.append(prefix);
String sep = ""; String sep = "";
@ -66,11 +62,6 @@ public class Type {
return name; return name;
} }
@Override
public boolean isObject() {
return name.equals("java.lang.Object");
}
public final String name; public final String name;
} }
@ -129,7 +120,7 @@ public class Type {
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
appendIfNotEmpty(sb, "<", typeArgTypes, ">"); appendIfNotEmpty(sb, "<", typeArgTypes, ">");
if (superclassType != null && !superclassType.isObject()) { if (superclassType != null) {
sb.append(" extends "); sb.append(" extends ");
sb.append(superclassType); sb.append(superclassType);
} }
@ -188,7 +179,7 @@ public class Type {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(name); sb.append(name);
String sep = " extends "; String sep = " extends ";
if (classBound != null && !classBound.isObject()) { if (classBound != null) {
sb.append(sep); sb.append(sep);
sb.append(classBound); sb.append(classBound);
sep = " & "; sep = " & ";

View file

@ -345,18 +345,18 @@ public abstract class AbstractMemberWriter {
/** /**
* Print use info. * Print use info.
*/ */
protected void printUseInfo(Object mems, String heading) { protected void printUseInfo(List<? extends ProgramElementDoc> mems, String heading) {
if (mems == null) { if (mems == null) {
return; return;
} }
List members = (List)mems; List<? extends ProgramElementDoc> members = mems;
if (members.size() > 0) { if (members.size() > 0) {
writer.tableIndexSummary(); writer.tableIndexSummary();
writer.tableUseInfoHeaderStart("#CCCCFF"); writer.tableUseInfoHeaderStart("#CCCCFF");
writer.print(heading); writer.print(heading);
writer.tableHeaderEnd(); writer.tableHeaderEnd();
for (Iterator it = members.iterator(); it.hasNext(); ) { for (Iterator<? extends ProgramElementDoc> it = members.iterator(); it.hasNext(); ) {
ProgramElementDoc pgmdoc = (ProgramElementDoc)it.next(); ProgramElementDoc pgmdoc = it.next();
ClassDoc cd = pgmdoc.containingClass(); ClassDoc cd = pgmdoc.containingClass();
writer.printSummaryLinkType(this, pgmdoc); writer.printSummaryLinkType(this, pgmdoc);

View file

@ -39,28 +39,28 @@ public class ClassUseWriter extends SubWriterHolderWriter {
final ClassDoc classdoc; final ClassDoc classdoc;
Set pkgToPackageAnnotations = null; Set pkgToPackageAnnotations = null;
final Map pkgToClassTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
final Map pkgToClassAnnotations; final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
final Map pkgToMethodTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
final Map pkgToMethodArgTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
final Map pkgToMethodReturnTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
final Map pkgToMethodAnnotations; final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
final Map pkgToMethodParameterAnnotations; final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
final Map pkgToFieldTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
final Map pkgToFieldAnnotations; final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
final Map pkgToSubclass; final Map<String,List<ProgramElementDoc>> pkgToSubclass;
final Map pkgToSubinterface; final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
final Map pkgToImplementingClass; final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
final Map pkgToField; final Map<String,List<ProgramElementDoc>> pkgToField;
final Map pkgToMethodReturn; final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
final Map pkgToMethodArgs; final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
final Map pkgToMethodThrows; final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
final Map pkgToConstructorAnnotations; final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
final Map pkgToConstructorParameterAnnotations; final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
final Map pkgToConstructorArgs; final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
final Map pkgToConstructorArgTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
final Map pkgToConstructorThrows; final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
final SortedSet pkgSet; final SortedSet<PackageDoc> pkgSet;
final MethodWriterImpl methodSubWriter; final MethodWriterImpl methodSubWriter;
final ConstructorWriterImpl constrSubWriter; final ConstructorWriterImpl constrSubWriter;
final FieldWriterImpl fieldSubWriter; final FieldWriterImpl fieldSubWriter;
@ -81,9 +81,9 @@ public class ClassUseWriter extends SubWriterHolderWriter {
super(configuration, path, filename, relpath); super(configuration, path, filename, relpath);
this.classdoc = classdoc; this.classdoc = classdoc;
if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName())) if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
pkgToPackageAnnotations = new HashSet((List) mapper.classToPackageAnnotations.get(classdoc.qualifiedName())); pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
configuration.currentcd = classdoc; configuration.currentcd = classdoc;
this.pkgSet = new TreeSet(); this.pkgSet = new TreeSet<PackageDoc>();
this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam); this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations); this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam); this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
@ -135,19 +135,19 @@ public class ClassUseWriter extends SubWriterHolderWriter {
} }
} }
private Map pkgDivide(Map classMap) { private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
Map map = new HashMap(); Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
List list= (List)classMap.get(classdoc.qualifiedName()); List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
if (list != null) { if (list != null) {
Collections.sort(list); Collections.sort(list);
Iterator it = list.iterator(); Iterator<? extends ProgramElementDoc> it = list.iterator();
while (it.hasNext()) { while (it.hasNext()) {
ProgramElementDoc doc = (ProgramElementDoc)it.next(); ProgramElementDoc doc = it.next();
PackageDoc pkg = doc.containingPackage(); PackageDoc pkg = doc.containingPackage();
pkgSet.add(pkg); pkgSet.add(pkg);
List inPkg = (List)map.get(pkg.name()); List<ProgramElementDoc> inPkg = map.get(pkg.name());
if (inPkg == null) { if (inPkg == null) {
inPkg = new ArrayList(); inPkg = new ArrayList<ProgramElementDoc>();
map.put(pkg.name(), inPkg); map.put(pkg.name(), inPkg);
} }
inPkg.add(doc); inPkg.add(doc);

View file

@ -253,7 +253,7 @@ public class ConfigurationImpl extends Configuration {
} }
} }
if (root.specifiedClasses().length > 0) { if (root.specifiedClasses().length > 0) {
Map map = new HashMap(); Map<String,PackageDoc> map = new HashMap<String,PackageDoc>();
PackageDoc pd; PackageDoc pd;
ClassDoc[] classes = root.classes(); ClassDoc[] classes = root.classes();
for (int i = 0; i < classes.length; i++) { for (int i = 0; i < classes.length; i++) {
@ -481,7 +481,7 @@ public class ConfigurationImpl extends Configuration {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Comparator getMemberComparator() { public Comparator<ProgramElementDoc> getMemberComparator() {
return null; return null;
} }
} }

View file

@ -107,7 +107,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set printedPackageHeaders) { public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set<String> printedPackageHeaders) {
String packageName = pkg.name(); String packageName = pkg.name();
//add link to summary //add link to summary
li(); li();

View file

@ -55,10 +55,10 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
super(writer, classDoc); super(writer, classDoc);
VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc, VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated); VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated);
List constructors = new ArrayList(visibleMemberMap.getMembersFor(classDoc)); List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc));
for (int i = 0; i < constructors.size(); i++) { for (int i = 0; i < constructors.size(); i++) {
if (((ProgramElementDoc)(constructors.get(i))).isProtected() || if ((constructors.get(i)).isProtected() ||
((ProgramElementDoc)(constructors.get(i))).isPrivate()) { (constructors.get(i)).isPrivate()) {
setFoundNonPubConstructor(true); setFoundNonPubConstructor(true);
} }
} }

View file

@ -1463,7 +1463,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
int originalLength = result.length(); int originalLength = result.length();
TagletOutput output = TagletWriter.getInlineTagOuput( TagletOutput output = TagletWriter.getInlineTagOuput(
configuration.tagletManager, holderTag, configuration.tagletManager, holderTag,
(Tag) tagelem, getTagletWriterInstance(isFirstSentence)); tagelem, getTagletWriterInstance(isFirstSentence));
result.append(output == null ? "" : output.toString()); result.append(output == null ? "" : output.toString());
if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) { if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) {
break; break;
@ -1750,8 +1750,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @return an array of strings representing the annotations being * @return an array of strings representing the annotations being
* documented. * documented.
*/ */
private List getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) { private List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
List results = new ArrayList(); List<String> results = new ArrayList<String>();
StringBuffer annotation; StringBuffer annotation;
for (int i = 0; i < descList.length; i++) { for (int i = 0; i < descList.length; i++) {
AnnotationTypeDoc annotationDoc = descList[i].annotationType(); AnnotationTypeDoc annotationDoc = descList[i].annotationType();
@ -1781,7 +1781,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
pairs[j].element(), pairs[j].element().name(), false)); pairs[j].element(), pairs[j].element().name(), false));
annotation.append('='); annotation.append('=');
AnnotationValue annotationValue = pairs[j].value(); AnnotationValue annotationValue = pairs[j].value();
List annotationTypeValues = new ArrayList(); List<AnnotationValue> annotationTypeValues = new ArrayList<AnnotationValue>();
if (annotationValue.value() instanceof AnnotationValue[]) { if (annotationValue.value() instanceof AnnotationValue[]) {
AnnotationValue[] annotationArray = AnnotationValue[] annotationArray =
(AnnotationValue[]) annotationValue.value(); (AnnotationValue[]) annotationValue.value();

View file

@ -90,7 +90,7 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
tagletManager.getSerializedFormTags(), tagletManager.getSerializedFormTags(),
writer.getTagletWriterInstance(false), output); writer.getTagletWriterInstance(false), output);
print(output.toString()); print(output.toString());
MethodDoc method = (MethodDoc)member; MethodDoc method = member;
if (method.name().compareTo("writeExternal") == 0 if (method.name().compareTo("writeExternal") == 0
&& method.tags("serialData").length == 0) { && method.tags("serialData").length == 0) {
serialWarning(member.position(), "doclet.MissingSerialDataTag", serialWarning(member.position(), "doclet.MissingSerialDataTag",

View file

@ -73,7 +73,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc)); super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc));
this.packageDoc = packageDoc; this.packageDoc = packageDoc;
if (configuration.root.specifiedPackages().length == 0) { if (configuration.root.specifiedPackages().length == 0) {
documentedClasses = new HashSet(Arrays.asList(configuration.root.classes())); documentedClasses = new HashSet<ClassDoc>(Arrays.asList(configuration.root.classes()));
} }
} }

View file

@ -49,7 +49,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
* *
* @see Group * @see Group
*/ */
private Map groupPackageMap; private Map<String,List<PackageDoc>> groupPackageMap;
/** /**
* List to store the order groups as specified on the command line. * List to store the order groups as specified on the command line.
@ -120,10 +120,9 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
protected void generateIndex() { protected void generateIndex() {
for (int i = 0; i < groupList.size(); i++) { for (int i = 0; i < groupList.size(); i++) {
String groupname = (String)groupList.get(i); String groupname = (String)groupList.get(i);
List list = (List)groupPackageMap.get(groupname); List<PackageDoc> list = groupPackageMap.get(groupname);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
printIndexContents((PackageDoc[])list. printIndexContents(list.toArray(new PackageDoc[list.size()]),
toArray(new PackageDoc[list.size()]),
groupname); groupname);
} }
} }

View file

@ -38,7 +38,7 @@ import java.util.*;
public class PackageUseWriter extends SubWriterHolderWriter { public class PackageUseWriter extends SubWriterHolderWriter {
final PackageDoc pkgdoc; final PackageDoc pkgdoc;
final SortedMap usingPackageToUsedClasses = new TreeMap(); final SortedMap<String,Set<ClassDoc>> usingPackageToUsedClasses = new TreeMap<String,Set<ClassDoc>>();
/** /**
* Constructor. * Constructor.
@ -61,15 +61,15 @@ public class PackageUseWriter extends SubWriterHolderWriter {
ClassDoc[] content = pkgdoc.allClasses(); ClassDoc[] content = pkgdoc.allClasses();
for (int i = 0; i < content.length; ++i) { for (int i = 0; i < content.length; ++i) {
ClassDoc usedClass = content[i]; ClassDoc usedClass = content[i];
Set usingClasses = (Set)mapper.classToClass.get(usedClass.qualifiedName()); Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName());
if (usingClasses != null) { if (usingClasses != null) {
for (Iterator it = usingClasses.iterator(); it.hasNext(); ) { for (Iterator it = usingClasses.iterator(); it.hasNext(); ) {
ClassDoc usingClass = (ClassDoc)it.next(); ClassDoc usingClass = (ClassDoc)it.next();
PackageDoc usingPackage = usingClass.containingPackage(); PackageDoc usingPackage = usingClass.containingPackage();
Set usedClasses = (Set)usingPackageToUsedClasses Set<ClassDoc> usedClasses = usingPackageToUsedClasses
.get(usingPackage.name()); .get(usingPackage.name());
if (usedClasses == null) { if (usedClasses == null) {
usedClasses = new TreeSet(); usedClasses = new TreeSet<ClassDoc>();
usingPackageToUsedClasses.put(Util.getPackageName(usingPackage), usingPackageToUsedClasses.put(Util.getPackageName(usingPackage),
usedClasses); usedClasses);
} }

View file

@ -120,12 +120,12 @@ public abstract class Configuration {
/** /**
* The list of doc-file subdirectories to exclude * The list of doc-file subdirectories to exclude
*/ */
protected Set excludedDocFileDirs; protected Set<String> excludedDocFileDirs;
/** /**
* The list of qualifiers to exclude * The list of qualifiers to exclude
*/ */
protected Set excludedQualifiers; protected Set<String> excludedQualifiers;
/** /**
* The Root of the generated Program Structure from the Doclet API. * The Root of the generated Program Structure from the Doclet API.
@ -255,8 +255,8 @@ public abstract class Configuration {
message = message =
new MessageRetriever(this, new MessageRetriever(this,
"com.sun.tools.doclets.internal.toolkit.resources.doclets"); "com.sun.tools.doclets.internal.toolkit.resources.doclets");
excludedDocFileDirs = new HashSet(); excludedDocFileDirs = new HashSet<String>();
excludedQualifiers = new HashSet(); excludedQualifiers = new HashSet<String>();
} }
/** /**
@ -329,14 +329,14 @@ public abstract class Configuration {
DocErrorReporter reporter); DocErrorReporter reporter);
private void initPackageArray() { private void initPackageArray() {
Set set = new HashSet(Arrays.asList(root.specifiedPackages())); Set<PackageDoc> set = new HashSet<PackageDoc>(Arrays.asList(root.specifiedPackages()));
ClassDoc[] classes = root.specifiedClasses(); ClassDoc[] classes = root.specifiedClasses();
for (int i = 0; i < classes.length; i++) { for (int i = 0; i < classes.length; i++) {
set.add(classes[i].containingPackage()); set.add(classes[i].containingPackage());
} }
ArrayList results = new ArrayList(set); ArrayList<PackageDoc> results = new ArrayList<PackageDoc>(set);
Collections.sort(results); Collections.sort(results);
packages = (PackageDoc[]) results.toArray(new PackageDoc[] {}); packages = results.toArray(new PackageDoc[] {});
} }
/** /**
@ -345,7 +345,7 @@ public abstract class Configuration {
* @param options the two dimensional array of options. * @param options the two dimensional array of options.
*/ */
public void setOptions(String[][] options) { public void setOptions(String[][] options) {
LinkedHashSet customTagStrs = new LinkedHashSet(); LinkedHashSet<String[]> customTagStrs = new LinkedHashSet<String[]>();
for (int oi = 0; oi < options.length; ++oi) { for (int oi = 0; oi < options.length; ++oi) {
String[] os = options[oi]; String[] os = options[oi];
String opt = os[0].toLowerCase(); String opt = os[0].toLowerCase();
@ -476,7 +476,7 @@ public abstract class Configuration {
} }
} }
private void addToSet(Set s, String str){ private void addToSet(Set<String> s, String str){
StringTokenizer st = new StringTokenizer(str, ":"); StringTokenizer st = new StringTokenizer(str, ":");
String current; String current;
while(st.hasMoreTokens()){ while(st.hasMoreTokens()){
@ -712,5 +712,5 @@ public abstract class Configuration {
* *
* @return the {@link java.util.Comparator} used to sort members. * @return the {@link java.util.Comparator} used to sort members.
*/ */
public abstract Comparator getMemberComparator(); public abstract Comparator<ProgramElementDoc> getMemberComparator();
} }

View file

@ -79,7 +79,7 @@ public interface ConstantsSummaryWriter {
* something more than once. * something more than once.
*/ */
public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
Set WriteedPackageHeaders); Set<String> WriteedPackageHeaders);
/** /**
* Write the given package name. * Write the given package name.

View file

@ -61,7 +61,7 @@ public abstract class AbstractBuilder {
* efficiency purposes. We don't want to copy the * efficiency purposes. We don't want to copy the
* doc files multiple times for a single package. * doc files multiple times for a single package.
*/ */
protected static Set containingPackagesSeen; protected static Set<String> containingPackagesSeen;
/** /**
* True if we want to print debug output. * True if we want to print debug output.

View file

@ -84,7 +84,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
builder.annotationTypeDoc = annotationTypeDoc; builder.annotationTypeDoc = annotationTypeDoc;
builder.writer = writer; builder.writer = writer;
if(containingPackagesSeen == null) { if(containingPackagesSeen == null) {
containingPackagesSeen = new HashSet(); containingPackagesSeen = new HashSet<String>();
} }
return builder; return builder;
} }

View file

@ -73,7 +73,7 @@ public class AnnotationTypeOptionalMemberBuilder extends
builder.writer = writer; builder.writer = writer;
builder.visibleMemberMap = new VisibleMemberMap(classDoc, builder.visibleMemberMap = new VisibleMemberMap(classDoc,
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, configuration.nodeprecated); VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, configuration.nodeprecated);
builder.members = new ArrayList( builder.members = new ArrayList<ProgramElementDoc>(
builder.visibleMemberMap.getMembersFor(classDoc)); builder.visibleMemberMap.getMembersFor(classDoc));
if (configuration.getMemberComparator() != null) { if (configuration.getMemberComparator() != null) {
Collections.sort(builder.members, Collections.sort(builder.members,

View file

@ -62,7 +62,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
/** /**
* The list of members being documented. * The list of members being documented.
*/ */
protected List members; protected List<ProgramElementDoc> members;
/** /**
* The index of the current member that is being documented at this point * The index of the current member that is being documented at this point
@ -97,7 +97,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
builder.writer = writer; builder.writer = writer;
builder.visibleMemberMap = new VisibleMemberMap(classDoc, builder.visibleMemberMap = new VisibleMemberMap(classDoc,
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, configuration.nodeprecated); VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, configuration.nodeprecated);
builder.members = new ArrayList( builder.members = new ArrayList<ProgramElementDoc>(
builder.visibleMemberMap.getMembersFor(classDoc)); builder.visibleMemberMap.getMembersFor(classDoc));
if (configuration.getMemberComparator() != null) { if (configuration.getMemberComparator() != null) {
Collections.sort(builder.members, Collections.sort(builder.members,

View file

@ -100,7 +100,7 @@ public class ClassBuilder extends AbstractBuilder {
Util.setEnumDocumentation(configuration, classDoc); Util.setEnumDocumentation(configuration, classDoc);
} }
if(containingPackagesSeen == null) { if(containingPackagesSeen == null) {
containingPackagesSeen = new HashSet(); containingPackagesSeen = new HashSet<String>();
} }
return builder; return builder;
} }

View file

@ -63,12 +63,12 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
/** /**
* The set of ClassDocs that have constant fields. * The set of ClassDocs that have constant fields.
*/ */
protected Set classDocsWithConstFields; protected Set<ClassDoc> classDocsWithConstFields;
/** /**
* The set of printed package headers. * The set of printed package headers.
*/ */
protected Set printedPackageHeaders; protected Set<String> printedPackageHeaders;
/** /**
* The current package being documented. * The current package being documented.
@ -102,7 +102,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
ConstantsSummaryBuilder builder = new ConstantsSummaryBuilder( ConstantsSummaryBuilder builder = new ConstantsSummaryBuilder(
configuration); configuration);
builder.writer = writer; builder.writer = writer;
builder.classDocsWithConstFields = new HashSet(); builder.classDocsWithConstFields = new HashSet<ClassDoc>();
return builder; return builder;
} }
@ -169,7 +169,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
public void buildContents() { public void buildContents() {
writer.writeContentsHeader(); writer.writeContentsHeader();
PackageDoc[] packages = configuration.packages; PackageDoc[] packages = configuration.packages;
printedPackageHeaders = new HashSet(); printedPackageHeaders = new HashSet<String>();
for (int i = 0; i < packages.length; i++) { for (int i = 0; i < packages.length; i++) {
if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) { if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) {
writer.writeLinkToPackageContent(packages[i], writer.writeLinkToPackageContent(packages[i],
@ -188,7 +188,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
*/ */
public void buildConstantSummaries(List elements) { public void buildConstantSummaries(List elements) {
PackageDoc[] packages = configuration.packages; PackageDoc[] packages = configuration.packages;
printedPackageHeaders = new HashSet(); printedPackageHeaders = new HashSet<String>();
for (int i = 0; i < packages.length; i++) { for (int i = 0; i < packages.length; i++) {
if (hasConstantField(packages[i])) { if (hasConstantField(packages[i])) {
currentPackage = packages[i]; currentPackage = packages[i];
@ -315,7 +315,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param pkgname the name of the package to check. * @param pkgname the name of the package to check.
*/ */
private boolean hasPrintedPackageIndex(String pkgname) { private boolean hasPrintedPackageIndex(String pkgname) {
String[] list = (String[])printedPackageHeaders.toArray(new String[] {}); String[] list = printedPackageHeaders.toArray(new String[] {});
for (int i = 0; i < list.length; i++) { for (int i = 0; i < list.length; i++) {
if (pkgname.startsWith(list[i])) { if (pkgname.startsWith(list[i])) {
return true; return true;
@ -363,7 +363,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* Builds the table of constants for a given class. * Builds the table of constants for a given class.
*/ */
protected void buildMembersSummary() { protected void buildMembersSummary() {
List members = new ArrayList(members()); List<FieldDoc> members = new ArrayList<FieldDoc>(members());
if (members.size() > 0) { if (members.size() > 0) {
Collections.sort(members); Collections.sort(members);
writer.writeConstantMembers(classdoc, members); writer.writeConstantMembers(classdoc, members);
@ -375,17 +375,17 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param cd the classdoc to examine. * @param cd the classdoc to examine.
* @return the list of visible constant fields for the given classdoc. * @return the list of visible constant fields for the given classdoc.
*/ */
protected List members() { protected List<FieldDoc> members() {
List l = visibleMemberMapFields.getLeafClassMembers(configuration); List<ProgramElementDoc> l = visibleMemberMapFields.getLeafClassMembers(configuration);
l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration)); l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration));
Iterator iter; Iterator<ProgramElementDoc> iter;
if(l != null){ if(l != null){
iter = l.iterator(); iter = l.iterator();
} else { } else {
return null; return null;
} }
List inclList = new LinkedList(); List<FieldDoc> inclList = new LinkedList<FieldDoc>();
FieldDoc member; FieldDoc member;
while(iter.hasNext()){ while(iter.hasNext()){
member = (FieldDoc)iter.next(); member = (FieldDoc)iter.next();

View file

@ -72,7 +72,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
/** /**
* The constructors being documented. * The constructors being documented.
*/ */
private List constructors; private List<ProgramElementDoc> constructors;
/** /**
* Construct a new ConstructorBuilder. * Construct a new ConstructorBuilder.
@ -104,12 +104,10 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
VisibleMemberMap.CONSTRUCTORS, VisibleMemberMap.CONSTRUCTORS,
configuration.nodeprecated); configuration.nodeprecated);
builder.constructors = builder.constructors =
new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
for (int i = 0; i < builder.constructors.size(); i++) { for (int i = 0; i < builder.constructors.size(); i++) {
if (((ProgramElementDoc) (builder.constructors.get(i))) if (builder.constructors.get(i).isProtected()
.isProtected() || builder.constructors.get(i).isPrivate()) {
|| ((ProgramElementDoc) (builder.constructors.get(i)))
.isPrivate()) {
writer.setFoundNonPubConstructor(true); writer.setFoundNonPubConstructor(true);
} }
} }

View file

@ -61,7 +61,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
/** /**
* The list of enum constants being documented. * The list of enum constants being documented.
*/ */
private List enumConstants; private List<ProgramElementDoc> enumConstants;
/** /**
* The index of the current enum constant that is being documented at this point * The index of the current enum constant that is being documented at this point
@ -99,7 +99,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
VisibleMemberMap.ENUM_CONSTANTS, VisibleMemberMap.ENUM_CONSTANTS,
configuration.nodeprecated); configuration.nodeprecated);
builder.enumConstants = builder.enumConstants =
new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
if (configuration.getMemberComparator() != null) { if (configuration.getMemberComparator() != null) {
Collections.sort( Collections.sort(
builder.enumConstants, builder.enumConstants,

View file

@ -61,7 +61,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
/** /**
* The list of fields being documented. * The list of fields being documented.
*/ */
private List fields; private List<ProgramElementDoc> fields;
/** /**
* The index of the current field that is being documented at this point * The index of the current field that is being documented at this point
@ -99,8 +99,8 @@ public class FieldBuilder extends AbstractMemberBuilder {
VisibleMemberMap.FIELDS, VisibleMemberMap.FIELDS,
configuration.nodeprecated); configuration.nodeprecated);
builder.fields = builder.fields =
new ArrayList(builder.visibleMemberMap.getLeafClassMembers( new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
configuration)); configuration));
if (configuration.getMemberComparator() != null) { if (configuration.getMemberComparator() != null) {
Collections.sort( Collections.sort(
builder.fields, builder.fields,

View file

@ -45,7 +45,7 @@ public class LayoutParser extends DefaultHandler {
/** /**
* The map of XML elements that have been parsed. * The map of XML elements that have been parsed.
*/ */
private Map xmlElementsMap; private Map<String,List<Object>> xmlElementsMap;
private Configuration configuration; private Configuration configuration;
private static LayoutParser instance; private static LayoutParser instance;
@ -56,7 +56,7 @@ public class LayoutParser extends DefaultHandler {
* This class is a singleton. * This class is a singleton.
*/ */
private LayoutParser(Configuration configuration) { private LayoutParser(Configuration configuration) {
xmlElementsMap = new HashMap(); xmlElementsMap = new HashMap<String,List<Object>>();
this.configuration = configuration; this.configuration = configuration;
} }
@ -83,7 +83,7 @@ public class LayoutParser extends DefaultHandler {
return (List) xmlElementsMap.get(root); return (List) xmlElementsMap.get(root);
} }
try { try {
List xmlElements = new ArrayList(); List<Object> xmlElements = new ArrayList<Object>();
xmlElementsMap.put(root, xmlElements); xmlElementsMap.put(root, xmlElements);
currentRoot = root; currentRoot = root;
isParsing = false; isParsing = false;
@ -106,7 +106,7 @@ public class LayoutParser extends DefaultHandler {
throws SAXException { throws SAXException {
if (isParsing || qName.equals(currentRoot)) { if (isParsing || qName.equals(currentRoot)) {
isParsing = true; isParsing = true;
List xmlElements = (List) xmlElementsMap.get(currentRoot); List<Object> xmlElements = xmlElementsMap.get(currentRoot);
xmlElements.add(qName); xmlElements.add(qName);
} }
} }
@ -120,11 +120,11 @@ public class LayoutParser extends DefaultHandler {
isParsing = false; isParsing = false;
return; return;
} }
List xmlElements = (List) xmlElementsMap.get(currentRoot); List<Object> xmlElements = xmlElementsMap.get(currentRoot);
if (xmlElements.get(xmlElements.size()-1).equals(qName)) { if (xmlElements.get(xmlElements.size()-1).equals(qName)) {
return; return;
} else { } else {
List subElements = new ArrayList(); List<Object> subElements = new ArrayList<Object>();
int targetIndex = xmlElements.indexOf(qName); int targetIndex = xmlElements.indexOf(qName);
int size = xmlElements.size(); int size = xmlElements.size();
for (int i = targetIndex; i < size; i++) { for (int i = targetIndex; i < size; i++) {

View file

@ -306,13 +306,13 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
*/ */
private void buildSummary(MemberSummaryWriter writer, private void buildSummary(MemberSummaryWriter writer,
VisibleMemberMap visibleMemberMap) { VisibleMemberMap visibleMemberMap) {
List members = new ArrayList(visibleMemberMap.getLeafClassMembers( List<ProgramElementDoc> members = new ArrayList<ProgramElementDoc>(visibleMemberMap.getLeafClassMembers(
configuration)); configuration));
if (members.size() > 0) { if (members.size() > 0) {
Collections.sort(members); Collections.sort(members);
writer.writeMemberSummaryHeader(classDoc); writer.writeMemberSummaryHeader(classDoc);
for (int i = 0; i < members.size(); i++) { for (int i = 0; i < members.size(); i++) {
ProgramElementDoc member = (ProgramElementDoc) members.get(i); ProgramElementDoc member = members.get(i);
Tag[] firstSentenceTags = member.firstSentenceTags(); Tag[] firstSentenceTags = member.firstSentenceTags();
if (member instanceof MethodDoc && firstSentenceTags.length == 0) { if (member instanceof MethodDoc && firstSentenceTags.length == 0) {
//Inherit comments from overriden or implemented method if //Inherit comments from overriden or implemented method if
@ -349,7 +349,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
if (inhclass == classDoc) { if (inhclass == classDoc) {
continue; continue;
} }
List inhmembers = visibleMemberMap.getMembersFor(inhclass); List<ProgramElementDoc> inhmembers = visibleMemberMap.getMembersFor(inhclass);
if (inhmembers.size() > 0) { if (inhmembers.size() > 0) {
Collections.sort(inhmembers); Collections.sort(inhmembers);
writer.writeInheritedMemberSummaryHeader(inhclass); writer.writeInheritedMemberSummaryHeader(inhclass);
@ -358,7 +358,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
inhclass.isPackagePrivate() && inhclass.isPackagePrivate() &&
! Util.isLinkable(inhclass, configuration) ? ! Util.isLinkable(inhclass, configuration) ?
classDoc : inhclass, classDoc : inhclass,
(ProgramElementDoc) inhmembers.get(j), inhmembers.get(j),
j == 0, j == 0,
j == inhmembers.size() - 1); j == inhmembers.size() - 1);
} }

View file

@ -66,7 +66,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
/** /**
* The methods being documented. * The methods being documented.
*/ */
private List methods; private List<ProgramElementDoc> methods;
private MethodBuilder(Configuration configuration) { private MethodBuilder(Configuration configuration) {
super(configuration); super(configuration);
@ -94,7 +94,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
VisibleMemberMap.METHODS, VisibleMemberMap.METHODS,
configuration.nodeprecated); configuration.nodeprecated);
builder.methods = builder.methods =
new ArrayList(builder.visibleMemberMap.getLeafClassMembers( new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
configuration)); configuration));
if (configuration.getMemberComparator() != null) { if (configuration.getMemberComparator() != null) {
Collections.sort( Collections.sort(

View file

@ -26,6 +26,7 @@ package com.sun.tools.doclets.internal.toolkit.taglets;
import java.util.Map; import java.util.Map;
import com.sun.javadoc.Tag; import com.sun.javadoc.Tag;
import com.sun.tools.doclets.Taglet;
/** /**
* An inline Taglet used to denote literal code fragments. * An inline Taglet used to denote literal code fragments.
@ -47,7 +48,7 @@ public class CodeTaglet extends LiteralTaglet {
private static final String NAME = "code"; private static final String NAME = "code";
public static void register(Map map) { public static void register(Map<String, Taglet> map) {
map.remove(NAME); map.remove(NAME);
map.put(NAME, new CodeTaglet()); map.put(NAME, new CodeTaglet());
} }

View file

@ -46,7 +46,7 @@ public class LiteralTaglet implements Taglet {
private static final String NAME = "literal"; private static final String NAME = "literal";
public static void register(Map map) { public static void register(Map<String,Taglet> map) {
map.remove(NAME); map.remove(NAME);
map.put(NAME, new LiteralTaglet()); map.put(NAME, new LiteralTaglet());
} }

View file

@ -56,11 +56,11 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
* check. * check.
* @return a name-rank number map. * @return a name-rank number map.
*/ */
private static Map getRankMap(Object[] params){ private static Map<String,String> getRankMap(Object[] params){
if (params == null) { if (params == null) {
return null; return null;
} }
HashMap result = new HashMap(); HashMap<String,String> result = new HashMap<String,String>();
for (int i = 0; i < params.length; i++) { for (int i = 0; i < params.length; i++) {
String name = params[i] instanceof Parameter ? String name = params[i] instanceof Parameter ?
((Parameter) params[i]).name() : ((Parameter) params[i]).name() :
@ -192,7 +192,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
private TagletOutput getTagletOutput(boolean isNonTypeParams, Doc holder, private TagletOutput getTagletOutput(boolean isNonTypeParams, Doc holder,
TagletWriter writer, Object[] formalParameters, ParamTag[] paramTags) { TagletWriter writer, Object[] formalParameters, ParamTag[] paramTags) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
Set alreadyDocumented = new HashSet(); Set<String> alreadyDocumented = new HashSet<String>();
if (paramTags.length > 0) { if (paramTags.length > 0) {
result.appendOutput( result.appendOutput(
processParamTags(isNonTypeParams, paramTags, processParamTags(isNonTypeParams, paramTags,
@ -214,7 +214,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
*/ */
private TagletOutput getInheritedTagletOutput(boolean isNonTypeParams, Doc holder, private TagletOutput getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
TagletWriter writer, Object[] formalParameters, TagletWriter writer, Object[] formalParameters,
Set alreadyDocumented) { Set<String> alreadyDocumented) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
if ((! alreadyDocumented.contains(null)) && if ((! alreadyDocumented.contains(null)) &&
holder instanceof MethodDoc) { holder instanceof MethodDoc) {
@ -263,7 +263,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
*/ */
private TagletOutput processParamTags(boolean isNonTypeParams, private TagletOutput processParamTags(boolean isNonTypeParams,
ParamTag[] paramTags, Map rankMap, TagletWriter writer, ParamTag[] paramTags, Map rankMap, TagletWriter writer,
Set alreadyDocumented) { Set<String> alreadyDocumented) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
if (paramTags.length > 0) { if (paramTags.length > 0) {
for (int i = 0; i < paramTags.length; ++i) { for (int i = 0; i < paramTags.length; ++i) {

View file

@ -61,7 +61,7 @@ public class TagletManager {
/** /**
* The map of custom tags. * The map of custom tags.
*/ */
private LinkedHashMap customTags; private LinkedHashMap<String,Taglet> customTags;
/** /**
* The array of custom tags that can appear in packages. * The array of custom tags that can appear in packages.
@ -111,31 +111,31 @@ public class TagletManager {
/** /**
* Keep track of standard tags. * Keep track of standard tags.
*/ */
private Set standardTags; private Set<String> standardTags;
/** /**
* Keep track of standard tags in lowercase to compare for better * Keep track of standard tags in lowercase to compare for better
* error messages when a tag like @docRoot is mistakenly spelled * error messages when a tag like @docRoot is mistakenly spelled
* lowercase @docroot. * lowercase @docroot.
*/ */
private Set standardTagsLowercase; private Set<String> standardTagsLowercase;
/** /**
* Keep track of overriden standard tags. * Keep track of overriden standard tags.
*/ */
private Set overridenStandardTags; private Set<String> overridenStandardTags;
/** /**
* Keep track of the tags that may conflict * Keep track of the tags that may conflict
* with standard tags in the future (any custom tag without * with standard tags in the future (any custom tag without
* a period in its name). * a period in its name).
*/ */
private Set potentiallyConflictingTags; private Set<String> potentiallyConflictingTags;
/** /**
* The set of unseen custom tags. * The set of unseen custom tags.
*/ */
private Set unseenCustomTags; private Set<String> unseenCustomTags;
/** /**
* True if we do not want to use @since tags. * True if we do not want to use @since tags.
@ -161,12 +161,12 @@ public class TagletManager {
*/ */
public TagletManager(boolean nosince, boolean showversion, public TagletManager(boolean nosince, boolean showversion,
boolean showauthor, MessageRetriever message){ boolean showauthor, MessageRetriever message){
overridenStandardTags = new HashSet(); overridenStandardTags = new HashSet<String>();
potentiallyConflictingTags = new HashSet(); potentiallyConflictingTags = new HashSet<String>();
standardTags = new HashSet(); standardTags = new HashSet<String>();
standardTagsLowercase = new HashSet(); standardTagsLowercase = new HashSet<String>();
unseenCustomTags = new HashSet(); unseenCustomTags = new HashSet<String>();
customTags = new LinkedHashMap(); customTags = new LinkedHashMap<String,Taglet>();
this.nosince = nosince; this.nosince = nosince;
this.showversion = showversion; this.showversion = showversion;
this.showauthor = showauthor; this.showauthor = showauthor;
@ -201,7 +201,7 @@ public class TagletManager {
*/ */
public void addCustomTag(String classname, String tagletPath) { public void addCustomTag(String classname, String tagletPath) {
try { try {
Class customTagClass = null; Class<?> customTagClass = null;
// construct class loader // construct class loader
String cpString = null; // make sure env.class.path defaults to dot String cpString = null; // make sure env.class.path defaults to dot
@ -219,7 +219,7 @@ public class TagletManager {
meth.invoke(null, new Object[] {customTags}); meth.invoke(null, new Object[] {customTags});
list = customTags.values().toArray(); list = customTags.values().toArray();
Object newLastTag = (list != null&& list.length > 0) Object newLastTag = (list != null&& list.length > 0)
? (Object) list[list.length-1] : null; ? list[list.length-1] : null;
if (lastTag != newLastTag) { if (lastTag != newLastTag) {
//New taglets must always be added to the end of the LinkedHashMap. //New taglets must always be added to the end of the LinkedHashMap.
//If the current and previous last taglet are not equal, that //If the current and previous last taglet are not equal, that
@ -315,7 +315,7 @@ public class TagletManager {
if (tagName == null || locations == null) { if (tagName == null || locations == null) {
return; return;
} }
Taglet tag = (Taglet) customTags.get(tagName); Taglet tag = customTags.get(tagName);
locations = locations.toLowerCase(); locations = locations.toLowerCase();
if (tag == null || header != null) { if (tag == null || header != null) {
customTags.remove(tagName); customTags.remove(tagName);
@ -396,7 +396,7 @@ public class TagletManager {
} }
} }
//Check if this tag is being used in the wrong location. //Check if this tag is being used in the wrong location.
if((taglet = (Taglet) customTags.get(name)) != null) { if ((taglet = customTags.get(name)) != null) {
if (areInlineTags && ! taglet.isInlineTag()) { if (areInlineTags && ! taglet.isInlineTag()) {
printTagMisuseWarn(taglet, tags[i], "inline"); printTagMisuseWarn(taglet, tags[i], "inline");
} }
@ -425,7 +425,7 @@ public class TagletManager {
* @param holderType the type of documentation that the misused tag was found in. * @param holderType the type of documentation that the misused tag was found in.
*/ */
private void printTagMisuseWarn(Taglet taglet, Tag tag, String holderType) { private void printTagMisuseWarn(Taglet taglet, Tag tag, String holderType) {
Set locationsSet = new LinkedHashSet(); Set<String> locationsSet = new LinkedHashSet<String>();
if (taglet.inOverview()) { if (taglet.inOverview()) {
locationsSet.add("overview"); locationsSet.add("overview");
} }
@ -447,7 +447,7 @@ public class TagletManager {
if (taglet.isInlineTag()) { if (taglet.isInlineTag()) {
locationsSet.add("inline text"); locationsSet.add("inline text");
} }
String[] locations = (String[]) locationsSet.toArray(new String[]{}); String[] locations = locationsSet.toArray(new String[]{});
if (locations == null || locations.length == 0) { if (locations == null || locations.length == 0) {
//This known tag is excluded. //This known tag is excluded.
return; return;
@ -592,17 +592,17 @@ public class TagletManager {
* Initialize the custom tag arrays. * Initialize the custom tag arrays.
*/ */
private void initCustomTagArrays() { private void initCustomTagArrays() {
Iterator it = customTags.values().iterator(); Iterator<Taglet> it = customTags.values().iterator();
ArrayList pTags = new ArrayList(customTags.size()); ArrayList<Taglet> pTags = new ArrayList<Taglet>(customTags.size());
ArrayList tTags = new ArrayList(customTags.size()); ArrayList<Taglet> tTags = new ArrayList<Taglet>(customTags.size());
ArrayList fTags = new ArrayList(customTags.size()); ArrayList<Taglet> fTags = new ArrayList<Taglet>(customTags.size());
ArrayList cTags = new ArrayList(customTags.size()); ArrayList<Taglet> cTags = new ArrayList<Taglet>(customTags.size());
ArrayList mTags = new ArrayList(customTags.size()); ArrayList<Taglet> mTags = new ArrayList<Taglet>(customTags.size());
ArrayList iTags = new ArrayList(customTags.size()); ArrayList<Taglet> iTags = new ArrayList<Taglet>(customTags.size());
ArrayList oTags = new ArrayList(customTags.size()); ArrayList<Taglet> oTags = new ArrayList<Taglet>(customTags.size());
Taglet current; Taglet current;
while (it.hasNext()) { while (it.hasNext()) {
current = (Taglet) it.next(); current = it.next();
if (current.inPackage() && !current.isInlineTag()) { if (current.inPackage() && !current.isInlineTag()) {
pTags.add(current); pTags.add(current);
} }
@ -625,20 +625,20 @@ public class TagletManager {
oTags.add(current); oTags.add(current);
} }
} }
packageTags = (Taglet[]) pTags.toArray(new Taglet[] {}); packageTags = pTags.toArray(new Taglet[] {});
typeTags = (Taglet[]) tTags.toArray(new Taglet[] {}); typeTags = tTags.toArray(new Taglet[] {});
fieldTags = (Taglet[]) fTags.toArray(new Taglet[] {}); fieldTags = fTags.toArray(new Taglet[] {});
constructorTags = (Taglet[]) cTags.toArray(new Taglet[] {}); constructorTags = cTags.toArray(new Taglet[] {});
methodTags = (Taglet[]) mTags.toArray(new Taglet[] {}); methodTags = mTags.toArray(new Taglet[] {});
overviewTags = (Taglet[]) oTags.toArray(new Taglet[] {}); overviewTags = oTags.toArray(new Taglet[] {});
inlineTags = (Taglet[]) iTags.toArray(new Taglet[] {}); inlineTags = iTags.toArray(new Taglet[] {});
//Init the serialized form tags //Init the serialized form tags
serializedFormTags = new Taglet[4]; serializedFormTags = new Taglet[4];
serializedFormTags[0] = (Taglet) customTags.get("serialData"); serializedFormTags[0] = customTags.get("serialData");
serializedFormTags[1] = (Taglet) customTags.get("throws"); serializedFormTags[1] = customTags.get("throws");
serializedFormTags[2] = (Taglet) customTags.get("since"); serializedFormTags[2] = customTags.get("since");
serializedFormTags[3] = (Taglet) customTags.get("see"); serializedFormTags[3] = customTags.get("see");
} }
/** /**
@ -726,10 +726,9 @@ public class TagletManager {
printReportHelper("doclet.Notice_taglet_unseen", unseenCustomTags); printReportHelper("doclet.Notice_taglet_unseen", unseenCustomTags);
} }
private void printReportHelper(String noticeKey, Set names) { private void printReportHelper(String noticeKey, Set<String> names) {
if (names.size() > 0) { if (names.size() > 0) {
String[] namesArray = String[] namesArray = names.toArray(new String[] {});
(String[]) names.toArray(new String[] {});
String result = " "; String result = " ";
for (int i = 0; i < namesArray.length; i++) { for (int i = 0; i < namesArray.length; i++) {
result += "@" + namesArray[i]; result += "@" + namesArray[i];
@ -751,9 +750,9 @@ public class TagletManager {
*/ */
public Taglet getTaglet(String name) { public Taglet getTaglet(String name) {
if (name.indexOf("@") == 0) { if (name.indexOf("@") == 0) {
return (Taglet) customTags.get(name.substring(1)); return customTags.get(name.substring(1));
} else { } else {
return (Taglet) customTags.get(name); return customTags.get(name);
} }
} }

View file

@ -82,7 +82,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
* Add links for exceptions that are declared but not documented. * Add links for exceptions that are declared but not documented.
*/ */
private TagletOutput linkToUndocumentedDeclaredExceptions( private TagletOutput linkToUndocumentedDeclaredExceptions(
Type[] declaredExceptionTypes, Set alreadyDocumented, Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
TagletWriter writer) { TagletWriter writer) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
//Add links to the exceptions declared but not documented. //Add links to the exceptions declared but not documented.
@ -107,11 +107,11 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
* documented. * documented.
*/ */
private TagletOutput inheritThrowsDocumentation(Doc holder, private TagletOutput inheritThrowsDocumentation(Doc holder,
Type[] declaredExceptionTypes, Set alreadyDocumented, Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
TagletWriter writer) { TagletWriter writer) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
if (holder instanceof MethodDoc) { if (holder instanceof MethodDoc) {
Set declaredExceptionTags = new LinkedHashSet(); Set<Tag> declaredExceptionTags = new LinkedHashSet<Tag>();
for (int j = 0; j < declaredExceptionTypes.length; j++) { for (int j = 0; j < declaredExceptionTypes.length; j++) {
DocFinder.Output inheritedDoc = DocFinder.Output inheritedDoc =
DocFinder.search(new DocFinder.Input((MethodDoc) holder, this, DocFinder.search(new DocFinder.Input((MethodDoc) holder, this,
@ -124,7 +124,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
declaredExceptionTags.addAll(inheritedDoc.tagList); declaredExceptionTags.addAll(inheritedDoc.tagList);
} }
result.appendOutput(throwsTagsOutput( result.appendOutput(throwsTagsOutput(
(ThrowsTag[]) declaredExceptionTags.toArray(new ThrowsTag[] {}), declaredExceptionTags.toArray(new ThrowsTag[] {}),
writer, alreadyDocumented, false)); writer, alreadyDocumented, false));
} }
return result; return result;
@ -137,7 +137,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder; ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder;
ThrowsTag[] tags = execHolder.throwsTags(); ThrowsTag[] tags = execHolder.throwsTags();
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
HashSet alreadyDocumented = new HashSet(); HashSet<String> alreadyDocumented = new HashSet<String>();
if (tags.length > 0) { if (tags.length > 0) {
result.appendOutput(throwsTagsOutput( result.appendOutput(throwsTagsOutput(
execHolder.throwsTags(), writer, alreadyDocumented, true)); execHolder.throwsTags(), writer, alreadyDocumented, true));
@ -161,7 +161,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
* @return the TagletOutput representation of this <code>Tag</code>. * @return the TagletOutput representation of this <code>Tag</code>.
*/ */
protected TagletOutput throwsTagsOutput(ThrowsTag[] throwTags, protected TagletOutput throwsTagsOutput(ThrowsTag[] throwTags,
TagletWriter writer, Set alreadyDocumented, boolean allowDups) { TagletWriter writer, Set<String> alreadyDocumented, boolean allowDups) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
if (throwTags.length > 0) { if (throwTags.length > 0) {
for (int i = 0; i < throwTags.length; ++i) { for (int i = 0; i < throwTags.length; ++i) {

View file

@ -49,44 +49,44 @@ import java.util.*;
* Stores the set of packages that the classes specified on the command line * Stores the set of packages that the classes specified on the command line
* belong to. Note that the default package is "". * belong to. Note that the default package is "".
*/ */
private Set packageSet; private Set<String> packageSet;
/** /**
* Stores all classes for each package * Stores all classes for each package
*/ */
private Map allClasses; private Map<String,Set<ClassDoc>> allClasses;
/** /**
* Stores ordinary classes (excluding Exceptions and Errors) for each * Stores ordinary classes (excluding Exceptions and Errors) for each
* package * package
*/ */
private Map ordinaryClasses; private Map<String,Set<ClassDoc>> ordinaryClasses;
/** /**
* Stores exceptions for each package * Stores exceptions for each package
*/ */
private Map exceptions; private Map<String,Set<ClassDoc>> exceptions;
/** /**
* Stores enums for each package. * Stores enums for each package.
*/ */
private Map enums; private Map<String,Set<ClassDoc>> enums;
/** /**
* Stores annotation types for each package. * Stores annotation types for each package.
*/ */
private Map annotationTypes; private Map<String,Set<ClassDoc>> annotationTypes;
/** /**
* Stores errors for each package * Stores errors for each package
*/ */
private Map errors; private Map<String,Set<ClassDoc>> errors;
/** /**
* Stores interfaces for each package * Stores interfaces for each package
*/ */
private Map interfaces; private Map<String,Set<ClassDoc>> interfaces;
/** /**
* Construct a new ClassDocCatalog. * Construct a new ClassDocCatalog.
@ -109,14 +109,14 @@ import java.util.*;
} }
private void init() { private void init() {
allClasses = new HashMap(); allClasses = new HashMap<String,Set<ClassDoc>>();
ordinaryClasses = new HashMap(); ordinaryClasses = new HashMap<String,Set<ClassDoc>>();
exceptions = new HashMap(); exceptions = new HashMap<String,Set<ClassDoc>>();
enums = new HashMap(); enums = new HashMap<String,Set<ClassDoc>>();
annotationTypes = new HashMap(); annotationTypes = new HashMap<String,Set<ClassDoc>>();
errors = new HashMap(); errors = new HashMap<String,Set<ClassDoc>>();
interfaces = new HashMap(); interfaces = new HashMap<String,Set<ClassDoc>>();
packageSet = new HashSet(); packageSet = new HashSet<String>();
} }
/** /**
@ -148,7 +148,7 @@ import java.util.*;
* @param classdoc the ClassDoc to add to the catelog. * @param classdoc the ClassDoc to add to the catelog.
* @param map the Map to add the ClassDoc to. * @param map the Map to add the ClassDoc to.
*/ */
private void addClass(ClassDoc classdoc, Map map) { private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
PackageDoc pkg = classdoc.containingPackage(); PackageDoc pkg = classdoc.containingPackage();
if (pkg.isIncluded()) { if (pkg.isIncluded()) {
@ -157,22 +157,22 @@ import java.util.*;
return; return;
} }
String key = Util.getPackageName(pkg); String key = Util.getPackageName(pkg);
Set s = (Set) map.get(key); Set<ClassDoc> s = map.get(key);
if (s == null) { if (s == null) {
packageSet.add(key); packageSet.add(key);
s = new HashSet(); s = new HashSet<ClassDoc>();
} }
s.add(classdoc); s.add(classdoc);
map.put(key, s); map.put(key, s);
} }
private ClassDoc[] getArray(Map m, String key) { private ClassDoc[] getArray(Map<String,Set<ClassDoc>> m, String key) {
Set s = (Set) m.get(key); Set<ClassDoc> s = m.get(key);
if (s == null) { if (s == null) {
return new ClassDoc[] {}; return new ClassDoc[] {};
} else { } else {
return (ClassDoc[]) s.toArray(new ClassDoc[] {}); return s.toArray(new ClassDoc[] {});
} }
} }
@ -202,7 +202,7 @@ import java.util.*;
* ClassDocs for. * ClassDocs for.
*/ */
public String[] packageNames() { public String[] packageNames() {
return (String[]) packageSet.toArray(new String[] {}); return packageSet.toArray(new String[] {});
} }
/** /**

View file

@ -49,35 +49,35 @@ public class ClassTree {
* List of baseclasses. Contains only java.lang.Object. Can be used to get * List of baseclasses. Contains only java.lang.Object. Can be used to get
* the mapped listing of sub-classes. * the mapped listing of sub-classes.
*/ */
private List baseclasses = new ArrayList(); private List<ClassDoc> baseclasses = new ArrayList<ClassDoc>();
/** /**
* Mapping for each Class with their SubClasses * Mapping for each Class with their SubClasses
*/ */
private Map subclasses = new HashMap(); private Map<ClassDoc,List<ClassDoc>> subclasses = new HashMap<ClassDoc,List<ClassDoc>>();
/** /**
* List of base-interfaces. Contains list of all the interfaces who do not * List of base-interfaces. Contains list of all the interfaces who do not
* have super-interfaces. Can be used to get the mapped listing of * have super-interfaces. Can be used to get the mapped listing of
* sub-interfaces. * sub-interfaces.
*/ */
private List baseinterfaces = new ArrayList(); private List<ClassDoc> baseinterfaces = new ArrayList<ClassDoc>();
/** /**
* Mapping for each Interface with their SubInterfaces * Mapping for each Interface with their SubInterfaces
*/ */
private Map subinterfaces = new HashMap(); private Map<ClassDoc,List<ClassDoc>> subinterfaces = new HashMap<ClassDoc,List<ClassDoc>>();
private List baseEnums = new ArrayList(); private List<ClassDoc> baseEnums = new ArrayList<ClassDoc>();
private Map subEnums = new HashMap(); private Map<ClassDoc,List<ClassDoc>> subEnums = new HashMap<ClassDoc,List<ClassDoc>>();
private List baseAnnotationTypes = new ArrayList(); private List<ClassDoc> baseAnnotationTypes = new ArrayList<ClassDoc>();
private Map subAnnotationTypes = new HashMap(); private Map<ClassDoc,List<ClassDoc>> subAnnotationTypes = new HashMap<ClassDoc,List<ClassDoc>>();
/** /**
* Mapping for each Interface with classes who implement it. * Mapping for each Interface with classes who implement it.
*/ */
private Map implementingclasses = new HashMap(); private Map<ClassDoc,List<ClassDoc>> implementingclasses = new HashMap<ClassDoc,List<ClassDoc>>();
/** /**
* Constructor. Build the Tree using the Root of this Javadoc run. * Constructor. Build the Tree using the Root of this Javadoc run.
@ -132,7 +132,7 @@ public class ClassTree {
processType(classes[i], configuration, baseclasses, subclasses); processType(classes[i], configuration, baseclasses, subclasses);
} else if (classes[i].isInterface()) { } else if (classes[i].isInterface()) {
processInterface(classes[i]); processInterface(classes[i]);
List list = (List)implementingclasses.get(classes[i]); List<ClassDoc> list = implementingclasses.get(classes[i]);
if (list != null) { if (list != null) {
Collections.sort(list); Collections.sort(list);
} }
@ -143,11 +143,11 @@ public class ClassTree {
} }
Collections.sort(baseinterfaces); Collections.sort(baseinterfaces);
for (Iterator it = subinterfaces.values().iterator(); it.hasNext(); ) { for (Iterator<List<ClassDoc>> it = subinterfaces.values().iterator(); it.hasNext(); ) {
Collections.sort((List)it.next()); Collections.sort(it.next());
} }
for (Iterator it = subclasses.values().iterator(); it.hasNext(); ) { for (Iterator<List<ClassDoc>> it = subclasses.values().iterator(); it.hasNext(); ) {
Collections.sort((List)it.next()); Collections.sort(it.next());
} }
} }
@ -164,7 +164,7 @@ public class ClassTree {
* @param configuration the current configurtation of the doclet. * @param configuration the current configurtation of the doclet.
*/ */
private void processType(ClassDoc cd, Configuration configuration, private void processType(ClassDoc cd, Configuration configuration,
List bases, Map subs) { List<ClassDoc> bases, Map<ClassDoc,List<ClassDoc>> subs) {
ClassDoc superclass = Util.getFirstVisibleSuperClassCD(cd, configuration); ClassDoc superclass = Util.getFirstVisibleSuperClassCD(cd, configuration);
if (superclass != null) { if (superclass != null) {
if (!add(subs, superclass, cd)) { if (!add(subs, superclass, cd)) {
@ -219,10 +219,10 @@ public class ClassTree {
* @param cd sub-interface to be mapped. * @param cd sub-interface to be mapped.
* @returns boolean true if class added, false if class already processed. * @returns boolean true if class added, false if class already processed.
*/ */
private boolean add(Map map, ClassDoc superclass, ClassDoc cd) { private boolean add(Map<ClassDoc,List<ClassDoc>> map, ClassDoc superclass, ClassDoc cd) {
List list = (List)map.get(superclass); List<ClassDoc> list = map.get(superclass);
if (list == null) { if (list == null) {
list = new ArrayList(); list = new ArrayList<ClassDoc>();
map.put(superclass, list); map.put(superclass, list);
} }
if (list.contains(cd)) { if (list.contains(cd)) {
@ -241,10 +241,10 @@ public class ClassTree {
* @param cd class for which the sub-class list is requested. * @param cd class for which the sub-class list is requested.
* @returns List Sub-Class list for the class passed. * @returns List Sub-Class list for the class passed.
*/ */
private List get(Map map, ClassDoc cd) { private List<ClassDoc> get(Map<ClassDoc,List<ClassDoc>> map, ClassDoc cd) {
List list = (List)map.get(cd); List<ClassDoc> list = map.get(cd);
if (list == null) { if (list == null) {
return new ArrayList(); return new ArrayList<ClassDoc>();
} }
return list; return list;
} }
@ -254,7 +254,7 @@ public class ClassTree {
* *
* @param cd class whose sub-class list is required. * @param cd class whose sub-class list is required.
*/ */
public List subclasses(ClassDoc cd) { public List<ClassDoc> subclasses(ClassDoc cd) {
return get(subclasses, cd); return get(subclasses, cd);
} }
@ -263,7 +263,7 @@ public class ClassTree {
* *
* @param cd interface whose sub-interface list is required. * @param cd interface whose sub-interface list is required.
*/ */
public List subinterfaces(ClassDoc cd) { public List<ClassDoc> subinterfaces(ClassDoc cd) {
return get(subinterfaces, cd); return get(subinterfaces, cd);
} }
@ -272,9 +272,9 @@ public class ClassTree {
* *
* @param cd interface whose implementing-classes list is required. * @param cd interface whose implementing-classes list is required.
*/ */
public List implementingclasses(ClassDoc cd) { public List<ClassDoc> implementingclasses(ClassDoc cd) {
List result = get(implementingclasses, cd); List<ClassDoc> result = get(implementingclasses, cd);
List subinterfaces = allSubs(cd, false); List<ClassDoc> subinterfaces = allSubs(cd, false);
//If class x implements a subinterface of cd, then it follows //If class x implements a subinterface of cd, then it follows
//that class x implements cd. //that class x implements cd.
@ -301,7 +301,7 @@ public class ClassTree {
* @param isEnum true if the subclasses should be forced to come from the * @param isEnum true if the subclasses should be forced to come from the
* enum tree. * enum tree.
*/ */
public List subs(ClassDoc cd, boolean isEnum) { public List<ClassDoc> subs(ClassDoc cd, boolean isEnum) {
if (isEnum) { if (isEnum) {
return get(subEnums, cd); return get(subEnums, cd);
} else if (cd.isAnnotationType()) { } else if (cd.isAnnotationType()) {
@ -324,10 +324,10 @@ public class ClassTree {
* @param isEnum true if the subclasses should be forced to come from the * @param isEnum true if the subclasses should be forced to come from the
* enum tree. * enum tree.
*/ */
public List allSubs(ClassDoc cd, boolean isEnum) { public List<ClassDoc> allSubs(ClassDoc cd, boolean isEnum) {
List list = subs(cd, isEnum); List<ClassDoc> list = subs(cd, isEnum);
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
cd = (ClassDoc)list.get(i); cd = list.get(i);
List tlist = subs(cd, isEnum); List tlist = subs(cd, isEnum);
for (int j = 0; j < tlist.size(); j++) { for (int j = 0; j < tlist.size(); j++) {
ClassDoc tcd = (ClassDoc)tlist.get(j); ClassDoc tcd = (ClassDoc)tlist.get(j);

View file

@ -46,138 +46,138 @@ public class ClassUseMapper {
* Mapping of ClassDocs to set of PackageDoc used by that class. * Mapping of ClassDocs to set of PackageDoc used by that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToPackage = new HashMap(); public Map<String,Set<PackageDoc>> classToPackage = new HashMap<String,Set<PackageDoc>>();
/** /**
* Mapping of Annotations to set of PackageDoc that use the annotation. * Mapping of Annotations to set of PackageDoc that use the annotation.
*/ */
public Map classToPackageAnnotations = new HashMap(); public Map<String,List<PackageDoc>> classToPackageAnnotations = new HashMap<String,List<PackageDoc>>();
/** /**
* Mapping of ClassDocs to set of ClassDoc used by that class. * Mapping of ClassDocs to set of ClassDoc used by that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToClass = new HashMap(); public Map<String,Set<ClassDoc>> classToClass = new HashMap<String,Set<ClassDoc>>();
/** /**
* Mapping of ClassDocs to list of ClassDoc which are direct or * Mapping of ClassDocs to list of ClassDoc which are direct or
* indirect subclasses of that class. * indirect subclasses of that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToSubclass = new HashMap(); public Map<String,List<ClassDoc>> classToSubclass = new HashMap<String,List<ClassDoc>>();
/** /**
* Mapping of ClassDocs to list of ClassDoc which are direct or * Mapping of ClassDocs to list of ClassDoc which are direct or
* indirect subinterfaces of that interface. * indirect subinterfaces of that interface.
* Entries may be null. * Entries may be null.
*/ */
public Map classToSubinterface = new HashMap(); public Map<String,List<ClassDoc>> classToSubinterface = new HashMap<String,List<ClassDoc>>();
/** /**
* Mapping of ClassDocs to list of ClassDoc which implement * Mapping of ClassDocs to list of ClassDoc which implement
* this interface. * this interface.
* Entries may be null. * Entries may be null.
*/ */
public Map classToImplementingClass = new HashMap(); public Map<String,List<ClassDoc>> classToImplementingClass = new HashMap<String,List<ClassDoc>>();
/** /**
* Mapping of ClassDocs to list of FieldDoc declared as that class. * Mapping of ClassDocs to list of FieldDoc declared as that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToField = new HashMap(); public Map<String,List<FieldDoc>> classToField = new HashMap<String,List<FieldDoc>>();
/** /**
* Mapping of ClassDocs to list of MethodDoc returning that class. * Mapping of ClassDocs to list of MethodDoc returning that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToMethodReturn = new HashMap(); public Map<String,List<MethodDoc>> classToMethodReturn = new HashMap<String,List<MethodDoc>>();
/** /**
* Mapping of ClassDocs to list of MethodDoc having that class * Mapping of ClassDocs to list of MethodDoc having that class
* as an arg. * as an arg.
* Entries may be null. * Entries may be null.
*/ */
public Map classToMethodArgs = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToMethodArgs = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* Mapping of ClassDocs to list of MethodDoc which throws that class. * Mapping of ClassDocs to list of MethodDoc which throws that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToMethodThrows = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToMethodThrows = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* Mapping of ClassDocs to list of ConstructorDoc having that class * Mapping of ClassDocs to list of ConstructorDoc having that class
* as an arg. * as an arg.
* Entries may be null. * Entries may be null.
*/ */
public Map classToConstructorArgs = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToConstructorArgs = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* Mapping of ClassDocs to list of ConstructorDoc which throws that class. * Mapping of ClassDocs to list of ConstructorDoc which throws that class.
* Entries may be null. * Entries may be null.
*/ */
public Map classToConstructorThrows = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToConstructorThrows = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* The mapping of AnnotationTypeDocs to constructors that use them. * The mapping of AnnotationTypeDocs to constructors that use them.
*/ */
public Map classToConstructorAnnotations = new HashMap(); public Map<String,List<ConstructorDoc>> classToConstructorAnnotations = new HashMap<String,List<ConstructorDoc>>();
/** /**
* The mapping of AnnotationTypeDocs to Constructor parameters that use them. * The mapping of AnnotationTypeDocs to Constructor parameters that use them.
*/ */
public Map classToConstructorParamAnnotation = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToConstructorParamAnnotation = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* The mapping of ClassDocs to Constructor arguments that use them as type parameters. * The mapping of ClassDocs to Constructor arguments that use them as type parameters.
*/ */
public Map classToConstructorDocArgTypeParam = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToConstructorDocArgTypeParam = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* The mapping of ClassDocs to ClassDocs that use them as type parameters. * The mapping of ClassDocs to ClassDocs that use them as type parameters.
*/ */
public Map classToClassTypeParam = new HashMap(); public Map<String,List<ClassDoc>> classToClassTypeParam = new HashMap<String,List<ClassDoc>>();
/** /**
* The mapping of AnnotationTypeDocs to ClassDocs that use them. * The mapping of AnnotationTypeDocs to ClassDocs that use them.
*/ */
public Map classToClassAnnotations = new HashMap(); public Map<String,List<ClassDoc>> classToClassAnnotations = new HashMap<String,List<ClassDoc>>();
/** /**
* The mapping of ClassDocs to ExecutableMemberDocs that use them as type parameters. * The mapping of ClassDocs to ExecutableMemberDocs that use them as type parameters.
*/ */
public Map classToExecMemberDocTypeParam = new HashMap(); public Map<String,List<MethodDoc>> classToExecMemberDocTypeParam = new HashMap<String,List<MethodDoc>>();
/** /**
* The mapping of ClassDocs to ExecutableMemberDocs arguments that use them as type parameters. * The mapping of ClassDocs to ExecutableMemberDocs arguments that use them as type parameters.
*/ */
public Map classToExecMemberDocArgTypeParam = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToExecMemberDocArgTypeParam = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* The mapping of AnnotationTypeDocs to ExecutableMemberDocs that use them. * The mapping of AnnotationTypeDocs to ExecutableMemberDocs that use them.
*/ */
public Map classToExecMemberDocAnnotations = new HashMap(); public Map<String,List<MethodDoc>> classToExecMemberDocAnnotations = new HashMap<String,List<MethodDoc>>();
/** /**
* The mapping of ClassDocs to ExecutableMemberDocs that have return type * The mapping of ClassDocs to ExecutableMemberDocs that have return type
* with type parameters of that class. * with type parameters of that class.
*/ */
public Map classToExecMemberDocReturnTypeParam = new HashMap(); public Map<String,List<MethodDoc>> classToExecMemberDocReturnTypeParam = new HashMap<String,List<MethodDoc>>();
/** /**
* The mapping of AnnotationTypeDocs to MethodDoc parameters that use them. * The mapping of AnnotationTypeDocs to MethodDoc parameters that use them.
*/ */
public Map classToExecMemberDocParamAnnotation = new HashMap(); public Map<String,List<ExecutableMemberDoc>> classToExecMemberDocParamAnnotation = new HashMap<String,List<ExecutableMemberDoc>>();
/** /**
* The mapping of ClassDocs to FieldDocs that use them as type parameters. * The mapping of ClassDocs to FieldDocs that use them as type parameters.
*/ */
public Map classToFieldDocTypeParam = new HashMap(); public Map<String,List<FieldDoc>> classToFieldDocTypeParam = new HashMap<String,List<FieldDoc>>();
/** /**
* The mapping of AnnotationTypeDocs to FieldDocs that use them. * The mapping of AnnotationTypeDocs to FieldDocs that use them.
*/ */
public Map annotationToFieldDoc = new HashMap(); public Map<String,List<FieldDoc>> annotationToFieldDoc = new HashMap<String,List<FieldDoc>>();
public ClassUseMapper(RootDoc root, ClassTree classtree) { public ClassUseMapper(RootDoc root, ClassTree classtree) {
@ -231,15 +231,15 @@ public class ClassUseMapper {
/** /**
* Return all subclasses of a class AND fill-in classToSubclass map. * Return all subclasses of a class AND fill-in classToSubclass map.
*/ */
private Collection subclasses(ClassDoc cd) { private Collection<ClassDoc> subclasses(ClassDoc cd) {
Collection ret = (Collection)classToSubclass.get(cd.qualifiedName()); Collection<ClassDoc> ret = classToSubclass.get(cd.qualifiedName());
if (ret == null) { if (ret == null) {
ret = new TreeSet(); ret = new TreeSet<ClassDoc>();
List subs = classtree.subclasses(cd); List<ClassDoc> subs = classtree.subclasses(cd);
if (subs != null) { if (subs != null) {
ret.addAll(subs); ret.addAll(subs);
for (Iterator it = subs.iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) {
ret.addAll(subclasses((ClassDoc)it.next())); ret.addAll(subclasses(it.next()));
} }
} }
addAll(classToSubclass, cd, ret); addAll(classToSubclass, cd, ret);
@ -250,15 +250,15 @@ public class ClassUseMapper {
/** /**
* Return all subinterfaces of an interface AND fill-in classToSubinterface map. * Return all subinterfaces of an interface AND fill-in classToSubinterface map.
*/ */
private Collection subinterfaces(ClassDoc cd) { private Collection<ClassDoc> subinterfaces(ClassDoc cd) {
Collection ret = (Collection)classToSubinterface.get(cd.qualifiedName()); Collection<ClassDoc> ret = classToSubinterface.get(cd.qualifiedName());
if (ret == null) { if (ret == null) {
ret = new TreeSet(); ret = new TreeSet<ClassDoc>();
List subs = classtree.subinterfaces(cd); List<ClassDoc> subs = classtree.subinterfaces(cd);
if (subs != null) { if (subs != null) {
ret.addAll(subs); ret.addAll(subs);
for (Iterator it = subs.iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) {
ret.addAll(subinterfaces((ClassDoc)it.next())); ret.addAll(subinterfaces(it.next()));
} }
} }
addAll(classToSubinterface, cd, ret); addAll(classToSubinterface, cd, ret);
@ -272,11 +272,11 @@ public class ClassUseMapper {
* implementing subinterfaces) AND fill-in both classToImplementingClass * implementing subinterfaces) AND fill-in both classToImplementingClass
* and classToSubinterface maps. * and classToSubinterface maps.
*/ */
private Collection implementingClasses(ClassDoc cd) { private Collection<ClassDoc> implementingClasses(ClassDoc cd) {
Collection ret = (List)classToImplementingClass.get(cd.qualifiedName()); Collection<ClassDoc> ret = classToImplementingClass.get(cd.qualifiedName());
if (ret == null) { if (ret == null) {
ret = new TreeSet(); ret = new TreeSet<ClassDoc>();
List impl = classtree.implementingclasses(cd); List<ClassDoc> impl = classtree.implementingclasses(cd);
if (impl != null) { if (impl != null) {
ret.addAll(impl); ret.addAll(impl);
for (Iterator it = impl.iterator(); it.hasNext();) { for (Iterator it = impl.iterator(); it.hasNext();) {
@ -298,7 +298,7 @@ public class ClassUseMapper {
private void mapExecutable(ExecutableMemberDoc em) { private void mapExecutable(ExecutableMemberDoc em) {
Parameter[] params = em.parameters(); Parameter[] params = em.parameters();
boolean isConstructor = em.isConstructor(); boolean isConstructor = em.isConstructor();
List classArgs = new ArrayList(); List<Type> classArgs = new ArrayList<Type>();
for (int k = 0; k < params.length; k++) { for (int k = 0; k < params.length; k++) {
Type pcd = params[k].type(); Type pcd = params[k].type();
// primitives don't get mapped, also avoid dups // primitives don't get mapped, also avoid dups
@ -325,34 +325,38 @@ public class ClassUseMapper {
} }
} }
private List refList(Map map, ClassDoc cd) { private <T> List<T> refList(Map<String,List<T>> map, ClassDoc cd) {
List list = (List)map.get(cd.qualifiedName()); List<T> list = map.get(cd.qualifiedName());
if (list == null) { if (list == null) {
list = new ArrayList(); @SuppressWarnings("unchecked")
List<T> l = new ArrayList();
list = l;
map.put(cd.qualifiedName(), list); map.put(cd.qualifiedName(), list);
} }
return list; return list;
} }
private Set packageSet(ClassDoc cd) { private Set<PackageDoc> packageSet(ClassDoc cd) {
Set pkgSet = (Set)classToPackage.get(cd.qualifiedName()); Set<PackageDoc> pkgSet = classToPackage.get(cd.qualifiedName());
if (pkgSet == null) { if (pkgSet == null) {
pkgSet = new TreeSet(); pkgSet = new TreeSet<PackageDoc>();
classToPackage.put(cd.qualifiedName(), pkgSet); classToPackage.put(cd.qualifiedName(), pkgSet);
} }
return pkgSet; return pkgSet;
} }
private Set classSet(ClassDoc cd) { private Set<ClassDoc> classSet(ClassDoc cd) {
Set clsSet = (Set)classToClass.get(cd.qualifiedName()); Set<ClassDoc> clsSet = classToClass.get(cd.qualifiedName());
if (clsSet == null) { if (clsSet == null) {
clsSet = new TreeSet(); @SuppressWarnings("unchecked")
Set<ClassDoc> s = new TreeSet();
clsSet = s;
classToClass.put(cd.qualifiedName(), clsSet); classToClass.put(cd.qualifiedName(), clsSet);
} }
return clsSet; return clsSet;
} }
private void add(Map map, ClassDoc cd, ProgramElementDoc ref) { private <T extends ProgramElementDoc> void add(Map<String,List<T>> map, ClassDoc cd, T ref) {
// add to specified map // add to specified map
refList(map, cd).add(ref); refList(map, cd).add(ref);
@ -361,25 +365,23 @@ public class ClassUseMapper {
classSet(cd).add(ref instanceof MemberDoc? classSet(cd).add(ref instanceof MemberDoc?
((MemberDoc)ref).containingClass() : ((MemberDoc)ref).containingClass() :
ref); (ClassDoc)ref);
} }
private void addAll(Map map, ClassDoc cd, Collection refs) { private void addAll(Map<String,List<ClassDoc>> map, ClassDoc cd, Collection<ClassDoc> refs) {
if (refs == null) { if (refs == null) {
return; return;
} }
// add to specified map // add to specified map
refList(map, cd).addAll(refs); refList(map, cd).addAll(refs);
Set pkgSet = packageSet(cd); Set<PackageDoc> pkgSet = packageSet(cd);
Set clsSet = classSet(cd); Set<ClassDoc> clsSet = classSet(cd);
// add ref's package to package map and class map // add ref's package to package map and class map
for (Iterator it = refs.iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = refs.iterator(); it.hasNext();) {
ProgramElementDoc pedoc = (ProgramElementDoc)it.next(); ClassDoc cls = it.next();
pkgSet.add(pedoc.containingPackage()); pkgSet.add(cls.containingPackage());
clsSet.add(pedoc instanceof MemberDoc? clsSet.add(cls);
((MemberDoc)pedoc).containingClass() :
pedoc);
} }
} }
@ -392,8 +394,8 @@ public class ClassUseMapper {
* @param doc the doc whose type parameters are being checked. * @param doc the doc whose type parameters are being checked.
* @param holder the holder that owns the type parameters. * @param holder the holder that owns the type parameters.
*/ */
private void mapTypeParameters(Map map, Object doc, private <T extends ProgramElementDoc> void mapTypeParameters(Map<String,List<T>> map, Object doc,
ProgramElementDoc holder) { T holder) {
TypeVariable[] typeVariables; TypeVariable[] typeVariables;
if (doc instanceof ClassDoc) { if (doc instanceof ClassDoc) {
typeVariables = ((ClassDoc) doc).typeParameters(); typeVariables = ((ClassDoc) doc).typeParameters();
@ -438,9 +440,8 @@ public class ClassUseMapper {
* @param doc the doc whose type parameters are being checked. * @param doc the doc whose type parameters are being checked.
* @param holder the holder that owns the type parameters. * @param holder the holder that owns the type parameters.
*/ */
private void mapAnnotations(Map map, Object doc, private <T extends ProgramElementDoc> void mapAnnotations(Map<String,List<T>> map, Object doc,
Object holder) { T holder) {
TypeVariable[] typeVariables;
AnnotationDesc[] annotations; AnnotationDesc[] annotations;
boolean isPackage = false; boolean isPackage = false;
if (doc instanceof ProgramElementDoc) { if (doc instanceof ProgramElementDoc) {
@ -458,12 +459,31 @@ public class ClassUseMapper {
if (isPackage) if (isPackage)
refList(map, annotationDoc).add(holder); refList(map, annotationDoc).add(holder);
else else
add(map, annotationDoc, (ProgramElementDoc) holder); add(map, annotationDoc, holder);
} }
} }
private void addTypeParameterToMap(Map map, Type type,
ProgramElementDoc holder) { /**
* Map the AnnotationType to the ProgramElementDocs that use them as
* type parameters.
*
* @param map the map the insert the information into.
* @param doc the doc whose type parameters are being checked.
* @param holder the holder that owns the type parameters.
*/
private <T extends PackageDoc> void mapAnnotations(Map<String,List<T>> map, PackageDoc doc,
T holder) {
AnnotationDesc[] annotations;
annotations = doc.annotations();
for (int i = 0; i < annotations.length; i++) {
AnnotationTypeDoc annotationDoc = annotations[i].annotationType();
refList(map, annotationDoc).add(holder);
}
}
private <T extends ProgramElementDoc> void addTypeParameterToMap(Map<String,List<T>> map, Type type,
T holder) {
if (type instanceof ClassDoc) { if (type instanceof ClassDoc) {
add(map, (ClassDoc) type, holder); add(map, (ClassDoc) type, holder);
} else if (type instanceof ParameterizedType) { } else if (type instanceof ParameterizedType) {

View file

@ -52,7 +52,7 @@ public class DeprecatedAPIListBuilder {
/** /**
* List of deprecated type Lists. * List of deprecated type Lists.
*/ */
private List deprecatedLists; private List<List<Doc>> deprecatedLists;
/** /**
@ -61,9 +61,9 @@ public class DeprecatedAPIListBuilder {
* @param root Root of the tree. * @param root Root of the tree.
*/ */
public DeprecatedAPIListBuilder(RootDoc root) { public DeprecatedAPIListBuilder(RootDoc root) {
deprecatedLists = new ArrayList(); deprecatedLists = new ArrayList<List<Doc>>();
for (int i = 0; i < NUM_TYPES; i++) { for (int i = 0; i < NUM_TYPES; i++) {
deprecatedLists.add(i, new ArrayList()); deprecatedLists.add(i, new ArrayList<Doc>());
} }
buildDeprecatedAPIInfo(root); buildDeprecatedAPIInfo(root);
} }
@ -114,7 +114,7 @@ public class DeprecatedAPIListBuilder {
* @param list List of all the particular deprecated members, e.g. methods. * @param list List of all the particular deprecated members, e.g. methods.
* @param members members to be added in the list. * @param members members to be added in the list.
*/ */
private void composeDeprecatedList(List list, MemberDoc[] members) { private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) {
for (int i = 0; i < members.length; i++) { for (int i = 0; i < members.length; i++) {
if (Util.isDeprecated(members[i])) { if (Util.isDeprecated(members[i])) {
list.add(members[i]); list.add(members[i]);
@ -137,8 +137,8 @@ public class DeprecatedAPIListBuilder {
* *
* @param the constant representing the type of list being returned. * @param the constant representing the type of list being returned.
*/ */
public List getList(int type) { public List<Doc> getList(int type) {
return (List) deprecatedLists.get(type); return deprecatedLists.get(type);
} }
/** /**
@ -147,6 +147,6 @@ public class DeprecatedAPIListBuilder {
* @param type the type of list being checked. * @param type the type of list being checked.
*/ */
public boolean hasDocumentation(int type) { public boolean hasDocumentation(int type) {
return ((List) deprecatedLists.get(type)).size() > 0; return (deprecatedLists.get(type)).size() > 0;
} }
} }

View file

@ -164,7 +164,7 @@ public class DocFinder {
* subclass of IOException. This subclass of DocFinder.Output allows * subclass of IOException. This subclass of DocFinder.Output allows
* multiple tag inheritence. * multiple tag inheritence.
*/ */
public List tagList = new ArrayList(); public List<Tag> tagList = new ArrayList<Tag>();
} }
/** /**

View file

@ -53,7 +53,7 @@ public class Extern {
* Map package names onto Extern Item objects. * Map package names onto Extern Item objects.
* Lazily initialized. * Lazily initialized.
*/ */
private Map packageToItemMap; private Map<String,Item> packageToItemMap;
/** /**
* The global configuration information for this run. * The global configuration information for this run.
@ -101,7 +101,7 @@ public class Extern {
this.path = path; this.path = path;
this.relative = relative; this.relative = relative;
if (packageToItemMap == null) { if (packageToItemMap == null) {
packageToItemMap = new HashMap(); packageToItemMap = new HashMap<String,Item>();
} }
if (!packageToItemMap.containsKey(packageName)) { // save the previous if (!packageToItemMap.containsKey(packageName)) { // save the previous
packageToItemMap.put(packageName, this); // mapped location packageToItemMap.put(packageName, this); // mapped location
@ -185,7 +185,7 @@ public class Extern {
if (packageToItemMap == null) { if (packageToItemMap == null) {
return null; return null;
} }
return (Item)packageToItemMap.get(pkgName); return packageToItemMap.get(pkgName);
} }
/** /**

View file

@ -61,24 +61,24 @@ public class Group {
/** /**
* Map of regular expressions with the corresponding group name. * Map of regular expressions with the corresponding group name.
*/ */
private Map regExpGroupMap = new HashMap(); private Map<String,String> regExpGroupMap = new HashMap<String,String>();
/** /**
* List of regular expressions sorted according to the length. Regular * List of regular expressions sorted according to the length. Regular
* expression with longest length will be first in the sorted order. * expression with longest length will be first in the sorted order.
*/ */
private List sortedRegExpList = new ArrayList(); private List<String> sortedRegExpList = new ArrayList<String>();
/** /**
* List of group names in the same order as given on the command line. * List of group names in the same order as given on the command line.
*/ */
private List groupList = new ArrayList(); private List<String> groupList = new ArrayList<String>();
/** /**
* Map of non-regular expressions(possible package names) with the * Map of non-regular expressions(possible package names) with the
* corresponding group name. * corresponding group name.
*/ */
private Map pkgNameGroupMap = new HashMap(); private Map<String,String> pkgNameGroupMap = new HashMap<String,String>();
/** /**
* The global configuration information for this run. * The global configuration information for this run.
@ -90,9 +90,9 @@ public class Group {
* the compare method in the implementing class is doing the reverse * the compare method in the implementing class is doing the reverse
* comparison. * comparison.
*/ */
private static class MapKeyComparator implements Comparator { private static class MapKeyComparator implements Comparator<String> {
public int compare(Object key1, Object key2) { public int compare(String key1, String key2) {
return ((String)key2).length() - ((String)key1).length(); return key2.length() - key1.length();
} }
} }
@ -182,8 +182,8 @@ public class Group {
* *
* @param packages Packages specified on the command line. * @param packages Packages specified on the command line.
*/ */
public Map groupPackages(PackageDoc[] packages) { public Map<String,List<PackageDoc>> groupPackages(PackageDoc[] packages) {
Map groupPackageMap = new HashMap(); Map<String,List<PackageDoc>> groupPackageMap = new HashMap<String,List<PackageDoc>>();
String defaultGroupName = String defaultGroupName =
(pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())? (pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
configuration.message.getText("doclet.Packages") : configuration.message.getText("doclet.Packages") :
@ -195,7 +195,7 @@ public class Group {
for (int i = 0; i < packages.length; i++) { for (int i = 0; i < packages.length; i++) {
PackageDoc pkg = packages[i]; PackageDoc pkg = packages[i];
String pkgName = pkg.name(); String pkgName = pkg.name();
String groupName = (String)pkgNameGroupMap.get(pkgName); String groupName = pkgNameGroupMap.get(pkgName);
// if this package is not explicitly assigned to a group, // if this package is not explicitly assigned to a group,
// try matching it to group specified by regular expression // try matching it to group specified by regular expression
if (groupName == null) { if (groupName == null) {
@ -220,9 +220,9 @@ public class Group {
*/ */
String regExpGroupName(String pkgName) { String regExpGroupName(String pkgName) {
for (int j = 0; j < sortedRegExpList.size(); j++) { for (int j = 0; j < sortedRegExpList.size(); j++) {
String regexp = (String)sortedRegExpList.get(j); String regexp = sortedRegExpList.get(j);
if (pkgName.startsWith(regexp)) { if (pkgName.startsWith(regexp)) {
return (String)regExpGroupMap.get(regexp); return regExpGroupMap.get(regexp);
} }
} }
return null; return null;
@ -235,10 +235,10 @@ public class Group {
* @param map Map to be searched for gorup name. * @param map Map to be searched for gorup name.
* @param groupname Group name to search. * @param groupname Group name to search.
*/ */
List getPkgList(Map map, String groupname) { List<PackageDoc> getPkgList(Map<String,List<PackageDoc>> map, String groupname) {
List list = (List)map.get(groupname); List<PackageDoc> list = map.get(groupname);
if (list == null) { if (list == null) {
list = new ArrayList(); list = new ArrayList<PackageDoc>();
map.put(groupname, list); map.put(groupname, list);
} }
return list; return list;

View file

@ -41,8 +41,8 @@ import java.util.*;
*/ */
public class ImplementedMethods { public class ImplementedMethods {
private Map interfaces = new HashMap(); private Map<MethodDoc,Type> interfaces = new HashMap<MethodDoc,Type>();
private List methlist = new ArrayList(); private List<MethodDoc> methlist = new ArrayList<MethodDoc>();
private Configuration configuration; private Configuration configuration;
private final ClassDoc classdoc; private final ClassDoc classdoc;
private final MethodDoc method; private final MethodDoc method;
@ -67,7 +67,7 @@ public class ImplementedMethods {
*/ */
public MethodDoc[] build(boolean sort) { public MethodDoc[] build(boolean sort) {
buildImplementedMethodList(sort); buildImplementedMethodList(sort);
return (MethodDoc[])methlist.toArray(new MethodDoc[methlist.size()]); return methlist.toArray(new MethodDoc[methlist.size()]);
} }
public MethodDoc[] build() { public MethodDoc[] build() {
@ -75,7 +75,7 @@ public class ImplementedMethods {
} }
public Type getMethodHolder(MethodDoc methodDoc) { public Type getMethodHolder(MethodDoc methodDoc) {
return (Type) interfaces.get(methodDoc); return interfaces.get(methodDoc);
} }
/** /**
@ -111,7 +111,7 @@ public class ImplementedMethods {
ClassDoc overriddenClass = method.overriddenClass(); ClassDoc overriddenClass = method.overriddenClass();
if (overriddenClass != null) { if (overriddenClass != null) {
for (int i = 0; i < methlist.size(); i++) { for (int i = 0; i < methlist.size(); i++) {
ClassDoc cd = ((MethodDoc)methlist.get(i)).containingClass(); ClassDoc cd = methlist.get(i).containingClass();
if (cd == overriddenClass || overriddenClass.subclassOf(cd)) { if (cd == overriddenClass || overriddenClass.subclassOf(cd)) {
methlist.remove(i); // remove overridden method methlist.remove(i); // remove overridden method
return; return;
@ -131,7 +131,7 @@ public class ImplementedMethods {
private boolean overridingMethodFound(MethodDoc method) { private boolean overridingMethodFound(MethodDoc method) {
ClassDoc containingClass = method.containingClass(); ClassDoc containingClass = method.containingClass();
for (int i = 0; i < methlist.size(); i++) { for (int i = 0; i < methlist.size(); i++) {
MethodDoc listmethod = (MethodDoc)methlist.get(i); MethodDoc listmethod = methlist.get(i);
if (containingClass == listmethod.containingClass()) { if (containingClass == listmethod.containingClass()) {
// it's the same method. // it's the same method.
return true; return true;

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