From 8e2924170272d4ceda6720bdacd83212288ab08d Mon Sep 17 00:00:00 2001
From: Alan Bateman
Date: Mon, 21 Feb 2011 13:54:13 +0000
Subject: [PATCH 01/91] 7020517: (fs) FileStore.equals returns true if both
volumes have the same serial number
Reviewed-by: chegar
---
jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java | 5 ++---
jdk/test/java/nio/file/FileStore/Basic.java | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java
index 8b3c2fb4b19..07eb73231ce 100644
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java
@@ -201,13 +201,12 @@ class WindowsFileStore
if (!(ob instanceof WindowsFileStore))
return false;
WindowsFileStore other = (WindowsFileStore)ob;
- return this.volInfo.volumeSerialNumber() == other.volInfo.volumeSerialNumber();
+ return root.equals(other.root);
}
@Override
public int hashCode() {
- // reveals VSN without permission check - okay?
- return volInfo.volumeSerialNumber();
+ return root.hashCode();
}
@Override
diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java
index f49bc6552bb..8a53ca4a47d 100644
--- a/jdk/test/java/nio/file/FileStore/Basic.java
+++ b/jdk/test/java/nio/file/FileStore/Basic.java
@@ -22,7 +22,7 @@
*/
/* @test
- * @bug 4313887 6873621 6979526 7006126
+ * @bug 4313887 6873621 6979526 7006126 7020517
* @summary Unit test for java.nio.file.FileStore
* @library ..
*/
From 7ddd950b1d1868ddcf23c5c7033928ec572e674d Mon Sep 17 00:00:00 2001
From: Mike Duigou
Date: Mon, 21 Feb 2011 14:53:11 -0800
Subject: [PATCH 02/91] 7019705: Add -XX:+AggressiveOpts options to MOAT test
Reviewed-by: alanb
---
jdk/test/java/util/Collection/MOAT.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/jdk/test/java/util/Collection/MOAT.java b/jdk/test/java/util/Collection/MOAT.java
index a85afa3c8d2..ce7975635a8 100644
--- a/jdk/test/java/util/Collection/MOAT.java
+++ b/jdk/test/java/util/Collection/MOAT.java
@@ -28,6 +28,8 @@
* 6431845 4802633 6570566 6570575 6570631 6570924 6691185 6691215
* @summary Run many tests on many Collection and Map implementations
* @author Martin Buchholz
+ * @run main MOAT
+ * @run main/othervm -XX:+AggressiveOpts MOAT
*/
/* Mother Of All (Collection) Tests
From 53bff1223916557ba3b63a7b34c7b303a22542ed Mon Sep 17 00:00:00 2001
From: Masayoshi Okutsu
Date: Tue, 22 Feb 2011 14:51:43 +0900
Subject: [PATCH 03/91] 7010379: fontconfig update for RHEL 6
Reviewed-by: peytoia
---
jdk/make/sun/awt/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile
index 7d8b4b6a6f1..18190f1c66c 100644
--- a/jdk/make/sun/awt/Makefile
+++ b/jdk/make/sun/awt/Makefile
@@ -368,7 +368,7 @@ else
FONTCONFIGS_SRC = $(CLOSED_SRC)/solaris/classes/sun/awt/fontconfigs
_FONTCONFIGS = \
fontconfig.properties \
- fontconfig.RedHat.properties \
+ fontconfig.RedHat.5.5.properties \
fontconfig.Turbo.properties \
fontconfig.SuSE.10.properties \
fontconfig.SuSE.11.properties
From 17cace4c588daf15aea08500ce4ac155ced224f1 Mon Sep 17 00:00:00 2001
From: Alan Bateman
Date: Tue, 22 Feb 2011 12:04:48 +0000
Subject: [PATCH 04/91] 7020888: (file) Miscellaneous and trivial clean-ups
(typos and opportunities to use suppressed exceptions)
Reviewed-by: mduigou, chegar
---
.../share/classes/java/io/BufferedReader.java | 13 ++++++++-----
.../share/classes/java/io/BufferedWriter.java | 17 ++++++++---------
jdk/src/share/classes/java/io/File.java | 2 +-
.../classes/java/io/FilterOutputStream.java | 7 +++----
.../classes/java/io/PushbackInputStream.java | 13 ++++++++-----
.../share/classes/java/io/PushbackReader.java | 7 +++++--
.../nio/channels/AsynchronousFileChannel.java | 4 ++--
.../java/nio/channels/SocketChannel.java | 9 ++++++---
.../classes/java/nio/file/CopyMoveHelper.java | 6 ++++--
jdk/src/share/classes/java/nio/file/Files.java | 15 ++++++++-------
.../classes/sun/nio/ch/FileChannelImpl.java | 4 ++--
...UnixAsynchronousServerSocketChannelImpl.java | 4 +++-
.../ch/UnixAsynchronousSocketChannelImpl.java | 9 ++++++---
jdk/test/java/lang/ProcessBuilder/Basic.java | 6 +++---
14 files changed, 67 insertions(+), 49 deletions(-)
diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java
index e8583e046f0..45a71f5cf1c 100644
--- a/jdk/src/share/classes/java/io/BufferedReader.java
+++ b/jdk/src/share/classes/java/io/BufferedReader.java
@@ -512,11 +512,14 @@ public class BufferedReader extends Reader {
public void close() throws IOException {
synchronized (lock) {
- if (in == null)
- return;
- in.close();
- in = null;
- cb = null;
+ if (in != null) {
+ try {
+ in.close();
+ } finally {
+ in = null;
+ cb = null;
+ }
+ }
}
}
}
diff --git a/jdk/src/share/classes/java/io/BufferedWriter.java b/jdk/src/share/classes/java/io/BufferedWriter.java
index 4322683d367..fad7b44add4 100644
--- a/jdk/src/share/classes/java/io/BufferedWriter.java
+++ b/jdk/src/share/classes/java/io/BufferedWriter.java
@@ -255,17 +255,16 @@ public class BufferedWriter extends Writer {
}
}
+ @SuppressWarnings("try")
public void close() throws IOException {
synchronized (lock) {
- if (out == null) {
- return;
- }
- try {
- flushBuffer();
- } finally {
- out.close();
- out = null;
- cb = null;
+ if (out != null) {
+ try (Writer w = out) {
+ flushBuffer();
+ } finally {
+ out = null;
+ cb = null;
+ }
}
}
}
diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java
index cde70d0b977..af198a5ed48 100644
--- a/jdk/src/share/classes/java/io/File.java
+++ b/jdk/src/share/classes/java/io/File.java
@@ -2055,7 +2055,7 @@ public class File
*
* @return a {@code Path} constructed from this abstract path
*
- * @throws InvalidPathException
+ * @throws java.nio.file.InvalidPathException
* if a {@code Path} object cannot be constructed from the abstract
* path (see {@link java.nio.file.FileSystem#getPath FileSystem.getPath})
*
diff --git a/jdk/src/share/classes/java/io/FilterOutputStream.java b/jdk/src/share/classes/java/io/FilterOutputStream.java
index 97154443a81..b7e920b1753 100644
--- a/jdk/src/share/classes/java/io/FilterOutputStream.java
+++ b/jdk/src/share/classes/java/io/FilterOutputStream.java
@@ -152,11 +152,10 @@ class FilterOutputStream extends OutputStream {
* @see java.io.FilterOutputStream#flush()
* @see java.io.FilterOutputStream#out
*/
+ @SuppressWarnings("try")
public void close() throws IOException {
- try {
- flush();
- } catch (IOException ignored) {
+ try (OutputStream ostream = out) {
+ flush();
}
- out.close();
}
}
diff --git a/jdk/src/share/classes/java/io/PushbackInputStream.java b/jdk/src/share/classes/java/io/PushbackInputStream.java
index a0e240f1d84..b6583f1dfb4 100644
--- a/jdk/src/share/classes/java/io/PushbackInputStream.java
+++ b/jdk/src/share/classes/java/io/PushbackInputStream.java
@@ -374,10 +374,13 @@ class PushbackInputStream extends FilterInputStream {
* @exception IOException if an I/O error occurs.
*/
public synchronized void close() throws IOException {
- if (in == null)
- return;
- in.close();
- in = null;
- buf = null;
+ if (in != null) {
+ try {
+ in.close();
+ } finally {
+ in = null;
+ buf = null;
+ }
+ }
}
}
diff --git a/jdk/src/share/classes/java/io/PushbackReader.java b/jdk/src/share/classes/java/io/PushbackReader.java
index 3add8a5d3f7..af44ee72fd3 100644
--- a/jdk/src/share/classes/java/io/PushbackReader.java
+++ b/jdk/src/share/classes/java/io/PushbackReader.java
@@ -245,8 +245,11 @@ public class PushbackReader extends FilterReader {
* @exception IOException If an I/O error occurs
*/
public void close() throws IOException {
- super.close();
- buf = null;
+ try {
+ super.close();
+ } finally {
+ buf = null;
+ }
}
/**
diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java
index 1ca3417cce2..4f4ac7f4a36 100644
--- a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java
+++ b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java
@@ -53,7 +53,7 @@ import java.util.Collections;
* operation. This class also defines read and write methods that initiate
* asynchronous operations, returning a {@link Future} to represent the pending
* result of the operation. The {@code Future} may be used to check if the
- * operation has completed, to wait for its completion.
+ * operation has completed, wait for its completion, and retrieve the result.
*
*
In addition to read and write operations, this class defines the
* following operations:
@@ -79,7 +79,7 @@ import java.util.Collections;
* itself a thread in the thread pool, then the completion handler may be invoked
* directly by the initiating thread. When an {@code AsynchronousFileChannel} is
* created without specifying a thread pool then the channel is associated with
- * a system-dependent and default thread pool that may be shared with other
+ * a system-dependent default thread pool that may be shared with other
* channels. The default thread pool is configured by the system properties
* defined by the {@link AsynchronousChannelGroup} class.
*
diff --git a/jdk/src/share/classes/java/nio/channels/SocketChannel.java b/jdk/src/share/classes/java/nio/channels/SocketChannel.java
index fe044c4741d..b582c6d656a 100644
--- a/jdk/src/share/classes/java/nio/channels/SocketChannel.java
+++ b/jdk/src/share/classes/java/nio/channels/SocketChannel.java
@@ -182,10 +182,13 @@ public abstract class SocketChannel
SocketChannel sc = open();
try {
sc.connect(remote);
- } finally {
- if (!sc.isConnected()) {
- try { sc.close(); } catch (IOException x) { }
+ } catch (Throwable x) {
+ try {
+ sc.close();
+ } catch (Throwable suppressed) {
+ x.addSuppressed(suppressed);
}
+ throw x;
}
assert sc.isConnected();
return sc;
diff --git a/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java b/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java
index 70ca6ee50ad..54bfe085962 100644
--- a/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java
+++ b/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java
@@ -135,11 +135,13 @@ class CopyMoveHelper {
view.setTimes(attrs.lastModifiedTime(),
attrs.lastAccessTime(),
attrs.creationTime());
- } catch (IOException x) {
+ } catch (Throwable x) {
// rollback
try {
Files.delete(target);
- } catch (IOException ignore) { }
+ } catch (Throwable suppressed) {
+ x.addSuppressed(suppressed);
+ }
throw x;
}
}
diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java
index 357529ac9cf..e509440696b 100644
--- a/jdk/src/share/classes/java/nio/file/Files.java
+++ b/jdk/src/share/classes/java/nio/file/Files.java
@@ -129,17 +129,18 @@ public final class Files {
*
* Path path = ...
*
- * // replace an existing file or create the file if it doesn't initially exist
+ * // truncate and overwrite an existing file, or create the file if
+ * // it doesn't initially exist
* OutputStream out = Files.newOutputStream(path);
*
* // append to an existing file, fail if the file does not exist
* out = Files.newOutputStream(path, APPEND);
*
* // append to an existing file, create file if it doesn't initially exist
- * out = Files.newOutputStream(CREATE, APPEND);
+ * out = Files.newOutputStream(path, CREATE, APPEND);
*
* // always create new file, failing if it already exists
- * out = Files.newOutputStream(CREATE_NEW);
+ * out = Files.newOutputStream(path, CREATE_NEW);
*
*
* @param path
@@ -895,8 +896,8 @@ public final class Files {
/**
* Creates a new directory in the default temporary-file directory, using
- * the given prefix and suffix to generate its name. The resulting {@code
- * Path} is associated with the default {@code FileSystem}.
+ * the given prefix to generate its name. The resulting {@code Path} is
+ * associated with the default {@code FileSystem}.
*
*
This method works in exactly the manner specified by {@link
* #createTempDirectory(Path,String,FileAttribute[])} method for the case
@@ -2583,7 +2584,7 @@ public final class Files {
* walkFileTree(start, EnumSet.noneOf(FileVisitOption.class), Integer.MAX_VALUE, visitor)
*
* In other words, it does not follow symbolic links, and visits all levels
- * of the file level.
+ * of the file tree.
*
* @param start
* the starting file
@@ -3005,7 +3006,7 @@ public final class Files {
* or after some bytes have been written to the file.
*
*
Usage example: By default the method creates a new file or
- * overrides an existing file. Suppose you instead want to append bytes
+ * overwrites an existing file. Suppose you instead want to append bytes
* to an existing file:
*
* Path path = ...
diff --git a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
index b15086eab12..c52fff788e9 100644
--- a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
+++ b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
@@ -475,8 +475,8 @@ public class FileChannelImpl
assert !target.isOpen();
try {
close();
- } catch (IOException ignore) {
- // nothing we can do
+ } catch (Throwable suppressed) {
+ e.addSuppressed(suppressed);
}
throw e;
} catch (IOException ioe) {
diff --git a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
index 119146b68f4..ee3731a0c2e 100644
--- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
+++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
@@ -236,7 +236,9 @@ class UnixAsynchronousServerSocketChannelImpl
} catch (SecurityException x) {
try {
ch.close();
- } catch (IOException ignore) { }
+ } catch (Throwable suppressed) {
+ x.addSuppressed(suppressed);
+ }
throw x;
}
return ch;
diff --git a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
index 4d887890ccd..13e4ad36434 100644
--- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
+++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
@@ -255,10 +255,11 @@ class UnixAsynchronousSocketChannelImpl
// close channel if connection cannot be established
try {
close();
- } catch (IOException ignore) { }
+ } catch (Throwable suppressed) {
+ e.addSuppressed(suppressed);
+ }
}
-
// invoke handler and set result
CompletionHandler handler = connectHandler;
Object att = connectAttachment;
@@ -345,7 +346,9 @@ class UnixAsynchronousSocketChannelImpl
if (e != null) {
try {
close();
- } catch (IOException ignore) { }
+ } catch (Throwable suppressed) {
+ e.addSuppressed(suppressed);
+ }
}
if (handler == null) {
return CompletedFuture.withResult(null, e);
diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java
index ebe65fb5bad..e109a4e78bd 100644
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java
@@ -1762,9 +1762,9 @@ public class Basic {
equal(p.exitValue(), 5);
- p.getInputStream().close();
- p.getErrorStream().close();
- p.getOutputStream().close();
+ try { p.getInputStream().close(); } catch (IOException ignore) { }
+ try {p.getErrorStream().close(); } catch (IOException ignore) { }
+ try { p.getOutputStream().close(); } catch (IOException ignore) { }
InputStream[] streams = { p.getInputStream(), p.getErrorStream() };
for (final InputStream in : streams) {
From 4c2006a7802d67d8da64c858eb4126ef0eb2381f Mon Sep 17 00:00:00 2001
From: Alan Bateman
Date: Tue, 22 Feb 2011 14:28:13 +0000
Subject: [PATCH 05/91] 7021327: Changes for 7020888 included changes to other
files in error
Reviewed-by: chegar
---
.../share/classes/java/io/BufferedReader.java | 13 +++++--------
.../share/classes/java/io/BufferedWriter.java | 17 +++++++++--------
.../classes/java/io/FilterOutputStream.java | 7 ++++---
.../classes/java/io/PushbackInputStream.java | 13 +++++--------
.../share/classes/java/io/PushbackReader.java | 7 ++-----
jdk/test/java/lang/ProcessBuilder/Basic.java | 6 +++---
6 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java
index 45a71f5cf1c..e8583e046f0 100644
--- a/jdk/src/share/classes/java/io/BufferedReader.java
+++ b/jdk/src/share/classes/java/io/BufferedReader.java
@@ -512,14 +512,11 @@ public class BufferedReader extends Reader {
public void close() throws IOException {
synchronized (lock) {
- if (in != null) {
- try {
- in.close();
- } finally {
- in = null;
- cb = null;
- }
- }
+ if (in == null)
+ return;
+ in.close();
+ in = null;
+ cb = null;
}
}
}
diff --git a/jdk/src/share/classes/java/io/BufferedWriter.java b/jdk/src/share/classes/java/io/BufferedWriter.java
index fad7b44add4..4322683d367 100644
--- a/jdk/src/share/classes/java/io/BufferedWriter.java
+++ b/jdk/src/share/classes/java/io/BufferedWriter.java
@@ -255,16 +255,17 @@ public class BufferedWriter extends Writer {
}
}
- @SuppressWarnings("try")
public void close() throws IOException {
synchronized (lock) {
- if (out != null) {
- try (Writer w = out) {
- flushBuffer();
- } finally {
- out = null;
- cb = null;
- }
+ if (out == null) {
+ return;
+ }
+ try {
+ flushBuffer();
+ } finally {
+ out.close();
+ out = null;
+ cb = null;
}
}
}
diff --git a/jdk/src/share/classes/java/io/FilterOutputStream.java b/jdk/src/share/classes/java/io/FilterOutputStream.java
index b7e920b1753..97154443a81 100644
--- a/jdk/src/share/classes/java/io/FilterOutputStream.java
+++ b/jdk/src/share/classes/java/io/FilterOutputStream.java
@@ -152,10 +152,11 @@ class FilterOutputStream extends OutputStream {
* @see java.io.FilterOutputStream#flush()
* @see java.io.FilterOutputStream#out
*/
- @SuppressWarnings("try")
public void close() throws IOException {
- try (OutputStream ostream = out) {
- flush();
+ try {
+ flush();
+ } catch (IOException ignored) {
}
+ out.close();
}
}
diff --git a/jdk/src/share/classes/java/io/PushbackInputStream.java b/jdk/src/share/classes/java/io/PushbackInputStream.java
index b6583f1dfb4..a0e240f1d84 100644
--- a/jdk/src/share/classes/java/io/PushbackInputStream.java
+++ b/jdk/src/share/classes/java/io/PushbackInputStream.java
@@ -374,13 +374,10 @@ class PushbackInputStream extends FilterInputStream {
* @exception IOException if an I/O error occurs.
*/
public synchronized void close() throws IOException {
- if (in != null) {
- try {
- in.close();
- } finally {
- in = null;
- buf = null;
- }
- }
+ if (in == null)
+ return;
+ in.close();
+ in = null;
+ buf = null;
}
}
diff --git a/jdk/src/share/classes/java/io/PushbackReader.java b/jdk/src/share/classes/java/io/PushbackReader.java
index af44ee72fd3..3add8a5d3f7 100644
--- a/jdk/src/share/classes/java/io/PushbackReader.java
+++ b/jdk/src/share/classes/java/io/PushbackReader.java
@@ -245,11 +245,8 @@ public class PushbackReader extends FilterReader {
* @exception IOException If an I/O error occurs
*/
public void close() throws IOException {
- try {
- super.close();
- } finally {
- buf = null;
- }
+ super.close();
+ buf = null;
}
/**
diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java
index e109a4e78bd..ebe65fb5bad 100644
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java
@@ -1762,9 +1762,9 @@ public class Basic {
equal(p.exitValue(), 5);
- try { p.getInputStream().close(); } catch (IOException ignore) { }
- try {p.getErrorStream().close(); } catch (IOException ignore) { }
- try { p.getOutputStream().close(); } catch (IOException ignore) { }
+ p.getInputStream().close();
+ p.getErrorStream().close();
+ p.getOutputStream().close();
InputStream[] streams = { p.getInputStream(), p.getErrorStream() };
for (final InputStream in : streams) {
From 7073df6b9666e9da3e635af0754377db577c9594 Mon Sep 17 00:00:00 2001
From: Michael McMahon
Date: Tue, 22 Feb 2011 14:44:43 +0000
Subject: [PATCH 06/91] 6702400: ChunkedInputStream expecting -1 from int read,
but int->char comparision is wrong
Reviewed-by: chegar
---
.../sun/net/httpserver/ChunkedInputStream.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java b/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java
index 97b8242a9fa..95e01018986 100644
--- a/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java
+++ b/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java
@@ -69,32 +69,33 @@ class ChunkedInputStream extends LeftOverInputStream {
*/
private int readChunkHeader () throws IOException {
boolean gotCR = false;
- char c;
+ int c;
char[] len_arr = new char [16];
int len_size = 0;
boolean end_of_len = false;
- while ((c=(char)in.read())!= -1) {
+ while ((c=in.read())!= -1) {
+ char ch = (char) c;
if (len_size == len_arr.length -1) {
throw new IOException ("invalid chunk header");
}
if (gotCR) {
- if (c == LF) {
+ if (ch == LF) {
int l = numeric (len_arr, len_size);
return l;
} else {
gotCR = false;
}
if (!end_of_len) {
- len_arr[len_size++] = c;
+ len_arr[len_size++] = ch;
}
} else {
- if (c == CR) {
+ if (ch == CR) {
gotCR = true;
- } else if (c == ';') {
+ } else if (ch == ';') {
end_of_len = true;
} else if (!end_of_len) {
- len_arr[len_size++] = c;
+ len_arr[len_size++] = ch;
}
}
}
From 4ce804890912ce7a0002c9e631c4dc699ac33c39 Mon Sep 17 00:00:00 2001
From: Valerie Peng
Date: Tue, 22 Feb 2011 12:01:35 -0800
Subject: [PATCH 07/91] 6604496: Support for CKM_AES_CTR (counter mode)
Enhanced SunPKCS11 provider to support AES/CTR/NoPadding transformation.
Reviewed-by: vinnie
---
.../sun/security/pkcs11/P11Cipher.java | 43 +++---
.../sun/security/pkcs11/SunPKCS11.java | 4 +-
.../pkcs11/wrapper/CK_AES_CTR_PARAMS.java | 66 ++++++++++
.../security/pkcs11/wrapper/CK_MECHANISM.java | 7 +-
.../pkcs11/wrapper/PKCS11Constants.java | 39 +++++-
.../sun/security/pkcs11/wrapper/p11_convert.c | 75 ++++++++++-
.../security/pkcs11/wrapper/pkcs-11v2-20a3.h | 124 ++++++++++++++++++
.../security/pkcs11/wrapper/pkcs11wrapper.h | 4 +-
.../pkcs11/Cipher/TestSymmCiphers.java | 10 +-
.../pkcs11/Cipher/TestSymmCiphersNoPad.java | 7 +-
10 files changed, 345 insertions(+), 34 deletions(-)
create mode 100644 jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java
create mode 100644 jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java
index 3d2525f3f07..5257859e30e 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,14 +42,12 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
* Cipher implementation class. This class currently supports
* DES, DESede, AES, ARCFOUR, and Blowfish.
*
- * This class is designed to support ECB and CBC with NoPadding and
- * PKCS5Padding for both. It will use its own padding impl if the
- * native mechanism does not support padding.
+ * This class is designed to support ECB, CBC, CTR with NoPadding
+ * and ECB, CBC with PKCS5Padding. It will use its own padding impl
+ * if the native mechanism does not support padding.
*
- * Note that PKCS#11 current only supports ECB and CBC. There are no
- * provisions for other modes such as CFB, OFB, PCBC, or CTR mode.
- * However, CTR could be implemented relatively easily (and efficiently)
- * on top of ECB mode in this class, if need be.
+ * Note that PKCS#11 currently only supports ECB, CBC, and CTR.
+ * There are no provisions for other modes such as CFB, OFB, and PCBC.
*
* @author Andreas Sterbenz
* @since 1.5
@@ -60,6 +58,8 @@ final class P11Cipher extends CipherSpi {
private final static int MODE_ECB = 3;
// mode constant for CBC mode
private final static int MODE_CBC = 4;
+ // mode constant for CTR mode
+ private final static int MODE_CTR = 5;
// padding constant for NoPadding
private final static int PAD_NONE = 5;
@@ -157,7 +157,7 @@ final class P11Cipher extends CipherSpi {
private byte[] padBuffer;
private int padBufferLen;
- // original IV, if in MODE_CBC
+ // original IV, if in MODE_CBC or MODE_CTR
private byte[] iv;
// number of bytes buffered internally by the native mechanism and padBuffer
@@ -213,6 +213,8 @@ final class P11Cipher extends CipherSpi {
("CBC mode not supported with stream ciphers");
}
result = MODE_CBC;
+ } else if (mode.equals("CTR")) {
+ result = MODE_CTR;
} else {
throw new NoSuchAlgorithmException("Unsupported mode " + mode);
}
@@ -228,6 +230,10 @@ final class P11Cipher extends CipherSpi {
if (padding.equals("NOPADDING")) {
paddingType = PAD_NONE;
} else if (padding.equals("PKCS5PADDING")) {
+ if (this.blockMode == MODE_CTR) {
+ throw new NoSuchPaddingException
+ ("PKCS#5 padding not supported with CTR mode");
+ }
paddingType = PAD_PKCS5;
if (mechanism != CKM_DES_CBC_PAD && mechanism != CKM_DES3_CBC_PAD &&
mechanism != CKM_AES_CBC_PAD) {
@@ -348,11 +354,14 @@ final class P11Cipher extends CipherSpi {
("IV not used in ECB mode");
}
}
- } else { // MODE_CBC
+ } else { // MODE_CBC or MODE_CTR
if (iv == null) {
if (encrypt == false) {
- throw new InvalidAlgorithmParameterException
- ("IV must be specified for decryption in CBC mode");
+ String exMsg =
+ (blockMode == MODE_CBC ?
+ "IV must be specified for decryption in CBC mode" :
+ "IV must be specified for decryption in CTR mode");
+ throw new InvalidAlgorithmParameterException(exMsg);
}
// generate random IV
if (random == null) {
@@ -410,13 +419,15 @@ final class P11Cipher extends CipherSpi {
if (session == null) {
session = token.getOpSession();
}
+ CK_MECHANISM mechParams = (blockMode == MODE_CTR?
+ new CK_MECHANISM(mechanism, new CK_AES_CTR_PARAMS(iv)) :
+ new CK_MECHANISM(mechanism, iv));
+
try {
if (encrypt) {
- token.p11.C_EncryptInit(session.id(),
- new CK_MECHANISM(mechanism, iv), p11Key.keyID);
+ token.p11.C_EncryptInit(session.id(), mechParams, p11Key.keyID);
} else {
- token.p11.C_DecryptInit(session.id(),
- new CK_MECHANISM(mechanism, iv), p11Key.keyID);
+ token.p11.C_DecryptInit(session.id(), mechParams, p11Key.keyID);
}
} catch (PKCS11Exception ex) {
// release session when initialization failed
diff --git a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
index 55843b95c58..d1a1db3defd 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -621,6 +621,8 @@ public final class SunPKCS11 extends AuthProvider {
m(CKM_AES_CBC_PAD, CKM_AES_CBC));
d(CIP, "AES/ECB", P11Cipher, s("AES"),
m(CKM_AES_ECB));
+ d(CIP, "AES/CTR/NoPadding", P11Cipher,
+ m(CKM_AES_CTR));
d(CIP, "Blowfish/CBC", P11Cipher,
m(CKM_BLOWFISH_CBC));
diff --git a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java
new file mode 100644
index 00000000000..7208f481c2a
--- /dev/null
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.pkcs11.wrapper;
+
+/**
+ * This class represents the necessary parameters required by
+ * the CKM_AES_CTR mechanism as defined in CK_AES_CTR_PARAMS structure.
+ *
+ * @author Yu-Ching Valerie Peng
+ * @since 1.7
+ */
+public class CK_AES_CTR_PARAMS {
+
+ private final long ulCounterBits;
+ private final byte cb[];
+
+ public CK_AES_CTR_PARAMS(byte[] cb) {
+ ulCounterBits = 128;
+ this.cb = cb.clone();
+ }
+
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+
+ buffer.append(Constants.INDENT);
+ buffer.append("ulCounterBits: ");
+ buffer.append(ulCounterBits);
+ buffer.append(Constants.NEWLINE);
+
+ buffer.append(Constants.INDENT);
+ buffer.append("cb: ");
+ buffer.append(Functions.toHexString(cb));
+
+ return buffer.toString();
+ }
+}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java
index b84c5e99c15..3322d19b00c 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -48,6 +48,7 @@
package sun.security.pkcs11.wrapper;
import java.math.BigInteger;
+import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
* class CK_MECHANISM specifies a particular mechanism and any parameters it
@@ -127,6 +128,10 @@ public class CK_MECHANISM {
init(mechanism, params);
}
+ public CK_MECHANISM(long mechanism, CK_AES_CTR_PARAMS params) {
+ init(mechanism, params);
+ }
+
private void init(long mechanism, Object pParameter) {
this.mechanism = mechanism;
this.pParameter = pParameter;
diff --git a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java
index f5bf7f1034d..98e9fe0651b 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -47,8 +47,6 @@
package sun.security.pkcs11.wrapper;
-
-
/**
* This interface holds constants of the PKCS#11 v2.11 standard.
* This is mainly the content of the 'pkcs11t.h' header file.
@@ -306,6 +304,10 @@ public interface PKCS11Constants {
public static final long CKK_VENDOR_DEFINED = 0x80000000L;
+ // new for v2.20 amendment 3
+ //public static final long CKK_CAMELLIA = 0x00000025L;
+ //public static final long CKK_ARIA = 0x00000026L;
+
// pseudo key type ANY (for template manager)
public static final long PCKK_ANY = 0x7FFFFF22L;
@@ -690,6 +692,34 @@ public interface PKCS11Constants {
public static final long CKM_VENDOR_DEFINED = 0x80000000L;
+ // new for v2.20 amendment 3
+ public static final long CKM_SHA224 = 0x00000255L;
+ public static final long CKM_SHA224_HMAC = 0x00000256L;
+ public static final long CKM_SHA224_HMAC_GENERAL = 0x00000257L;
+ public static final long CKM_SHA224_KEY_DERIVATION = 0x00000396L;
+ public static final long CKM_SHA224_RSA_PKCS = 0x00000046L;
+ public static final long CKM_SHA224_RSA_PKCS_PSS = 0x00000047L;
+ public static final long CKM_AES_CTR = 0x00001086L;
+ /*
+ public static final long CKM_CAMELLIA_KEY_GEN = 0x00000550L;
+ public static final long CKM_CAMELLIA_ECB = 0x00000551L;
+ public static final long CKM_CAMELLIA_CBC = 0x00000552L;
+ public static final long CKM_CAMELLIA_MAC = 0x00000553L;
+ public static final long CKM_CAMELLIA_MAC_GENERAL = 0x00000554L;
+ public static final long CKM_CAMELLIA_CBC_PAD = 0x00000555L;
+ public static final long CKM_CAMELLIA_ECB_ENCRYPT_DATA = 0x00000556L;
+ public static final long CKM_CAMELLIA_CBC_ENCRYPT_DATA = 0x00000557L;
+ public static final long CKM_CAMELLIA_CTR = 0x00000558L;
+ public static final long CKM_ARIA_KEY_GEN = 0x00000560L;
+ public static final long CKM_ARIA_ECB = 0x00000561L;
+ public static final long CKM_ARIA_CBC = 0x00000562L;
+ public static final long CKM_ARIA_MAC = 0x00000563L;
+ public static final long CKM_ARIA_MAC_GENERAL = 0x00000564L;
+ public static final long CKM_ARIA_CBC_PAD = 0x00000565L;
+ public static final long CKM_ARIA_ECB_ENCRYPT_DATA = 0x00000566L;
+ public static final long CKM_ARIA_CBC_ENCRYPT_DATA = 0x00000567L;
+ */
+
// NSS private
public static final long CKM_NSS_TLS_PRF_GENERAL = 0x80000373L;
@@ -881,7 +911,8 @@ public interface PKCS11Constants {
/* The following MGFs are defined */
public static final long CKG_MGF1_SHA1 = 0x00000001L;
-
+ // new for v2.20 amendment 3
+ public static final long CKG_MGF1_SHA224 = 0x00000005L;
/* The following encoding parameter sources are defined */
public static final long CKZ_DATA_SPECIFIED = 0x00000001L;
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
index 4abc1507388..c32a278b585 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -694,6 +694,46 @@ CK_SSL3_KEY_MAT_PARAMS jSsl3KeyMatParamToCKSsl3KeyMatParam(JNIEnv *env, jobject
return ckParam ;
}
+/*
+ * converts the Java CK_AES_CTR_PARAMS object to a CK_AES_CTR_PARAMS structure
+ *
+ * @param env - used to call JNI funktions to get the Java classes and objects
+ * @param jParam - the Java CK_AES_CTR_PARAMS object to convert
+ * @param ckpParam - pointer to the new CK_AES_CTR_PARAMS structure
+ */
+void jAesCtrParamsToCKAesCtrParam(JNIEnv *env, jobject jParam,
+ CK_AES_CTR_PARAMS_PTR ckpParam) {
+ jclass jAesCtrParamsClass;
+ jfieldID fieldID;
+ jlong jCounterBits;
+ jobject jCb;
+ CK_BYTE_PTR ckBytes;
+ CK_ULONG ckTemp;
+
+ /* get ulCounterBits */
+ jAesCtrParamsClass = (*env)->FindClass(env, CLASS_AES_CTR_PARAMS);
+ if (jAesCtrParamsClass == NULL) { return; }
+ fieldID = (*env)->GetFieldID(env, jAesCtrParamsClass, "ulCounterBits", "J");
+ if (fieldID == NULL) { return; }
+ jCounterBits = (*env)->GetLongField(env, jParam, fieldID);
+
+ /* get cb */
+ fieldID = (*env)->GetFieldID(env, jAesCtrParamsClass, "cb", "[B");
+ if (fieldID == NULL) { return; }
+ jCb = (*env)->GetObjectField(env, jParam, fieldID);
+
+ /* populate java values */
+ ckpParam->ulCounterBits = jLongToCKULong(jCounterBits);
+ jByteArrayToCKByteArray(env, jCb, &ckBytes, &ckTemp);
+ if ((*env)->ExceptionCheck(env)) { return; }
+ if (ckTemp != 16) {
+ TRACE1("ERROR: WRONG CTR IV LENGTH %d", ckTemp);
+ } else {
+ memcpy(ckpParam->cb, ckBytes, ckTemp);
+ free(ckBytes);
+ }
+}
+
/*
* converts a Java CK_MECHANISM object into a CK_MECHANISM structure
*
@@ -937,12 +977,10 @@ void jMechanismParameterToCKMechanismParameterSlow(JNIEnv *env, jobject jParam,
{
/* get all Java mechanism parameter classes */
jclass jVersionClass, jSsl3MasterKeyDeriveParamsClass, jSsl3KeyMatParamsClass;
- jclass jTlsPrfParamsClass, jRsaPkcsOaepParamsClass, jPbeParamsClass;
- jclass jPkcs5Pbkd2ParamsClass, jRsaPkcsPssParamsClass;
+ jclass jTlsPrfParamsClass, jAesCtrParamsClass, jRsaPkcsOaepParamsClass;
+ jclass jPbeParamsClass, jPkcs5Pbkd2ParamsClass, jRsaPkcsPssParamsClass;
jclass jEcdh1DeriveParamsClass, jEcdh2DeriveParamsClass;
jclass jX942Dh1DeriveParamsClass, jX942Dh2DeriveParamsClass;
-
- /* get all Java mechanism parameter classes */
TRACE0("\nDEBUG: jMechanismParameterToCKMechanismParameter");
/* most common cases, i.e. NULL/byte[]/long, are already handled by
@@ -1046,6 +1084,33 @@ void jMechanismParameterToCKMechanismParameterSlow(JNIEnv *env, jobject jParam,
return;
}
+ jAesCtrParamsClass = (*env)->FindClass(env, CLASS_AES_CTR_PARAMS);
+ if (jAesCtrParamsClass == NULL) { return; }
+ if ((*env)->IsInstanceOf(env, jParam, jAesCtrParamsClass)) {
+ /*
+ * CK_AES_CTR_PARAMS
+ */
+ CK_AES_CTR_PARAMS_PTR ckpParam;
+
+ ckpParam = (CK_AES_CTR_PARAMS_PTR) malloc(sizeof(CK_AES_CTR_PARAMS));
+ if (ckpParam == NULL) {
+ JNU_ThrowOutOfMemoryError(env, 0);
+ return;
+ }
+
+ /* convert jParameter to CKParameter */
+ jAesCtrParamsToCKAesCtrParam(env, jParam, ckpParam);
+ if ((*env)->ExceptionCheck(env)) {
+ free(ckpParam);
+ return;
+ }
+
+ /* get length and pointer of parameter */
+ *ckpLength = sizeof(CK_AES_CTR_PARAMS);
+ *ckpParamPtr = ckpParam;
+ return;
+ }
+
jRsaPkcsOaepParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_OAEP_PARAMS);
if (jRsaPkcsOaepParamsClass == NULL) { return; }
if ((*env)->IsInstanceOf(env, jParam, jRsaPkcsOaepParamsClass)) {
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h
new file mode 100644
index 00000000000..0486fdf6a63
--- /dev/null
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h
@@ -0,0 +1,124 @@
+/* pkcs-11v2-20a3.h include file for the PKCS #11 Version 2.20 Amendment 3
+ document. */
+
+/* $Revision: 1.4 $ */
+
+/* License to copy and use this software is granted provided that it is
+ * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
+ * (Cryptoki) Version 2.20 Amendment 3" in all material mentioning or
+ * referencing this software.
+
+ * RSA Security Inc. makes no representations concerning either the
+ * merchantability of this software or the suitability of this software for
+ * any particular purpose. It is provided "as is" without express or implied
+ * warranty of any kind.
+ */
+
+/* This file is preferably included after inclusion of pkcs11.h */
+
+#ifndef _PKCS_11V2_20A3_H_
+#define _PKCS_11V2_20A3_H_ 1
+
+/* Are the definitions of this file already included in pkcs11t.h ? */
+#ifndef CKK_CAMELLIA
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Key types */
+
+/* Camellia is new for PKCS #11 v2.20 amendment 3 */
+#define CKK_CAMELLIA 0x00000025
+/* ARIA is new for PKCS #11 v2.20 amendment 3 */
+#define CKK_ARIA 0x00000026
+
+
+/* Mask-generating functions */
+
+/* SHA-224 is new for PKCS #11 v2.20 amendment 3 */
+#define CKG_MGF1_SHA224 0x00000005
+
+
+/* Mechanism Identifiers */
+
+/* SHA-224 is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_SHA224 0x00000255
+#define CKM_SHA224_HMAC 0x00000256
+#define CKM_SHA224_HMAC_GENERAL 0x00000257
+
+/* SHA-224 key derivation is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_SHA224_KEY_DERIVATION 0x00000396
+
+/* SHA-224 RSA mechanisms are new for PKCS #11 v2.20 amendment 3 */
+#define CKM_SHA224_RSA_PKCS 0x00000046
+#define CKM_SHA224_RSA_PKCS_PSS 0x00000047
+
+/* AES counter mode is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_AES_CTR 0x00001086
+
+/* Camellia is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_CAMELLIA_KEY_GEN 0x00000550
+#define CKM_CAMELLIA_ECB 0x00000551
+#define CKM_CAMELLIA_CBC 0x00000552
+#define CKM_CAMELLIA_MAC 0x00000553
+#define CKM_CAMELLIA_MAC_GENERAL 0x00000554
+#define CKM_CAMELLIA_CBC_PAD 0x00000555
+#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556
+#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557
+#define CKM_CAMELLIA_CTR 0x00000558
+
+/* ARIA is new for PKCS #11 v2.20 amendment 3 */
+#define CKM_ARIA_KEY_GEN 0x00000560
+#define CKM_ARIA_ECB 0x00000561
+#define CKM_ARIA_CBC 0x00000562
+#define CKM_ARIA_MAC 0x00000563
+#define CKM_ARIA_MAC_GENERAL 0x00000564
+#define CKM_ARIA_CBC_PAD 0x00000565
+#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566
+#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567
+
+
+/* Mechanism parameters */
+
+/* CK_AES_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_AES_CTR_PARAMS {
+ CK_ULONG ulCounterBits;
+ CK_BYTE cb[16];
+} CK_AES_CTR_PARAMS;
+
+typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR;
+
+/* CK_CAMELLIA_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_CAMELLIA_CTR_PARAMS {
+ CK_ULONG ulCounterBits;
+ CK_BYTE cb[16];
+} CK_CAMELLIA_CTR_PARAMS;
+
+typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR;
+
+/* CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS {
+ CK_BYTE iv[16];
+ CK_BYTE_PTR pData;
+ CK_ULONG length;
+} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS;
+
+typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR;
+
+/* CK_ARIA_CBC_ENCRYPT_DATA_PARAMS is new for PKCS #11 v2.20 amendment 3 */
+typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS {
+ CK_BYTE iv[16];
+ CK_BYTE_PTR pData;
+ CK_ULONG length;
+} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS;
+
+typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
index 98598d807f5..ff6d550d523 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -153,6 +153,7 @@
#include "p11_md.h"
#include "pkcs11.h"
+#include "pkcs-11v2-20a3.h"
#include
#include
@@ -272,6 +273,7 @@
#define CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_SSL3_MASTER_KEY_DERIVE_PARAMS"
#define CLASS_SSL3_KEY_MAT_PARAMS "sun/security/pkcs11/wrapper/CK_SSL3_KEY_MAT_PARAMS"
#define CLASS_TLS_PRF_PARAMS "sun/security/pkcs11/wrapper/CK_TLS_PRF_PARAMS"
+#define CLASS_AES_CTR_PARAMS "sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS"
/* function to convert a PKCS#11 return value other than CK_OK into a Java Exception
* or to throw a PKCS11RuntimeException
diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java
index b8a6dcced66..14e41cdddd2 100644
--- a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* @test %I% %E%
- * @bug 4898461
+ * @bug 4898461 6604496
* @summary basic test for symmetric ciphers with padding
* @author Valerie Peng
* @library ..
@@ -70,9 +70,13 @@ public class TestSymmCiphers extends PKCS11Test {
new CI("DES/ECB/PKCS5Padding", "DES", 6400),
new CI("DESede/ECB/PKCS5Padding", "DESede", 400),
new CI("AES/ECB/PKCS5Padding", "AES", 64),
+
new CI("DES", "DES", 6400),
new CI("DESede", "DESede", 408),
- new CI("AES", "AES", 128)
+ new CI("AES", "AES", 128),
+
+ new CI("AES/CTR/NoPadding", "AES", 3200)
+
};
private static StringBuffer debugBuf = new StringBuffer();
diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
index 5c2e939e8bd..5f94ea48f57 100644
--- a/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4898484
+ * @bug 4898484 6604496
* @summary basic test for symmetric ciphers with no padding
* @author Valerie Peng
* @library ..
@@ -59,7 +59,8 @@ public class TestSymmCiphersNoPad extends PKCS11Test {
new CI("DES/CBC/NoPadding", "DES", 400),
new CI("DESede/CBC/NoPadding", "DESede", 160),
new CI("AES/CBC/NoPadding", "AES", 4800),
- new CI("Blowfish/CBC/NoPadding", "Blowfish", 24)
+ new CI("Blowfish/CBC/NoPadding", "Blowfish", 24),
+ new CI("AES/CTR/NoPadding", "AES", 1600)
};
private static StringBuffer debugBuf;
From 1c5e7bf24aee783887dbebb6314694ed4f0f526d Mon Sep 17 00:00:00 2001
From: Igor Veresov
Date: Tue, 22 Feb 2011 15:25:02 -0800
Subject: [PATCH 08/91] 7020521: arraycopy stubs place prebarriers incorrectly
Rearranged the pre-barrier placement in arraycopy stubs so that they are properly called in case of chained calls. Also refactored the code a little bit so that it looks uniform across the platforms and is more readable.
Reviewed-by: never, kvn
---
.../src/cpu/sparc/vm/stubGenerator_sparc.cpp | 279 ++++++++++--------
.../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 31 +-
.../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 236 +++++++--------
3 files changed, 292 insertions(+), 254 deletions(-)
diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
index 7bb56140d61..f9961334370 100644
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -968,19 +968,6 @@ class StubGenerator: public StubCodeGenerator {
return start;
}
- static address disjoint_byte_copy_entry;
- static address disjoint_short_copy_entry;
- static address disjoint_int_copy_entry;
- static address disjoint_long_copy_entry;
- static address disjoint_oop_copy_entry;
-
- static address byte_copy_entry;
- static address short_copy_entry;
- static address int_copy_entry;
- static address long_copy_entry;
- static address oop_copy_entry;
-
- static address checkcast_copy_entry;
//
// Verify that a register contains clean 32-bits positive value
@@ -1283,7 +1270,7 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_disjoint_byte_copy(bool aligned, const char * name) {
+ address generate_disjoint_byte_copy(bool aligned, address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1299,9 +1286,11 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) disjoint_byte_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
// for short arrays, just do single element copy
__ cmp(count, 23); // 16 + 7
@@ -1391,15 +1380,13 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_conjoint_byte_copy(bool aligned, const char * name) {
+ address generate_conjoint_byte_copy(bool aligned, address nooverlap_target,
+ address *entry, const char *name) {
// Do reverse copy.
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
- address nooverlap_target = aligned ?
- StubRoutines::arrayof_jbyte_disjoint_arraycopy() :
- disjoint_byte_copy_entry;
Label L_skip_alignment, L_align, L_aligned_copy;
Label L_copy_byte, L_copy_byte_loop, L_exit;
@@ -1412,9 +1399,11 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) byte_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
array_overlap_test(nooverlap_target, 0);
@@ -1504,7 +1493,7 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_disjoint_short_copy(bool aligned, const char * name) {
+ address generate_disjoint_short_copy(bool aligned, address *entry, const char * name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1520,9 +1509,11 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) disjoint_short_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
// for short arrays, just do single element copy
__ cmp(count, 11); // 8 + 3 (22 bytes)
@@ -1842,15 +1833,13 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_conjoint_short_copy(bool aligned, const char * name) {
+ address generate_conjoint_short_copy(bool aligned, address nooverlap_target,
+ address *entry, const char *name) {
// Do reverse copy.
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
- address nooverlap_target = aligned ?
- StubRoutines::arrayof_jshort_disjoint_arraycopy() :
- disjoint_short_copy_entry;
Label L_skip_alignment, L_skip_alignment2, L_aligned_copy;
Label L_copy_2_bytes, L_copy_2_bytes_loop, L_exit;
@@ -1865,9 +1854,11 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) short_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
array_overlap_test(nooverlap_target, 1);
@@ -2072,7 +2063,7 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_disjoint_int_copy(bool aligned, const char * name) {
+ address generate_disjoint_int_copy(bool aligned, address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -2080,9 +2071,11 @@ class StubGenerator: public StubCodeGenerator {
const Register count = O2;
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) disjoint_int_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
generate_disjoint_int_copy_core(aligned);
@@ -2204,20 +2197,19 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_conjoint_int_copy(bool aligned, const char * name) {
+ address generate_conjoint_int_copy(bool aligned, address nooverlap_target,
+ address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
- address nooverlap_target = aligned ?
- StubRoutines::arrayof_jint_disjoint_arraycopy() :
- disjoint_int_copy_entry;
-
assert_clean_int(O2, O3); // Make sure 'count' is clean int.
- if (!aligned) int_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
array_overlap_test(nooverlap_target, 2);
@@ -2336,16 +2328,18 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_disjoint_long_copy(bool aligned, const char * name) {
+ address generate_disjoint_long_copy(bool aligned, address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
assert_clean_int(O2, O3); // Make sure 'count' is clean int.
- if (!aligned) disjoint_long_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
generate_disjoint_long_copy_core(aligned);
@@ -2406,19 +2400,21 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_conjoint_long_copy(bool aligned, const char * name) {
+ address generate_conjoint_long_copy(bool aligned, address nooverlap_target,
+ address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
assert(!aligned, "usage");
- address nooverlap_target = disjoint_long_copy_entry;
assert_clean_int(O2, O3); // Make sure 'count' is clean int.
- if (!aligned) long_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
array_overlap_test(nooverlap_target, 3);
@@ -2439,7 +2435,7 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_disjoint_oop_copy(bool aligned, const char * name) {
+ address generate_disjoint_oop_copy(bool aligned, address *entry, const char *name) {
const Register from = O0; // source array address
const Register to = O1; // destination array address
@@ -2451,9 +2447,11 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) disjoint_oop_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here
+ BLOCK_COMMENT("Entry:");
+ }
// save arguments for barrier generation
__ mov(to, G1);
@@ -2487,7 +2485,8 @@ class StubGenerator: public StubCodeGenerator {
// to: O1
// count: O2 treated as signed
//
- address generate_conjoint_oop_copy(bool aligned, const char * name) {
+ address generate_conjoint_oop_copy(bool aligned, address nooverlap_target,
+ address *entry, const char *name) {
const Register from = O0; // source array address
const Register to = O1; // destination array address
@@ -2499,22 +2498,19 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(count, O3); // Make sure 'count' is clean int.
- if (!aligned) oop_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here
- if (!aligned) BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here
+ BLOCK_COMMENT("Entry:");
+ }
+
+ array_overlap_test(nooverlap_target, LogBytesPerHeapOop);
// save arguments for barrier generation
__ mov(to, G1);
__ mov(count, G5);
-
gen_write_ref_array_pre_barrier(G1, G5);
- address nooverlap_target = aligned ?
- StubRoutines::arrayof_oop_disjoint_arraycopy() :
- disjoint_oop_copy_entry;
-
- array_overlap_test(nooverlap_target, LogBytesPerHeapOop);
-
#ifdef _LP64
if (UseCompressedOops) {
generate_conjoint_int_copy_core(aligned);
@@ -2582,7 +2578,7 @@ class StubGenerator: public StubCodeGenerator {
// ckval: O4 (super_klass)
// ret: O0 zero for success; (-1^K) where K is partial transfer count
//
- address generate_checkcast_copy(const char* name) {
+ address generate_checkcast_copy(const char *name, address *entry) {
const Register O0_from = O0; // source array address
const Register O1_to = O1; // destination array address
@@ -2600,8 +2596,6 @@ class StubGenerator: public StubCodeGenerator {
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
- gen_write_ref_array_pre_barrier(O1, O2);
-
#ifdef ASSERT
// We sometimes save a frame (see generate_type_check below).
// If this will cause trouble, let's fail now instead of later.
@@ -2625,9 +2619,13 @@ class StubGenerator: public StubCodeGenerator {
}
#endif //ASSERT
- checkcast_copy_entry = __ pc();
- // caller can pass a 64-bit byte count here (from generic stub)
- BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from generic stub)
+ BLOCK_COMMENT("Entry:");
+ }
+
+ gen_write_ref_array_pre_barrier(O1_to, O2_count);
Label load_element, store_element, do_card_marks, fail, done;
__ addcc(O2_count, 0, G1_remain); // initialize loop index, and test it
@@ -2700,7 +2698,11 @@ class StubGenerator: public StubCodeGenerator {
// Examines the alignment of the operands and dispatches
// to a long, int, short, or byte copy loop.
//
- address generate_unsafe_copy(const char* name) {
+ address generate_unsafe_copy(const char* name,
+ address byte_copy_entry,
+ address short_copy_entry,
+ address int_copy_entry,
+ address long_copy_entry) {
const Register O0_from = O0; // source array address
const Register O1_to = O1; // destination array address
@@ -2796,8 +2798,13 @@ class StubGenerator: public StubCodeGenerator {
// O0 == 0 - success
// O0 == -1 - need to call System.arraycopy
//
- address generate_generic_copy(const char *name) {
-
+ address generate_generic_copy(const char *name,
+ address entry_jbyte_arraycopy,
+ address entry_jshort_arraycopy,
+ address entry_jint_arraycopy,
+ address entry_oop_arraycopy,
+ address entry_jlong_arraycopy,
+ address entry_checkcast_arraycopy) {
Label L_failed, L_objArray;
// Input registers
@@ -2970,15 +2977,15 @@ class StubGenerator: public StubCodeGenerator {
BLOCK_COMMENT("choose copy loop based on element size");
__ cmp(G3_elsize, 0);
- __ br(Assembler::equal,true,Assembler::pt,StubRoutines::_jbyte_arraycopy);
+ __ br(Assembler::equal, true, Assembler::pt, entry_jbyte_arraycopy);
__ delayed()->signx(length, count); // length
__ cmp(G3_elsize, LogBytesPerShort);
- __ br(Assembler::equal,true,Assembler::pt,StubRoutines::_jshort_arraycopy);
+ __ br(Assembler::equal, true, Assembler::pt, entry_jshort_arraycopy);
__ delayed()->signx(length, count); // length
__ cmp(G3_elsize, LogBytesPerInt);
- __ br(Assembler::equal,true,Assembler::pt,StubRoutines::_jint_arraycopy);
+ __ br(Assembler::equal, true, Assembler::pt, entry_jint_arraycopy);
__ delayed()->signx(length, count); // length
#ifdef ASSERT
{ Label L;
@@ -2989,7 +2996,7 @@ class StubGenerator: public StubCodeGenerator {
__ bind(L);
}
#endif
- __ br(Assembler::always,false,Assembler::pt,StubRoutines::_jlong_arraycopy);
+ __ br(Assembler::always, false, Assembler::pt, entry_jlong_arraycopy);
__ delayed()->signx(length, count); // length
// objArrayKlass
@@ -3013,7 +3020,7 @@ class StubGenerator: public StubCodeGenerator {
__ add(src, src_pos, from); // src_addr
__ add(dst, dst_pos, to); // dst_addr
__ BIND(L_plain_copy);
- __ br(Assembler::always, false, Assembler::pt,StubRoutines::_oop_arraycopy);
+ __ br(Assembler::always, false, Assembler::pt, entry_oop_arraycopy);
__ delayed()->signx(length, count); // length
__ BIND(L_checkcast_copy);
@@ -3057,7 +3064,7 @@ class StubGenerator: public StubCodeGenerator {
__ ld_ptr(G4_dst_klass, ek_offset, O4); // dest elem klass
// lduw(O4, sco_offset, O3); // sco of elem klass
- __ br(Assembler::always, false, Assembler::pt, checkcast_copy_entry);
+ __ br(Assembler::always, false, Assembler::pt, entry_checkcast_arraycopy);
__ delayed()->lduw(O4, sco_offset, O3);
}
@@ -3068,39 +3075,76 @@ class StubGenerator: public StubCodeGenerator {
}
void generate_arraycopy_stubs() {
+ address entry;
+ address entry_jbyte_arraycopy;
+ address entry_jshort_arraycopy;
+ address entry_jint_arraycopy;
+ address entry_oop_arraycopy;
+ address entry_jlong_arraycopy;
+ address entry_checkcast_arraycopy;
- // Note: the disjoint stubs must be generated first, some of
- // the conjoint stubs use them.
- StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(false, "jbyte_disjoint_arraycopy");
- StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, "jshort_disjoint_arraycopy");
- StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_copy(false, "jint_disjoint_arraycopy");
- StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_copy(false, "jlong_disjoint_arraycopy");
- StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_oop_copy(false, "oop_disjoint_arraycopy");
- StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(true, "arrayof_jbyte_disjoint_arraycopy");
- StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(true, "arrayof_jshort_disjoint_arraycopy");
- StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_int_copy(true, "arrayof_jint_disjoint_arraycopy");
- StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_long_copy(true, "arrayof_jlong_disjoint_arraycopy");
- StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_disjoint_oop_copy(true, "arrayof_oop_disjoint_arraycopy");
+ StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(false, &entry,
+ "jbyte_disjoint_arraycopy");
+ StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(false, entry, &entry_jbyte_arraycopy,
+ "jbyte_arraycopy");
+ StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, &entry,
+ "jshort_disjoint_arraycopy");
+ StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, entry, &entry_jshort_arraycopy,
+ "jshort_arraycopy");
+ StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_copy(false, &entry,
+ "jint_disjoint_arraycopy");
+ StubRoutines::_jint_arraycopy = generate_conjoint_int_copy(false, entry, &entry_jint_arraycopy,
+ "jint_arraycopy");
+ StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_copy(false, &entry,
+ "jlong_disjoint_arraycopy");
+ StubRoutines::_jlong_arraycopy = generate_conjoint_long_copy(false, entry, &entry_jlong_arraycopy,
+ "jlong_arraycopy");
+ StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_oop_copy(false, &entry,
+ "oop_disjoint_arraycopy");
+ StubRoutines::_oop_arraycopy = generate_conjoint_oop_copy(false, entry, &entry_oop_arraycopy,
+ "oop_arraycopy");
- StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(false, "jbyte_arraycopy");
- StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, "jshort_arraycopy");
- StubRoutines::_jint_arraycopy = generate_conjoint_int_copy(false, "jint_arraycopy");
- StubRoutines::_jlong_arraycopy = generate_conjoint_long_copy(false, "jlong_arraycopy");
- StubRoutines::_oop_arraycopy = generate_conjoint_oop_copy(false, "oop_arraycopy");
- StubRoutines::_arrayof_jbyte_arraycopy = generate_conjoint_byte_copy(true, "arrayof_jbyte_arraycopy");
- StubRoutines::_arrayof_jshort_arraycopy = generate_conjoint_short_copy(true, "arrayof_jshort_arraycopy");
+
+ StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(true, &entry,
+ "arrayof_jbyte_disjoint_arraycopy");
+ StubRoutines::_arrayof_jbyte_arraycopy = generate_conjoint_byte_copy(true, entry, NULL,
+ "arrayof_jbyte_arraycopy");
+
+ StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(true, &entry,
+ "arrayof_jshort_disjoint_arraycopy");
+ StubRoutines::_arrayof_jshort_arraycopy = generate_conjoint_short_copy(true, entry, NULL,
+ "arrayof_jshort_arraycopy");
+
+ StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_int_copy(true, &entry,
+ "arrayof_jint_disjoint_arraycopy");
#ifdef _LP64
// since sizeof(jint) < sizeof(HeapWord), there's a different flavor:
- StubRoutines::_arrayof_jint_arraycopy = generate_conjoint_int_copy(true, "arrayof_jint_arraycopy");
+ StubRoutines::_arrayof_jint_arraycopy = generate_conjoint_int_copy(true, entry, NULL, "arrayof_jint_arraycopy");
#else
StubRoutines::_arrayof_jint_arraycopy = StubRoutines::_jint_arraycopy;
#endif
+
+ StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_long_copy(true, NULL,
+ "arrayof_jlong_disjoint_arraycopy");
+ StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_disjoint_oop_copy(true, NULL,
+ "arrayof_oop_disjoint_arraycopy");
+
StubRoutines::_arrayof_jlong_arraycopy = StubRoutines::_jlong_arraycopy;
StubRoutines::_arrayof_oop_arraycopy = StubRoutines::_oop_arraycopy;
- StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy");
- StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy");
- StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy");
+ StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
+ StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy",
+ entry_jbyte_arraycopy,
+ entry_jshort_arraycopy,
+ entry_jint_arraycopy,
+ entry_jlong_arraycopy);
+ StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy",
+ entry_jbyte_arraycopy,
+ entry_jshort_arraycopy,
+ entry_jint_arraycopy,
+ entry_oop_arraycopy,
+ entry_jlong_arraycopy,
+ entry_checkcast_arraycopy);
StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
@@ -3224,21 +3268,6 @@ class StubGenerator: public StubCodeGenerator {
}; // end class declaration
-
-address StubGenerator::disjoint_byte_copy_entry = NULL;
-address StubGenerator::disjoint_short_copy_entry = NULL;
-address StubGenerator::disjoint_int_copy_entry = NULL;
-address StubGenerator::disjoint_long_copy_entry = NULL;
-address StubGenerator::disjoint_oop_copy_entry = NULL;
-
-address StubGenerator::byte_copy_entry = NULL;
-address StubGenerator::short_copy_entry = NULL;
-address StubGenerator::int_copy_entry = NULL;
-address StubGenerator::long_copy_entry = NULL;
-address StubGenerator::oop_copy_entry = NULL;
-
-address StubGenerator::checkcast_copy_entry = NULL;
-
void StubGenerator_generate(CodeBuffer* code, bool all) {
StubGenerator g(code, all);
}
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
index 9a7371cf6dd..484eff7af9e 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
@@ -945,6 +945,12 @@ class StubGenerator: public StubCodeGenerator {
__ movptr(from , Address(rsp, 12+ 4));
__ movptr(to , Address(rsp, 12+ 8));
__ movl(count, Address(rsp, 12+ 12));
+
+ if (entry != NULL) {
+ *entry = __ pc(); // Entry point from conjoint arraycopy stub.
+ BLOCK_COMMENT("Entry:");
+ }
+
if (t == T_OBJECT) {
__ testl(count, count);
__ jcc(Assembler::zero, L_0_count);
@@ -952,9 +958,6 @@ class StubGenerator: public StubCodeGenerator {
__ mov(saved_to, to); // save 'to'
}
- *entry = __ pc(); // Entry point from conjoint arraycopy stub.
- BLOCK_COMMENT("Entry:");
-
__ subptr(to, from); // to --> to_from
__ cmpl(count, 2< rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
@@ -1479,7 +1467,8 @@ class StubGenerator: public StubCodeGenerator {
// dwords or qwords that span cache line boundaries will still be loaded
// and stored atomically.
//
- address generate_conjoint_byte_copy(bool aligned, const char *name) {
+ address generate_conjoint_byte_copy(bool aligned, address nooverlap_target,
+ address* entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1494,11 +1483,13 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- byte_copy_entry = __ pc();
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
- array_overlap_test(disjoint_byte_copy_entry, Address::times_1);
+ array_overlap_test(nooverlap_target, Address::times_1);
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
@@ -1574,7 +1565,7 @@ class StubGenerator: public StubCodeGenerator {
// disjoint_short_copy_entry is set to the no-overlap entry point
// used by generate_conjoint_short_copy().
//
- address generate_disjoint_short_copy(bool aligned, const char *name) {
+ address generate_disjoint_short_copy(bool aligned, address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1593,9 +1584,11 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- disjoint_short_copy_entry = __ pc();
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
@@ -1686,7 +1679,8 @@ class StubGenerator: public StubCodeGenerator {
// or qwords that span cache line boundaries will still be loaded
// and stored atomically.
//
- address generate_conjoint_short_copy(bool aligned, const char *name) {
+ address generate_conjoint_short_copy(bool aligned, address nooverlap_target,
+ address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1701,11 +1695,13 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- short_copy_entry = __ pc();
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
+ }
- array_overlap_test(disjoint_short_copy_entry, Address::times_2);
+ array_overlap_test(nooverlap_target, Address::times_2);
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
@@ -1773,7 +1769,7 @@ class StubGenerator: public StubCodeGenerator {
// disjoint_int_copy_entry is set to the no-overlap entry point
// used by generate_conjoint_int_oop_copy().
//
- address generate_disjoint_int_oop_copy(bool aligned, bool is_oop, const char *name) {
+ address generate_disjoint_int_oop_copy(bool aligned, bool is_oop, address* entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1793,21 +1789,17 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- (is_oop ? disjoint_oop_copy_entry : disjoint_int_copy_entry) = __ pc();
-
- if (is_oop) {
- // no registers are destroyed by this call
- gen_write_ref_array_pre_barrier(/* dest */ c_rarg1, /* count */ c_rarg2);
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
}
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
-
if (is_oop) {
__ movq(saved_to, to);
+ gen_write_ref_array_pre_barrier(to, count);
}
// 'from', 'to' and 'count' are now valid
@@ -1867,7 +1859,8 @@ class StubGenerator: public StubCodeGenerator {
// the hardware handle it. The two dwords within qwords that span
// cache line boundaries will still be loaded and stored atomicly.
//
- address generate_conjoint_int_oop_copy(bool aligned, bool is_oop, const char *name) {
+ address generate_conjoint_int_oop_copy(bool aligned, bool is_oop, address nooverlap_target,
+ address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1882,20 +1875,21 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- if (is_oop) {
- // no registers are destroyed by this call
- gen_write_ref_array_pre_barrier(/* dest */ c_rarg1, /* count */ c_rarg2);
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
}
- (is_oop ? oop_copy_entry : int_copy_entry) = __ pc();
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
-
- array_overlap_test(is_oop ? disjoint_oop_copy_entry : disjoint_int_copy_entry,
- Address::times_4);
+ array_overlap_test(nooverlap_target, Address::times_4);
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
+ if (is_oop) {
+ // no registers are destroyed by this call
+ gen_write_ref_array_pre_barrier(to, count);
+ }
+
assert_clean_int(count, rax); // Make sure 'count' is clean int.
// 'from', 'to' and 'count' are now valid
__ movptr(dword_count, count);
@@ -1959,7 +1953,7 @@ class StubGenerator: public StubCodeGenerator {
// disjoint_oop_copy_entry or disjoint_long_copy_entry is set to the
// no-overlap entry point used by generate_conjoint_long_oop_copy().
//
- address generate_disjoint_long_oop_copy(bool aligned, bool is_oop, const char *name) {
+ address generate_disjoint_long_oop_copy(bool aligned, bool is_oop, address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -1978,20 +1972,19 @@ class StubGenerator: public StubCodeGenerator {
// Save no-overlap entry point for generate_conjoint_long_oop_copy()
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- if (is_oop) {
- disjoint_oop_copy_entry = __ pc();
- // no registers are destroyed by this call
- gen_write_ref_array_pre_barrier(/* dest */ c_rarg1, /* count */ c_rarg2);
- } else {
- disjoint_long_copy_entry = __ pc();
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
}
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
-
// 'from', 'to' and 'qword_count' are now valid
+ if (is_oop) {
+ // no registers are destroyed by this call
+ gen_write_ref_array_pre_barrier(to, qword_count);
+ }
// Copy from low to high addresses. Use 'to' as scratch.
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
@@ -2045,7 +2038,8 @@ class StubGenerator: public StubCodeGenerator {
// c_rarg1 - destination array address
// c_rarg2 - element count, treated as ssize_t, can be zero
//
- address generate_conjoint_long_oop_copy(bool aligned, bool is_oop, const char *name) {
+ address generate_conjoint_long_oop_copy(bool aligned, bool is_oop, address nooverlap_target,
+ address *entry, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
@@ -2059,26 +2053,16 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
assert_clean_int(c_rarg2, rax); // Make sure 'count' is clean int.
- address disjoint_copy_entry = NULL;
- if (is_oop) {
- assert(!UseCompressedOops, "shouldn't be called for compressed oops");
- disjoint_copy_entry = disjoint_oop_copy_entry;
- oop_copy_entry = __ pc();
- array_overlap_test(disjoint_oop_copy_entry, Address::times_8);
- } else {
- disjoint_copy_entry = disjoint_long_copy_entry;
- long_copy_entry = __ pc();
- array_overlap_test(disjoint_long_copy_entry, Address::times_8);
+ if (entry != NULL) {
+ *entry = __ pc();
+ // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
+ BLOCK_COMMENT("Entry:");
}
- BLOCK_COMMENT("Entry:");
- // caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
- array_overlap_test(disjoint_copy_entry, Address::times_8);
+ array_overlap_test(nooverlap_target, Address::times_8);
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
-
// 'from', 'to' and 'qword_count' are now valid
-
if (is_oop) {
// Save to and count for store barrier
__ movptr(saved_count, qword_count);
@@ -2162,7 +2146,7 @@ class StubGenerator: public StubCodeGenerator {
// rax == 0 - success
// rax == -1^K - failure, where K is partial transfer count
//
- address generate_checkcast_copy(const char *name) {
+ address generate_checkcast_copy(const char *name, address *entry) {
Label L_load_element, L_store_element, L_do_card_marks, L_done;
@@ -2216,8 +2200,10 @@ class StubGenerator: public StubCodeGenerator {
#endif
// Caller of this entry point must set up the argument registers.
- checkcast_copy_entry = __ pc();
- BLOCK_COMMENT("Entry:");
+ if (entry != NULL) {
+ *entry = __ pc();
+ BLOCK_COMMENT("Entry:");
+ }
// allocate spill slots for r13, r14
enum {
@@ -2334,7 +2320,9 @@ class StubGenerator: public StubCodeGenerator {
// Examines the alignment of the operands and dispatches
// to a long, int, short, or byte copy loop.
//
- address generate_unsafe_copy(const char *name) {
+ address generate_unsafe_copy(const char *name,
+ address byte_copy_entry, address short_copy_entry,
+ address int_copy_entry, address long_copy_entry) {
Label L_long_aligned, L_int_aligned, L_short_aligned;
@@ -2432,7 +2420,10 @@ class StubGenerator: public StubCodeGenerator {
// rax == 0 - success
// rax == -1^K - failure, where K is partial transfer count
//
- address generate_generic_copy(const char *name) {
+ address generate_generic_copy(const char *name,
+ address byte_copy_entry, address short_copy_entry,
+ address int_copy_entry, address long_copy_entry,
+ address oop_copy_entry, address checkcast_copy_entry) {
Label L_failed, L_failed_0, L_objArray;
Label L_copy_bytes, L_copy_shorts, L_copy_ints, L_copy_longs;
@@ -2725,33 +2716,60 @@ class StubGenerator: public StubCodeGenerator {
}
void generate_arraycopy_stubs() {
- // Call the conjoint generation methods immediately after
- // the disjoint ones so that short branches from the former
- // to the latter can be generated.
- StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(false, "jbyte_disjoint_arraycopy");
- StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(false, "jbyte_arraycopy");
+ address entry;
+ address entry_jbyte_arraycopy;
+ address entry_jshort_arraycopy;
+ address entry_jint_arraycopy;
+ address entry_oop_arraycopy;
+ address entry_jlong_arraycopy;
+ address entry_checkcast_arraycopy;
- StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, "jshort_disjoint_arraycopy");
- StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, "jshort_arraycopy");
+ StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(false, &entry,
+ "jbyte_disjoint_arraycopy");
+ StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(false, entry, &entry_jbyte_arraycopy,
+ "jbyte_arraycopy");
- StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, false, "jint_disjoint_arraycopy");
- StubRoutines::_jint_arraycopy = generate_conjoint_int_oop_copy(false, false, "jint_arraycopy");
+ StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, &entry,
+ "jshort_disjoint_arraycopy");
+ StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, entry, &entry_jshort_arraycopy,
+ "jshort_arraycopy");
- StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, false, "jlong_disjoint_arraycopy");
- StubRoutines::_jlong_arraycopy = generate_conjoint_long_oop_copy(false, false, "jlong_arraycopy");
+ StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, false, &entry,
+ "jint_disjoint_arraycopy");
+ StubRoutines::_jint_arraycopy = generate_conjoint_int_oop_copy(false, false, entry,
+ &entry_jint_arraycopy, "jint_arraycopy");
+
+ StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, false, &entry,
+ "jlong_disjoint_arraycopy");
+ StubRoutines::_jlong_arraycopy = generate_conjoint_long_oop_copy(false, false, entry,
+ &entry_jlong_arraycopy, "jlong_arraycopy");
if (UseCompressedOops) {
- StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, true, "oop_disjoint_arraycopy");
- StubRoutines::_oop_arraycopy = generate_conjoint_int_oop_copy(false, true, "oop_arraycopy");
+ StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, true, &entry,
+ "oop_disjoint_arraycopy");
+ StubRoutines::_oop_arraycopy = generate_conjoint_int_oop_copy(false, true, entry,
+ &entry_oop_arraycopy, "oop_arraycopy");
} else {
- StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, true, "oop_disjoint_arraycopy");
- StubRoutines::_oop_arraycopy = generate_conjoint_long_oop_copy(false, true, "oop_arraycopy");
+ StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, true, &entry,
+ "oop_disjoint_arraycopy");
+ StubRoutines::_oop_arraycopy = generate_conjoint_long_oop_copy(false, true, entry,
+ &entry_oop_arraycopy, "oop_arraycopy");
}
- StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy");
- StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy");
- StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy");
+ StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
+ StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy",
+ entry_jbyte_arraycopy,
+ entry_jshort_arraycopy,
+ entry_jint_arraycopy,
+ entry_jlong_arraycopy);
+ StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy",
+ entry_jbyte_arraycopy,
+ entry_jshort_arraycopy,
+ entry_jint_arraycopy,
+ entry_oop_arraycopy,
+ entry_jlong_arraycopy,
+ entry_checkcast_arraycopy);
StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
@@ -3069,20 +3087,6 @@ class StubGenerator: public StubCodeGenerator {
}
}; // end class declaration
-address StubGenerator::disjoint_byte_copy_entry = NULL;
-address StubGenerator::disjoint_short_copy_entry = NULL;
-address StubGenerator::disjoint_int_copy_entry = NULL;
-address StubGenerator::disjoint_long_copy_entry = NULL;
-address StubGenerator::disjoint_oop_copy_entry = NULL;
-
-address StubGenerator::byte_copy_entry = NULL;
-address StubGenerator::short_copy_entry = NULL;
-address StubGenerator::int_copy_entry = NULL;
-address StubGenerator::long_copy_entry = NULL;
-address StubGenerator::oop_copy_entry = NULL;
-
-address StubGenerator::checkcast_copy_entry = NULL;
-
void StubGenerator_generate(CodeBuffer* code, bool all) {
StubGenerator g(code, all);
}
From dd0e38d73ab8832a7c0e72d269327739d158901d Mon Sep 17 00:00:00 2001
From: Stuart Marks
Date: Tue, 22 Feb 2011 15:34:17 -0800
Subject: [PATCH 09/91] 7021209: convert lang, math, util to use
try-with-resources
Reviewed-by: alanb, darcy, naoto
---
jdk/src/share/classes/java/lang/Package.java | 10 +--
jdk/src/share/classes/java/util/Currency.java | 4 +-
.../util/calendar/LocalGregorianCalendar.java | 4 +-
.../util/prefs/FileSystemPreferences.java | 12 +--
jdk/test/java/lang/Character/CheckScript.java | 47 +++++-----
.../lang/Runtime/shutdown/ShutdownHooks.java | 10 +--
.../lang/instrument/BootClassPath/Setup.java | 34 ++++----
.../java/lang/instrument/ilib/Inject.java | 29 ++++---
.../java/math/BigInteger/BigIntegerTest.java | 49 +++--------
.../java/util/Currency/ValidateISO4217.java | 87 ++++++++++---------
.../util/Formatter/FailingConstructors.java | 5 +-
.../java/util/Locale/LocaleEnhanceTest.java | 10 +--
.../java/util/ResourceBundle/Bug6204853.java | 19 ++--
.../util/Scanner/FailingConstructors.java | 5 +-
14 files changed, 150 insertions(+), 175 deletions(-)
diff --git a/jdk/src/share/classes/java/lang/Package.java b/jdk/src/share/classes/java/lang/Package.java
index 99db6944c92..75bb658af44 100644
--- a/jdk/src/share/classes/java/lang/Package.java
+++ b/jdk/src/share/classes/java/lang/Package.java
@@ -576,12 +576,10 @@ public class Package implements java.lang.reflect.AnnotatedElement {
* Returns the Manifest for the specified JAR file name.
*/
private static Manifest loadManifest(String fn) {
- try {
- FileInputStream fis = new FileInputStream(fn);
- JarInputStream jis = new JarInputStream(fis, false);
- Manifest man = jis.getManifest();
- jis.close();
- return man;
+ try (FileInputStream fis = new FileInputStream(fn);
+ JarInputStream jis = new JarInputStream(fis, false))
+ {
+ return jis.getManifest();
} catch (IOException e) {
return null;
}
diff --git a/jdk/src/share/classes/java/util/Currency.java b/jdk/src/share/classes/java/util/Currency.java
index b3058053afa..e9ce7005df6 100644
--- a/jdk/src/share/classes/java/util/Currency.java
+++ b/jdk/src/share/classes/java/util/Currency.java
@@ -233,7 +233,9 @@ public final class Currency implements Serializable {
"currency.properties");
if (propFile.exists()) {
Properties props = new Properties();
- props.load(new FileReader(propFile));
+ try (FileReader fr = new FileReader(propFile)) {
+ props.load(fr);
+ }
Set keys = props.stringPropertyNames();
Pattern propertiesPattern =
Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*([0-3])");
diff --git a/jdk/src/share/classes/sun/util/calendar/LocalGregorianCalendar.java b/jdk/src/share/classes/sun/util/calendar/LocalGregorianCalendar.java
index 6710dbae3bc..de5f749608c 100644
--- a/jdk/src/share/classes/sun/util/calendar/LocalGregorianCalendar.java
+++ b/jdk/src/share/classes/sun/util/calendar/LocalGregorianCalendar.java
@@ -127,7 +127,9 @@ public class LocalGregorianCalendar extends BaseCalendar {
calendarProps = (Properties) AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws IOException {
Properties props = new Properties();
- props.load(new FileInputStream(fname));
+ try (FileInputStream fis = new FileInputStream(fname)) {
+ props.load(fis);
+ }
return props;
}
});
diff --git a/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java b/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
index 32e4b032929..53a19b5f5bd 100644
--- a/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
+++ b/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
@@ -571,9 +571,9 @@ class FileSystemPreferences extends AbstractPreferences {
long newLastSyncTime = 0;
try {
newLastSyncTime = prefsFile.lastModified();
- FileInputStream fis = new FileInputStream(prefsFile);
- XmlSupport.importMap(fis, m);
- fis.close();
+ try (FileInputStream fis = new FileInputStream(prefsFile)) {
+ XmlSupport.importMap(fis, m);
+ }
} catch(Exception e) {
if (e instanceof InvalidPreferencesFormatException) {
getLogger().warning("Invalid preferences format in "
@@ -618,9 +618,9 @@ class FileSystemPreferences extends AbstractPreferences {
if (!dir.exists() && !dir.mkdirs())
throw new BackingStoreException(dir +
" create failed.");
- FileOutputStream fos = new FileOutputStream(tmpFile);
- XmlSupport.exportMap(fos, prefsCache);
- fos.close();
+ try (FileOutputStream fos = new FileOutputStream(tmpFile)) {
+ XmlSupport.exportMap(fos, prefsCache);
+ }
if (!tmpFile.renameTo(prefsFile))
throw new BackingStoreException("Can't rename " +
tmpFile + " to " + prefsFile);
diff --git a/jdk/test/java/lang/Character/CheckScript.java b/jdk/test/java/lang/Character/CheckScript.java
index a286643c8cf..6d0f650d169 100644
--- a/jdk/test/java/lang/Character/CheckScript.java
+++ b/jdk/test/java/lang/Character/CheckScript.java
@@ -12,40 +12,43 @@ import java.lang.Character.UnicodeScript;
public class CheckScript {
- public static void main(String[] args) throws Exception {
-
- BufferedReader sbfr = null;
+ static BufferedReader open(String[] args) throws FileNotFoundException {
if (args.length == 0) {
- sbfr = new BufferedReader(new FileReader(new File(System.getProperty("test.src", "."), "Scripts.txt")));
+ return new BufferedReader(new FileReader(new File(System.getProperty("test.src", "."), "Scripts.txt")));
} else if (args.length == 1) {
- sbfr = new BufferedReader(new FileReader(args[0]));
+ return new BufferedReader(new FileReader(args[0]));
} else {
System.out.println("java CharacterScript Scripts.txt");
throw new RuntimeException("Datafile name should be specified.");
}
+ }
+
+ public static void main(String[] args) throws Exception {
+
Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s+;\\s+(\\w+)\\s+#.*").matcher("");
String line = null;
HashMap> scripts = new HashMap<>();
- while ((line = sbfr.readLine()) != null) {
- if (line.length() <= 1 || line.charAt(0) == '#') {
- continue;
- }
- m.reset(line);
- if (m.matches()) {
- int start = Integer.parseInt(m.group(1), 16);
- int end = (m.group(2)==null)?start
- :Integer.parseInt(m.group(2), 16);
- String name = m.group(3).toLowerCase(Locale.ENGLISH);
- ArrayList ranges = scripts.get(name);
- if (ranges == null) {
- ranges = new ArrayList();
- scripts.put(name, ranges);
+ try (BufferedReader sbfr = open(args)) {
+ while ((line = sbfr.readLine()) != null) {
+ if (line.length() <= 1 || line.charAt(0) == '#') {
+ continue;
+ }
+ m.reset(line);
+ if (m.matches()) {
+ int start = Integer.parseInt(m.group(1), 16);
+ int end = (m.group(2)==null)?start
+ :Integer.parseInt(m.group(2), 16);
+ String name = m.group(3).toLowerCase(Locale.ENGLISH);
+ ArrayList ranges = scripts.get(name);
+ if (ranges == null) {
+ ranges = new ArrayList();
+ scripts.put(name, ranges);
+ }
+ ranges.add(start);
+ ranges.add(end);
}
- ranges.add(start);
- ranges.add(end);
}
}
- sbfr.close();
// check all defined ranges
Integer[] ZEROSIZEARRAY = new Integer[0];
for (String name : scripts.keySet()) {
diff --git a/jdk/test/java/lang/Runtime/shutdown/ShutdownHooks.java b/jdk/test/java/lang/Runtime/shutdown/ShutdownHooks.java
index a198d98b872..bfe2b60e3ee 100644
--- a/jdk/test/java/lang/Runtime/shutdown/ShutdownHooks.java
+++ b/jdk/test/java/lang/Runtime/shutdown/ShutdownHooks.java
@@ -43,9 +43,9 @@ public class ShutdownHooks {
file = new File(dir, args[1]);
// write to file
System.out.println("writing to "+ file);
- PrintWriter pw = new PrintWriter(file);
- pw.println("Shutdown begins");
- pw.close();
+ try (PrintWriter pw = new PrintWriter(file)) {
+ pw.println("Shutdown begins");
+ }
}
public static class Cleaner extends Thread {
@@ -56,10 +56,8 @@ public class ShutdownHooks {
// register the DeleteOnExitHook while the application
// shutdown hook is running
file.deleteOnExit();
- try {
- PrintWriter pw = new PrintWriter(file);
+ try (PrintWriter pw = new PrintWriter(file)) {
pw.println("file is being deleted");
- pw.close();
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
diff --git a/jdk/test/java/lang/instrument/BootClassPath/Setup.java b/jdk/test/java/lang/instrument/BootClassPath/Setup.java
index 90beff135ea..3ef40f13217 100644
--- a/jdk/test/java/lang/instrument/BootClassPath/Setup.java
+++ b/jdk/test/java/lang/instrument/BootClassPath/Setup.java
@@ -62,31 +62,33 @@ public class Setup {
* Create manifest file with Boot-Class-Path encoding the
* sub-directory name.
*/
- FileOutputStream out = new FileOutputStream(manifestFile);
- out.write("Manifest-Version: 1.0\n".getBytes("UTF-8"));
+ try (FileOutputStream out = new FileOutputStream(manifestFile)) {
+ out.write("Manifest-Version: 1.0\n".getBytes("UTF-8"));
- byte[] premainBytes = ("Premain-Class: " + premainClass + "\n").getBytes("UTF-8");
- out.write(premainBytes);
+ byte[] premainBytes =
+ ("Premain-Class: " + premainClass + "\n").getBytes("UTF-8");
+ out.write(premainBytes);
- out.write( "Boot-Class-Path: ".getBytes("UTF-8") );
+ out.write( "Boot-Class-Path: ".getBytes("UTF-8") );
- byte[] value = bootClassPath.getBytes("UTF-8");
- for (int i=0; i it = infoList.iterator(); it.hasNext(); ) {
- Info info = it.next();
- if (!info.className.equals(currentClassName)) {
- dataOut.writeInt(123456); // class name marker
- currentClassName = info.className;
- dataOut.writeUTF(currentClassName);
+ dataOut.writeInt(infoList.size());
+ for (Iterator it = infoList.iterator(); it.hasNext(); ) {
+ Info info = it.next();
+ if (!info.className.equals(currentClassName)) {
+ dataOut.writeInt(123456); // class name marker
+ currentClassName = info.className;
+ dataOut.writeUTF(currentClassName);
+ }
+ dataOut.writeInt(info.location);
+ dataOut.writeUTF(info.methodName);
}
- dataOut.writeInt(info.location);
- dataOut.writeUTF(info.methodName);
}
- dataOut.close();
}
public byte[] bytecodes(String className, String methodName, int location) {
diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java
index ba35c7bbdbe..c23563f2208 100644
--- a/jdk/test/java/math/BigInteger/BigIntegerTest.java
+++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java
@@ -645,26 +645,17 @@ public class BigIntegerTest {
BigInteger b2 = null;
File f = new File("serialtest");
- FileOutputStream fos = new FileOutputStream(f);
- try {
- ObjectOutputStream oos = new ObjectOutputStream(fos);
- try {
+
+ try (FileOutputStream fos = new FileOutputStream(f)) {
+ try (ObjectOutputStream oos = new ObjectOutputStream(fos)) {
oos.writeObject(b1);
oos.flush();
- } finally {
- oos.close();
}
- FileInputStream fis = new FileInputStream(f);
- try {
- ObjectInputStream ois = new ObjectInputStream(fis);
- try {
- b2 = (BigInteger)ois.readObject();
- } finally {
- ois.close();
- }
- } finally {
- fis.close();
+ try (FileInputStream fis = new FileInputStream(f);
+ ObjectInputStream ois = new ObjectInputStream(fis))
+ {
+ b2 = (BigInteger)ois.readObject();
}
if (!b1.equals(b2) ||
@@ -673,8 +664,6 @@ public class BigIntegerTest {
System.err.println("Serialized failed for hex " +
b1.toString(16));
}
- } finally {
- fos.close();
}
f.delete();
}
@@ -683,29 +672,17 @@ public class BigIntegerTest {
BigInteger b1 = fetchNumber(rnd.nextInt(100));
BigInteger b2 = null;
File f = new File("serialtest");
- FileOutputStream fos = new FileOutputStream(f);
- try {
- ObjectOutputStream oos = new ObjectOutputStream(fos);
- try {
+ try (FileOutputStream fos = new FileOutputStream(f)) {
+ try (ObjectOutputStream oos = new ObjectOutputStream(fos)) {
oos.writeObject(b1);
oos.flush();
- } finally {
- oos.close();
}
- FileInputStream fis = new FileInputStream(f);
- try {
- ObjectInputStream ois = new ObjectInputStream(fis);
- try {
- b2 = (BigInteger)ois.readObject();
- } finally {
- ois.close();
- }
- } finally {
- fis.close();
+ try (FileInputStream fis = new FileInputStream(f);
+ ObjectInputStream ois = new ObjectInputStream(fis))
+ {
+ b2 = (BigInteger)ois.readObject();
}
- } finally {
- fos.close();
}
if (!b1.equals(b2) ||
diff --git a/jdk/test/java/util/Currency/ValidateISO4217.java b/jdk/test/java/util/Currency/ValidateISO4217.java
index c92b06226fe..486741fdd2c 100644
--- a/jdk/test/java/util/Currency/ValidateISO4217.java
+++ b/jdk/test/java/util/Currency/ValidateISO4217.java
@@ -111,57 +111,58 @@ public class ValidateISO4217 {
static void test1() throws Exception {
- FileReader fr = new FileReader(new File(System.getProperty("test.src", "."), datafile));
- BufferedReader in = new BufferedReader(fr);
- String line;
- SimpleDateFormat format = null;
+ try (FileReader fr = new FileReader(new File(System.getProperty("test.src", "."), datafile));
+ BufferedReader in = new BufferedReader(fr))
+ {
+ String line;
+ SimpleDateFormat format = null;
- while ((line = in.readLine()) != null) {
- if (line.length() == 0 || line.charAt(0) == '#') {
- continue;
- }
+ while ((line = in.readLine()) != null) {
+ if (line.length() == 0 || line.charAt(0) == '#') {
+ continue;
+ }
- StringTokenizer tokens = new StringTokenizer(line, "\t");
- String country = tokens.nextToken();
- if (country.length() != 2) {
- continue;
- }
+ StringTokenizer tokens = new StringTokenizer(line, "\t");
+ String country = tokens.nextToken();
+ if (country.length() != 2) {
+ continue;
+ }
- String currency;
- String numeric;
- String minorUnit;
- int tokensCount = tokens.countTokens();
- if (tokensCount < 3) {
- currency = "";
- numeric = "0";
- minorUnit = "0";
- } else {
- currency = tokens.nextToken();
- numeric = tokens.nextToken();
- minorUnit = tokens.nextToken();
- testCurrencies.add(Currency.getInstance(currency));
+ String currency;
+ String numeric;
+ String minorUnit;
+ int tokensCount = tokens.countTokens();
+ if (tokensCount < 3) {
+ currency = "";
+ numeric = "0";
+ minorUnit = "0";
+ } else {
+ currency = tokens.nextToken();
+ numeric = tokens.nextToken();
+ minorUnit = tokens.nextToken();
+ testCurrencies.add(Currency.getInstance(currency));
- // check for the cutover
- if (tokensCount > 3) {
- if (format == null) {
- format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US);
- format.setTimeZone(TimeZone.getTimeZone("GMT"));
- format.setLenient(false);
- }
- if (format.parse(tokens.nextToken()).getTime() <
- System.currentTimeMillis()) {
- currency = tokens.nextToken();
- numeric = tokens.nextToken();
- minorUnit = tokens.nextToken();
- testCurrencies.add(Currency.getInstance(currency));
+ // check for the cutover
+ if (tokensCount > 3) {
+ if (format == null) {
+ format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US);
+ format.setTimeZone(TimeZone.getTimeZone("GMT"));
+ format.setLenient(false);
+ }
+ if (format.parse(tokens.nextToken()).getTime() <
+ System.currentTimeMillis()) {
+ currency = tokens.nextToken();
+ numeric = tokens.nextToken();
+ minorUnit = tokens.nextToken();
+ testCurrencies.add(Currency.getInstance(currency));
+ }
}
}
+ int index = toIndex(country);
+ testCountryCurrency(country, currency, Integer.parseInt(numeric),
+ Integer.parseInt(minorUnit), index);
}
- int index = toIndex(country);
- testCountryCurrency(country, currency, Integer.parseInt(numeric),
- Integer.parseInt(minorUnit), index);
}
- in.close();
for (int i = 0; i < additionalCodes.length; i++) {
int index = toIndex(additionalCodes[i][0]);
diff --git a/jdk/test/java/util/Formatter/FailingConstructors.java b/jdk/test/java/util/Formatter/FailingConstructors.java
index 8ef99f146a4..29e34bc179e 100644
--- a/jdk/test/java/util/Formatter/FailingConstructors.java
+++ b/jdk/test/java/util/Formatter/FailingConstructors.java
@@ -34,6 +34,7 @@ import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.nio.file.Files;
import java.util.Formatter;
public class FailingConstructors {
@@ -47,9 +48,7 @@ public class FailingConstructors {
/* create the file and write its contents */
File file = File.createTempFile(fileName, null);
file.deleteOnExit();
- FileOutputStream fos = new FileOutputStream(file);
- fos.write(FILE_CONTENTS.getBytes());
- fos.close();
+ Files.write(file.toPath(), FILE_CONTENTS.getBytes());
test(true, file);
file.delete();
diff --git a/jdk/test/java/util/Locale/LocaleEnhanceTest.java b/jdk/test/java/util/Locale/LocaleEnhanceTest.java
index f7ed5ab3dfb..1a5e9b5e418 100644
--- a/jdk/test/java/util/Locale/LocaleEnhanceTest.java
+++ b/jdk/test/java/util/Locale/LocaleEnhanceTest.java
@@ -1187,14 +1187,12 @@ public class LocaleEnhanceTest extends LocaleTestFmwk {
locale = new Locale(lang, country, variant);
}
- // desrialize
- try {
- FileInputStream fis = new FileInputStream(testfile);
- ObjectInputStream ois = new ObjectInputStream(fis);
-
+ // deserialize
+ try (FileInputStream fis = new FileInputStream(testfile);
+ ObjectInputStream ois = new ObjectInputStream(fis))
+ {
Object o = ois.readObject();
assertEquals("Deserialize Java 6 Locale " + locale, o, locale);
- ois.close();
} catch (Exception e) {
errln("Exception while reading " + testfile.getAbsolutePath() + " - " + e.getMessage());
}
diff --git a/jdk/test/java/util/ResourceBundle/Bug6204853.java b/jdk/test/java/util/ResourceBundle/Bug6204853.java
index ca13fa65015..4ba5386c8e5 100644
--- a/jdk/test/java/util/ResourceBundle/Bug6204853.java
+++ b/jdk/test/java/util/ResourceBundle/Bug6204853.java
@@ -39,24 +39,19 @@ import java.util.PropertyResourceBundle;
public final class Bug6204853 {
public Bug6204853() {
- try {
- String srcDir = System.getProperty("test.src", ".");
- FileInputStream fis8859_1 =
- new FileInputStream(new File(srcDir, "Bug6204853.properties"));
- FileInputStream fisUtf8 =
- new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
- InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8");
-
+ String srcDir = System.getProperty("test.src", ".");
+ try (FileInputStream fis8859_1 =
+ new FileInputStream(new File(srcDir, "Bug6204853.properties"));
+ FileInputStream fisUtf8 =
+ new FileInputStream(new File(srcDir, "Bug6204853_Utf8.properties"));
+ InputStreamReader isrUtf8 = new InputStreamReader(fisUtf8, "UTF-8"))
+ {
PropertyResourceBundle bundleUtf8 = new PropertyResourceBundle(isrUtf8);
PropertyResourceBundle bundle = new PropertyResourceBundle(fis8859_1);
String[] arrayUtf8 = createKeyValueArray(bundleUtf8);
String[] array = createKeyValueArray(bundle);
- isrUtf8.close();
- fisUtf8.close();
- fis8859_1.close();
-
if (!Arrays.equals(arrayUtf8, array)) {
throw new RuntimeException("PropertyResourceBundle constructed from a UTF-8 encoded property file is not equal to the one constructed from ISO-8859-1 encoded property file.");
}
diff --git a/jdk/test/java/util/Scanner/FailingConstructors.java b/jdk/test/java/util/Scanner/FailingConstructors.java
index 476c000ae1a..d74f5c79cc4 100644
--- a/jdk/test/java/util/Scanner/FailingConstructors.java
+++ b/jdk/test/java/util/Scanner/FailingConstructors.java
@@ -33,6 +33,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.nio.file.Files;
import java.util.Scanner;
public class FailingConstructors {
@@ -46,9 +47,7 @@ public class FailingConstructors {
/* create the file and write its contents */
File file = File.createTempFile(fileName, null);
file.deleteOnExit();
- FileOutputStream fos = new FileOutputStream(file);
- fos.write(FILE_CONTENTS.getBytes());
- fos.close();
+ Files.write(file.toPath(), FILE_CONTENTS.getBytes());
test(true, file);
file.delete();
From 66ca7600c46c11809b4324c4163a0ed8e92b1651 Mon Sep 17 00:00:00 2001
From: Masayoshi Okutsu
Date: Wed, 23 Feb 2011 14:09:23 +0900
Subject: [PATCH 10/91] 6623219: Font.canDisplayUpTo does not work with
supplementary characters
Reviewed-by: prr, peytoia
---
jdk/src/share/classes/java/awt/Font.java | 61 ++++++++--
.../SupplementaryCanDisplayUpToTest.java | 105 ++++++++++++++++++
2 files changed, 154 insertions(+), 12 deletions(-)
create mode 100644 jdk/test/java/awt/FontClass/SurrogateTest/SupplementaryCanDisplayUpToTest.java
diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java
index 051ec7fa578..73585e46f9f 100644
--- a/jdk/src/share/classes/java/awt/Font.java
+++ b/jdk/src/share/classes/java/awt/Font.java
@@ -1985,8 +1985,22 @@ public class Font implements java.io.Serializable
* @since 1.2
*/
public int canDisplayUpTo(String str) {
- return canDisplayUpTo(new StringCharacterIterator(str), 0,
- str.length());
+ Font2D font2d = getFont2D();
+ int len = str.length();
+ for (int i = 0; i < len; i++) {
+ char c = str.charAt(i);
+ if (font2d.canDisplay(c)) {
+ continue;
+ }
+ if (!Character.isHighSurrogate(c)) {
+ return i;
+ }
+ if (!font2d.canDisplay(str.codePointAt(i))) {
+ return i;
+ }
+ i++;
+ }
+ return -1;
}
/**
@@ -2009,11 +2023,21 @@ public class Font implements java.io.Serializable
* @since 1.2
*/
public int canDisplayUpTo(char[] text, int start, int limit) {
- while (start < limit && canDisplay(text[start])) {
- ++start;
+ Font2D font2d = getFont2D();
+ for (int i = start; i < limit; i++) {
+ char c = text[i];
+ if (font2d.canDisplay(c)) {
+ continue;
+ }
+ if (!Character.isHighSurrogate(c)) {
+ return i;
+ }
+ if (!font2d.canDisplay(Character.codePointAt(text, i, limit))) {
+ return i;
+ }
+ i++;
}
-
- return start == limit ? -1 : start;
+ return -1;
}
/**
@@ -2034,13 +2058,26 @@ public class Font implements java.io.Serializable
* @since 1.2
*/
public int canDisplayUpTo(CharacterIterator iter, int start, int limit) {
- for (char c = iter.setIndex(start);
- iter.getIndex() < limit && canDisplay(c);
- c = iter.next()) {
+ Font2D font2d = getFont2D();
+ char c = iter.setIndex(start);
+ for (int i = start; i < limit; i++, c = iter.next()) {
+ if (font2d.canDisplay(c)) {
+ continue;
+ }
+ if (!Character.isHighSurrogate(c)) {
+ return i;
+ }
+ char c2 = iter.next();
+ // c2 could be CharacterIterator.DONE which is not a low surrogate.
+ if (!Character.isLowSurrogate(c2)) {
+ return i;
+ }
+ if (!font2d.canDisplay(Character.toCodePoint(c, c2))) {
+ return i;
+ }
+ i++;
}
-
- int result = iter.getIndex();
- return result == limit ? -1 : result;
+ return -1;
}
/**
diff --git a/jdk/test/java/awt/FontClass/SurrogateTest/SupplementaryCanDisplayUpToTest.java b/jdk/test/java/awt/FontClass/SurrogateTest/SupplementaryCanDisplayUpToTest.java
new file mode 100644
index 00000000000..1fd09e4b068
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/SurrogateTest/SupplementaryCanDisplayUpToTest.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6623219
+ * @summary Test canDisplayUpTo with supplementary characters.
+ */
+
+import java.awt.*;
+import java.text.*;
+
+public class SupplementaryCanDisplayUpToTest {
+ // Lists consisting of a font name, test text, and its expected
+ // return value. Test text uses private area code point U+F0000
+ // (\udb80\udc00).
+ private static String[][] DATA = {
+ // Windows
+ { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80\udc00", "4" },
+ { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80Z", "4" },
+ { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80", "4" },
+ { "Meiryo", "\ud87e\udd45\ud87e\udd47\udc00", "4" },
+ { "Meiryo", "\ud87e\udd45\ud87e\udd47", "-1" },
+
+ // Linux
+ { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80\udc00", "4" },
+ { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80Z", "4" },
+ { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80", "4" },
+ { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udc00", "4" },
+ { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b", "-1" },
+
+ // Solaris
+ { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80\udc00", "4" },
+ { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80Z", "4" },
+ { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80", "4" },
+ { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udc00", "4" },
+ { "FZMingTi", "\ud87e\udc25\ud87e\udc3b", "-1" },
+ };
+ private static int errorcount = 0;
+
+ public static void main(String[] args) {
+ for (String[] data : DATA) {
+ String fontname = data[0];
+ Font font = new Font(fontname, Font.PLAIN, 16);
+ if (font.getFamily().equals(Font.DIALOG)) {
+ // Skip any unavailable fonts.
+ continue;
+ }
+
+ System.out.printf("Testing with font '%s'... ", fontname);
+ int errors = 0;
+ String text = data[1];
+ int expected = Integer.parseInt(data[2]);
+
+ int result = font.canDisplayUpTo(text);
+ if (result != expected) {
+ System.err.println("canDisplayUpTo(String) returns " + result);
+ errors++;
+ }
+
+ result = font.canDisplayUpTo(text.toCharArray(), 0, text.length());
+ if (result != expected) {
+ System.err.println("canDisplayUpTo(char[], int, int) returns " + result);
+ errors++;
+ }
+
+ CharacterIterator iter = new StringCharacterIterator(text);
+ result = font.canDisplayUpTo(iter, iter.getBeginIndex(), iter.getEndIndex());
+ if (result != expected) {
+ System.err.println("canDisplayUpTo(CharacterIterator, int, int) returns " + result);
+ errors++;
+ }
+
+ if (errors == 0) {
+ System.out.println("passed");
+ } else {
+ System.out.println("failed");
+ errorcount += errors;
+ }
+ }
+ if (errorcount > 0) {
+ throw new RuntimeException("SupplementaryCanDisplayUpToTest: failed");
+ }
+ }
+}
From 7e8c6fd47b9675e68d784549794b3bf1340f9de5 Mon Sep 17 00:00:00 2001
From: Masayoshi Okutsu
Date: Wed, 23 Feb 2011 16:50:13 +0900
Subject: [PATCH 11/91] 6955047: (tz) javadoc for
TimeZone.getDisplayName(boolean daylight, int style, Locale locale) is not
clear 7021680: (tz) daylight savings time should be daylight saving time
Reviewed-by: peytoia
---
jdk/src/share/classes/java/util/Calendar.java | 4 +--
.../classes/java/util/GregorianCalendar.java | 4 +--
jdk/src/share/classes/java/util/TimeZone.java | 28 +++++++++++--------
3 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/jdk/src/share/classes/java/util/Calendar.java b/jdk/src/share/classes/java/util/Calendar.java
index 70460eaec07..897a891cbe8 100644
--- a/jdk/src/share/classes/java/util/Calendar.java
+++ b/jdk/src/share/classes/java/util/Calendar.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -554,7 +554,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparableget and set indicating the
- * daylight savings offset in milliseconds.
+ * daylight saving offset in milliseconds.
*
* This field reflects the correct daylight saving offset value of
* the time zone of this Calendar if the
diff --git a/jdk/src/share/classes/java/util/GregorianCalendar.java b/jdk/src/share/classes/java/util/GregorianCalendar.java
index 75402f0ff65..3a6d203256a 100644
--- a/jdk/src/share/classes/java/util/GregorianCalendar.java
+++ b/jdk/src/share/classes/java/util/GregorianCalendar.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -260,7 +260,7 @@ import sun.util.calendar.ZoneInfo;
* // create a Pacific Standard Time time zone
* SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
*
- * // set up rules for daylight savings time
+ * // set up rules for Daylight Saving Time
* pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
* pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
*
diff --git a/jdk/src/share/classes/java/util/TimeZone.java b/jdk/src/share/classes/java/util/TimeZone.java
index 9799be601fe..266f627d7e2 100644
--- a/jdk/src/share/classes/java/util/TimeZone.java
+++ b/jdk/src/share/classes/java/util/TimeZone.java
@@ -339,8 +339,9 @@ abstract public class TimeZone implements Serializable, Cloneable {
/**
* Returns a name in the specified {@code style} of this {@code TimeZone}
* suitable for presentation to the user in the default locale. If the
- * specified {@code daylight} is {@code true}, a daylight saving time name
- * is returned. Otherwise, a standard time name is returned.
+ * specified {@code daylight} is {@code true}, a Daylight Saving Time name
+ * is returned (even if this {@code TimeZone} doesn't observe Daylight Saving
+ * Time). Otherwise, a Standard Time name is returned.
*
*
This method is equivalent to:
*
@@ -348,7 +349,8 @@ abstract public class TimeZone implements Serializable, Cloneable {
* Locale.getDefault({@link Locale.Category#DISPLAY}))
*
*
- * @param daylight if {@code true}, return the daylight saving time name.
+ * @param daylight {@code true} specifying a Daylight Saving Time name, or
+ * {@code false} specifying a Standard Time name
* @param style either {@link #LONG} or {@link #SHORT}
* @return the human-readable name of this time zone in the default locale.
* @exception IllegalArgumentException if {@code style} is invalid.
@@ -356,6 +358,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @see #getDisplayName(boolean, int, Locale)
* @see Locale#getDefault(Locale.Category)
* @see Locale.Category
+ * @see java.text.DateFormatSymbols#getZoneStrings()
*/
public final String getDisplayName(boolean daylight, int style) {
return getDisplayName(daylight, style,
@@ -365,8 +368,9 @@ abstract public class TimeZone implements Serializable, Cloneable {
/**
* Returns a name in the specified {@code style} of this {@code TimeZone}
* suitable for presentation to the user in the specified {@code
- * locale}. If the specified {@code daylight} is {@code true}, a daylight
- * saving time name is returned. Otherwise, a standard time name is
+ * locale}. If the specified {@code daylight} is {@code true}, a Daylight
+ * Saving Time name is returned (even if this {@code TimeZone} doesn't
+ * observe Daylight Saving Time). Otherwise, a Standard Time name is
* returned.
*
*
When looking up a time zone name, the {@linkplain
@@ -379,13 +383,15 @@ abstract public class TimeZone implements Serializable, Cloneable {
* found, the name is returned. Otherwise, a string in the
* normalized custom ID format is returned.
*
- * @param daylight if {@code true}, return the daylight saving time name.
+ * @param daylight {@code true} specifying a Daylight Saving Time name, or
+ * {@code false} specifying a Standard Time name
* @param style either {@link #LONG} or {@link #SHORT}
- * @param locale the locale in which to supply the display name.
+ * @param locale the locale in which to supply the display name.
* @return the human-readable name of this time zone in the given locale.
* @exception IllegalArgumentException if {@code style} is invalid.
* @exception NullPointerException if {@code locale} is {@code null}.
* @since 1.2
+ * @see java.text.DateFormatSymbols#getZoneStrings()
*/
public String getDisplayName(boolean daylight, int style, Locale locale) {
if (style != SHORT && style != LONG) {
@@ -526,10 +532,10 @@ abstract public class TimeZone implements Serializable, Cloneable {
/**
* Queries if the given {@code date} is in Daylight Saving Time in
- * this {@code TimeZone}.
+ * this time zone.
*
- * @param date the given {@code Date}.
- * @return {@code true} if the given {@code date} is in Daylight Saving Time,
+ * @param date the given Date.
+ * @return {@code true} if the given date is in Daylight Saving Time,
* {@code false}, otherwise.
*/
abstract public boolean inDaylightTime(Date date);
@@ -566,7 +572,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param rawOffset the given time zone GMT offset in milliseconds.
* @return an array of IDs, where the time zone for that ID has
* the specified GMT offset. For example, "America/Phoenix" and "America/Denver"
- * both have GMT-07:00, but differ in daylight savings behavior.
+ * both have GMT-07:00, but differ in daylight saving behavior.
* @see #getRawOffset()
*/
public static synchronized String[] getAvailableIDs(int rawOffset) {
From ad3d04a30c217367c574e22f0d09789df587285e Mon Sep 17 00:00:00 2001
From: Doug Lea
Date: Wed, 23 Feb 2011 14:56:44 +0000
Subject: [PATCH 12/91] 7017493: ConcurrentLinkedDeque: Unexpected
initialization order can lead to crash due to use of Unsafe
Reviewed-by: chegar
---
.../concurrent/ConcurrentLinkedDeque.java | 71 +++++++++-------
.../concurrent/ConcurrentLinkedQueue.java | 52 +++++++-----
.../concurrent/ConcurrentSkipListMap.java | 61 +++++++++-----
.../concurrent/ConcurrentSkipListSet.java | 20 +++--
.../util/concurrent/CopyOnWriteArrayList.java | 19 +++--
.../util/concurrent/LinkedTransferQueue.java | 60 +++++++------
.../classes/java/util/concurrent/Phaser.java | 20 ++---
.../concurrent/PriorityBlockingQueue.java | 23 ++---
.../util/concurrent/SynchronousQueue.java | 84 ++++++++++++++-----
9 files changed, 245 insertions(+), 165 deletions(-)
diff --git a/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java b/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
index 2158084f9f9..1030fac0423 100644
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
@@ -272,13 +272,6 @@ public class ConcurrentLinkedDeque
private static final Node
*
*
Otherwise the new URI's authority component is copied from
- * this URI, and its path is computed as follows:
+ * this URI, and its path is computed as follows:
*
*
*
@@ -1005,7 +1005,7 @@ public final class URI
* path and then normalizing the result as if by invoking the {@link
* #normalize() normalize} method.
*
- *
+ *
*
*
*
@@ -1511,7 +1511,7 @@ public final class URI
* fragments.
*
*
Two hierarchical URIs with identical schemes are ordered
- * according to the ordering of their authority components:
+ * according to the ordering of their authority components:
*
*
*
@@ -1526,7 +1526,7 @@ public final class URI
* the URIs are ordered according to the ordering of their authority
* components.
*
- *
+ *
*
*
Finally, two hierarchical URIs with identical schemes and
* authority components are ordered according to the ordering of their
diff --git a/jdk/src/share/classes/java/net/package.html b/jdk/src/share/classes/java/net/package.html
index 7c7058d7b1c..12dfe9803d0 100644
--- a/jdk/src/share/classes/java/net/package.html
+++ b/jdk/src/share/classes/java/net/package.html
@@ -31,18 +31,18 @@ Provides the classes for implementing networking applications.
The java.net package can be roughly divided in two sections:
-
A Low Level API, which deals with the following abstractions:
+
A Low Level API, which deals with the following abstractions:
Addresses, which are networking identifiers, like IP addresses.
Sockets, which are basic bidirectional data communication mechanisms.
Interfaces, which describe network interfaces.
-
-
A High Level API, which deals with the following abstractions:
+
+
A High Level API, which deals with the following abstractions:
URIs, which represent Universal Resource Identifiers.
URLs, which represent Universal Resource Locators.
Connections, which represents connections to the resource pointed to by URLs.
-
+
Addresses
Addresses are used throughout the java.net APIs as either host identifiers, or socket endpoint identifiers.
From 23ff61a1ff627571961fc5ecaa6dfeeaf1f5ea0e Mon Sep 17 00:00:00 2001
From: Chris Hegarty
Date: Thu, 3 Mar 2011 16:48:53 +0000
Subject: [PATCH 63/91] 6721694: java/lang/Thread/StartOOMTest.java fails with
timeout or with crash
The test is not suitable to be run automatically
Reviewed-by: alanb
---
jdk/test/java/lang/Thread/StartOOMTest.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/jdk/test/java/lang/Thread/StartOOMTest.java b/jdk/test/java/lang/Thread/StartOOMTest.java
index fd6c070baef..57edd723c31 100644
--- a/jdk/test/java/lang/Thread/StartOOMTest.java
+++ b/jdk/test/java/lang/Thread/StartOOMTest.java
@@ -22,11 +22,14 @@
*/
/*
- * @test
- * @bug 6379235
- * @ignore until 6721694 is fixed
- * @run main/othervm -server -Xmx32m -Xms32m -Xss256m StartOOMTest
- * @summary ThreadGroup accounting mistake possible with failure of Thread.start()
+ * This test is relatively useful for verifying 6379235, but
+ * is too resource intensive, especially on 64 bit systems,
+ * to be run automatically, see 6721694.
+ *
+ * When run it should be typically be run with the server vm
+ * and a relatively small java heap, and a large stack size
+ * ( to provoke the OOM quicker ).
+ * java -server -Xmx32m -Xms32m -Xss256m StartOOMTest
*/
import java.util.*;
From 75bd2accd370d72ffa4ee37ef779e81bedccfad7 Mon Sep 17 00:00:00 2001
From: Sean Coffey
Date: Thu, 3 Mar 2011 16:51:03 +0000
Subject: [PATCH 64/91] 6750362: Very large LDAP requests throw a OOM on LDAP
servers which aren't aware of Paged Results Controls 6748156: add an new JNDI
property to control the boolean flag WaitForReply
Reviewed-by: vinnie, robm
---
.../classes/com/sun/jndi/ldap/Connection.java | 16 ++-
.../classes/com/sun/jndi/ldap/LdapClient.java | 8 +-
.../classes/com/sun/jndi/ldap/LdapCtx.java | 65 +++++++++-
.../com/sun/jndi/ldap/LdapRequest.java | 49 ++++++--
.../com/sun/jndi/ldap/NoWaitForReplyTest.java | 118 ++++++++++++++++++
5 files changed, 231 insertions(+), 25 deletions(-)
create mode 100644 jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java
index 94067617ae1..6ca3ae1d85a 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -380,13 +380,19 @@ public final class Connection implements Runnable {
}
LdapRequest writeRequest(BerEncoder ber, int msgId) throws IOException {
- return writeRequest(ber, msgId, false /* pauseAfterReceipt */);
+ return writeRequest(ber, msgId, false /* pauseAfterReceipt */, -1);
}
- LdapRequest writeRequest(BerEncoder ber, int msgId, boolean pauseAfterReceipt)
- throws IOException {
+ LdapRequest writeRequest(BerEncoder ber, int msgId,
+ boolean pauseAfterReceipt) throws IOException {
+ return writeRequest(ber, msgId, pauseAfterReceipt, -1);
+ }
- LdapRequest req = new LdapRequest(msgId, pauseAfterReceipt);
+ LdapRequest writeRequest(BerEncoder ber, int msgId,
+ boolean pauseAfterReceipt, int replyQueueCapacity) throws IOException {
+
+ LdapRequest req =
+ new LdapRequest(msgId, pauseAfterReceipt, replyQueueCapacity);
addRequest(req);
if (traceFile != null) {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java
index 99f84c0adb3..41a3dfba14b 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -516,7 +516,8 @@ public final class LdapClient implements PooledConnection {
LdapResult search(String dn, int scope, int deref, int sizeLimit,
int timeLimit, boolean attrsOnly, String attrs[],
String filter, int batchSize, Control[] reqCtls,
- Hashtable binaryAttrs, boolean waitFirstReply)
+ Hashtable binaryAttrs, boolean waitFirstReply,
+ int replyQueueCapacity)
throws IOException, NamingException {
ensureOpen();
@@ -543,7 +544,8 @@ public final class LdapClient implements PooledConnection {
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
- LdapRequest req = conn.writeRequest(ber, curMsgId);
+ LdapRequest req =
+ conn.writeRequest(ber, curMsgId, false, replyQueueCapacity);
res.msgId = curMsgId;
res.status = LdapClient.LDAP_SUCCESS; //optimistic
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
index e50ebc0d17a..68b272e10e5 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -191,6 +191,14 @@ final public class LdapCtx extends ComponentDirContext
// Environment property for the domain name (derived from this context's DN)
private static final String DOMAIN_NAME = "com.sun.jndi.ldap.domainname";
+ // Block until the first search reply is received
+ private static final String WAIT_FOR_REPLY =
+ "com.sun.jndi.ldap.search.waitForReply";
+
+ // Size of the queue of unprocessed search replies
+ private static final String REPLY_QUEUE_SIZE =
+ "com.sun.jndi.ldap.search.replyQueueSize";
+
// ----------------- Fields that don't change -----------------------
private static final NameParser parser = new LdapNameParser();
@@ -246,6 +254,8 @@ final public class LdapCtx extends ComponentDirContext
private Hashtable binaryAttrs = null; // attr values returned as byte[]
private int connectTimeout = -1; // no timeout value
private int readTimeout = -1; // no timeout value
+ private boolean waitForReply = true; // wait for search response
+ private int replyQueueSize = -1; // unlimited queue size
private boolean useSsl = false; // true if SSL protocol is active
private boolean useDefaultPortNumber = false; // no port number was supplied
@@ -1759,8 +1769,8 @@ final public class LdapCtx extends ComponentDirContext
SearchControls cons,
Continuation cont)
throws NamingException {
- return searchAux(name, filter, cloneSearchControls(cons), true, true,
- cont);
+ return searchAux(name, filter, cloneSearchControls(cons), true,
+ waitForReply, cont);
}
protected NamingEnumeration c_search(Name name,
@@ -1928,7 +1938,7 @@ final public class LdapCtx extends ComponentDirContext
}
private LdapResult doSearch(Name name, String filter, SearchControls cons,
- boolean relative, boolean waitFirstReply) throws NamingException {
+ boolean relative, boolean waitForReply) throws NamingException {
ensureOpen();
try {
int scope;
@@ -1984,7 +1994,8 @@ final public class LdapCtx extends ComponentDirContext
batchSize,
reqCtls,
binaryAttrs,
- waitFirstReply);
+ waitForReply,
+ replyQueueSize);
respCtls = answer.resControls; // retrieve response controls
return answer;
@@ -2170,6 +2181,10 @@ final public class LdapCtx extends ComponentDirContext
connectTimeout = -1;
} else if (propName.equals(READ_TIMEOUT)) {
readTimeout = -1;
+ } else if (propName.equals(WAIT_FOR_REPLY)) {
+ waitForReply = true;
+ } else if (propName.equals(REPLY_QUEUE_SIZE)) {
+ replyQueueSize = -1;
// The following properties affect the connection
@@ -2225,6 +2240,11 @@ final public class LdapCtx extends ComponentDirContext
setConnectTimeout((String)propVal);
} else if (propName.equals(READ_TIMEOUT)) {
setReadTimeout((String)propVal);
+ } else if (propName.equals(WAIT_FOR_REPLY)) {
+ setWaitForReply((String)propVal);
+ } else if (propName.equals(REPLY_QUEUE_SIZE)) {
+ setReplyQueueSize((String)propVal);
+
// The following properties affect the connection
} else if (propName.equals(Context.SECURITY_PROTOCOL)) {
@@ -2312,6 +2332,13 @@ final public class LdapCtx extends ComponentDirContext
// Set the read timeout
setReadTimeout((String)envprops.get(READ_TIMEOUT));
+ // Set the flag that controls whether to block until the first reply
+ // is received
+ setWaitForReply((String)envprops.get(WAIT_FOR_REPLY));
+
+ // Set the size of the queue of unprocessed search replies
+ setReplyQueueSize((String)envprops.get(REPLY_QUEUE_SIZE));
+
// When connection is created, it will use these and other
// properties from the environment
}
@@ -2441,6 +2468,34 @@ final public class LdapCtx extends ComponentDirContext
}
}
+ /**
+ * Sets the size of the queue of unprocessed search replies
+ */
+ private void setReplyQueueSize(String replyQueueSizeProp) {
+ if (replyQueueSizeProp != null) {
+ replyQueueSize = Integer.parseInt(replyQueueSizeProp);
+ // disallow an empty queue
+ if (replyQueueSize <= 0) {
+ replyQueueSize = -1; // unlimited
+ }
+ } else {
+ replyQueueSize = -1; // unlimited
+ }
+ }
+
+ /**
+ * Sets the flag that controls whether to block until the first search
+ * reply is received
+ */
+ private void setWaitForReply(String waitForReplyProp) {
+ if (waitForReplyProp != null &&
+ (waitForReplyProp.equalsIgnoreCase("false"))) {
+ waitForReply = false;
+ } else {
+ waitForReply = true;
+ }
+ }
+
/**
* Sets the read timeout value
*/
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java
index 2f8e39e5724..23347ac5dc8 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
package com.sun.jndi.ldap;
import java.io.IOException;
-import java.util.Vector;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
import javax.naming.CommunicationException;
final class LdapRequest {
@@ -35,14 +36,26 @@ final class LdapRequest {
int msgId; // read-only
private int gotten = 0;
- private Vector replies = new Vector(3);
+ private BlockingQueue replies;
+ private int highWatermark = -1;
private boolean cancelled = false;
private boolean pauseAfterReceipt = false;
private boolean completed = false;
LdapRequest(int msgId, boolean pause) {
+ this(msgId, pause, -1);
+ }
+
+ LdapRequest(int msgId, boolean pause, int replyQueueCapacity) {
this.msgId = msgId;
this.pauseAfterReceipt = pause;
+ if (replyQueueCapacity == -1) {
+ this.replies = new LinkedBlockingQueue();
+ } else {
+ this.replies =
+ new LinkedBlockingQueue(replyQueueCapacity);
+ highWatermark = (replyQueueCapacity * 80) / 100; // 80% capacity
+ }
}
synchronized void cancel() {
@@ -57,7 +70,13 @@ final class LdapRequest {
if (cancelled) {
return false;
}
- replies.addElement(ber);
+
+ // Add a new reply to the queue of unprocessed replies.
+ try {
+ replies.put(ber);
+ } catch (InterruptedException e) {
+ // ignore
+ }
// peek at the BER buffer to check if it is a SearchResultDone PDU
try {
@@ -70,6 +89,14 @@ final class LdapRequest {
ber.reset();
notify(); // notify anyone waiting for reply
+ /*
+ * If a queue capacity has been set then trigger a pause when the
+ * queue has filled to 80% capacity. Later, when the queue has drained
+ * then the reader gets unpaused.
+ */
+ if (highWatermark != -1 && replies.size() >= highWatermark) {
+ return true; // trigger the pause
+ }
return pauseAfterReceipt;
}
@@ -79,14 +106,12 @@ final class LdapRequest {
" cancelled");
}
- if (gotten < replies.size()) {
- BerDecoder answer = (BerDecoder)replies.elementAt(gotten);
- replies.setElementAt(null, gotten); // remove reference
- ++gotten; // skip to next
- return answer;
- } else {
- return null;
- }
+ /*
+ * Remove a reply if the queue is not empty.
+ * poll returns null if queue is empty.
+ */
+ BerDecoder reply = replies.poll();
+ return reply;
}
synchronized boolean hasSearchCompleted() {
diff --git a/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java b/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java
new file mode 100644
index 00000000000..4a93ef41ff8
--- /dev/null
+++ b/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 6748156
+ * @summary add an new JNDI property to control the boolean flag WaitForReply
+ */
+
+import java.net.Socket;
+import java.net.ServerSocket;
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+
+public class NoWaitForReplyTest {
+
+ public static void main(String[] args) throws Exception {
+
+ boolean passed = false;
+
+ // Set up the environment for creating the initial context
+ Hashtable env = new Hashtable(11);
+ env.put(Context.PROVIDER_URL, "ldap://localhost:22001");
+ env.put(Context.INITIAL_CONTEXT_FACTORY,
+ "com.sun.jndi.ldap.LdapCtxFactory");
+
+ // Wait up to 10 seconds for a response from the LDAP server
+ env.put("com.sun.jndi.ldap.read.timeout", "10000");
+
+ // Don't wait until the first search reply is received
+ env.put("com.sun.jndi.ldap.search.waitForReply", "false");
+
+ // Send the LDAP search request without first authenticating (no bind)
+ env.put("java.naming.ldap.version", "3");
+
+ DummyServer ldapServer = new DummyServer();
+
+ try {
+
+ // start the LDAP server
+ ldapServer.start();
+
+ // Create initial context
+ System.out.println("Client: connecting to the server");
+ DirContext ctx = new InitialDirContext(env);
+
+ SearchControls scl = new SearchControls();
+ scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ System.out.println("Client: performing search");
+ NamingEnumeration answer =
+ ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+
+ // Server will never reply: either we waited in the call above until
+ // the timeout (fail) or we did not wait and reached here (pass).
+ passed = true;
+ System.out.println("Client: did not wait until first reply");
+
+ // Close the context when we're done
+ ctx.close();
+
+ } catch (NamingException e) {
+ // timeout (ignore)
+ }
+ ldapServer.interrupt();
+
+ if (!passed) {
+ throw new Exception(
+ "Test FAILED: should not have waited until first search reply");
+ }
+ System.out.println("Test PASSED");
+ }
+
+ static class DummyServer extends Thread {
+
+ static int serverPort = 22001;
+
+ DummyServer() {
+ }
+
+ public void run() {
+ try {
+ ServerSocket serverSock = new ServerSocket(serverPort);
+ Socket socket = serverSock.accept();
+ System.out.println("Server: accepted a connection");
+ BufferedInputStream bin =
+ new BufferedInputStream(socket.getInputStream());
+
+ while (true) {
+ bin.read();
+ }
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+}
+}
From 9d85a7afc458c5ddf1dfd16de58068af168f4d72 Mon Sep 17 00:00:00 2001
From: Michael McMahon
Date: Thu, 3 Mar 2011 17:14:23 +0000
Subject: [PATCH 65/91] 7024264: HttpURLConnection/NetPermission doc issue
Reviewed-by: chegar
---
jdk/src/share/classes/java/net/HttpURLConnection.java | 3 ++-
jdk/src/share/classes/java/net/NetPermission.java | 7 +++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/jdk/src/share/classes/java/net/HttpURLConnection.java b/jdk/src/share/classes/java/net/HttpURLConnection.java
index db4fc05d905..3b74394f6cd 100644
--- a/jdk/src/share/classes/java/net/HttpURLConnection.java
+++ b/jdk/src/share/classes/java/net/HttpURLConnection.java
@@ -400,7 +400,8 @@ abstract public class HttpURLConnection extends URLConnection {
* @exception ProtocolException if the method cannot be reset or if
* the requested method isn't valid for HTTP.
* @exception SecurityException if a security manager is set and the
- * "allowHttpTrace" NetPermission is not granted.
+ * method is "TRACE", but the "allowHttpTrace"
+ * NetPermission is not granted.
* @see #getRequestMethod()
*/
public void setRequestMethod(String method) throws ProtocolException {
diff --git a/jdk/src/share/classes/java/net/NetPermission.java b/jdk/src/share/classes/java/net/NetPermission.java
index 0c459c3d5ab..2e1a2c93bba 100644
--- a/jdk/src/share/classes/java/net/NetPermission.java
+++ b/jdk/src/share/classes/java/net/NetPermission.java
@@ -73,6 +73,13 @@ import java.util.StringTokenizer;
*
*
*
+ *
getNetworkInformation
+ *
The ability to retrieve all information about local network interfaces.
+ *
Malicious code can read information about network hardware such as
+ * MAC addresses, which could be used to construct local IPv6 addresses.
+ *
+ *
+ *
*
getProxySelector
*
The ability to get the proxy selector used to make decisions
* on which proxies to use when making network connections.
From f13a584b8a2096382256fa882d686de7b1e752f2 Mon Sep 17 00:00:00 2001
From: Clemens Eisserer
Date: Thu, 3 Mar 2011 16:06:42 -0800
Subject: [PATCH 66/91] 7023589: Xrender : NullPointerException in
sun.font.XRGlyphCache.freeGlyphs running Java 2D demo
Reviewed-by: prr
---
.../share/classes/sun/font/StrikeCache.java | 10 +++---
.../classes/sun/font/XRGlyphCache.java | 35 ++++++++++---------
2 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/jdk/src/share/classes/sun/font/StrikeCache.java b/jdk/src/share/classes/sun/font/StrikeCache.java
index a7aa1f5846c..46c7b7a9a9e 100644
--- a/jdk/src/share/classes/sun/font/StrikeCache.java
+++ b/jdk/src/share/classes/sun/font/StrikeCache.java
@@ -319,8 +319,7 @@ public final class StrikeCache {
ArrayList gids = null;
for (int i = 0; i < glyphPtrs.length; i++) {
- if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
- && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+ if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0) {
if (gids == null) {
gids = new ArrayList();
@@ -330,6 +329,8 @@ public final class StrikeCache {
}
if (gids != null) {
+ // Any reference by the disposers to the native glyph ptrs
+ // must be done before this returns.
notifyDisposeListeners(gids);
}
}
@@ -345,8 +346,7 @@ public final class StrikeCache {
for (int i=0; i < glyphPtrs.length; i++) {
if (glyphPtrs[i] != 0
- && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
- && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+ && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0) {
if (gids == null) {
gids = new ArrayList();
@@ -356,6 +356,8 @@ public final class StrikeCache {
}
if (gids != null) {
+ // Any reference by the disposers to the native glyph ptrs
+ // must be done before this returns.
notifyDisposeListeners(gids);
}
}
diff --git a/jdk/src/solaris/classes/sun/font/XRGlyphCache.java b/jdk/src/solaris/classes/sun/font/XRGlyphCache.java
index 9e767242b9f..7dbb23a774f 100644
--- a/jdk/src/solaris/classes/sun/font/XRGlyphCache.java
+++ b/jdk/src/solaris/classes/sun/font/XRGlyphCache.java
@@ -70,9 +70,14 @@ public class XRGlyphCache implements GlyphDisposedListener {
try {
SunToolkit.awtLock();
- ArrayList glyphIDList = new ArrayList(glyphPtrList.size());
+ GrowableIntArray glyphIDList = new GrowableIntArray(1, glyphPtrList.size());
for (long glyphPtr : glyphPtrList) {
- glyphIDList.add(XRGlyphCacheEntry.getGlyphID(glyphPtr));
+ int glyphID = XRGlyphCacheEntry.getGlyphID(glyphPtr);
+
+ //Check if glyph hasn't been freed already
+ if (glyphID != 0) {
+ glyphIDList.addInt(glyphID);
+ }
}
freeGlyphs(glyphIDList);
} finally {
@@ -83,7 +88,6 @@ public class XRGlyphCache implements GlyphDisposedListener {
protected int getFreeGlyphID() {
if (freeGlyphIDs.size() > 0) {
int newID = freeGlyphIDs.remove(freeGlyphIDs.size() - 1);
- ;
return newID;
}
return nextID++;
@@ -246,7 +250,7 @@ public class XRGlyphCache implements GlyphDisposedListener {
glyph.setPinned();
}
- ArrayList deleteGlyphList = new ArrayList();
+ GrowableIntArray deleteGlyphList = new GrowableIntArray(1, 10);
int pixelsToRelease = cachedPixels - MAX_CACHED_PIXELS;
for (int i = cacheList.size() - 1; i >= 0 && pixelsToRelease > 0; i--) {
@@ -254,7 +258,7 @@ public class XRGlyphCache implements GlyphDisposedListener {
if (!entry.isPinned()) {
pixelsToRelease -= entry.getPixelCnt();
- deleteGlyphList.add(new Integer(entry.getGlyphID()));
+ deleteGlyphList.addInt(entry.getGlyphID());
}
}
@@ -265,26 +269,23 @@ public class XRGlyphCache implements GlyphDisposedListener {
freeGlyphs(deleteGlyphList);
}
- private void freeGlyphs(List glyphIdList) {
+ private void freeGlyphs(GrowableIntArray glyphIdList) {
+ GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 10);
+ GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 10);
- freeGlyphIDs.addAll(glyphIdList);
+ for (int i=0; i < glyphIdList.getSize(); i++) {
+ int glyphId = glyphIdList.getInt(i);
+ freeGlyphIDs.add(glyphId);
- GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 1);
- GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 1);
-
- for (Integer glyphId : glyphIdList) {
- tmp.setValue(glyphId.intValue());
+ tmp.setValue(glyphId);
XRGlyphCacheEntry entry = cacheMap.get(tmp);
cachedPixels -= entry.getPixelCnt();
-
- int removedGlyphID = entry.getGlyphID();
- tmp.setValue(removedGlyphID);
cacheMap.remove(tmp);
if (entry.getGlyphSet() == grayGlyphSet) {
- removedGrayscaleGlyphs.addInt(removedGlyphID);
+ removedGrayscaleGlyphs.addInt(glyphId);
} else {
- removedLCDGlyphs.addInt(removedGlyphID);
+ removedLCDGlyphs.addInt(glyphId);
}
entry.setGlyphID(0);
From 1d820278f6f3fb18fcf16e33c82740c8aa592dc7 Mon Sep 17 00:00:00 2001
From: Alan Bateman
Date: Fri, 4 Mar 2011 09:29:56 +0000
Subject: [PATCH 67/91] 6944810: (ch) Assert failure in
sun.nio.ch.PendingIoCache.clearPendingIoMap [win]
Reviewed-by: chegar
---
.../nio/channels/AsynchronousFileChannel.java | 4 ++--
.../classes/sun/nio/ch/PendingIoCache.java | 7 ++++---
.../WindowsAsynchronousFileChannelImpl.java | 13 +++++++-----
.../WindowsAsynchronousSocketChannelImpl.java | 4 ++--
jdk/test/ProblemList.txt | 21 -------------------
5 files changed, 16 insertions(+), 33 deletions(-)
diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java
index 4f4ac7f4a36..3e90769d329 100644
--- a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java
+++ b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java
@@ -48,7 +48,7 @@ import java.util.Collections;
*
*
An asynchronous file channel does not have a current position
* within the file. Instead, the file position is specified to each read and
- * write methd that initiate asynchronous operations. A {@link CompletionHandler}
+ * write method that initiates asynchronous operations. A {@link CompletionHandler}
* is specified as a parameter and is invoked to consume the result of the I/O
* operation. This class also defines read and write methods that initiate
* asynchronous operations, returning a {@link Future} to represent the pending
@@ -73,7 +73,7 @@ import java.util.Collections;
* which tasks are submitted to handle I/O events and dispatch to completion
* handlers that consume the results of I/O operations on the channel. The
* completion handler for an I/O operation initiated on a channel is guaranteed
- * to be invoked by one threads in the thread pool (This ensures that the
+ * to be invoked by one of the threads in the thread pool (This ensures that the
* completion handler is run by a thread with the expected identity).
* Where an I/O operation completes immediately, and the initiating thread is
* itself a thread in the thread pool, then the completion handler may be invoked
diff --git a/jdk/src/windows/classes/sun/nio/ch/PendingIoCache.java b/jdk/src/windows/classes/sun/nio/ch/PendingIoCache.java
index 3d78a733c8c..7a4b1e3e319 100644
--- a/jdk/src/windows/classes/sun/nio/ch/PendingIoCache.java
+++ b/jdk/src/windows/classes/sun/nio/ch/PendingIoCache.java
@@ -110,8 +110,7 @@ class PendingIoCache {
if (closed)
return;
- // handle the case that where there are I/O operations that have
- // not completed.
+ // handle case where I/O operations that have not completed.
if (!pendingIoMap.isEmpty())
clearPendingIoMap();
@@ -132,7 +131,9 @@ class PendingIoCache {
closePending = true;
try {
this.wait(50);
- } catch (InterruptedException x) { }
+ } catch (InterruptedException x) {
+ Thread.currentThread().interrupt();
+ }
closePending = false;
if (pendingIoMap.isEmpty())
return;
diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
index 694b23a34a9..82405875928 100644
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
@@ -439,6 +439,7 @@ public class WindowsAsynchronousFileChannelImpl
address = ((DirectBuffer)buf).address();
}
+ boolean pending = false;
try {
begin();
@@ -449,6 +450,7 @@ public class WindowsAsynchronousFileChannelImpl
n = readFile(handle, address, rem, position, overlapped);
if (n == IOStatus.UNAVAILABLE) {
// I/O is pending
+ pending = true;
return;
} else if (n == IOStatus.EOF) {
result.setResult(n);
@@ -460,14 +462,15 @@ public class WindowsAsynchronousFileChannelImpl
// failed to initiate read
result.setFailure(toIOException(x));
} finally {
+ if (!pending) {
+ // release resources
+ if (overlapped != 0L)
+ ioCache.remove(overlapped);
+ releaseBufferIfSubstituted();
+ }
end();
}
- // release resources
- if (overlapped != 0L)
- ioCache.remove(overlapped);
- releaseBufferIfSubstituted();
-
// invoke completion handler
Invoker.invoke(result);
}
diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
index 28d3c074549..2cc9cf026af 100644
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
@@ -239,14 +239,14 @@ class WindowsAsynchronousSocketChannelImpl
result.setResult(null);
}
} catch (Throwable x) {
+ if (overlapped != 0L)
+ ioCache.remove(overlapped);
exc = x;
} finally {
end();
}
if (exc != null) {
- if (overlapped != 0L)
- ioCache.remove(overlapped);
closeChannel();
result.setFailure(toIOException(exc));
}
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index 62c19030b00..27518785b07 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -380,30 +380,9 @@ java/io/File/MaxPathLength.java windows-all
# jdk_nio
-# 6944810
-java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java windows-all
-
# 6963118
java/nio/channels/Selector/Wakeup.java windows-all
-# The asynchronous I/O implementation on Windows requires Windows XP or newer.
-# We can remove the following once all Windows 2000 machines have been
-# decommissioned.
-java/nio/channels/AsynchronousChannelGroup/Basic.java windows-5.0
-java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Identity.java windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Restart.java windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Unbounded.java windows-5.0
-java/nio/channels/AsynchronousDatagramChannel/Basic.java windows-5.0
-java/nio/channels/AsynchronousFileChannel/Lock.java windows-5.0
-java/nio/channels/AsynchronousServerSocketChannel/Basic.java windows-5.0
-java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/Basic.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/DieBeforeComplete.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/Leaky.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/StressLoopback.java windows-5.0
-java/nio/channels/Channels/Basic2.java windows-5.0
-
# 6959891
com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
From a5c5bb811d1d01d32b3641170ea3db917454b5ab Mon Sep 17 00:00:00 2001
From: Kumar Srinivasan
Date: Fri, 4 Mar 2011 09:32:20 -0800
Subject: [PATCH 68/91] 7023963: (misc) fix diamond anon instances in the jdk
Reviewed-by: alanb, mchung, mcimadamore, dholmes
---
.../classes/com/sun/java/util/jar/pack/PackageReader.java | 4 ++--
.../classes/com/sun/java/util/jar/pack/PackageWriter.java | 4 ++--
.../nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java | 4 ++--
.../share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
index 41436e7b3b4..d676ee8e6fb 100644
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1011,7 +1011,7 @@ class PackageReader extends BandStructure {
return -1;
}
- Comparator entryOutputOrder = new Comparator<>() {
+ Comparator entryOutputOrder = new Comparator() {
public int compare(Entry e0, Entry e1) {
int k0 = getOutputIndex(e0);
int k1 = getOutputIndex(e1);
diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
index 8220e115663..f531fb7d999 100644
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -785,7 +785,7 @@ class PackageWriter extends BandStructure {
defMap.entrySet().toArray(layoutsAndCounts);
// Sort by count, most frequent first.
// Predefs. participate in this sort, though it does not matter.
- Arrays.sort(layoutsAndCounts, new Comparator<>() {
+ Arrays.sort(layoutsAndCounts, new Comparator() {
public int compare(Object o0, Object o1) {
Map.Entry e0 = (Map.Entry) o0;
Map.Entry e1 = (Map.Entry) o1;
diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java
index 10f6bd477a9..543220fc63a 100644
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -76,7 +76,7 @@ public class ZipDirectoryStream implements DirectoryStream {
} catch (IOException e) {
throw new IllegalStateException(e);
}
- return new Iterator<>() {
+ return new Iterator() {
private Path next;
@Override
public boolean hasNext() {
diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java
index b03ba2929eb..1232a27ff1f 100644
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -590,7 +590,7 @@ public class ZipPath implements Path {
@Override
public Iterator iterator() {
- return new Iterator<>() {
+ return new Iterator() {
private int i = 0;
@Override
From 2b73fac982c5f0ff14d5444c9fa57351c2a7a104 Mon Sep 17 00:00:00 2001
From: Xueming Shen
Date: Fri, 4 Mar 2011 11:35:53 -0800
Subject: [PATCH 69/91] 7023244: (zipfs) langtools CompileTest fails on
read-only file system
Replaced checkAccess with Files.isWritable()
Reviewed-by: alanb
---
.../demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
index 40afd8afb84..fc43fd87ccf 100644
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
@@ -112,11 +112,8 @@ public class ZipFileSystem extends FileSystem {
}
// sm and existence check
zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ);
- try {
- zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.WRITE);
- } catch (AccessDeniedException x) {
+ if (!Files.isWritable(zfpath))
this.readOnly = true;
- }
this.zc = ZipCoder.get(nameEncoding);
this.defaultdir = new ZipPath(this, getBytes(defaultDir));
this.ch = Files.newByteChannel(zfpath, READ);
From d048451ca290076aff8bd9ff3ae96500b9e5a3c2 Mon Sep 17 00:00:00 2001
From: Alan Bateman
Date: Fri, 4 Mar 2011 21:26:50 +0000
Subject: [PATCH 70/91] 7023403: (ch) sun.nio.ch.SolarisEventPort.startPoll
failed with AssertionError
Reviewed-by: forax
---
.../ch/UnixAsynchronousSocketChannelImpl.java | 19 ++++++++++++-------
.../AsynchronousSocketChannel/Basic.java | 2 +-
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
index 13e4ad36434..37caeeb9bce 100644
--- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
+++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
@@ -137,7 +137,7 @@ class UnixAsynchronousSocketChannelImpl
return port;
}
- // register for events if there are outstanding I/O operations
+ // register events for outstanding I/O operations, caller already owns updateLock
private void updateEvents() {
assert Thread.holdsLock(updateLock);
int events = 0;
@@ -149,6 +149,13 @@ class UnixAsynchronousSocketChannelImpl
port.startPoll(fdVal, events);
}
+ // register events for outstanding I/O operations
+ private void lockAndUpdateEvents() {
+ synchronized (updateLock) {
+ updateEvents();
+ }
+ }
+
// invoke to finish read and/or write operations
private void finish(boolean mayInvokeDirect,
boolean readable,
@@ -402,9 +409,8 @@ class UnixAsynchronousSocketChannelImpl
exc = x;
} finally {
// restart poll in case of concurrent write
- synchronized (updateLock) {
- updateEvents();
- }
+ if (!(exc instanceof AsynchronousCloseException))
+ lockAndUpdateEvents();
end();
}
@@ -598,9 +604,8 @@ class UnixAsynchronousSocketChannelImpl
exc = x;
} finally {
// restart poll in case of concurrent write
- synchronized (updateLock) {
- updateEvents();
- }
+ if (!(exc instanceof AsynchronousCloseException))
+ lockAndUpdateEvents();
end();
}
diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
index 9f67fc37113..afe61d6d80a 100644
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
@@ -22,7 +22,7 @@
*/
/* @test
- * @bug 4607272 6842687 6878369
+ * @bug 4607272 6842687 6878369 6944810 7023403
* @summary Unit test for AsynchronousSocketChannel
* @run main/timeout=600 Basic
*/
From d0c0743b8ca614c5516a00c7417cc6110ee51428 Mon Sep 17 00:00:00 2001
From: Erik Trimble
Date: Fri, 4 Mar 2011 14:06:22 -0800
Subject: [PATCH 71/91] 7024814: Bump the HS21 build number to 04
Update the HS21 build number to 04
Reviewed-by: jcoomes
---
hotspot/make/hotspot_version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index 31407e75dde..82f6dea775a 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=21
HS_MINOR_VER=0
-HS_BUILD_NUMBER=03
+HS_BUILD_NUMBER=04
JDK_MAJOR_VER=1
JDK_MINOR_VER=7
From fb59857e93b79fa263473894a3366c2a6d31ac4f Mon Sep 17 00:00:00 2001
From: Phil Race
Date: Fri, 4 Mar 2011 15:54:41 -0800
Subject: [PATCH 72/91] 7023591: Xrender: java2D font demo - text highlighting
tab content is black
Reviewed-by: flar
---
jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java b/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java
index 8654bede25c..4cba5a0b2a1 100644
--- a/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java
+++ b/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java
@@ -109,7 +109,7 @@ public class AAShapePipe
Region clip = sg.getCompClip();
int abox[] = new int[4];
AATileGenerator aatg =
- renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
+ renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, lw1, lw2,
clip, abox);
if (aatg == null) {
// Nothing to render
From 1af9167ee76edceaa351ff64c5aacd0de36554e9 Mon Sep 17 00:00:00 2001
From: Pavel Porvatov
Date: Sat, 5 Mar 2011 18:27:51 +0300
Subject: [PATCH 73/91] 6760148: Certain fonts are not correctly soft wrapped
when using JTextComponent.print()
Reviewed-by: peterz
---
.../classes/javax/swing/text/Utilities.java | 31 +++++--------------
.../javax/swing/text/WrappedPlainView.java | 8 ++---
2 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/jdk/src/share/classes/javax/swing/text/Utilities.java b/jdk/src/share/classes/javax/swing/text/Utilities.java
index 704cfa02c84..e3ef4940d5a 100644
--- a/jdk/src/share/classes/javax/swing/text/Utilities.java
+++ b/jdk/src/share/classes/javax/swing/text/Utilities.java
@@ -390,11 +390,15 @@ public class Utilities {
}
if ((x >= currX) && (x < nextX)) {
// found the hit position... return the appropriate side
- if ((round == false) || ((x - currX) < (nextX - x))) {
- return i - txtOffset;
- } else {
- return i + 1 - txtOffset;
+ int offset = ((round == false) || ((x - currX) < (nextX - x))) ?
+ (i - txtOffset) : (i + 1 - txtOffset);
+ // the length of the string measured as a whole may differ from
+ // the sum of individual character lengths, for example if
+ // fractional metrics are enabled; and we must guard from this.
+ while (metrics.charsWidth(txt, txtOffset, offset + 1) > (x - x0)) {
+ offset--;
}
+ return (offset < 0 ? 0 : offset);
}
currX = nextX;
}
@@ -403,24 +407,6 @@ public class Utilities {
return txtCount;
}
- /**
- * Adjust text offset so that the length of a resulting string as a whole
- * fits into the specified width.
- */
- static int adjustOffsetForFractionalMetrics(
- Segment s, FontMetrics fm, int offset, int width) {
- // Sometimes the offset returned by getTabbedTextOffset is beyond the
- // available area, when fractional metrics are enabled. We should
- // guard against this.
- if (offset < s.count) {
- while (offset > 0 &&
- fm.charsWidth(s.array, s.offset, offset + 1) > width) {
- offset--;
- }
- }
- return offset;
- }
-
/**
* Determine where to break the given text to fit
* within the given span. This tries to find a word boundary.
@@ -443,7 +429,6 @@ public class Utilities {
int txtCount = s.count;
int index = Utilities.getTabbedTextOffset(s, metrics, x0, x,
e, startOffset, false);
- index = adjustOffsetForFractionalMetrics(s, metrics, index, x - x0);
if (index >= txtCount - 1) {
return txtCount;
diff --git a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java
index 2f02a7ca956..90d11659c2c 100644
--- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java
@@ -239,11 +239,9 @@ public class WrappedPlainView extends BoxView implements TabExpander {
tabBase, tabBase + currentWidth,
this, p0);
} else {
- int offset = Utilities.getTabbedTextOffset(segment, metrics,
- tabBase, tabBase + currentWidth, this, p0, false);
- offset = Utilities.adjustOffsetForFractionalMetrics(
- segment, metrics, offset, currentWidth);
- p = p0 + offset;
+ p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
+ tabBase, tabBase + currentWidth,
+ this, p0, false);
}
SegmentCache.releaseSharedSegment(segment);
return p;
From 02b628a10f2ab2b602bb27862363be45b039897d Mon Sep 17 00:00:00 2001
From: Sean Coffey
Date: Mon, 7 Mar 2011 14:43:11 +0000
Subject: [PATCH 74/91] 7025105: TEST_BUG
test/com/sun/jndi/ldap/NoWaitForReplyTest.java should be cleaned up
Reviewed-by: alanb
---
.../com/sun/jndi/ldap/NoWaitForReplyTest.java | 127 ++++++++++--------
1 file changed, 70 insertions(+), 57 deletions(-)
diff --git a/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java b/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java
index 4a93ef41ff8..bb772c09bc5 100644
--- a/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java
+++ b/jdk/test/com/sun/jndi/ldap/NoWaitForReplyTest.java
@@ -38,81 +38,94 @@ public class NoWaitForReplyTest {
public static void main(String[] args) throws Exception {
- boolean passed = false;
-
- // Set up the environment for creating the initial context
- Hashtable env = new Hashtable(11);
- env.put(Context.PROVIDER_URL, "ldap://localhost:22001");
- env.put(Context.INITIAL_CONTEXT_FACTORY,
- "com.sun.jndi.ldap.LdapCtxFactory");
-
- // Wait up to 10 seconds for a response from the LDAP server
- env.put("com.sun.jndi.ldap.read.timeout", "10000");
-
- // Don't wait until the first search reply is received
- env.put("com.sun.jndi.ldap.search.waitForReply", "false");
-
- // Send the LDAP search request without first authenticating (no bind)
- env.put("java.naming.ldap.version", "3");
-
- DummyServer ldapServer = new DummyServer();
-
- try {
+ boolean passed = false;
// start the LDAP server
+ DummyServer ldapServer = new DummyServer();
ldapServer.start();
- // Create initial context
- System.out.println("Client: connecting to the server");
- DirContext ctx = new InitialDirContext(env);
+ // Set up the environment for creating the initial context
+ Hashtable env = new Hashtable(11);
+ env.put(Context.PROVIDER_URL, "ldap://localhost:" +
+ ldapServer.getPortNumber());
+ env.put(Context.INITIAL_CONTEXT_FACTORY,
+ "com.sun.jndi.ldap.LdapCtxFactory");
- SearchControls scl = new SearchControls();
- scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
- System.out.println("Client: performing search");
- NamingEnumeration answer =
- ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+ // Wait up to 10 seconds for a response from the LDAP server
+ env.put("com.sun.jndi.ldap.read.timeout", "10000");
- // Server will never reply: either we waited in the call above until
- // the timeout (fail) or we did not wait and reached here (pass).
- passed = true;
- System.out.println("Client: did not wait until first reply");
+ // Don't wait until the first search reply is received
+ env.put("com.sun.jndi.ldap.search.waitForReply", "false");
- // Close the context when we're done
- ctx.close();
+ // Send the LDAP search request without first authenticating (no bind)
+ env.put("java.naming.ldap.version", "3");
- } catch (NamingException e) {
- // timeout (ignore)
- }
- ldapServer.interrupt();
- if (!passed) {
- throw new Exception(
- "Test FAILED: should not have waited until first search reply");
- }
- System.out.println("Test PASSED");
+ try {
+
+ // Create initial context
+ System.out.println("Client: connecting to the server");
+ DirContext ctx = new InitialDirContext(env);
+
+ SearchControls scl = new SearchControls();
+ scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ System.out.println("Client: performing search");
+ NamingEnumeration answer =
+ ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+
+ // Server will never reply: either we waited in the call above until
+ // the timeout (fail) or we did not wait and reached here (pass).
+ passed = true;
+ System.out.println("Client: did not wait until first reply");
+
+ // Close the context when we're done
+ ctx.close();
+
+ } catch (NamingException e) {
+ // timeout (ignore)
+ }
+ ldapServer.interrupt();
+
+ if (!passed) {
+ throw new Exception(
+ "Test FAILED: should not have waited until first search reply");
+ }
+ System.out.println("Test PASSED");
}
static class DummyServer extends Thread {
- static int serverPort = 22001;
+ private final ServerSocket serverSocket;
- DummyServer() {
- }
+ DummyServer() throws IOException {
+ this.serverSocket = new ServerSocket(0);
+ System.out.println("Server: listening on port " + serverSocket.getLocalPort());
+ }
- public void run() {
- try {
- ServerSocket serverSock = new ServerSocket(serverPort);
- Socket socket = serverSock.accept();
+ public int getPortNumber() {
+ return serverSocket.getLocalPort();
+ }
+
+ public void run() {
+ try (Socket socket = serverSocket.accept()) {
System.out.println("Server: accepted a connection");
- BufferedInputStream bin =
- new BufferedInputStream(socket.getInputStream());
+ InputStream in = socket.getInputStream();
- while (true) {
- bin.read();
+ while (!isInterrupted()) {
+ in.skip(in.available());
}
- } catch (IOException e) {
- // ignore
+
+ } catch (Exception e) {
+ // ignore
+
+ } finally {
+ System.out.println("Server: shutting down");
+ try {
+ serverSocket.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
}
}
}
-}
From 93b5e28256dac5075e01227d5ced210da5c21155 Mon Sep 17 00:00:00 2001
From: Sean Mullan
Date: Mon, 7 Mar 2011 13:20:55 -0500
Subject: [PATCH 75/91] 7022467: SecretKeyFactory doesn't support algorithm
"AES" on Windows and Linux
Reviewed-by: wetmore, valeriep
---
jdk/src/share/classes/javax/crypto/SecretKeyFactory.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java b/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java
index 1d00db7badb..bf32bae08c5 100644
--- a/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java
+++ b/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,6 @@ import sun.security.jca.GetInstance.Instance;
*
Every implementation of the Java platform is required to support the
* following standard SecretKeyFactory algorithms:
*
- *
AES
*
DES
*
DESede
*
From 1daa47b01d4825eb89ba9c586db4cb93ef962d6b Mon Sep 17 00:00:00 2001
From: Valerie Peng
Date: Mon, 7 Mar 2011 14:14:37 -0800
Subject: [PATCH 76/91] 6994008: PKCS11 should support "RSA" and
"RSA/ECB/NoPadding" ciphers
Add support for RSA_X_509 mechanism and aliasing of "RSA" to "RSA/ECB/PKCS1Padding".
Reviewed-by: wetmore
---
.../sun/security/pkcs11/P11RSACipher.java | 19 +++-
.../sun/security/pkcs11/SunPKCS11.java | 4 +-
.../security/pkcs11/Cipher/TestRSACipher.java | 98 ++++++++++---------
.../pkcs11/Cipher/TestRSACipherWrap.java | 55 ++++++-----
.../pkcs11/Cipher/TestRawRSACipher.java | 84 ++++++++++++++++
5 files changed, 181 insertions(+), 79 deletions(-)
create mode 100644 jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java b/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
index 18f3ab450ef..d9dc4e77ef7 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,11 @@ final class P11RSACipher extends CipherSpi {
// mode constant for public key decryption (verifying)
private final static int MODE_VERIFY = 4;
+ // padding type constant for NoPadding
+ private final static int PAD_NONE = 1;
+ // padding type constant for PKCS1Padding
+ private final static int PAD_PKCS1 = 2;
+
// token instance
private final Token token;
@@ -77,6 +82,9 @@ final class P11RSACipher extends CipherSpi {
// mode, one of MODE_* above
private int mode;
+ // padding, one of PAD_* above
+ private int padType;
+
private byte[] buffer;
private int bufOfs;
@@ -113,8 +121,10 @@ final class P11RSACipher extends CipherSpi {
protected void engineSetPadding(String padding)
throws NoSuchPaddingException {
String lowerPadding = padding.toLowerCase(Locale.ENGLISH);
- if (lowerPadding.equals("pkcs1Padding")) {
- // empty
+ if (lowerPadding.equals("pkcs1padding")) {
+ padType = PAD_PKCS1;
+ } else if (lowerPadding.equals("nopadding")) {
+ padType = PAD_NONE;
} else {
throw new NoSuchPaddingException("Unsupported padding " + padding);
}
@@ -209,7 +219,8 @@ final class P11RSACipher extends CipherSpi {
int n = (p11Key.keyLength() + 7) >> 3;
outputSize = n;
buffer = new byte[n];
- maxInputSize = encrypt ? (n - PKCS1_MIN_PADDING_LENGTH) : n;
+ maxInputSize = ((padType == PAD_PKCS1 && encrypt) ?
+ (n - PKCS1_MIN_PADDING_LENGTH) : n);
try {
initialize();
} catch (PKCS11Exception e) {
diff --git a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
index d1a1db3defd..d54c5617309 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -627,8 +627,10 @@ public final class SunPKCS11 extends AuthProvider {
m(CKM_BLOWFISH_CBC));
// XXX RSA_X_509, RSA_OAEP not yet supported
- d(CIP, "RSA/ECB/PKCS1Padding", P11RSACipher,
+ d(CIP, "RSA/ECB/PKCS1Padding", P11RSACipher, s("RSA"),
m(CKM_RSA_PKCS));
+ d(CIP, "RSA/ECB/NoPadding", P11RSACipher,
+ m(CKM_RSA_X_509));
d(SIG, "RawDSA", P11Signature, s("NONEwithDSA"),
m(CKM_DSA));
diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java
index f1adba35d23..4f27ff5de0c 100644
--- a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4898468
+ * @bug 4898468 6994008
* @summary basic test for RSA cipher
* @author Andreas Sterbenz
* @library ..
@@ -38,9 +38,12 @@ import javax.crypto.*;
public class TestRSACipher extends PKCS11Test {
+ private static final String[] RSA_ALGOS =
+ { "RSA/ECB/PKCS1Padding", "RSA" };
+
public void main(Provider p) throws Exception {
try {
- Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
+ Cipher.getInstance(RSA_ALGOS[0], p);
} catch (GeneralSecurityException e) {
System.out.println("Not supported by provider, skipping");
return;
@@ -55,57 +58,58 @@ public class TestRSACipher extends PKCS11Test {
b = new byte[16];
random.nextBytes(b);
- Cipher c1 = Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
- Cipher c2 = Cipher.getInstance("RSA/ECB/PKCS1Padding", "SunJCE");
+ for (String rsaAlgo: RSA_ALGOS) {
+ Cipher c1 = Cipher.getInstance(rsaAlgo, p);
+ Cipher c2 = Cipher.getInstance(rsaAlgo, "SunJCE");
- c1.init(Cipher.ENCRYPT_MODE, publicKey);
- e = c1.doFinal(b);
- c1.init(Cipher.DECRYPT_MODE, privateKey);
- d = c1.doFinal(e);
- match(b, d);
- c2.init(Cipher.DECRYPT_MODE, privateKey);
- d = c2.doFinal(e);
- match(b, d);
-
- // invalid data
- c1.init(Cipher.DECRYPT_MODE, publicKey);
- try {
+ c1.init(Cipher.ENCRYPT_MODE, publicKey);
+ e = c1.doFinal(b);
+ c1.init(Cipher.DECRYPT_MODE, privateKey);
d = c1.doFinal(e);
- throw new Exception("completed call");
- } catch (BadPaddingException ee) {
- ee.printStackTrace();
- }
+ match(b, d);
+ c2.init(Cipher.DECRYPT_MODE, privateKey);
+ d = c2.doFinal(e);
+ match(b, d);
- c1.init(Cipher.ENCRYPT_MODE, privateKey);
- e = c1.doFinal(b);
- c1.init(Cipher.DECRYPT_MODE, publicKey);
- d = c1.doFinal(e);
- match(b, d);
- c2.init(Cipher.DECRYPT_MODE, publicKey);
- d = c2.doFinal(e);
- match(b, d);
+ // invalid data
+ c1.init(Cipher.DECRYPT_MODE, publicKey);
+ try {
+ d = c1.doFinal(e);
+ throw new Exception("completed call");
+ } catch (BadPaddingException ee) {
+ ee.printStackTrace();
+ }
- // reinit tests
- c1.init(Cipher.ENCRYPT_MODE, privateKey);
- c1.init(Cipher.ENCRYPT_MODE, privateKey);
- e = c1.doFinal(b);
- e = c1.doFinal(b);
- c1.update(b);
- c1.update(b);
- c1.init(Cipher.ENCRYPT_MODE, privateKey);
- e = c1.doFinal();
- e = c1.doFinal();
- c1.update(b);
- e = c1.doFinal();
+ c1.init(Cipher.ENCRYPT_MODE, privateKey);
+ e = c1.doFinal(b);
+ c1.init(Cipher.DECRYPT_MODE, publicKey);
+ d = c1.doFinal(e);
+ match(b, d);
+ c2.init(Cipher.DECRYPT_MODE, publicKey);
+ d = c2.doFinal(e);
+ match(b, d);
- c1.update(new byte[256]);
- try {
+ // reinit tests
+ c1.init(Cipher.ENCRYPT_MODE, privateKey);
+ c1.init(Cipher.ENCRYPT_MODE, privateKey);
+ e = c1.doFinal(b);
+ e = c1.doFinal(b);
+ c1.update(b);
+ c1.update(b);
+ c1.init(Cipher.ENCRYPT_MODE, privateKey);
+ e = c1.doFinal();
+ e = c1.doFinal();
+ c1.update(b);
e = c1.doFinal();
- throw new Exception("completed call");
- } catch (IllegalBlockSizeException ee) {
- System.out.println(ee);
- }
+ c1.update(new byte[256]);
+ try {
+ e = c1.doFinal();
+ throw new Exception("completed call");
+ } catch (IllegalBlockSizeException ee) {
+ System.out.println(ee);
+ }
+ }
}
private static void match(byte[] b1, byte[] b2) throws Exception {
diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
index 159bb50a029..c00b39942cc 100644
--- a/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 6572331
+ * @bug 6572331 6994008
* @summary basic test for RSA cipher key wrapping functionality
* @author Valerie Peng
* @library ..
@@ -38,47 +38,48 @@ import javax.crypto.spec.SecretKeySpec;
public class TestRSACipherWrap extends PKCS11Test {
- private static final String RSA_ALGO = "RSA/ECB/PKCS1Padding";
+ private static final String[] RSA_ALGOS =
+ { "RSA/ECB/PKCS1Padding", "RSA" };
public void main(Provider p) throws Exception {
try {
- Cipher.getInstance(RSA_ALGO, p);
+ Cipher.getInstance(RSA_ALGOS[0], p);
} catch (GeneralSecurityException e) {
- System.out.println("Not supported by provider, skipping");
+ System.out.println(RSA_ALGOS[0] + " unsupported, skipping");
return;
}
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
kpg.initialize(1024);
KeyPair kp = kpg.generateKeyPair();
- PublicKey publicKey = kp.getPublic();
- PrivateKey privateKey = kp.getPrivate();
- Cipher cipherPKCS11 = Cipher.getInstance(RSA_ALGO, p);
- Cipher cipherJce = Cipher.getInstance(RSA_ALGO, "SunJCE");
+ for (String rsaAlgo: RSA_ALGOS) {
+ Cipher cipherPKCS11 = Cipher.getInstance(rsaAlgo, p);
+ Cipher cipherJce = Cipher.getInstance(rsaAlgo, "SunJCE");
- String algos[] = {"AES", "RC2", "Blowfish"};
- int keySizes[] = {128, 256};
+ String algos[] = {"AES", "RC2", "Blowfish"};
+ int keySizes[] = {128, 256};
- for (int j = 0; j < algos.length; j++) {
- String algorithm = algos[j];
- KeyGenerator keygen =
+ for (int j = 0; j < algos.length; j++) {
+ String algorithm = algos[j];
+ KeyGenerator keygen =
KeyGenerator.getInstance(algorithm);
- for (int i = 0; i < keySizes.length; i++) {
- SecretKey secretKey = null;
- System.out.print("Generate " + keySizes[i] + "-bit " +
+ for (int i = 0; i < keySizes.length; i++) {
+ SecretKey secretKey = null;
+ System.out.print("Generate " + keySizes[i] + "-bit " +
algorithm + " key using ");
- try {
- keygen.init(keySizes[i]);
- secretKey = keygen.generateKey();
- System.out.println(keygen.getProvider().getName());
- } catch (InvalidParameterException ipe) {
- secretKey = new SecretKeySpec(new byte[32], algorithm);
- System.out.println("SecretKeySpec class");
+ try {
+ keygen.init(keySizes[i]);
+ secretKey = keygen.generateKey();
+ System.out.println(keygen.getProvider().getName());
+ } catch (InvalidParameterException ipe) {
+ secretKey = new SecretKeySpec(new byte[32], algorithm);
+ System.out.println("SecretKeySpec class");
+ }
+ test(kp, secretKey, cipherPKCS11, cipherJce);
+ test(kp, secretKey, cipherPKCS11, cipherPKCS11);
+ test(kp, secretKey, cipherJce, cipherPKCS11);
}
- test(kp, secretKey, cipherPKCS11, cipherJce);
- test(kp, secretKey, cipherPKCS11, cipherPKCS11);
- test(kp, secretKey, cipherJce, cipherPKCS11);
}
}
}
diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java b/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java
new file mode 100644
index 00000000000..d1dd0206031
--- /dev/null
+++ b/jdk/test/sun/security/pkcs11/Cipher/TestRawRSACipher.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 6994008
+ * @summary basic test for RSA/ECB/NoPadding cipher
+ * @author Valerie Peng
+ * @library ..
+ */
+
+import javax.crypto.*;
+import java.io.*;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.*;
+import java.util.*;
+
+public class TestRawRSACipher extends PKCS11Test {
+
+ public void main(Provider p) throws Exception {
+ try {
+ Cipher.getInstance("RSA/ECB/NoPadding", p);
+ } catch (GeneralSecurityException e) {
+ System.out.println("Not supported by provider, skipping");
+ return;
+ }
+
+ final int KEY_LEN = 1024;
+ KeyPairGenerator kpGen = KeyPairGenerator.getInstance("RSA", p);
+ kpGen.initialize(KEY_LEN);
+ KeyPair kp = kpGen.generateKeyPair();
+ Random random = new Random();
+ byte[] plainText, cipherText, recoveredText;
+ plainText = new byte[KEY_LEN/8];
+ random.nextBytes(plainText);
+ plainText[0] = 0; // to ensure that it's less than modulus
+
+ Cipher c1 = Cipher.getInstance("RSA/ECB/NoPadding", p);
+ Cipher c2 = Cipher.getInstance("RSA/ECB/NoPadding", "SunJCE");
+
+ c1.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+ c2.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+
+ cipherText = c1.doFinal(plainText);
+ recoveredText = c2.doFinal(cipherText);
+ if (!Arrays.equals(plainText, recoveredText)) {
+ throw new RuntimeException("E/D Test against SunJCE Failed!");
+ }
+
+ c2.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+ c1.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+ cipherText = c2.doFinal(plainText);
+ recoveredText = c1.doFinal(cipherText);
+ if (!Arrays.equals(plainText, recoveredText)) {
+ throw new RuntimeException("D/E Test against SunJCE Failed!");
+ }
+
+ System.out.println("Test Passed");
+ }
+
+ public static void main(String[] args) throws Exception {
+ main(new TestRawRSACipher());
+ }
+}
From a36a5ce5999ad092e47a9bbdfa1534422bdc2362 Mon Sep 17 00:00:00 2001
From: Alan Bateman
Date: Tue, 8 Mar 2011 10:32:18 +0000
Subject: [PATCH 77/91] 7025468: Tests using diamond with anonymous inner
classes needs to be reverted
Reviewed-by: dholmes, forax
---
jdk/test/java/nio/file/DirectoryStream/Basic.java | 2 +-
jdk/test/java/util/PriorityQueue/NoNulls.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/jdk/test/java/nio/file/DirectoryStream/Basic.java b/jdk/test/java/nio/file/DirectoryStream/Basic.java
index 69f5d18f656..ec9d68ffd17 100644
--- a/jdk/test/java/nio/file/DirectoryStream/Basic.java
+++ b/jdk/test/java/nio/file/DirectoryStream/Basic.java
@@ -69,7 +69,7 @@ public class Basic {
throw new RuntimeException("entry not found");
// check filtering: f* should match foo
- DirectoryStream.Filter filter = new DirectoryStream.Filter<>() {
+ DirectoryStream.Filter filter = new DirectoryStream.Filter() {
private PathMatcher matcher =
dir.getFileSystem().getPathMatcher("glob:f*");
public boolean accept(Path file) {
diff --git a/jdk/test/java/util/PriorityQueue/NoNulls.java b/jdk/test/java/util/PriorityQueue/NoNulls.java
index a56259a8ae0..21f76876b4c 100644
--- a/jdk/test/java/util/PriorityQueue/NoNulls.java
+++ b/jdk/test/java/util/PriorityQueue/NoNulls.java
@@ -53,7 +53,7 @@ import java.util.concurrent.PriorityBlockingQueue;
public class NoNulls {
void test(String[] args) throws Throwable {
final Comparator nullTolerantComparator
- = new Comparator<>() {
+ = new Comparator() {
public int compare(String x, String y) {
return (x == null ? -1 :
y == null ? 1 :
@@ -65,7 +65,7 @@ public class NoNulls {
nullSortedSet.add(null);
final PriorityQueue nullPriorityQueue
- = new PriorityQueue<>() {
+ = new PriorityQueue() {
public Object[] toArray() { return new Object[] { null };}};
final Collection nullCollection = new ArrayList<>();
From 71bd8c66ee0c9dcb9238e56d5dd1978c7f5104b5 Mon Sep 17 00:00:00 2001
From: Abhijit Saha
Date: Wed, 9 Mar 2011 16:44:27 -0800
Subject: [PATCH 78/91] 6908562: JFB Custom Revision Version Build/Makefile
changes
Reviewed-by: ohair, ksrini, katleman
---
jdk/make/common/Release.gmk | 13 ++++++++++---
jdk/make/common/shared/Defs.gmk | 6 +++++-
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk
index d9872bcc71c..a64bdacfedc 100644
--- a/jdk/make/common/Release.gmk
+++ b/jdk/make/common/Release.gmk
@@ -62,7 +62,8 @@ EXCLUDE_PROPWARN_PKGS += sun.dyn
# This is an interim solution until the ct.sym is replaced
# with a new module system (being discussed for JDK 7).
#
-EXPORTED_PRIVATE_PKGS = com.sun.servicetag
+EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
+ com.oracle.net
# 64-bit solaris has a few special cases. We define the variable
# SOLARIS64 for use in this Makefile to easily test those cases
@@ -86,8 +87,14 @@ ifdef OPENJDK
IMAGE_DOCLIST_JRE = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
else
# Where to find these files
- SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
- SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
+ ifeq ($(J4B), true)
+ SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdkfb
+ SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jrefb
+ else
+ SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
+ SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
+ endif
+
IMAGE_DOCLIST_JDK = COPYRIGHT README.html THIRDPARTYLICENSEREADME.txt
IMAGE_DOCLIST_JRE = COPYRIGHT Welcome.html THIRDPARTYLICENSEREADME.txt
ifeq ($(PLATFORM), windows)
diff --git a/jdk/make/common/shared/Defs.gmk b/jdk/make/common/shared/Defs.gmk
index 587f1ad1911..cfc889a0148 100644
--- a/jdk/make/common/shared/Defs.gmk
+++ b/jdk/make/common/shared/Defs.gmk
@@ -218,7 +218,11 @@ ifdef OPENJDK
else
LAUNCHER_NAME = java
PRODUCT_NAME = Java(TM)
- PRODUCT_SUFFIX = SE Runtime Environment
+ ifeq ($(J4B), true)
+ PRODUCT_SUFFIX = SE Runtime Environment for Business
+ else
+ PRODUCT_SUFFIX = SE Runtime Environment
+ endif
JDK_RC_PLATFORM_NAME = Platform SE
COMPANY_NAME = Oracle Corporation
endif
From 3e459d7a5d94b4fef5b212265979014c76af3014 Mon Sep 17 00:00:00 2001
From: Mandy Chung
Date: Wed, 9 Mar 2011 23:11:07 -0800
Subject: [PATCH 79/91] 7025631: Remove the modules build support from jdk 7
Reviewed-by: alanb, ohair
---
jdk/make/Makefile | 2 -
jdk/make/com/sun/crypto/provider/Makefile | 2 +-
jdk/make/com/sun/java/pack/Makefile | 2 -
jdk/make/com/sun/java/pack/prop/Makefile | 1 -
jdk/make/com/sun/jndi/cosnaming/Makefile | 1 -
jdk/make/com/sun/jndi/dns/Makefile | 1 -
jdk/make/com/sun/jndi/ldap/Makefile | 1 -
jdk/make/com/sun/jndi/rmi/registry/Makefile | 1 -
jdk/make/com/sun/nio/sctp/Makefile | 1 -
jdk/make/com/sun/org/apache/xml/Makefile | 1 -
jdk/make/com/sun/rowset/Makefile | 1 -
jdk/make/com/sun/script/Makefile | 1 -
.../com/sun/security/auth/module/Makefile | 1 -
jdk/make/com/sun/servicetag/Makefile | 1 -
jdk/make/com/sun/tools/attach/Makefile | 4 +-
jdk/make/common/Defs.gmk | 71 +-----------
jdk/make/common/Demo.gmk | 2 -
jdk/make/common/Library.gmk | 10 --
jdk/make/common/Program.gmk | 1 -
jdk/make/common/Release.gmk | 2 +-
jdk/make/common/Sanity.gmk | 3 +-
jdk/make/common/Subdirs.gmk | 102 ++++--------------
jdk/make/common/shared/Sanity.gmk | 22 +---
jdk/make/java/awt/Makefile | 1 -
jdk/make/java/fdlibm/Makefile | 1 -
jdk/make/java/instrument/Makefile | 1 -
jdk/make/java/java/Makefile | 6 +-
jdk/make/java/java_crw_demo/Makefile | 1 -
jdk/make/java/java_hprof_demo/Makefile | 1 -
jdk/make/java/jli/Makefile | 1 -
jdk/make/java/jvm/Makefile | 5 +-
jdk/make/java/logging/Makefile | 1 -
jdk/make/java/main/java/Makefile | 1 -
jdk/make/java/main/javaw/Makefile | 1 -
jdk/make/java/management/Makefile | 1 -
jdk/make/java/net/Makefile | 1 -
jdk/make/java/nio/Makefile | 7 +-
jdk/make/java/npt/Makefile | 1 -
jdk/make/java/redist/Makefile | 9 +-
jdk/make/java/redist/fonts/Makefile | 1 -
jdk/make/java/redist/sajdi/Makefile | 1 -
jdk/make/java/security/Makefile | 1 -
jdk/make/java/sql/Makefile | 1 -
jdk/make/java/text/base/Makefile | 1 -
jdk/make/java/verify/Makefile | 1 -
jdk/make/java/zip/Makefile | 1 -
jdk/make/javax/crypto/Makefile | 18 +---
jdk/make/javax/imageio/Makefile | 1 -
jdk/make/javax/print/Makefile | 1 -
jdk/make/javax/sound/Makefile | 1 -
jdk/make/javax/sound/jsoundalsa/Makefile | 1 -
jdk/make/javax/sound/jsoundds/Makefile | 1 -
jdk/make/javax/sql/Makefile | 1 -
jdk/make/javax/swing/Makefile | 1 -
jdk/make/javax/swing/plaf/Makefile | 1 -
jdk/make/jpda/back/Makefile | 1 -
jdk/make/jpda/transport/Makefile | 1 -
jdk/make/jpda/transport/shmem/Makefile | 1 -
jdk/make/jpda/transport/socket/Makefile | 1 -
jdk/make/jpda/tty/Makefile | 1 -
jdk/make/launchers/Makefile | 2 -
jdk/make/mkdemo/jvmti/Makefile | 1 -
jdk/make/mkdemo/management/Makefile | 1 -
jdk/make/mksample/dtrace/Makefile | 1 -
jdk/make/mksample/jmx/jmx-scandir/Makefile | 1 -
jdk/make/mksample/nbproject/Makefile | 1 -
jdk/make/mksample/nio/file/Makefile | 1 -
jdk/make/mksample/nio/multicast/Makefile | 1 -
jdk/make/mksample/nio/server/Makefile | 1 -
.../mksample/scripting/scriptpad/Makefile | 1 -
.../mksample/webservices/EbayClient/Makefile | 1 -
.../mksample/webservices/EbayServer/Makefile | 1 -
jdk/make/sun/applet/Makefile | 1 -
jdk/make/sun/awt/Makefile | 2 -
jdk/make/sun/cmm/Makefile | 1 -
jdk/make/sun/cmm/kcms/Makefile | 1 -
jdk/make/sun/cmm/lcms/Makefile | 1 -
jdk/make/sun/dcpr/Makefile | 1 -
jdk/make/sun/font/Makefile | 2 -
jdk/make/sun/font/t2k/Makefile | 1 -
jdk/make/sun/headless/Makefile | 1 -
jdk/make/sun/image/generic/Makefile | 1 -
jdk/make/sun/image/vis/Makefile | 1 -
jdk/make/sun/jar/Makefile | 1 -
jdk/make/sun/javazic/Makefile | 2 -
jdk/make/sun/jawt/Makefile | 1 -
jdk/make/sun/jconsole/Makefile | 1 -
jdk/make/sun/jdbc/Makefile | 1 -
jdk/make/sun/jdga/Makefile | 1 -
jdk/make/sun/jpeg/Makefile | 1 -
jdk/make/sun/launcher/Makefile | 1 -
jdk/make/sun/management/Makefile | 1 -
jdk/make/sun/native2ascii/Makefile | 1 -
jdk/make/sun/net/others/Makefile | 1 -
jdk/make/sun/net/spi/nameservice/dns/Makefile | 1 -
jdk/make/sun/nio/cs/Makefile | 1 -
jdk/make/sun/org/mozilla/javascript/Makefile | 1 -
jdk/make/sun/pisces/Makefile | 1 -
jdk/make/sun/rmi/cgi/Makefile | 1 -
jdk/make/sun/rmi/oldtools/Makefile | 1 -
jdk/make/sun/rmi/registry/Makefile | 1 -
jdk/make/sun/rmi/rmi/Makefile | 1 -
jdk/make/sun/rmi/rmic/Makefile | 1 -
jdk/make/sun/rmi/rmid/Makefile | 1 -
jdk/make/sun/security/ec/Makefile | 3 +-
jdk/make/sun/security/jgss/wrapper/Makefile | 1 -
jdk/make/sun/security/krb5/Makefile | 1 -
jdk/make/sun/security/mscapi/Makefile | 3 +-
jdk/make/sun/security/pkcs11/Makefile | 3 +-
jdk/make/sun/security/smartcardio/Makefile | 1 -
jdk/make/sun/security/tools/Makefile | 1 -
jdk/make/sun/serialver/Makefile | 1 -
jdk/make/sun/splashscreen/Makefile | 1 -
jdk/make/sun/text/Makefile | 1 -
jdk/make/sun/tools/Makefile | 1 -
jdk/make/sun/tracing/dtrace/Makefile | 1 -
jdk/make/sun/xawt/Makefile | 1 -
117 files changed, 45 insertions(+), 333 deletions(-)
diff --git a/jdk/make/Makefile b/jdk/make/Makefile
index 74651fca20b..afcdda1ee29 100644
--- a/jdk/make/Makefile
+++ b/jdk/make/Makefile
@@ -74,7 +74,6 @@ import -- copy in the pre-built components (e.g. VM) \n\
import_product -- copy in the product components \n\
import_fastdebug -- copy in the fastdebug components \n\
import_debug -- copy in the debug components \n\
-modules -- build the jdk and jre module images (experimental) \n\
create_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\
"
@@ -261,7 +260,6 @@ docs:: sanity-docs post-sanity-docs
# Release engineering targets.
#
include $(BUILDDIR)/common/Release.gmk
-include $(BUILDDIR)/common/Modules.gmk
#
# Cscope targets.
diff --git a/jdk/make/com/sun/crypto/provider/Makefile b/jdk/make/com/sun/crypto/provider/Makefile
index 3df93501c55..f52fb576fc6 100644
--- a/jdk/make/com/sun/crypto/provider/Makefile
+++ b/jdk/make/com/sun/crypto/provider/Makefile
@@ -249,7 +249,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunjce_provider.jar
else
$(JAR_DESTFILE): $(SIGNED_DIR)/sunjce_provider.jar
endif
- $(install-non-module-file)
+ $(install-file)
ifndef OPENJDK
install-prebuilt:
diff --git a/jdk/make/com/sun/java/pack/Makefile b/jdk/make/com/sun/java/pack/Makefile
index e7fe8d44b76..0e73e055621 100644
--- a/jdk/make/com/sun/java/pack/Makefile
+++ b/jdk/make/com/sun/java/pack/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../..
-MODULE = pack200
PACKAGE = com.sun.java.util.jar.pack
LIBRARY = unpack
PRODUCT = sun
@@ -156,7 +155,6 @@ ifdef MT
endif
$(CP) $(TEMPDIR)/unpack200$(EXE_SUFFIX) $(UNPACK_EXE)
@$(call binary_file_verification,$@)
- $(install-module-file)
ifeq ($(PLATFORM), windows)
$(RES):: $(VERSIONINFO_RESOURCE)
diff --git a/jdk/make/com/sun/java/pack/prop/Makefile b/jdk/make/com/sun/java/pack/prop/Makefile
index 7f8ac7f76cc..b023d0505fd 100644
--- a/jdk/make/com/sun/java/pack/prop/Makefile
+++ b/jdk/make/com/sun/java/pack/prop/Makefile
@@ -29,7 +29,6 @@
# to a collision of rules with Classes.gmk and Library.gmk
BUILDDIR = ../../../../..
-MODULE = pack200
PACKAGE = com.sun.java.util.jar.pack
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/jndi/cosnaming/Makefile b/jdk/make/com/sun/jndi/cosnaming/Makefile
index 73a64ecd846..17425dba5f7 100644
--- a/jdk/make/com/sun/jndi/cosnaming/Makefile
+++ b/jdk/make/com/sun/jndi/cosnaming/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../..
-MODULE = jndi-cosnaming
PACKAGE = com.sun.jndi.cosnaming
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/jndi/dns/Makefile b/jdk/make/com/sun/jndi/dns/Makefile
index ccb98d84837..4b34bdafaa9 100644
--- a/jdk/make/com/sun/jndi/dns/Makefile
+++ b/jdk/make/com/sun/jndi/dns/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../..
-MODULE = jndi-dns
PACKAGE = com.sun.jndi.dns
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/jndi/ldap/Makefile b/jdk/make/com/sun/jndi/ldap/Makefile
index eaf663841c7..5b74b910167 100644
--- a/jdk/make/com/sun/jndi/ldap/Makefile
+++ b/jdk/make/com/sun/jndi/ldap/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../..
-MODULE = jndi-ldap
PACKAGE = com.sun.jndi.ldap
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/jndi/rmi/registry/Makefile b/jdk/make/com/sun/jndi/rmi/registry/Makefile
index 1138bc94bd8..d8b3e6b512c 100644
--- a/jdk/make/com/sun/jndi/rmi/registry/Makefile
+++ b/jdk/make/com/sun/jndi/rmi/registry/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../../..
-MODULE = jndi-rmiregistry
PACKAGE = com.sun.jndi.rmi.registry
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/nio/sctp/Makefile b/jdk/make/com/sun/nio/sctp/Makefile
index a3d9d0db477..975776889e8 100644
--- a/jdk/make/com/sun/nio/sctp/Makefile
+++ b/jdk/make/com/sun/nio/sctp/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../..
-MODULE = sctp
PACKAGE = com.sun.nio.sctp
LIBRARY = sctp
PRODUCT = sun
diff --git a/jdk/make/com/sun/org/apache/xml/Makefile b/jdk/make/com/sun/org/apache/xml/Makefile
index 195c9089308..dc0f4831722 100644
--- a/jdk/make/com/sun/org/apache/xml/Makefile
+++ b/jdk/make/com/sun/org/apache/xml/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../../..
-MODULE = security-xmldsig
PACKAGE = com.sun.org.apache.xml
PRODUCT = xml
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/rowset/Makefile b/jdk/make/com/sun/rowset/Makefile
index 3a73d987827..672aecef30d 100644
--- a/jdk/make/com/sun/rowset/Makefile
+++ b/jdk/make/com/sun/rowset/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = jdbc-enterprise
PACKAGE = com.sun.rowset
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/script/Makefile b/jdk/make/com/sun/script/Makefile
index e30127e1b67..1554d1f5936 100644
--- a/jdk/make/com/sun/script/Makefile
+++ b/jdk/make/com/sun/script/Makefile
@@ -25,7 +25,6 @@
BUILDDIR = ../../..
-MODULE = scripting-rhino
PACKAGE = com.sun.script
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/security/auth/module/Makefile b/jdk/make/com/sun/security/auth/module/Makefile
index 0de24cd7be3..b53e1b307f3 100644
--- a/jdk/make/com/sun/security/auth/module/Makefile
+++ b/jdk/make/com/sun/security/auth/module/Makefile
@@ -26,7 +26,6 @@
# Makefile for building auth modules.
BUILDDIR = ../../../../..
-MODULE = security-auth
PACKAGE = com.sun.security.auth.module
PRODUCT = sun
diff --git a/jdk/make/com/sun/servicetag/Makefile b/jdk/make/com/sun/servicetag/Makefile
index a0d384d4f90..d647fc8df90 100644
--- a/jdk/make/com/sun/servicetag/Makefile
+++ b/jdk/make/com/sun/servicetag/Makefile
@@ -22,7 +22,6 @@
# questions.
BUILDDIR = ../../..
-MODULE = servicetag
PACKAGE = com.sun.servicetag
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/com/sun/tools/attach/Makefile b/jdk/make/com/sun/tools/attach/Makefile
index 100562c9363..0fa41d9d9ca 100644
--- a/jdk/make/com/sun/tools/attach/Makefile
+++ b/jdk/make/com/sun/tools/attach/Makefile
@@ -25,7 +25,6 @@
BUILDDIR = ../../../..
-MODULE = attach
PACKAGE = com.sun.tools.attach
LIBRARY = attach
PRODUCT = sun
@@ -66,8 +65,7 @@ $(SERVICEDIR)/%: $(SHARE_SRC)/classes/sun/tools/attach/META-INF/services/%
@$(MKDIR) -p $(@D)
@$(RM) $@
@$(CAT) $< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $@
- @$(install-module-file)
-
+
.PHONY: copy-files
diff --git a/jdk/make/common/Defs.gmk b/jdk/make/common/Defs.gmk
index 6854d4e8708..ebd619798a9 100644
--- a/jdk/make/common/Defs.gmk
+++ b/jdk/make/common/Defs.gmk
@@ -224,9 +224,6 @@ INCLUDEDIR = $(OUTPUTDIR)/include
# for generated class files
CLASSBINDIR = $(OUTPUTDIR)/classes
DEMOCLASSDIR = $(OUTPUTDIR)/democlasses
-# for modules
-MODULES_DIR = $(OUTPUTDIR)/modules
-ABS_MODULES_DIR = $(ABS_OUTPUTDIR)/modules
# for generated tool class files
BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses
# for build tool jar files
@@ -297,22 +294,6 @@ ifneq ($(LIBRARY),)
endif
endif
-#
-# Build units may or may not define MODULE. Default to "other".
-#
-# MODULE variable defines the lowest-level module name that
-# might or might not be the name of the modules created in
-# the modules build (see make/modules/modules.config and
-# modules.group).
-#
-MODULES_TEMPDIR = $(OUTPUTDIR)/tmp/modules
-ABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modules
-
-ifndef MODULE
- MODULE = other
-endif
-override MODULE_DEST_DIR = $(MODULES_TEMPDIR)/$(MODULE)
-
# the use of += above makes a space separated list which we need to
# remove for filespecs.
#
@@ -422,52 +403,13 @@ PKGDIR = $(subst .,/,$(PACKAGE))
#
include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
-#
-# Macros to find the module that $@ belongs to
-#
-
UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
-MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \
- -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \
- -e 's%.*\/lib\/%lib\/%' \
- -e 's%.*\/bin\/%bin\/%' \
- -e 's%.*\/include\/%include\/%' \
- -e 's%.*\/demo\/%demo\/%' \
- -e 's%.*\/sample\/%sample\/%'
-
-# Install a file to its module
-define install-module-file
-dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
-$(CP) -f $@ $(MODULE_DEST_DIR)/$$dest
-endef
-
-# Install all files from the directory to its module
-define install-module-dir
-dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
-$(CP) -rf $(@D)/* $(MODULE_DEST_DIR)/$$dest
-endef
-
-# chmod the file in its module
-define chmod-module-file
-dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(CHMOD) $1 $(MODULE_DEST_DIR)/$$dest
-endef
-
-# install a sym link in its module
-define install-module-sym-link
-dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(LN) -sf $1 $(MODULE_DEST_DIR)/$$dest
-endef
-
# Run MAKE $@ for a launcher:
# $(call make-launcher, name, mainclass, java-args, main-args)
define make-launcher
$(CD) $(BUILDDIR)/launchers && \
$(MAKE) -f Makefile.launcher \
- MODULE=$(MODULE) \
PROGRAM=$(strip $1) \
MAIN_CLASS=$(strip $2) \
MAIN_JAVA_ARGS="$(strip $3)" \
@@ -488,28 +430,18 @@ endef
define install-file
$(prep-target)
$(CP) $< $@
-@$(install-module-file)
endef
define chmod-file
$(CHMOD) $1 $@
-@$(call chmod-module-file, $1)
endef
define install-sym-link
$(LN) -s $1 $@
-@$(call install-module-sym-link, $1)
-endef
-
-#
-# Marcos for files not belonging to any module
-define install-non-module-file
-$(prep-target)
-$(CP) $< $@
endef
define install-manifest-file
-$(install-non-module-file)
+$(install-file)
endef
# Cleanup rule for after debug java run (hotspot.log file is left around)
@@ -577,7 +509,6 @@ endef
define install-import-file
$(install-importonly-file)
-@$(install-module-file)
endef
.PHONY: all build clean clobber
diff --git a/jdk/make/common/Demo.gmk b/jdk/make/common/Demo.gmk
index 24ee29f0ba5..576f8103428 100644
--- a/jdk/make/common/Demo.gmk
+++ b/jdk/make/common/Demo.gmk
@@ -25,8 +25,6 @@
# JDK Demo building jar file.
-MODULE = demos
-
# Some names are defined with LIBRARY inside the Defs.gmk file
LIBRARY=$(DEMONAME)
OBJDIR=$(TEMPDIR)/$(DEMONAME)
diff --git a/jdk/make/common/Library.gmk b/jdk/make/common/Library.gmk
index 5fbed139ce5..e7a24d477ff 100644
--- a/jdk/make/common/Library.gmk
+++ b/jdk/make/common/Library.gmk
@@ -168,18 +168,9 @@ $(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lcf
$(OTHER_LCF) $(JAVALIB) $(LDLIBS)
$(CP) $(OBJDIR)/$(@F) $@
@$(call binary_file_verification,$@)
- $(install-module-file)
$(CP) $(OBJDIR)/$(LIBRARY).map $(@D)
$(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D)
-$(ACTUAL_LIBRARY):: $(ACTUAL_LIBRARY_DIR)/$(LIBRARY).map $(ACTUAL_LIBRARY_DIR)/$(LIBRARY).pdb
-
-$(ACTUAL_LIBRARY_DIR)/%.map: FORCE
- $(install-module-file)
-
-$(ACTUAL_LIBRARY_DIR)/%.pdb: FORCE
- $(install-module-file)
-
endif # LIBRARY
$(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m)
@@ -235,7 +226,6 @@ ifeq ($(LIBRARY), fdlibm)
else # LIBRARY
$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
@$(call binary_file_verification,$@)
- $(install-module-file)
ifeq ($(WRITE_LIBVERSION),true)
$(MCS) -d -a "$(FULL_VERSION)" $@
endif # WRITE_LIBVERSION
diff --git a/jdk/make/common/Program.gmk b/jdk/make/common/Program.gmk
index 5700e32c89d..040bcc50719 100644
--- a/jdk/make/common/Program.gmk
+++ b/jdk/make/common/Program.gmk
@@ -186,7 +186,6 @@ $(ACTUAL_PROGRAM):: $(FILES_o)
$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
$(FILES_o) $(THREADLIBS) $(LDLIBS)
@$(call binary_file_verification,$@)
- $(install-module-file)
endif # PLATFORM
diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk
index d9872bcc71c..275664d4e5a 100644
--- a/jdk/make/common/Release.gmk
+++ b/jdk/make/common/Release.gmk
@@ -60,7 +60,7 @@ EXCLUDE_PROPWARN_PKGS += sun.dyn
#
# Include the exported private packages in ct.sym.
# This is an interim solution until the ct.sym is replaced
-# with a new module system (being discussed for JDK 7).
+# with a new module system (being discussed for JDK 8).
#
EXPORTED_PRIVATE_PKGS = com.sun.servicetag
diff --git a/jdk/make/common/Sanity.gmk b/jdk/make/common/Sanity.gmk
index 7a01efbd51d..5060b8c12b4 100644
--- a/jdk/make/common/Sanity.gmk
+++ b/jdk/make/common/Sanity.gmk
@@ -71,8 +71,7 @@ sanity-base: pre-sanity \
sane-cacerts \
sane-ant_version \
sane-zip_version \
- sane-msvcrt_path \
- sane-build_modules
+ sane-msvcrt_path
# The rules sanity-* have a one-to-one correspondence with the major targets
# Each sanity-* rule should have no body to ensure that the post-sanity-* is the
diff --git a/jdk/make/common/Subdirs.gmk b/jdk/make/common/Subdirs.gmk
index 51d0c7f8e97..4da8acfca4e 100644
--- a/jdk/make/common/Subdirs.gmk
+++ b/jdk/make/common/Subdirs.gmk
@@ -40,9 +40,6 @@
#
# By default, subdirs specified in the SUBDIRS and all SUBDIRS_*
# variables will be built.
-#
-# BUILD_MODULES variable can be used to specify one or more groups
-# to be built (BUILD_MODULES=all will build all groups).
#
# Variables of the currently supported groups are:
# SUBDIRS_desktop
@@ -53,15 +50,12 @@
#
# Change to the above list also need to update
# make/common/shared/Sanity.gmk. NOTE: this list is subject
-# to change till the JDK 7 SE profiles/modules are finalized.
+# to change.
#
# Eventually we want to restructure the make directory
# according to these grouping (e.g. make/desktop/...) and
# the SUBDIRS_ variables would not be needed.
#
-# To build the desktop and tools groups only, you can do:
-# gnumake BUILD_MODULES="desktop tools" ...
-#
# Iterate the subdirectories specified in $1.
# - cd into each subdir and make them
@@ -96,77 +90,51 @@ endef
#
# Iterate the list specified in SUBDIRS_ only if
-# SUBDIRS_ is set and or "all" is specified
-# in the BUILD_MODULES variable
+# SUBDIRS_ is set.
#
ifdef SUBDIRS_desktop
- ifneq (,$(findstring desktop, $(BUILD_MODULES)))
- define subdirs-desktop-loop
- @$(call subdirs-group-loop,SUBDIRS_desktop)
- endef
- else
- define subdirs-desktop-loop
- endef
- endif
+ define subdirs-desktop-loop
+ @$(call subdirs-group-loop,SUBDIRS_desktop)
+ endef
else
define subdirs-desktop-loop
endef
endif # SUBDIRS_desktop
ifdef SUBDIRS_enterprise
- ifneq (,$(findstring enterprise, $(BUILD_MODULES)))
- define subdirs-enterprise-loop
- @$(call subdirs-group-loop,SUBDIRS_enterprise)
- endef
- else
- define subdirs-enterprise-loop
- endef
- endif
+ define subdirs-enterprise-loop
+ @$(call subdirs-group-loop,SUBDIRS_enterprise)
+ endef
else
define subdirs-enterprise-loop
endef
endif # SUBDIRS_enterprise
ifdef SUBDIRS_management
- ifneq (,$(findstring management, $(BUILD_MODULES)))
- define subdirs-management-loop
- @$(call subdirs-group-loop,SUBDIRS_management)
- endef
- else
- define subdirs-management-loop
- endef
- endif
+ define subdirs-management-loop
+ @$(call subdirs-group-loop,SUBDIRS_management)
+ endef
else
-define subdirs-management-loop
-endef
+ define subdirs-management-loop
+ endef
endif # SUBDIRS_management
ifdef SUBDIRS_misc
- ifneq (,$(findstring misc, $(BUILD_MODULES)))
- define subdirs-misc-loop
- @$(call subdirs-group-loop,SUBDIRS_misc)
- endef
- else
- define subdirs-misc-loop
- endef
- endif
+ define subdirs-misc-loop
+ @$(call subdirs-group-loop,SUBDIRS_misc)
+ endef
else
-define subdirs-misc-loop
-endef
+ define subdirs-misc-loop
+ endef
endif # SUBDIRS_misc
ifdef SUBDIRS_tools
- ifneq (,$(findstring tools, $(BUILD_MODULES)))
- define subdirs-tools-loop
- @$(call subdirs-group-loop,SUBDIRS_tools)
- endef
- else
- define subdirs-tools-loop
- endef
- endif
+ define subdirs-tools-loop
+ @$(call subdirs-group-loop,SUBDIRS_tools)
+ endef
else
-define subdirs-tools-loop
-endef
+ define subdirs-tools-loop
+ endef
endif # SUBDIRS_tools
#
@@ -175,30 +143,6 @@ endif # SUBDIRS_tools
SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
$(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
-ifndef BUILD_MODULES
define SUBDIRS-loop
@$(call subdirs-group-loop,SUBDIRS_all)
endef
-
-else
-
-ifneq (,$(findstring all, $(BUILD_MODULES)))
-define SUBDIRS-loop
- @$(call subdirs-group-loop,SUBDIRS_all)
-endef
-
-else # BUILD_MODULES set
-#
-# Iterate SUBDIRS and the groups specified in BUILD_MODULES
-#
-define SUBDIRS-loop
- @$(call subdirs-group-loop,SUBDIRS)
- @$(subdirs-desktop-loop)
- @$(subdirs-enterprise-loop)
- @$(subdirs-management-loop)
- @$(subdirs-misc-loop)
- @$(subdirs-tools-loop)
-endef
-
-endif
-endif # BUILD_MODULES
diff --git a/jdk/make/common/shared/Sanity.gmk b/jdk/make/common/shared/Sanity.gmk
index b2aaaec7df2..873f63cae21 100644
--- a/jdk/make/common/shared/Sanity.gmk
+++ b/jdk/make/common/shared/Sanity.gmk
@@ -221,8 +221,7 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk
sane-zip_version \
sane-unzip_version \
sane-msvcrt_path \
- sane-freetype \
- sane-build_modules
+ sane-freetype
######################################################
# check for COPYRIGHT_YEAR variable
@@ -831,21 +830,6 @@ else
sane-freetype:
endif
-######################################################
-# if specified, BUILD_MODULES must contain valid values.
-######################################################
-MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
-sane-build_modules:
-ifdef BUILD_MODULES
- @for m in $(BUILD_MODULES) ; do \
- valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
- if [ "x$$valid" = "x" ] ; then \
- $(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \
- "" >> $(ERROR_FILE); \
- fi \
- done
-endif
-
######################################################
# CUPS_HEADERS_PATH must be valid
######################################################
@@ -1126,7 +1110,7 @@ TMP_SDK_INCLUDE_GET_FULL_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
# be checked when this represents a full control build (i.e. the
# HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory).
$(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
- @$(install-non-module-file)
+ @$(install-file)
@$(RM) $@.IMPORT
@if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \
$(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \
@@ -1140,7 +1124,7 @@ $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
fi
$(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
- @$(install-non-module-file)
+ @$(install-file)
@$(RM) $@.IMPORT
@if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \
$(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \
diff --git a/jdk/make/java/awt/Makefile b/jdk/make/java/awt/Makefile
index b53d05773a5..1da8f498cfc 100644
--- a/jdk/make/java/awt/Makefile
+++ b/jdk/make/java/awt/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = awt
PACKAGE = java.awt
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/fdlibm/Makefile b/jdk/make/java/fdlibm/Makefile
index c4778af3e93..38e4bfd9f55 100644
--- a/jdk/make/java/fdlibm/Makefile
+++ b/jdk/make/java/fdlibm/Makefile
@@ -31,7 +31,6 @@
#
BUILDDIR = ../..
-MODULE = base
LIBRARY = fdlibm
PRODUCT = java
diff --git a/jdk/make/java/instrument/Makefile b/jdk/make/java/instrument/Makefile
index f63c7ae78af..a2944e73ea0 100644
--- a/jdk/make/java/instrument/Makefile
+++ b/jdk/make/java/instrument/Makefile
@@ -27,7 +27,6 @@
# agent, supporting java.lang.instrument
BUILDDIR = ../..
-MODULE = instrument
PACKAGE = sun.instrument
LIBRARY = instrument
PRODUCT = sun
diff --git a/jdk/make/java/java/Makefile b/jdk/make/java/java/Makefile
index c8cbb30ec56..9a2627096f0 100644
--- a/jdk/make/java/java/Makefile
+++ b/jdk/make/java/java/Makefile
@@ -29,7 +29,6 @@
#
BUILDDIR = ../..
-MODULE = base
PACKAGE = java.lang
LIBRARY = java
PRODUCT = java
@@ -244,7 +243,7 @@ ifneq ($(PLATFORM),windows)
$(GENSRCDIR)/java/lang/UNIXProcess.java: \
$(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.$(PLATFORM)
- $(install-non-module-file)
+ $(install-file)
clean::
$(RM) $(GENSRCDIR)/java/lang/UNIXProcess.java
@@ -318,7 +317,6 @@ $(CURDATA): \
$(BOOT_JAVA_CMD) -jar $(GENERATECURRENCYDATA_JARFILE) -o $@.temp \
< $(SHARE_SRC)/classes/java/util/CurrencyData.properties
$(MV) $@.temp $@
- $(install-module-file)
$(call chmod-file, 444)
clean::
@@ -373,7 +371,7 @@ $(GENSRCDIR)/java/lang/CharacterDataLatin1.java \
-usecharforbyte 11 4 1
$(GENSRCDIR)/java/lang/%.java : $(CHARACTERDATA)/%.java.template
- $(install-non-module-file)
+ $(install-file)
clean::
$(RM) $(GENSRCDIR)/java/lang/CharacterDataLatin1.java
diff --git a/jdk/make/java/java_crw_demo/Makefile b/jdk/make/java/java_crw_demo/Makefile
index c1393b97b8f..6b3732079aa 100644
--- a/jdk/make/java/java_crw_demo/Makefile
+++ b/jdk/make/java/java_crw_demo/Makefile
@@ -25,7 +25,6 @@
BUILDDIR = ../..
-MODULE = demos
LIBRARY = java_crw_demo
PRODUCT = sun
LIBRARY_OUTPUT = java_crw_demo
diff --git a/jdk/make/java/java_hprof_demo/Makefile b/jdk/make/java/java_hprof_demo/Makefile
index 99421b205a8..8ad85dc0c5b 100644
--- a/jdk/make/java/java_hprof_demo/Makefile
+++ b/jdk/make/java/java_hprof_demo/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = instrument
LIBRARY = hprof
PRODUCT = sun
LIBRARY_OUTPUT = hprof_jvmti
diff --git a/jdk/make/java/jli/Makefile b/jdk/make/java/jli/Makefile
index 928df6405f4..3a0e9100ade 100644
--- a/jdk/make/java/jli/Makefile
+++ b/jdk/make/java/jli/Makefile
@@ -30,7 +30,6 @@
# its manifestations (java, javaw, javac, ...).
#
BUILDDIR = ../..
-MODULE = base
LIBRARY = jli
PRODUCT = java
diff --git a/jdk/make/java/jvm/Makefile b/jdk/make/java/jvm/Makefile
index 9da1ef1e37f..59a520353a6 100644
--- a/jdk/make/java/jvm/Makefile
+++ b/jdk/make/java/jvm/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = base
include $(BUILDDIR)/common/Defs.gmk
@@ -39,10 +38,10 @@ FILES_h = $(INCLUDEDIR)/jni.h \
$(INCLUDEDIR)/classfile_constants.h
$(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
- $(install-non-module-file)
+ $(install-file)
$(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
- $(install-non-module-file)
+ $(install-file)
JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg
diff --git a/jdk/make/java/logging/Makefile b/jdk/make/java/logging/Makefile
index aa5e05c1022..5f9153fb7b1 100644
--- a/jdk/make/java/logging/Makefile
+++ b/jdk/make/java/logging/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = logging
PACKAGE = java.util.logging
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/main/java/Makefile b/jdk/make/java/main/java/Makefile
index 7f9e8992ad0..452099f7a91 100644
--- a/jdk/make/java/main/java/Makefile
+++ b/jdk/make/java/main/java/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = base
PROGRAM = java
PRODUCT = java
diff --git a/jdk/make/java/main/javaw/Makefile b/jdk/make/java/main/javaw/Makefile
index 920cbbc7c61..e2fc6161aa7 100644
--- a/jdk/make/java/main/javaw/Makefile
+++ b/jdk/make/java/main/javaw/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = base
PROGRAM = javaw
PRODUCT = java
diff --git a/jdk/make/java/management/Makefile b/jdk/make/java/management/Makefile
index 7330307488a..ebf3640b812 100644
--- a/jdk/make/java/management/Makefile
+++ b/jdk/make/java/management/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = management
PACKAGE = java.lang.management
LIBRARY = management
PRODUCT = java
diff --git a/jdk/make/java/net/Makefile b/jdk/make/java/net/Makefile
index bd8801e5a56..6e865fa24ec 100644
--- a/jdk/make/java/net/Makefile
+++ b/jdk/make/java/net/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = base
PACKAGE = java.net
LIBRARY = net
PRODUCT = sun
diff --git a/jdk/make/java/nio/Makefile b/jdk/make/java/nio/Makefile
index af84a82b8ac..ab5a0bdf1f0 100644
--- a/jdk/make/java/nio/Makefile
+++ b/jdk/make/java/nio/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = nio
PACKAGE = java.nio
LIBRARY = nio
PRODUCT = java
@@ -304,11 +303,7 @@ endif # PLATFORM
# Rules
#
-SUBDIRS_management = mxbean
-include $(BUILDDIR)/common/Subdirs.gmk
-
build: sources
- $(SUBDIRS-loop)
clean clobber::
$(RM) -r $(NIO_GEN) $(SNIO_GEN)
@@ -821,7 +816,7 @@ SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSOR_SRC) | \
$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
$(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
- $(install-non-module-file)
+ $(install-file)
$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
$(prep-target)
diff --git a/jdk/make/java/npt/Makefile b/jdk/make/java/npt/Makefile
index a7a8264b268..53f14aa5148 100644
--- a/jdk/make/java/npt/Makefile
+++ b/jdk/make/java/npt/Makefile
@@ -26,7 +26,6 @@
BUILDDIR = ../..
# It's currently used by jpda and hprof. Put it in base module for now.
-MODULE = base
LIBRARY = npt
PRODUCT = sun
LIBRARY_OUTPUT = npt
diff --git a/jdk/make/java/redist/Makefile b/jdk/make/java/redist/Makefile
index ad37a7b3401..13fe4e19186 100644
--- a/jdk/make/java/redist/Makefile
+++ b/jdk/make/java/redist/Makefile
@@ -35,7 +35,6 @@
#
BUILDDIR = ../..
-MODULE = base
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
@@ -122,32 +121,26 @@ $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME) $@
- @$(install-module-file)
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@
- @$(install-module-file)
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
- @$(install-module-file)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME) $@
- @$(install-module-file)
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@
- @$(install-module-file)
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME):
@$(prep-target)
-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
- @$(install-module-file)
# Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Windows
else # PLATFORM
@@ -291,7 +284,7 @@ INTERNAL_IMPORT_LIST += \
$(LIBDIR)/jce.jar: \
$(BUILDDIR)/closed/tools/crypto/jce/jce.jar
- $(install-non-module-file)
+ $(install-file)
$(LIBDIR)/security/US_export_policy.jar: \
$(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
$(install-file)
diff --git a/jdk/make/java/redist/fonts/Makefile b/jdk/make/java/redist/fonts/Makefile
index 475e5a7d2ad..6c4c2f987df 100644
--- a/jdk/make/java/redist/fonts/Makefile
+++ b/jdk/make/java/redist/fonts/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = font
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/redist/sajdi/Makefile b/jdk/make/java/redist/sajdi/Makefile
index 5044fd01592..177c757cd05 100644
--- a/jdk/make/java/redist/sajdi/Makefile
+++ b/jdk/make/java/redist/sajdi/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = sajdi
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/security/Makefile b/jdk/make/java/security/Makefile
index 1d28b60f2ff..fa87a586468 100644
--- a/jdk/make/java/security/Makefile
+++ b/jdk/make/java/security/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = base
PACKAGE = java.security
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/sql/Makefile b/jdk/make/java/sql/Makefile
index 5a4bd4f5a3b..6b71ac1644b 100644
--- a/jdk/make/java/sql/Makefile
+++ b/jdk/make/java/sql/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = jdbc-base
PACKAGE = java.sql
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/text/base/Makefile b/jdk/make/java/text/base/Makefile
index 2b754932526..d53d21b822c 100644
--- a/jdk/make/java/text/base/Makefile
+++ b/jdk/make/java/text/base/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = base
PACKAGE = java.text
PRODUCT = sun
diff --git a/jdk/make/java/verify/Makefile b/jdk/make/java/verify/Makefile
index 00f610a6491..d0399120d81 100644
--- a/jdk/make/java/verify/Makefile
+++ b/jdk/make/java/verify/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = base
PRODUCT = java
LIBRARY = verify
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/java/zip/Makefile b/jdk/make/java/zip/Makefile
index 914609cf7e1..fd83ea3f282 100644
--- a/jdk/make/java/zip/Makefile
+++ b/jdk/make/java/zip/Makefile
@@ -25,7 +25,6 @@
BUILDDIR = ../..
-MODULE = base
PACKAGE = java.util.zip
LIBRARY = zip
PRODUCT = sun
diff --git a/jdk/make/javax/crypto/Makefile b/jdk/make/javax/crypto/Makefile
index b5ceae0ed67..f2f8baed554 100644
--- a/jdk/make/javax/crypto/Makefile
+++ b/jdk/make/javax/crypto/Makefile
@@ -108,7 +108,6 @@
#
BUILDDIR = ../..
-MODULE = base
PACKAGE = javax.crypto
PRODUCT = sun
@@ -294,7 +293,7 @@ limited: \
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
- $(install-non-module-file)
+ $(install-file)
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \
policy/limited/default_local.policy \
@@ -415,7 +414,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/jce.jar
else
$(JAR_DESTFILE): $(SIGNED_DIR)/jce.jar
endif
- $(install-non-module-file)
+ $(install-file)
#
# Install the appropriate policy file, depending on the type of build.
@@ -435,7 +434,7 @@ install-limited-jars: \
$(POLICY_DESTDIR)/local_policy.jar
$(CP) $^ $(POLICY_DESTDIR)
-install-limited: install-limited-jars install-module-files
+install-limited: install-limited-jars
ifndef OPENJDK
$(release-warning)
endif
@@ -449,7 +448,7 @@ install-unlimited-jars: \
$(POLICY_DESTDIR)/local_policy.jar
$(CP) $^ $(POLICY_DESTDIR)
-install-unlimited: install-unlimited-jars install-module-files
+install-unlimited: install-unlimited-jars
ifndef OPENJDK
$(release-warning)
endif
@@ -466,16 +465,9 @@ install-prebuilt-jars:
$(PREBUILT_DIR)/jce/local_policy.jar \
$(POLICY_DESTDIR)
-install-prebuilt: install-prebuilt-jars install-module-files
+install-prebuilt: install-prebuilt-jars
endif
-install-module-files: \
- $(POLICY_DESTDIR)/US_export_policy.jar \
- $(POLICY_DESTDIR)/local_policy.jar
-
-$(POLICY_DESTDIR)/%.jar :
- $(install-module-file)
-
# =====================================================
# Support routines.
#
diff --git a/jdk/make/javax/imageio/Makefile b/jdk/make/javax/imageio/Makefile
index 1768964b098..1a64c1038ba 100644
--- a/jdk/make/javax/imageio/Makefile
+++ b/jdk/make/javax/imageio/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = imageio
PACKAGE = javax.imageio
PRODUCT = jiio
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/javax/print/Makefile b/jdk/make/javax/print/Makefile
index 863dd6611fa..290de0f4126 100644
--- a/jdk/make/javax/print/Makefile
+++ b/jdk/make/javax/print/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = print
PACKAGE = javax.print
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/javax/sound/Makefile b/jdk/make/javax/sound/Makefile
index 645b9b3a097..9a6659c41b2 100644
--- a/jdk/make/javax/sound/Makefile
+++ b/jdk/make/javax/sound/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = sound
PACKAGE = javax.sound
LIBRARY = jsound
PRODUCT = sun
diff --git a/jdk/make/javax/sound/jsoundalsa/Makefile b/jdk/make/javax/sound/jsoundalsa/Makefile
index 3fc6232c8b0..95161cd6b87 100644
--- a/jdk/make/javax/sound/jsoundalsa/Makefile
+++ b/jdk/make/javax/sound/jsoundalsa/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = sound
PACKAGE = javax.sound
LIBRARY = jsoundalsa
PRODUCT = sun
diff --git a/jdk/make/javax/sound/jsoundds/Makefile b/jdk/make/javax/sound/jsoundds/Makefile
index e731732a6c2..26c59f1ab4b 100644
--- a/jdk/make/javax/sound/jsoundds/Makefile
+++ b/jdk/make/javax/sound/jsoundds/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = sound
PACKAGE = javax.sound
LIBRARY = jsoundds
PRODUCT = sun
diff --git a/jdk/make/javax/sql/Makefile b/jdk/make/javax/sql/Makefile
index a678c21073b..91a8db6cabc 100644
--- a/jdk/make/javax/sql/Makefile
+++ b/jdk/make/javax/sql/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = jdbc-enterprise
PACKAGE = javax.sql
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/javax/swing/Makefile b/jdk/make/javax/swing/Makefile
index 200c8f9b9d0..97c5060f7a2 100644
--- a/jdk/make/javax/swing/Makefile
+++ b/jdk/make/javax/swing/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = swing
PACKAGE = javax.swing
PRODUCT = com
SWING_SRC = $(SHARE_SRC)/classes/javax/swing
diff --git a/jdk/make/javax/swing/plaf/Makefile b/jdk/make/javax/swing/plaf/Makefile
index 0355f5ed3fb..ceb5304a8fa 100644
--- a/jdk/make/javax/swing/plaf/Makefile
+++ b/jdk/make/javax/swing/plaf/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = swing
PACKAGE = javax.swing.plaf
PRODUCT = com
SWING_SRC = $(SHARE_SRC)/classes/javax/swing
diff --git a/jdk/make/jpda/back/Makefile b/jdk/make/jpda/back/Makefile
index cf94227f3c6..65d47e922c4 100644
--- a/jdk/make/jpda/back/Makefile
+++ b/jdk/make/jpda/back/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = debugging
LIBRARY = jdwp
PRODUCT = jpda
diff --git a/jdk/make/jpda/transport/Makefile b/jdk/make/jpda/transport/Makefile
index 9f5dbf14328..a6f18ec29ad 100644
--- a/jdk/make/jpda/transport/Makefile
+++ b/jdk/make/jpda/transport/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = debugging
PRODUCT = jpda
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/jpda/transport/shmem/Makefile b/jdk/make/jpda/transport/shmem/Makefile
index caa9eced912..60e0276a429 100644
--- a/jdk/make/jpda/transport/shmem/Makefile
+++ b/jdk/make/jpda/transport/shmem/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = debugging
LIBRARY = dt_shmem
PRODUCT = jbug
diff --git a/jdk/make/jpda/transport/socket/Makefile b/jdk/make/jpda/transport/socket/Makefile
index 3c654f57edc..3a742d337b2 100644
--- a/jdk/make/jpda/transport/socket/Makefile
+++ b/jdk/make/jpda/transport/socket/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = debugging
LIBRARY = dt_socket
PRODUCT = jbug
diff --git a/jdk/make/jpda/tty/Makefile b/jdk/make/jpda/tty/Makefile
index 3e53414eab3..07a63fe8731 100644
--- a/jdk/make/jpda/tty/Makefile
+++ b/jdk/make/jpda/tty/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = jdb
PACKAGE = com.sun.tools.example.debug.tty
PRODUCT = jpda
PROGRAM = jdb
diff --git a/jdk/make/launchers/Makefile b/jdk/make/launchers/Makefile
index c6564126baf..8d7036be179 100644
--- a/jdk/make/launchers/Makefile
+++ b/jdk/make/launchers/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ..
-MODULE = tools
PACKAGE = launchers
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
@@ -38,7 +37,6 @@ include $(BUILDDIR)/common/Defs.gmk
define make-corba-launcher
$(CD) $(BUILDDIR)/launchers && \
$(MAKE) -f Makefile.launcher \
- MODULE=corba \
PROGRAM=$(strip $1) \
MAIN_CLASS=$(strip $2) \
MAIN_JAVA_ARGS="$(strip $3)" \
diff --git a/jdk/make/mkdemo/jvmti/Makefile b/jdk/make/mkdemo/jvmti/Makefile
index ccc3731c4ea..33bdf6fa106 100644
--- a/jdk/make/mkdemo/jvmti/Makefile
+++ b/jdk/make/mkdemo/jvmti/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = demos
PRODUCT = demos
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mkdemo/management/Makefile b/jdk/make/mkdemo/management/Makefile
index 80b1eee90b6..4ddccb7ec9f 100644
--- a/jdk/make/mkdemo/management/Makefile
+++ b/jdk/make/mkdemo/management/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = demos
PRODUCT = demos
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/dtrace/Makefile b/jdk/make/mksample/dtrace/Makefile
index 86914546ec6..033d4d3ba4c 100644
--- a/jdk/make/mksample/dtrace/Makefile
+++ b/jdk/make/mksample/dtrace/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/jmx/jmx-scandir/Makefile b/jdk/make/mksample/jmx/jmx-scandir/Makefile
index 2dab96070fd..3ee0e99ac6b 100644
--- a/jdk/make/mksample/jmx/jmx-scandir/Makefile
+++ b/jdk/make/mksample/jmx/jmx-scandir/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/nbproject/Makefile b/jdk/make/mksample/nbproject/Makefile
index a77771a8f5a..92ef6714746 100644
--- a/jdk/make/mksample/nbproject/Makefile
+++ b/jdk/make/mksample/nbproject/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/nio/file/Makefile b/jdk/make/mksample/nio/file/Makefile
index 6632aa0f336..9462d5063f1 100644
--- a/jdk/make/mksample/nio/file/Makefile
+++ b/jdk/make/mksample/nio/file/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/nio/multicast/Makefile b/jdk/make/mksample/nio/multicast/Makefile
index 380b51ef50c..ae3b4e1d816 100644
--- a/jdk/make/mksample/nio/multicast/Makefile
+++ b/jdk/make/mksample/nio/multicast/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/nio/server/Makefile b/jdk/make/mksample/nio/server/Makefile
index e7e246e5db6..bf97c727065 100644
--- a/jdk/make/mksample/nio/server/Makefile
+++ b/jdk/make/mksample/nio/server/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/scripting/scriptpad/Makefile b/jdk/make/mksample/scripting/scriptpad/Makefile
index 917b3da81b1..b60b01deb22 100644
--- a/jdk/make/mksample/scripting/scriptpad/Makefile
+++ b/jdk/make/mksample/scripting/scriptpad/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/webservices/EbayClient/Makefile b/jdk/make/mksample/webservices/EbayClient/Makefile
index 04adedc2410..d007ff36639 100644
--- a/jdk/make/mksample/webservices/EbayClient/Makefile
+++ b/jdk/make/mksample/webservices/EbayClient/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/mksample/webservices/EbayServer/Makefile b/jdk/make/mksample/webservices/EbayServer/Makefile
index 13c01e89702..e51d34622ca 100644
--- a/jdk/make/mksample/webservices/EbayServer/Makefile
+++ b/jdk/make/mksample/webservices/EbayServer/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
-MODULE = samples
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/applet/Makefile b/jdk/make/sun/applet/Makefile
index 79ff5fcb413..f73763f399b 100644
--- a/jdk/make/sun/applet/Makefile
+++ b/jdk/make/sun/applet/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = applet
PACKAGE = sun.applet
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile
index 7d8b4b6a6f1..0b752e24486 100644
--- a/jdk/make/sun/awt/Makefile
+++ b/jdk/make/sun/awt/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = awt
PACKAGE = sun.awt
LIBRARY = awt
PRODUCT = sun
@@ -405,7 +404,6 @@ $(LIBDIR)/%.bfc: $(FONTCONFIGS_SRC)/$(FONTCONFIGS_SRC_PREFIX)%.properties \
$(COMPILEFONTCONFIG_JARFILE)
$(prep-target)
$(BOOT_JAVA_CMD) -jar $(COMPILEFONTCONFIG_JARFILE) $(COMPILEFONTCONFIG_FLAGS) $< $@
- $(install-module-file)
$(call chmod-file, 444)
@$(java-vm-cleanup)
diff --git a/jdk/make/sun/cmm/Makefile b/jdk/make/sun/cmm/Makefile
index 50592142287..76d6904a521 100644
--- a/jdk/make/sun/cmm/Makefile
+++ b/jdk/make/sun/cmm/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = java2d
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/cmm/kcms/Makefile b/jdk/make/sun/cmm/kcms/Makefile
index ac3254461cd..b0dd8434ee7 100644
--- a/jdk/make/sun/cmm/kcms/Makefile
+++ b/jdk/make/sun/cmm/kcms/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = java2d
PACKAGE = sun.java2d.cmm.kcms
LIBRARY = kcms
PRODUCT = sun
diff --git a/jdk/make/sun/cmm/lcms/Makefile b/jdk/make/sun/cmm/lcms/Makefile
index 04a4c3c987e..52b550dda10 100644
--- a/jdk/make/sun/cmm/lcms/Makefile
+++ b/jdk/make/sun/cmm/lcms/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = java2d
PACKAGE = sun.java2d.cmm.lcms
LIBRARY = lcms
PRODUCT = sun
diff --git a/jdk/make/sun/dcpr/Makefile b/jdk/make/sun/dcpr/Makefile
index c401cbde4f8..bfeb4636a46 100644
--- a/jdk/make/sun/dcpr/Makefile
+++ b/jdk/make/sun/dcpr/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = java2d
PACKAGE = sun.dc
LIBRARY = dcpr
PRODUCT = sun
diff --git a/jdk/make/sun/font/Makefile b/jdk/make/sun/font/Makefile
index b22d0e7b793..dc735cb2cd6 100644
--- a/jdk/make/sun/font/Makefile
+++ b/jdk/make/sun/font/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = font
PACKAGE = sun.font
LIBRARY = fontmanager
PRODUCT = sun
@@ -136,7 +135,6 @@ library:: $(FREETYPE_LIB)
$(FREETYPE_LIB):
$(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
- $(install-module-file)
endif
#ifeq ($(PLATFORM), solaris)
diff --git a/jdk/make/sun/font/t2k/Makefile b/jdk/make/sun/font/t2k/Makefile
index a390b96b700..1a4c656826c 100644
--- a/jdk/make/sun/font/t2k/Makefile
+++ b/jdk/make/sun/font/t2k/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = font
PACKAGE = sun.font
LIBRARY = t2k
PRODUCT = sun
diff --git a/jdk/make/sun/headless/Makefile b/jdk/make/sun/headless/Makefile
index 243c5bdf561..e78761b0a40 100644
--- a/jdk/make/sun/headless/Makefile
+++ b/jdk/make/sun/headless/Makefile
@@ -30,7 +30,6 @@ MOTIF_VERSION = none
MOTIF_VERSION_STRING=none
LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/headless
-MODULE = awt
PACKAGE = sun.awt
LIBRARY = mawt
LIBRARY_OUTPUT = headless
diff --git a/jdk/make/sun/image/generic/Makefile b/jdk/make/sun/image/generic/Makefile
index 80d1454eeb3..6a55f0e98c8 100644
--- a/jdk/make/sun/image/generic/Makefile
+++ b/jdk/make/sun/image/generic/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = media
PACKAGE = sun.awt.medialib
LIBRARY = mlib_image
PRODUCT = sun
diff --git a/jdk/make/sun/image/vis/Makefile b/jdk/make/sun/image/vis/Makefile
index 9e1732f293d..fdf9c1f9937 100644
--- a/jdk/make/sun/image/vis/Makefile
+++ b/jdk/make/sun/image/vis/Makefile
@@ -27,7 +27,6 @@
# Makefile for building the VIS (solaris-only) version of medialib
#
BUILDDIR = ../../..
-MODULE = media
PACKAGE = sun.awt.medialib
LIBRARY = mlib_image_v
PRODUCT = sun
diff --git a/jdk/make/sun/jar/Makefile b/jdk/make/sun/jar/Makefile
index d544a3fe46a..7b4ed870ef3 100644
--- a/jdk/make/sun/jar/Makefile
+++ b/jdk/make/sun/jar/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = jar-tool
PACKAGE = sun.tools
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/javazic/Makefile b/jdk/make/sun/javazic/Makefile
index 8e5f723f7e6..64ccf846476 100644
--- a/jdk/make/sun/javazic/Makefile
+++ b/jdk/make/sun/javazic/Makefile
@@ -27,7 +27,6 @@
BUILDDIR = ../..
-MODULE = base
PACKAGE = sun.javazic
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
@@ -70,7 +69,6 @@ $(INSTALLDIR)/$(MAPFILE): $(WORKDIR)/$(MAPFILE)
$(RM) -r $(@D)
$(prep-target)
$(CP) -r $(WORKDIR)/* $(@D)
- $(install-module-dir)
clean clobber::
$(RM) -r $(TEMPDIR) $(INSTALLDIR)
diff --git a/jdk/make/sun/jawt/Makefile b/jdk/make/sun/jawt/Makefile
index be63ff89ff7..7741e1b5a83 100644
--- a/jdk/make/sun/jawt/Makefile
+++ b/jdk/make/sun/jawt/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = awt
PACKAGE = sun.awt
LIBRARY = jawt
PRODUCT = sun
diff --git a/jdk/make/sun/jconsole/Makefile b/jdk/make/sun/jconsole/Makefile
index 997bd2b6d42..7ce349bc811 100644
--- a/jdk/make/sun/jconsole/Makefile
+++ b/jdk/make/sun/jconsole/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = jconsole
PACKAGE = sun.tools.jconsole
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/jdbc/Makefile b/jdk/make/sun/jdbc/Makefile
index 5425aaec1e2..f3d9fea8eb1 100644
--- a/jdk/make/sun/jdbc/Makefile
+++ b/jdk/make/sun/jdbc/Makefile
@@ -33,7 +33,6 @@
#
BUILDDIR = ../..
-MODULE = jdbc-odbc
PACKAGE = sun.jdbc.odbc
LIBRARY = JdbcOdbc
PRODUCT = sun
diff --git a/jdk/make/sun/jdga/Makefile b/jdk/make/sun/jdga/Makefile
index f916be787e8..98b5c0dd9a5 100644
--- a/jdk/make/sun/jdga/Makefile
+++ b/jdk/make/sun/jdga/Makefile
@@ -25,7 +25,6 @@
BUILDDIR = ../..
-MODULE = java2d
PACKAGE = sun.jdga
LIBRARY = sunwjdga
PRODUCT = sun
diff --git a/jdk/make/sun/jpeg/Makefile b/jdk/make/sun/jpeg/Makefile
index b16ebea9f0f..78c53c461a1 100644
--- a/jdk/make/sun/jpeg/Makefile
+++ b/jdk/make/sun/jpeg/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = java2d
PACKAGE = sun.awt
LIBRARY = jpeg
PRODUCT = sun
diff --git a/jdk/make/sun/launcher/Makefile b/jdk/make/sun/launcher/Makefile
index 706d0157782..0d010919780 100644
--- a/jdk/make/sun/launcher/Makefile
+++ b/jdk/make/sun/launcher/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = base
PACKAGE = sun.launcher
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/management/Makefile b/jdk/make/sun/management/Makefile
index fad6979222a..e9d9ae53eb7 100644
--- a/jdk/make/sun/management/Makefile
+++ b/jdk/make/sun/management/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = management
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/native2ascii/Makefile b/jdk/make/sun/native2ascii/Makefile
index 6e03ddf6ccf..8504c408020 100644
--- a/jdk/make/sun/native2ascii/Makefile
+++ b/jdk/make/sun/native2ascii/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = tools
PACKAGE = sun.tools.native2ascii
PRODUCT = sun
OTHER_JAVACFLAGS += -Xlint:serial -Werror
diff --git a/jdk/make/sun/net/others/Makefile b/jdk/make/sun/net/others/Makefile
index 3b69440c41b..9e26bd7002a 100644
--- a/jdk/make/sun/net/others/Makefile
+++ b/jdk/make/sun/net/others/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = base
PACKAGE = sun.net
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/net/spi/nameservice/dns/Makefile b/jdk/make/sun/net/spi/nameservice/dns/Makefile
index 06f2f8b764e..dddb18571e0 100644
--- a/jdk/make/sun/net/spi/nameservice/dns/Makefile
+++ b/jdk/make/sun/net/spi/nameservice/dns/Makefile
@@ -30,7 +30,6 @@
BUILDDIR = ../../../../..
# dns should probably be its own module
-MODULE = net-dns
PACKAGE = sun.net.spi.nameservice.dns
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/nio/cs/Makefile b/jdk/make/sun/nio/cs/Makefile
index f1eee0e34f6..eeddbb03120 100644
--- a/jdk/make/sun/nio/cs/Makefile
+++ b/jdk/make/sun/nio/cs/Makefile
@@ -30,7 +30,6 @@
BUILDDIR = ../../..
# charsets should be separated from nio module
-MODULE = charsets
PACKAGE = sun.nio
PRODUCT = sun
diff --git a/jdk/make/sun/org/mozilla/javascript/Makefile b/jdk/make/sun/org/mozilla/javascript/Makefile
index 99880d08976..5ea19a7a47b 100644
--- a/jdk/make/sun/org/mozilla/javascript/Makefile
+++ b/jdk/make/sun/org/mozilla/javascript/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../../..
-MODULE = scripting-rhino
PACKAGE = sun.org.mozilla.javascript.internal
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/pisces/Makefile b/jdk/make/sun/pisces/Makefile
index f6c298c0afa..61b50d2d479 100644
--- a/jdk/make/sun/pisces/Makefile
+++ b/jdk/make/sun/pisces/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = java2d
PACKAGE = sun.pisces
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/rmi/cgi/Makefile b/jdk/make/sun/rmi/cgi/Makefile
index 04a68473e35..588c72a87eb 100644
--- a/jdk/make/sun/rmi/cgi/Makefile
+++ b/jdk/make/sun/rmi/cgi/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../../..
# java-rmi.cgi is a JDK tool
-MODULE = tools
PACKAGE = sun.rmi
PRODUCT = sun
PROGRAM = java-rmi
diff --git a/jdk/make/sun/rmi/oldtools/Makefile b/jdk/make/sun/rmi/oldtools/Makefile
index 9e7f051fbdd..e0afea2dd9c 100644
--- a/jdk/make/sun/rmi/oldtools/Makefile
+++ b/jdk/make/sun/rmi/oldtools/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = oldjavac
PRODUCT = oldjavac
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/rmi/registry/Makefile b/jdk/make/sun/rmi/registry/Makefile
index 3f3e0c18a21..69f37a04da9 100644
--- a/jdk/make/sun/rmi/registry/Makefile
+++ b/jdk/make/sun/rmi/registry/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = rmi
PACKAGE = sun.rmi.registry
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/rmi/rmi/Makefile b/jdk/make/sun/rmi/rmi/Makefile
index 67be5f1feb8..a0ace2be48c 100644
--- a/jdk/make/sun/rmi/rmi/Makefile
+++ b/jdk/make/sun/rmi/rmi/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = rmi
PACKAGE = sun.rmi
PRODUCT = sun
LIBRARY = rmi
diff --git a/jdk/make/sun/rmi/rmic/Makefile b/jdk/make/sun/rmi/rmic/Makefile
index bca860ee8ad..b6ec52b6849 100644
--- a/jdk/make/sun/rmi/rmic/Makefile
+++ b/jdk/make/sun/rmi/rmic/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../../..
-MODULE = rmic
PACKAGE = sun.rmi.rmic
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/rmi/rmid/Makefile b/jdk/make/sun/rmi/rmid/Makefile
index 1ab9d8c5084..118b7af9bce 100644
--- a/jdk/make/sun/rmi/rmid/Makefile
+++ b/jdk/make/sun/rmi/rmid/Makefile
@@ -29,7 +29,6 @@
#
BUILDDIR = ../../..
-MODULE = rmi-activation
PACKAGE = sun.rmi.activation
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/security/ec/Makefile b/jdk/make/sun/security/ec/Makefile
index 8f3f75dc3b3..26190f10a71 100644
--- a/jdk/make/sun/security/ec/Makefile
+++ b/jdk/make/sun/security/ec/Makefile
@@ -89,7 +89,6 @@
#
BUILDDIR = ../../..
-MODULE = security-sunec
PACKAGE = sun.security.ec
PRODUCT = sun
@@ -309,7 +308,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunec.jar
else
$(JAR_DESTFILE): $(SIGNED_DIR)/sunec.jar
endif
- $(install-non-module-file)
+ $(install-file)
ifndef OPENJDK
install-prebuilt:
diff --git a/jdk/make/sun/security/jgss/wrapper/Makefile b/jdk/make/sun/security/jgss/wrapper/Makefile
index 052cbf354c2..89df5e98e07 100644
--- a/jdk/make/sun/security/jgss/wrapper/Makefile
+++ b/jdk/make/sun/security/jgss/wrapper/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../../..
-MODULE = security-kerberos
PACKAGE = sun.security.jgss.wrapper
PRODUCT = sun
diff --git a/jdk/make/sun/security/krb5/Makefile b/jdk/make/sun/security/krb5/Makefile
index 8c8e5a88b72..16561e5bcee 100644
--- a/jdk/make/sun/security/krb5/Makefile
+++ b/jdk/make/sun/security/krb5/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = security-kerberos
PACKAGE = sun.security.krb5
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/security/mscapi/Makefile b/jdk/make/sun/security/mscapi/Makefile
index d4b940980ca..930ef7b078d 100644
--- a/jdk/make/sun/security/mscapi/Makefile
+++ b/jdk/make/sun/security/mscapi/Makefile
@@ -89,7 +89,6 @@
#
BUILDDIR = ../../..
-MODULE = security-sunmscapi
PACKAGE = sun.security.mscapi
LIBRARY = sunmscapi
PRODUCT = sun
@@ -273,7 +272,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunmscapi.jar
else
$(JAR_DESTFILE): $(SIGNED_DIR)/sunmscapi.jar
endif
- $(install-non-module-file)
+ $(install-file)
ifndef OPENJDK
install-prebuilt:
diff --git a/jdk/make/sun/security/pkcs11/Makefile b/jdk/make/sun/security/pkcs11/Makefile
index 9e8102651e1..5e01ffead68 100644
--- a/jdk/make/sun/security/pkcs11/Makefile
+++ b/jdk/make/sun/security/pkcs11/Makefile
@@ -89,7 +89,6 @@
#
BUILDDIR = ../../..
-MODULE = security-sunpkcs11
PACKAGE = sun.security.pkcs11
LIBRARY = j2pkcs11
PRODUCT = sun
@@ -288,7 +287,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunpkcs11.jar
else
$(JAR_DESTFILE): $(SIGNED_DIR)/sunpkcs11.jar
endif
- $(install-non-module-file)
+ $(install-file)
ifndef OPENJDK
install-prebuilt:
diff --git a/jdk/make/sun/security/smartcardio/Makefile b/jdk/make/sun/security/smartcardio/Makefile
index 73cbe72dd53..e6a6f2cc797 100644
--- a/jdk/make/sun/security/smartcardio/Makefile
+++ b/jdk/make/sun/security/smartcardio/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = security-smartcardio
PACKAGE = sun.security.smartcardio
LIBRARY = j2pcsc
PRODUCT = sun
diff --git a/jdk/make/sun/security/tools/Makefile b/jdk/make/sun/security/tools/Makefile
index 6b44e8178fe..bfdb261f6ba 100644
--- a/jdk/make/sun/security/tools/Makefile
+++ b/jdk/make/sun/security/tools/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../../..
-MODULE = security-tools
PACKAGE = sun.security.tools
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/serialver/Makefile b/jdk/make/sun/serialver/Makefile
index d2e8211f11c..d7e2a193096 100644
--- a/jdk/make/sun/serialver/Makefile
+++ b/jdk/make/sun/serialver/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = serialver
PACKAGE = sun.tools.serialver
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/splashscreen/Makefile b/jdk/make/sun/splashscreen/Makefile
index 322ebf0cab1..74487d8c2c7 100644
--- a/jdk/make/sun/splashscreen/Makefile
+++ b/jdk/make/sun/splashscreen/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = awt
PACKAGE = sun.awt
LIBRARY = splashscreen
PRODUCT = sun
diff --git a/jdk/make/sun/text/Makefile b/jdk/make/sun/text/Makefile
index e8ac3047d17..ac4dd9d45cd 100644
--- a/jdk/make/sun/text/Makefile
+++ b/jdk/make/sun/text/Makefile
@@ -29,7 +29,6 @@
BUILDDIR = ../..
-MODULE = localedata
PACKAGE = sun.text
PRODUCT = sun
diff --git a/jdk/make/sun/tools/Makefile b/jdk/make/sun/tools/Makefile
index c5d71cb4edf..f5cd405f612 100644
--- a/jdk/make/sun/tools/Makefile
+++ b/jdk/make/sun/tools/Makefile
@@ -28,7 +28,6 @@
#
BUILDDIR = ../..
-MODULE = tools
PACKAGE = sun.tools
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
diff --git a/jdk/make/sun/tracing/dtrace/Makefile b/jdk/make/sun/tracing/dtrace/Makefile
index 55c896b0a9c..83d475d5343 100644
--- a/jdk/make/sun/tracing/dtrace/Makefile
+++ b/jdk/make/sun/tracing/dtrace/Makefile
@@ -27,7 +27,6 @@
# Makefile for building dtrace extension
#
BUILDDIR = ../../..
-MODULE = tracing
PACKAGE = sun.tracing.dtrace
LIBRARY = jsdt
PRODUCT = sun
diff --git a/jdk/make/sun/xawt/Makefile b/jdk/make/sun/xawt/Makefile
index f1297ef192f..afe16f5737d 100644
--- a/jdk/make/sun/xawt/Makefile
+++ b/jdk/make/sun/xawt/Makefile
@@ -24,7 +24,6 @@
#
BUILDDIR = ../..
-MODULE = awt
PACKAGE = sun.awt.X11
LIBRARY = mawt
LIBRARY_OUTPUT = xawt
From 8469345e0502d36a46a7df65f5ff40855e072bcb Mon Sep 17 00:00:00 2001
From: Mandy Chung
Date: Wed, 9 Mar 2011 23:59:58 -0800
Subject: [PATCH 80/91] 7026228: Remove make/modules and
make/common/Modules.gmk
Reviewed-by: alanb, ohair
---
jdk/make/common/Modules.gmk | 454 ---------
jdk/make/java/nio/mxbean/Makefile | 34 -
jdk/make/modules/Makefile | 134 ---
jdk/make/modules/bootmodule.roots | 199 ----
jdk/make/modules/jdk7.depconfig | 473 ---------
jdk/make/modules/modules.config | 928 ------------------
jdk/make/modules/modules.group | 29 -
jdk/make/modules/optional.depconfig | 149 ---
jdk/make/modules/tools/Makefile | 154 ---
jdk/make/modules/tools/build.xml | 29 -
.../tools/nbproject/project.properties | 86 --
jdk/make/modules/tools/nbproject/project.xml | 39 -
.../classanalyzer/AnnotatedDependency.java | 627 ------------
.../sun/classanalyzer/AnnotationParser.java | 293 ------
.../com/sun/classanalyzer/BootAnalyzer.java | 819 ----------------
.../src/com/sun/classanalyzer/CheckDeps.java | 181 ----
.../com/sun/classanalyzer/ClassAnalyzer.java | 354 -------
.../sun/classanalyzer/ClassFileParser.java | 629 ------------
.../src/com/sun/classanalyzer/ClassPath.java | 275 ------
.../classanalyzer/CodeAttributeParser.java | 157 ---
.../classanalyzer/ConstantPoolAnalyzer.java | 60 --
.../sun/classanalyzer/ConstantPoolParser.java | 377 -------
.../sun/classanalyzer/DependencyConfig.java | 99 --
.../src/com/sun/classanalyzer/Klass.java | 357 -------
.../src/com/sun/classanalyzer/Module.java | 693 -------------
.../com/sun/classanalyzer/ModuleConfig.java | 562 -----------
.../com/sun/classanalyzer/ResolutionInfo.java | 201 ----
.../com/sun/classanalyzer/ResourceFile.java | 186 ----
.../src/com/sun/classanalyzer/ShowDeps.java | 100 --
29 files changed, 8678 deletions(-)
delete mode 100644 jdk/make/common/Modules.gmk
delete mode 100644 jdk/make/java/nio/mxbean/Makefile
delete mode 100644 jdk/make/modules/Makefile
delete mode 100644 jdk/make/modules/bootmodule.roots
delete mode 100644 jdk/make/modules/jdk7.depconfig
delete mode 100644 jdk/make/modules/modules.config
delete mode 100644 jdk/make/modules/modules.group
delete mode 100644 jdk/make/modules/optional.depconfig
delete mode 100644 jdk/make/modules/tools/Makefile
delete mode 100644 jdk/make/modules/tools/build.xml
delete mode 100644 jdk/make/modules/tools/nbproject/project.properties
delete mode 100644 jdk/make/modules/tools/nbproject/project.xml
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java
delete mode 100644 jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java
diff --git a/jdk/make/common/Modules.gmk b/jdk/make/common/Modules.gmk
deleted file mode 100644
index 9bf90db2932..00000000000
--- a/jdk/make/common/Modules.gmk
+++ /dev/null
@@ -1,454 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-JDK_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image
-JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image
-
-#
-# modules Target to build jdk and jre module image
-#
-# There is one jar file per module containing classes only.
-# All module jars are currently placed under jre/lib directory.
-#
-# Open issues that need further investigation:
-# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns
-# module. META-INF/services file is not installed.
-# 2. Signed jars
-# For JDK build, signed jars are copied to the build.
-# All jars in the module image are unsigned.
-
-MODULE_IMAGEBINDIR = bin
-
-#
-# Targets.
-#
-INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre
-INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk
-ifeq ($(PLATFORM), solaris)
- ifeq ($(ARCH_DATA_MODEL), 64)
- INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64
- INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64
- endif
-endif
-
-modules modules-clobber \
-initial-module-image-jre initial-module-image-jdk \
-initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
-trim-module-image-jre trim-module-image-jdk \
-process-module-image-jre process-module-image-jdk ::
- @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-
-# Order is important here, trim jre after jdk image is created
-modules:: gen-modules \
- sanity-module-images post-sanity-module-images \
- $(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \
- trim-module-image-jre trim-module-image-jdk \
- process-module-image-jre process-module-image-jdk
-
-# Don't use these
-module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre
-module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk
-
-#
-# Paths to these files we need
-JDK_MODULE_DOCFILES = $(IMAGE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%)
-JRE_MODULE_DOCFILES = $(IMAGE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%)
-
-###### RULES
-
-# JDK files
-$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
- $(process-doc-file)
-
-# JRE files
-$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
- $(process-doc-file)
-ifeq ($(PLATFORM), windows)
-$(JRE_MODULE_IMAGE_DIR)/README.txt: $(SHARE_JRE_DOC_SRC)/README
- $(process-doc-file)
-endif
-
-######################################################
-# JRE Image
-######################################################
-
-MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list
-
-# Modules in the jre/lib/security directory
-POLICY_MODULES = US_export_policy local_policy
-
-# Modules in the modules/ext directory
-EXT_MODULES = localedata security-sunec security-sunjce
-
-# Build PKCS#11 on all platforms except 64-bit Windows.
-PKCS11 = security-sunpkcs11
-ifeq ($(ARCH_DATA_MODEL), 64)
- ifeq ($(PLATFORM), windows)
- PKCS11 =
- endif
-endif
-
-EXT_MODULES += $(PKCS11)
-
-# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform.
-ifeq ($(PLATFORM), windows)
- ifneq ($(ARCH_DATA_MODEL), 64)
- EXT_MODULES += security-sunmscapi
- endif
-endif
-
-# Modules for JDK only
-JDK_MODULES = tools
-
-gen-modules:
- $(CD) modules; $(MAKE) all
-
-initial-module-image-jre-setup:
- $(RM) -r $(JRE_MODULE_IMAGE_DIR)
- $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)
-
-# 64-bit solaris jre image contains only the 64-bit add-on files.
-initial-module-image-jre-sol64:: initial-module-image-jre-setup
- @# Use tar instead of cp to preserve the symbolic links
- for dir in bin lib ; do \
- ( $(CD) $(OUTPUTDIR) && \
- $(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
- ($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
- done
- @# Remove some files from the jre area
- for t in $(NOTJRETOOLS) ; do \
- $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
- done
- $(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'`
- $(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'`
-
-# Construct an initial jre image (initial jdk jre) no trimming or stripping
-initial-module-image-jre:: initial-module-image-jre-setup \
- $(JRE_MODULE_DOCFILES) \
- $(BUILDMETAINDEX_JARFILE)
- @# Copy in bin directory
- $(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
- @# CTE plugin security change require new empty directory lib/applet
- $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet
- @# Copy files but not .jar in lib directory
- $(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
- @#
- @# copy modules to jre/lib
- @#
- for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
- $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \
- done
- $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext
- for m in $(EXT_MODULES) ; do \
- $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \
- done
- for m in $(POLICY_MODULES) ; do \
- $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \
- done
- @# Remove jdk modules
- for m in $(JDK_MODULES) ; do \
- $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \
- done
-
- @# Make sure all directories are read/execute for everyone
- $(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d`
- @# Remove some files from the jre area
- for t in $(NOTJRETOOLS) ; do \
- $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
- done
- @# Remove orb.idl and ir.idl from jre
- $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
- $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
- @# Generate meta-index to make boot and extension class loaders lazier
- $(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
- $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
- -o meta-index *.jar
- @$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup)
- $(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \
- $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
- -o meta-index *.jar
- @$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
-ifeq ($(PLATFORM), windows)
- @# Remove certain *.lib files
- $(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
- $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
- awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
- ifeq ($(ARCH_DATA_MODEL), 32)
- @# The Java Kernel JRE image ships with a special VM. It is not included
- @# in the full JRE image, so remove it. Also, is it only for 32-bit windows.
- $(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel
- endif
-endif # Windows
-ifneq ($(PLATFORM), windows)
- $(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES))
-endif # !windows
-
-# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
-# (Note the jdk WILL want the jre image before this trimming)
-# Removes server VM on Windows 32bit.
-# Remove certain shared libraries that should not be in the jre image
-# but should be in the jdk jre image.
-trim-module-image-jre::
-ifeq ($(PLATFORM), windows)
- ifeq ($(ARCH_DATA_MODEL), 32)
- $(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server
- endif
- ifdef NOTJRE_SHARED_LIBS
- for l in $(NOTJRE_SHARED_LIBS) ; do \
- $(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \
- done ;
- endif
-else # PLATFORM
- ifdef NOTJRE_SHARED_LIBS
- for l in $(NOTJRE_SHARED_LIBS) ; do \
- $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
- done ;
- endif
-endif # PLATFORM
-
-# Get list of all Elf files in the jre
-JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list
-$(JRE_MODULE_ELF_LIST):
- @$(prep-target)
-ifneq ($(PLATFORM), windows)
- $(RM) $@
- $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
- $(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
- | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-endif
-
-# Post process the image (strips and mcs on Elf files we are shipping)
-# (Note the jdk WILL want the jre image before this processing)
-process-module-image-jre:: $(JRE_MODULE_ELF_LIST)
-ifneq ($(POST_STRIP_PROCESS), )
- for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
- $(CHMOD) u+w $${f}; \
- $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
- $(POST_STRIP_PROCESS) $${f}; \
- $(CHMOD) go-w $${f}; \
- done
-endif
-ifneq ($(POST_MCS_PROCESS), )
- for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
- $(CHMOD) u+w $${f}; \
- $(ECHO) $(POST_MCS_PROCESS) $${f}; \
- $(POST_MCS_PROCESS) $${f}; \
- $(CHMOD) go-w $${f}; \
- done
-endif
- $(RM) $(JRE_MODULE_ELF_LIST)
-
-######################################################
-# JDK Image
-######################################################
-# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
-
-initial-module-image-jdk-setup:
- $(RM) -r $(JDK_MODULE_IMAGE_DIR)
- $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre
- ($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \
- | $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre )
- $(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man
- $(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d`
-
-initial-module-image-jdk64-bindemos:
- for dir in bin demo ; do \
- ( $(CD) $(OUTPUTDIR) && \
- $(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
- ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
- done
-
-# Solaris 64 bit image is special
-initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \
- initial-module-image-jdk64-bindemos
-
-# DB files to add
-ifeq ($(OPENJDK),true)
-
-initial-module-image-jdk-db:
-
-else
-
-# Create the list of db *.zip files to bundle with jdk
-ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
-DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
-
-initial-module-image-jdk-db: $(DB_ZIP_LIST)
- $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db
- for d in $(DB_ZIP_LIST); do \
- ($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
- done
-
-endif
-
-# Standard jdk image
-initial-module-image-jdk:: initial-module-image-jdk-setup \
- initial-module-image-jdk-db \
- $(JDK_MODULE_DOCFILES)
- $(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib
- @#
- @# copy jdk modules to jdk/lib
- @#
- $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib
- for m in $(JDK_MODULES) ; do \
- $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \
- done
- ifeq ($(PLATFORM), windows)
- @#
- @# lib/
- @#
- $(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
- $(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
- @#
- @# bin/
- @#
- @# copy all EXE files and only certain DLL files from BINDIR
- $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin
- $(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
- $(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
- ifeq ($(COMPILER_VERSION), VS2010)
- $(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
- endif
- ifeq ($(ARCH_DATA_MODEL), 32)
- ifeq ($(COMPILER_VERSION), VS2003)
- $(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
- endif
- endif
- else # PLATFORM
- @#
- @# bin/
- @#
- ($(CD) $(BINDIR)/.. && $(TAR) cf - \
- `$(FIND) bin \( -type f -o -type l \) -print `) | \
- ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -)
- endif # PLATFORM
- @#
- @# lib/ct.sym
- @#
- $(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
- $(JAVAC_CMD) -XDprocess.packages -proc:only \
- -processor com.sun.tools.javac.sym.CreateSymbols \
- -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
- -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
- $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
- $(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
- -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
- @$(java-vm-cleanup)
- $(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym
- @#
- @# CORBA supported orb.idl and ir.idl should be copied to lib
- @#
- $(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl
- $(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl
- ifeq ($(PLATFORM), linux)
- @#
- @# on Linux copy jexec from jre/lib to /lib
- @#
- $(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec
- endif # PLATFORM
- @#
- @# demo, include
- @#
- $(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR)
- $(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR)
- $(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR)
- @#
- @# Swing BeanInfo generation
- @#
- $(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans
-ifneq ($(PLATFORM), windows)
- $(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES))
-endif # !windows
-
-# Trim out files we don't want to ship
-trim-module-image-jdk::
- @# Remove tools that should not be part of SDK.
- for t in $(NOTJDKTOOLS); do \
- $(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX); \
- done
-
-# Get list of Elf files in the jdk
-JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list
-$(JDK_MODULE_ELF_LIST):
- @$(prep-target)
-ifneq ($(PLATFORM), windows)
- $(RM) $@
- $(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
- $(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
- | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
- file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
- | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-endif
-
-# Post process the image (strips and mcs on files we are shipping)
-process-module-image-jdk:: $(JDK_MODULE_ELF_LIST)
-ifneq ($(POST_STRIP_PROCESS), )
- for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
- $(CHMOD) u+w $${f}; \
- $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
- $(POST_STRIP_PROCESS) $${f}; \
- $(CHMOD) go-w $${f}; \
- done
-endif
-ifneq ($(POST_MCS_PROCESS), )
- for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
- $(CHMOD) u+w $${f}; \
- $(ECHO) $(POST_MCS_PROCESS) $${f}; \
- $(POST_MCS_PROCESS) $${f}; \
- $(CHMOD) go-w $${f}; \
- done
-endif
- $(RM) $(JDK_MODULE_ELF_LIST)
-
-######################################################
-# clobber
-######################################################
-modules-clobber::
- $(RM) -r $(JDK_MODULE_IMAGE_DIR)
- $(RM) -r $(JRE_MODULE_IMAGE_DIR)
-
-#
-# TODO - nop for now
-sanity-module-images post-sanity-module-images:
-
-modules modules-clobber::
- @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
- @$(java-vm-cleanup)
-
-.PHONY: modules module-image-jre module-image-jdk \
- initial-module-image-jre initial-module-image-jdk \
- initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
- initial-module-image-jdk-setup \
- initial-module-image-jdk-db \
- initial-module-image-jdk64-bindemos \
- initial-module-image-jre-setup \
- trim-module-image-jre trim-module-image-jdk \
- process-module-image-jre process-module-image-jdk \
- install-previous-jre install-previous-jdk \
- modules-clobber
-
-# Force rule
-FRC:
-
diff --git a/jdk/make/java/nio/mxbean/Makefile b/jdk/make/java/nio/mxbean/Makefile
deleted file mode 100644
index b5378266215..00000000000
--- a/jdk/make/java/nio/mxbean/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-MODULE = management
-PACKAGE = java.nio
-PRODUCT = java
-include $(BUILDDIR)/common/Defs.gmk
-
-FILES_java = java/nio/BufferPoolMXBean.java
-
-include $(BUILDDIR)/common/Classes.gmk
diff --git a/jdk/make/modules/Makefile b/jdk/make/modules/Makefile
deleted file mode 100644
index c31ff5a03ad..00000000000
--- a/jdk/make/modules/Makefile
+++ /dev/null
@@ -1,134 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ..
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Modularizing the JDK
-# - Post jdk build process until the source tree is restructured
-# for modules build
-# - /modules/ will be created for each module.
-#
-# Steps:
-# 0. During jdk build before this makefile is invoked, classes,
-# resource files, and other non-class files such as native libraries,
-# properties file, images, etc are created.
-#
-# Non-class files are copied to /tmp/modules/
-# directory in this step to prepare for the post-build modularization.
-#
-# The MODULE variable defined in other makefiles specifies
-# the lowest-level module that the non-class files belong to.
-# The name might or might not be the same as the name of the modules
-# in the resulting /modules directory.
-#
-# 1. Unpack all jars in the /lib directory to a temporary
-# location (/tmp/modules/classes) to prepare for modules
-# creation.
-#
-# 2. Run ClassAnalyzer tool to analyze all jdk classes and generate
-# class list for all modules and also perform dependency analysis.
-#
-# Input configuration files :-
-#
-# modules.config : defines the low-level modules and specifies
-# what classes and resource files each module includes.
-# modules.group : defines the module groups and its members.
-# jdk7.depconfig : lists the dynamic dependencies including
-# use of reflection Class.forName and JNI FindClass and
-# service provider.
-# optional.depconfig : lists the optional dependencies
-#
-# 3. Create one directory for each module (/modules/)
-# based on the output files from (2).
-#
-# modules.list lists the modules to be created for the modules
-# build and its members. For each module (m) in modules.list,
-# a. create $m/lib/$m.jar with all classes and resource files
-# listed in $m.classlist and $m.resources respectively.
-# b. copy all non-class files from its members to
-# /modules/$m.
-
-
-MAINMANIFEST=$(JDK_TOPDIR)/make/tools/manifest.mf
-MODULE_JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp
-
-TMP = $(ABS_MODULES_TEMPDIR)
-MODULE_CLASSLIST = $(ABS_MODULES_TEMPDIR)/classlist
-MODULE_CLASSES = $(ABS_MODULES_TEMPDIR)/classes
-MODULES_LIST = $(MODULE_CLASSLIST)/modules.list
-
-all:: unpack-jars gen-classlist modularize
-
-JAR_LIST := $(shell $(FIND) $(ABS_OUTPUTDIR)/lib -name \*.jar -print)
-unpack-jars:
- @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
- $(RM) -rf $(MODULE_CLASSES)
- $(MKDIR) -p $(MODULE_CLASSES)
- $(CP) -rf $(CLASSBINDIR)/* $(MODULE_CLASSES)
- @for jf in $(JAR_LIST) ; do \
- $(CD) $(MODULE_CLASSES) && $(BOOT_JAR_CMD) xf $$jf $(BOOT_JAR_JFLAGS);\
- done
- @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-gen-classlist:
- $(CD) tools && $(MAKE) all
-
-modularize: $(MODULE_JAR_MANIFEST_FILE)
- @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
- @$(RM) -rf $(MODULES_DIR)
-
- @# create jar file for modules and
- @# copy other files from all members of this module
- for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
- $(ECHO) "Creating module $$m" ; \
- $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.classlist > $(TMP)/tmp.cf ; \
- if [ -f $(MODULE_CLASSLIST)/$$m.resources ] ; then \
- $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.resources >> $(TMP)/tmp.cf ; \
- fi ; \
- $(MKDIR) -p $(ABS_MODULES_DIR)/$$m/lib; \
- $(CD) $(MODULE_CLASSES) && \
- $(BOOT_JAR_CMD) c0mf $(MODULE_JAR_MANIFEST_FILE) \
- $(ABS_MODULES_DIR)/$$m/lib/$$m.jar \
- @$(TMP)/tmp.cf \
- $(BOOT_JAR_JFLAGS); \
- for s in `$(GREP) "^$$m" $(MODULES_LIST)` ; do \
- if [ -d $(TMP)/$$s ] ; then \
- $(CP) -rf $(TMP)/$$s/* $(ABS_MODULES_DIR)/$$m; \
- $(RM) -rf $(ABS_MODULES_DIR)/$$m/classes; \
- fi \
- done \
- done
- @$(CD) $(MODULE_CLASSES) && $(java-vm-cleanup)
- @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-$(MODULE_JAR_MANIFEST_FILE):
- $(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) > $@
-
-clean clobber::
- $(RM) -rf $(MODULE_CLASSLIST)
- $(RM) -rf $(MODULES_DIR)
- $(RM) $(MODULE_JAR_MANIFEST_FILE)
diff --git a/jdk/make/modules/bootmodule.roots b/jdk/make/modules/bootmodule.roots
deleted file mode 100644
index a72115d97f1..00000000000
--- a/jdk/make/modules/bootmodule.roots
+++ /dev/null
@@ -1,199 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# List of root classes/methods, each line of the following syntax:
-#
-# |*
-# exclude |
-
-# The boot module generated based on this rootset does not support
-# - security permission check
-# - non-standard charset
-# - logging output
-# - resource bundles
-# including error output from the launcher
-
-# VM preloaded classes
-java.lang.Object
-java.lang.String
-java.lang.Class
-java.lang.Cloneable
-java.lang.ClassLoader
-java.lang.System
-java.lang.Throwable
-java.lang.Error
-java.lang.ThreadDeath
-java.lang.Exception
-java.lang.RuntimeException
-java.security.ProtectionDomain
-java.security.AccessControlContext
-java.lang.ClassNotFoundException
-java.lang.NoClassDefFoundError
-java.lang.ClassCastException
-java.lang.ArrayStoreException
-java.lang.VirtualMachineError
-java.lang.OutOfMemoryError
-java.lang.StackOverflowError
-java.lang.IllegalMonitorStateException
-java.lang.ref.Reference
-java.lang.ref.SoftReference
-java.lang.ref.WeakReference
-java.lang.ref.FinalReference
-java.lang.ref.PhantomReference
-java.lang.ref.Finalizer
-java.lang.Runnable
-java.lang.Thread
-java.lang.ThreadGroup
-java.util.Properties
-java.lang.reflect.AccessibleObject
-java.lang.reflect.Member
-java.lang.reflect.Field
-java.lang.reflect.Method
-java.lang.reflect.Constructor
-java.lang.reflect.Type
-sun.reflect.MagicAccessorImpl
-sun.reflect.MethodAccessorImpl
-sun.reflect.ConstructorAccessorImpl
-sun.reflect.DelegatingClassLoader
-sun.reflect.ConstantPool
-sun.reflect.UnsafeStaticFieldAccessorImpl
-java.util.Vector
-java.lang.StringBuffer
-java.lang.StackTraceElement
-java.nio.Buffer
-java.lang.Boolean
-java.lang.Character
-java.lang.Float
-java.lang.Double
-java.lang.Byte
-java.lang.Short
-java.lang.Integer
-java.lang.Long
-java.lang.NullPointerException
-java.lang.ArithmeticException
-java.lang.Compiler
-
-
-# Root methods
-java.lang.ClassLoader.getSystemClassLoader ()Ljava/lang/ClassLoader;
-java.lang.System.initializeSystemClass ()V
-sun.launcher.LauncherHelper.checkAndLoadMain (ZZLjava/lang/String;)Ljava/lang/Object;
-
-# The tool doesn't automatically find superclasses and parse the method
-# if overridden as it tries to reduce unnecessary classes being pulled in.
-# The following forces the dependency to be included the result.
-sun.net.www.protocol.file.Handler. ()V
-sun.net.www.protocol.jar.Handler. ()V
-sun.net.www.protocol.file.Handler.openConnection *
-sun.net.www.protocol.jar.Handler.openConnection *
-sun.misc.URLClassPath$JarLoader. (Ljava/net/URL;Ljava/net/URLStreamHandler;Ljava/util/HashMap;)V
-sun.misc.URLClassPath$FileLoader. (Ljava/net/URL;)V
-sun.misc.URLClassPath$FileLoader.getClassPath *
-sun.misc.URLClassPath$FileLoader.getResource *
-sun.misc.URLClassPath$JarLoader.getResource *
-sun.misc.URLClassPath$JarLoader.getClassPath *
-
-# permission collections
-java.io.FilePermission.newPermissionCollection ()Ljava/security/PermissionCollection;
-java.security.BasicPermission.newPermissionCollection ()Ljava/security/PermissionCollection;
-
-# native
-java.io.UnixFileSystem
-java.io.UnixFileSystem. ()V
-java.io.UnixFileSystem.canonicalize *
-java.io.Win32FileSystem
-java.io.Win32FileSystem. ()V
-java.io.Win32FileSystem.canonicalize *
-java.io.WinNTFileSystem
-java.io.WinNTFileSystem. ()V
-java.io.WinNTFileSystem.canonicalize *
-
-# missing
-java.util.HashMap. ()V
-java.util.HashMap$EntrySet.iterator *
-
-# Called from native GetStringPlatformChars (jni_util.c)
-java.lang.String.getBytes *
-
-# charset
-sun.nio.cs.US_ASCII.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_8.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_8.newDecoder *
-sun.nio.cs.UTF_16.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_16.newDecoder *
-sun.nio.cs.UTF_32.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_32.newDecoder *
-
-# hashcode
-java.util.jar.Attributes$Name.hashCode *
-
-# nio
-sun.nio.ByteBuffered
-sun.nio.ch.DirectBuffer
-java.nio.DirectByteBuffer
-java.nio.MappedByteBuffer
-java.nio.DirectLongBufferU
-
-# resource files
-sun.launcher.resources.launcher
-
-sun.misc.Launcher$AppClassLoader.getPermissions *
-sun.misc.Launcher$AppClassLoader.loadClass (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$AppClassLoader.findClass (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$ExtClassLoader.getPermissions *
-sun.misc.Launcher$ExtClassLoader.loadClass (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$ExtClassLoader.findClass (Ljava/lang/String;)Ljava/lang/Class;
-java.lang.ClassLoader.checkPackageAccess *
-java.lang.ClassLoader.findClass *
-java.lang.ClassLoader.defineClass *
-java.net.URLClassLoader.getPermissions *
-java.net.URLClassLoader.findClass *
-java.net.URLClassLoader.defineClass *
-java.security.SecureClassLoader.defineClass *
-# need to parse superclasses
-java.security.SecureClassLoader. ()V
-
-exclude sun.security.provider.PolicyFile.
-exclude java.lang.ClassLoader.compareCerts
-exclude java.security.cert.Certificate.equals
-# unsigned jars - no verifier
-exclude java.util.jar.JarFile.initializeVerifier
-exclude java.util.jar.JarVerifier
-exclude sun.security.util.SignatureFileVerifier.
-
-
-# what about other charset
-exclude sun.misc.Service
-exclude java.util.ServiceLoader
-
-# exclude support for localized messages
-exclude java.util.ResourceBundle.getBundle
-exclude java.text.MessageFormat
-exclude sun.util.logging.PlatformLogger$LoggerProxy.format *
-
-# exclude nio and miscellaneous classes
-exclude java.nio.channels.**
-exclude sun.misc.FloatingDecimal
-exclude sun.misc.FormattedFloatingDecimal
-exclude sun.misc.FDBigInt
diff --git a/jdk/make/modules/jdk7.depconfig b/jdk/make/modules/jdk7.depconfig
deleted file mode 100644
index 8c6d85fb099..00000000000
--- a/jdk/make/modules/jdk7.depconfig
+++ /dev/null
@@ -1,473 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# private java.lang.Object createInetSocketAddress(java.lang.String, int)
-@ClassForName
- com.sun.jndi.ldap.Connection -> java.net.InetSocketAddress
- com.sun.jndi.ldap.Connection -> java.net.SocketAddress
-
-# com.sun.jndi.ldap.VersionHelper
-@ClassForName(optional)
- com.sun.jndi.ldap.VersionHelper -> com.sun.jndi.ldap.VersionHelper*
-
-# private static void initMethodHandles()
-@ClassForName
- com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.CORBA.Stub
- com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.PortableRemoteObject
-
-# com.sun.naming.internal.ResourceManager$AppletParameter
-@ClassForName(optional)
- com.sun.naming.internal.ResourceManager$AppletParameter -> java.applet.Applet
-
-# private static boolean loadProviderAsService()
-@Provider
- com.sun.net.httpserver.spi.HttpServerProvider -> META-INF/services/com.sun.net.httpserver.spi.HttpServerProvider
-
-# com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT
-@ClassForName
- com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT -> javax.xml.XMLConstants
-
-# public static java.beans.PersistenceDelegate getPersistenceDelegate(java.lang.Class)
-@ClassForName
- java.beans.MetaData -> java.beans.*_PersistenceDelegate
-
-# private static java.lang.reflect.Method getNanosMethod()
-@ClassForName(optional)
- java.beans.java_sql_Timestamp_PersistenceDelegate -> java.sql.Timestamp
-
-# java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate
-@ClassForName
- java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate -> java.util.Collections$CheckedCollection
-
-# java.beans.java_util_Collections$CheckedMap_PersistenceDelegate
-@ClassForName
- java.beans.java_util_Collections$CheckedMap_PersistenceDelegate -> java.util.Collections$CheckedMap
-
-# private static java.lang.Object getType(java.lang.Object)
-@ClassForName
- java.beans.java_util_EnumMap_PersistenceDelegate -> java.util.EnumMap
-
-# private java.lang.Integer getAxis(java.lang.Object)
-@ClassForName
- java.beans.javax_swing_Box_PersistenceDelegate -> javax.swing.BoxLayout
-
-# java.lang.Double
-@Inline
- java.lang.Double -> sun.misc.FloatConsts
- java.lang.Double -> sun.misc.DoubleConsts
-
-# java.lang.Float
-@Inline
- java.lang.Float -> sun.misc.FloatConsts
- java.lang.Float -> sun.misc.DoubleConsts
-
-# java.net.DefaultDatagramSocketImplFactory
-@ClassForName(optional)
- java.net.DefaultDatagramSocketImplFactory -> java.net.*DatagramSocketImpl
-
-# private static sun.net.spi.nameservice.NameService createNSProvider(java.lang.String)
-@Provider
- java.net.InetAddress -> META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
-
-# static java.net.InetAddressImpl create()
-@ClassForName
- java.net.InetAddressImplFactory -> java.net.*Inet[46]AddressImpl
-
-# private static void init()
-@NativeFindClass
- java.net.PlainDatagramSocketImpl -> java.io.FileDescriptor
-
-# java.net.ProxySelector
-@ClassForName
- java.net.ProxySelector -> sun.net.spi.DefaultProxySelector
-
-# static java.net.URLStreamHandler getURLStreamHandler(java.lang.String)
-@ClassForName(optional)
- java.net.URL -> sun.net.www.protocol.*.Handler
-
-# private java.net.ContentHandler lookupContentHandlerClassFor(java.lang.String)
-@ClassForName
- java.net.URLConnection -> sun.net.www.content.*
-
-# private static java.nio.channels.spi.AsynchronousChannelProvider loadProviderAsService()
-@Provider
- java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder -> META-INF/services/java.nio.channels.spi.AsynchronousChannelProvider
-
-# private static boolean loadProviderFromProperty()
-@ClassForName
- java.nio.channels.spi.SelectorProvider -> sun.nio.ch.DefaultSelectorProvider
-
-# private static boolean loadProviderAsService()
-@Provider
- java.nio.channels.spi.SelectorProvider -> META-INF/services/java.nio.channels.spi.SelectorProvider
-
-# private static java.util.Iterator providers()
-@Provider
- java.nio.charset.Charset -> META-INF/services/java.nio.charset.spi.CharsetProvider
-
-# private static void probeExtendedProvider()
-@ClassForName(optional)
- java.nio.charset.Charset -> sun.nio.cs.ext.ExtendedCharsets
-
-# public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map, java.lang.ClassLoader)
-@Provider
- java.nio.file.FileSystems -> META-INF/services/java.nio.file.FileSystemProvider
-
-# private static java.util.List loadInstalledDetectors()
-@Provider
- java.nio.file.Files$DefaultFileTypeDetectorHolder -> META-INF/services/java.nio.file.spi.FileTypeDetector
-
-# public static java.util.List installedProviders()
-@Provider
- java.nio.file.spi.FileSystemProvider -> META-INF/services/java.nio.file.FileSystemProvider
-
-# private static java.rmi.server.RMIClassLoaderSpi initializeProvider()
-@Provider
- java.rmi.server.RMIClassLoader -> META-INF/services/java.rmi.server.RMIClassLoaderSpi
-
-# private static void initializeSystemScope()
-@ClassForName(optional)
- java.security.IdentityScope -> sun.security.provider.IdentityDatabase
-
-# static java.security.Policy getPolicyNoCheck()
-@ClassForName
- java.security.Policy -> sun.security.provider.PolicyFile
-
-# private static java.lang.Class getSpiClass(java.lang.String)
-@ClassForName
- java.security.Security -> java.security.*Spi
-
-# private static void invalidateSMCache(java.lang.String)
-@ClassForName
- java.security.Security -> java.lang.SecurityManager
-
-# private static void loadInitialDrivers()
-@Provider
- java.sql.DriverManager -> META-INF/services/java.sql.Driver
-
-# private static java.text.BreakIterator createBreakInstance(java.util.Locale, int, java.lang.String, java.lang.String)
-@Provider
- java.text.BreakIterator -> META-INF/services/java.util.spi.BreakIteratorProvider
-
-# public static java.text.Collator getInstance(java.util.Locale)
-@Provider
- java.text.Collator -> META-INF/services/java.util.spi.CollatorProvider
-
-# private static java.text.DateFormat get(int, int, int, java.util.Locale)
-@Provider
- java.text.DateFormat -> META-INF/services/java.util.spi.DateNameProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
- java.text.DateFormatSymbols -> META-INF/services/java.util.spi.DateFormatSymbolsProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
- java.text.DecimalFormatSymbols -> META-INF/services/java.util.spi.DecimalFormatSymbolsProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
- java.text.NumberFormat -> META-INF/services/java.util.spi.NumberFormatProvider
-
-# public java.lang.String getDisplayName(java.util.Locale)
-@Provider
- java.util.Currency -> META-INF/services/java.util.spi.CurrencyNameProvider
-
-# java.util.Formatter
-@Inline
- java.util.Formatter -> sun.misc.DoubleConsts
-
-# java.util.Locale
-@Inline
- java.util.Locale -> java.util.LocaleISOData
-
-# private java.lang.String getDisplayString(java.lang.String, java.util.Locale, int)
-@Provider
- java.util.Locale -> META-INF/services/java.util.spi.LocaleNameProvider
-
-# private static java.util.prefs.PreferencesFactory factory1()
-@ClassForName
- java.util.prefs.Preferences -> java.util.prefs.WindowsPreferencesFactory
- java.util.prefs.Preferences -> java.util.prefs.FileSystemPreferencesFactory
-
-# private static java.util.prefs.PreferencesFactory factory1()
-@Provider
- java.util.prefs.Preferences -> META-INF/services/java.util.prefs.PreferencesFactory
-
-# public void registerApplicationClasspathSpis()
-@Provider
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.IIOServiceProvider
-
-# private void registerInstalledProviders()
-@Provider
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderSpi
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageWriterSpi
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderWriterSpi
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageTranscoderSpi
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageInputStreamSpi
- javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageOutputStreamSpi
-
-# public javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String, byte[], int, int)
-@Provider
- javax.naming.ldap.StartTlsRequest -> META-INF/services/javax.naming.ldap.StartTlsResponse
-
-# private static java.util.ArrayList getAllLookupServices()
-@Provider
- javax.print.PrintServiceLookup -> META-INF/services/javax.print.PrintServiceLookup
-
-# private static java.util.ArrayList getAllFactories()
-@Provider
- javax.print.StreamPrintServiceFactory -> META-INF/services/javax.print.StreamPrintServiceFactory
-
-# private void initEngines(java.lang.ClassLoader)
-@Provider
- javax.script.ScriptEngineManager -> META-INF/services/javax.script.ScriptEngineFactory
-
-# private void initializeInputMethodLocatorList()
-@Provider
- sun.awt.im.ExecutableInputMethodManager -> META-INF/services/java.awt.im.spi.InputMethodDescriptor
-
-# private static java.lang.Class getConverterClass(int, java.lang.String)
-@ClassForName(optional)
- sun.io.Converters -> sun.io.*
-
-# public static sun.java2d.cmm.PCMM getModule()
-@Provider
- sun.java2d.cmm.CMSManager -> META-INF/services/sun.java2d.cmm.PCMM
-
-# public static sun.java2d.pipe.RenderingEngine getInstance()
-@Provider
- sun.java2d.pipe.RenderingEngine -> META-INF/services/sun.java2d.pipe.RenderingEngine
-
-# public static sun.java2d.pipe.RenderingEngine getInstance()
-@ClassForName(optional)
- sun.java2d.pipe.RenderingEngine -> sun.dc.DuctusRenderingEngine
-
-# sun.misc.FloatingDecimal
-@Inline
- sun.misc.FloatingDecimal -> sun.misc.FloatConsts
- sun.misc.FloatingDecimal -> sun.misc.DoubleConsts
-
-# sun.misc.FormattedFloatingDecimal
-@Inline
- sun.misc.FormattedFloatingDecimal -> sun.misc.FloatConsts
- sun.misc.FormattedFloatingDecimal -> sun.misc.DoubleConsts
-
-# sun.misc.FpUtils
-@Inline
- sun.misc.FpUtils -> sun.misc.FloatConsts
- sun.misc.FpUtils -> sun.misc.DoubleConsts
-
-# public java.net.URLStreamHandler createURLStreamHandler(java.lang.String)
-@ClassForName(optional)
- sun.misc.Launcher$Factory -> sun.net.www.protocol.*.Handler
-
-# private static sun.net.NetHooks$Provider loadProvider(java.lang.String)
-@ClassForName(optional)
- sun.net.NetHooks -> sun.net.spi.SdpProvider
-
-# sun.net.idn.StringPrep
-@Inline
- sun.net.idn.StringPrep -> sun.net.idn.UCharacterDirection
-
-# private static boolean init()
-@NativeFindClass
- sun.net.spi.DefaultProxySelector -> java.net.Proxy
- sun.net.spi.DefaultProxySelector -> java.net.Proxy$Type
- sun.net.spi.DefaultProxySelector -> java.net.InetSocketAddress
-
-# private static java.nio.channels.Channel createChannel()
-@ClassForName
- sun.nio.ch.InheritedChannel -> java.io.FileDescriptor
-
-# private static void initDBBConstructor()
-@ClassForName
- sun.nio.ch.Util -> java.nio.DirectByteBuffer
-
-# private static void initDBBRConstructor()
-@ClassForName
- sun.nio.ch.Util -> java.nio.DirectByteBufferR
-
-# private java.nio.charset.Charset lookup(java.lang.String)
-@ClassForName(optional)
- sun.nio.cs.FastCharsetProvider -> sun.nio.cs.*
-
-# sun.nio.cs.ext.ExtendedCharsets
-@ClassForName(optional)
- sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.*
-
-# sun.nio.cs.ext.ExtendedCharsets
-@ClassForName(optional)
- sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.*
-
-# public static java.nio.file.spi.FileSystemProvider create()
-@ClassForName
- sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.SolarisFileSystemProvider
- sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.LinuxFileSystemProvider
-
-# sun.rmi.server.MarshalInputStream
-@ClassForName
- sun.rmi.server.MarshalInputStream -> sun.rmi.server.Activation$ActivationSystemImpl_Stub
- sun.rmi.server.MarshalInputStream -> sun.rmi.registry.RegistryImpl_Stub
-
-# private java.security.Provider doLoadProvider()
-@ClassForName(optional)
- sun.security.jca.ProviderConfig -> sun.security.pkcs11.SunPKCS11
- sun.security.jca.ProviderConfig -> sun.security.provider.Sun
- sun.security.jca.ProviderConfig -> sun.security.rsa.SunRsaSign
- sun.security.jca.ProviderConfig -> sun.security.ec.SunEC
- sun.security.jca.ProviderConfig -> com.sun.net.ssl.internal.ssl.Provider
- sun.security.jca.ProviderConfig -> com.sun.crypto.provider.SunJCE
- sun.security.jca.ProviderConfig -> sun.security.jgss.SunProvider
- sun.security.jca.ProviderConfig -> com.sun.security.sasl.Provider
- sun.security.jca.ProviderConfig -> org.jcp.xml.dsig.internal.dom.XMLDSigRI
- sun.security.jca.ProviderConfig -> sun.security.smartcardio.SunPCSC
- sun.security.jca.ProviderConfig -> sun.security.mscapi.SunMSCAPI
-
-# public static java.security.Provider getSunProvider()
-@ClassForName
- sun.security.jca.Providers -> sun.security.provider.Sun
- sun.security.jca.Providers -> sun.security.provider.VerificationProvider
-
-# private static sun.security.jgss.spi.MechanismFactory getMechFactoryImpl(java.security.Provider, java.lang.String, org.ietf.jgss.Oid, sun.security.jgss.GSSCaller)
-@ClassForName
- sun.security.jgss.ProviderList -> sun.security.jgss.spi.MechanismFactory
-
-# sun.security.jgss.wrapper.SunNativeProvider
-@NativeFindClass
- sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.Oid
- sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.GSSException
- sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSNameElement
- sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSCredElement
- sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.NativeGSSContext
- sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.SunNativeProvider
- sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.MessageProp
- sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.ChannelBinding
- sun.security.jgss.wrapper.SunNativeProvider -> java.net.InetAddress
- sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSLibStub
-
-# static void ensureLoaded()
-@NativeFindClass
- sun.security.krb5.Credentials -> sun.security.krb5.internal.Krb5
- sun.security.krb5.Credentials -> sun.security.krb5.internal.Ticket
- sun.security.krb5.Credentials -> sun.security.krb5.PrincipalName
- sun.security.krb5.Credentials -> sun.security.util.DerValue
- sun.security.krb5.Credentials -> sun.security.krb5.EncryptionKey
- sun.security.krb5.Credentials -> sun.security.krb5.internal.TicketFlags
- sun.security.krb5.Credentials -> sun.security.krb5.internal.KerberosTime
-
-# public static java.lang.String getDefaultCacheName()
-@ClassForName(optional)
- sun.security.krb5.internal.ccache.FileCredentialsCache -> com.sun.security.auth.module.UnixSystem
-
-# sun.security.pkcs.PKCS9Attribute
-@ClassForName
- sun.security.pkcs.PKCS9Attribute -> sun.security.util.ObjectIdentifier
- sun.security.pkcs.PKCS9Attribute -> java.util.Date
- sun.security.pkcs.PKCS9Attribute -> sun.security.pkcs.SignerInfo
- sun.security.pkcs.PKCS9Attribute -> sun.security.x509.CertificateExtensions
-
-# protected T engineGetKeySpec(java.security.Key, java.lang.Class)
-@ClassForName
- sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPublicKeySpec
- sun.security.provider.DSAKeyFactory -> java.security.spec.X509EncodedKeySpec
- sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPrivateKeySpec
- sun.security.provider.DSAKeyFactory -> java.security.spec.PKCS8EncodedKeySpec
-
-# protected T engineGetParameterSpec(java.lang.Class)
-@ClassForName
- sun.security.provider.DSAParameters -> java.security.spec.DSAParameterSpec
-
-# sun.security.provider.VerificationProvider
-@ClassForName(optional)
- sun.security.provider.VerificationProvider -> sun.security.provider.Sun
- sun.security.provider.VerificationProvider -> sun.security.rsa.SunRsaSign
-
-# sun.security.provider.certpath.URICertStore$LDAP
-@ClassForName(optional)
- sun.security.provider.certpath.URICertStore$LDAP -> sun.security.provider.certpath.ldap.LDAPCertStoreHelper
-
-# sun.security.smartcardio.PCSC
-@NativeFindClass
- sun.security.smartcardio.PCSC -> sun.security.smartcardio.PCSCException
-
-# sun.security.ssl.HandshakeMessage
-@ClassForName
- sun.security.ssl.HandshakeMessage -> java.security.MessageDigest$Delegate
-
-# sun.security.ssl.JsseJce
-@ClassForName(optional)
- sun.security.ssl.JsseJce -> sun.security.krb5.PrincipalName
-
-# sun.security.x509.OIDMap$OIDInfo
-@ClassForName
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectKeyIdentifierExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.KeyUsageExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PrivateKeyUsageExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectAlternativeNameExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuerAlternativeNameExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.BasicConstraintsExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLNumberExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLReasonCodeExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NameConstraintsExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyMappingsExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityKeyIdentifierExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyConstraintsExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NetscapeCertTypeExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificatePoliciesExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.ExtendedKeyUsageExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.InhibitAnyPolicyExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLDistributionPointsExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificateIssuerExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectInfoAccessExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityInfoAccessExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuingDistributionPointExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.DeltaCRLIndicatorExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.FreshestCRLExtension
- sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.OCSPNoCheckExtension
-
-# sun.util.LocaleServiceProviderPool$AllAvailableLocales
-@Provider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.BreakIteratorProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.CollatorProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatSymbolsProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.NumberFormatProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.CurrencyNameProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.LocaleNameProvider
- sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.TimeZoneNameProvider
-
-# private static final java.lang.String[] retrieveDisplayNames(sun.util.resources.OpenListResourceBundle, java.lang.String, java.util.Locale)
-@Provider
- sun.util.TimeZoneNameUtility -> META-INF/services/java.util.spi.TimeZoneNamePProvider
-
-# public static sun.util.calendar.CalendarSystem forName(java.lang.String)
-@ClassForName
- sun.util.calendar.CalendarSystem -> sun.util.calendar.Gregorian
- sun.util.calendar.CalendarSystem -> sun.util.calendar.LocalGregorianCalendar
- sun.util.calendar.CalendarSystem -> sun.util.calendar.JulianCalendar
-
-# sun.util.logging.LoggingSupport
-@ClassForName(optional)
- sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl
diff --git a/jdk/make/modules/modules.config b/jdk/make/modules/modules.config
deleted file mode 100644
index 2d5d785bf46..00000000000
--- a/jdk/make/modules/modules.config
+++ /dev/null
@@ -1,928 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// These classes are not referenced in the JDK but we can't
-// remove them for compatibility reason. Define this module
-// first so that other modules don't need to exclude these clases
-module private-legacy {
- include sun.misc.Cache*,
- sun.misc.ClassLoaderUtil,
- sun.misc.Compare,
- sun.misc.ConditionLock,
- sun.misc.CRC16,
- sun.misc.Lock,
- sun.misc.Regexp,
- sun.misc.RequestProcessor,
- sun.misc.Sort,
- sun.misc.Request,
- sun.misc.Timeable,
- sun.misc.Timer,
- sun.misc.TimerThread,
- sun.misc.TimerTickThread,
- sun.misc.UCDecoder,
- sun.misc.UCEncoder,
- sun.misc.UUDecoder,
- sun.misc.UUEncoder,
- com.sun.net.ssl.SSLContext,
- sun.net.NetworkServer,
- sun.net.URLCanonicalizer,
- sun.reflect.misc.ConstructorUtil,
- sun.reflect.FieldInfo,
- sun.reflect.SignatureIterator,
- sun.reflect.generics.reflectiveObjects.NotImplementedException,
- sunw.io.Serializable,
- sunw.util.EventListener,
- sunw.util.EventObject;
-}
-
-// Deprecated classes that aren't referenced/used go here.
-module deprecated {
- // add deprecated security classes once b78 is promoted
-}
-
-/**************************************************************************/
-
-module base {
- // core classes
- include java.lang.*,
- java.lang.annotation.*,
- java.lang.ref.*,
- java.lang.reflect.*,
- java.math.*,
- java.net.*,
- java.util.*,
- java.util.concurrent.**,
- java.util.jar.*,
- java.util.regex.*,
- java.util.spi.*,
- java.util.zip.*,
- java.text.**;
-
- exclude java.util.jar.Pack200*,
- java.util.XMLUtils,
- java.text.Bidi;
-
- include java.io.*, java.nio.*, java.nio.charset.**;
- exclude java.io.TempFileHelper, java.nio.BufferPoolMXBean;
-
- // security APIs
- // javax.crypto and javax.security.auth are included to avoid inconsistent
- // spliting of JCA and JAAS. This adds about 85k. Also note that some deprecated
- // classes must be included for now (see 6876158, 6876170)
- include java.security.*,
- java.security.cert.*,
- java.security.interfaces.*,
- java.security.spec.*,
- javax.security.auth.**,
- javax.crypto.**;
-
- // Sun and RSA security providers (except LDAP CertStore)
- // roots sun.security.provider.* sun.security.provider.certpath.* sun.security.rsa.*
- include com.sun.security.auth.PrincipalComparator,
- com.sun.security.auth.SubjectCodeSource,
- com.sun.security.auth.login.**,
- com.sun.security.auth.Policy*,
- sun.security.action.*,
- sun.security.ec.*,
- sun.security.jca.*,
- sun.security.pkcs.*,
- sun.security.provider.*,
- sun.security.provider.certpath.*,
- sun.security.rsa.*,
- sun.security.util.*,
- sun.security.validator.*,
- sun.security.x509.*,
- sun.security.timestamp.*;
-
- // this list is based on the classlist generated from the rootset
- // need investigation
- exclude sun.security.ec.ECD*,
- sun.security.ec.ECKeyPairGenerator,
- sun.security.ec.SunEC*,
- sun.security.pkcs.PKCS10*,
- sun.security.pkcs.EncodingException,
- sun.security.util.AuthResources_*,
- sun.security.util.Resources_*,
- sun.security.util.BigInt,
- sun.security.util.HostnameChecker,
- sun.security.x509.CertAndKeyGen,
- sun.security.util.PathList;
-
- // Kerberos not needed
- exclude javax.security.auth.kerberos.**,
- sun.security.jgss.**,
- sun.security.krb5.**,
- sun.security.ssl.Kerberos*,
- org.ietf.jgss.**;
-
- // property events and annotations
- include java.beans.ChangeListenerMap,
- java.beans.IndexedPropertyChangeEvent,
- java.beans.PropertyChange*,
- java.beans.PropertyVetoException,
- java.beans.VetoableChange*,
- java.beans.ConstructorProperties;
-
- // mandatory charsets
- include sun.nio.cs.*;
-
- exclude sun.nio.cs.AbstractCharsetProvider,
- sun.nio.cs.CharsetMapping,
- sun.nio.cs.IBM*,
- sun.nio.cs.ISO*,
- sun.nio.cs.KOI8_*,
- sun.nio.cs.MS125*,
- sun.nio.cs.UTF_32*,
- sun.nio.cs.SingleByteDecoder,
- sun.nio.cs.SingleByteEncoder;
-
- allow sun.nio.cs.ISO_8859_1,
- sun.nio.cs.ISO_8859_15,
- sun.nio.cs.MS1252;
-
- include sun.text.*,
- sun.text.normalizer.*;
-
- // resource files
- include sun/text/resources/*.icu;
-
- exclude sun.text.bidi.*,
- sun.text.CharArrayCodePointIterator,
- sun.text.CharSequenceCodePointIterator,
- sun.text.CharacterIteratorCodePointIterator,
- sun.text.CodePointIterator;
-
- include sun.util.*,
- sun.util.calendar.*,
- sun.util.logging.*,
- sun.util.resources.LocaleData,
- sun.util.resources.LocaleNamesBundle,
- sun.util.resources.OpenListResourceBundle;
-
- // US_en locale
- include sun.text.resources.BreakIteratorInfo,
- sun.text.resources.FormatData,
- sun.text.resources.FormatData_en_US,
- sun.util.resources.CalendarData,
- sun.util.resources.CalendarData_en,
- sun.util.resources.TimeZoneNames,
- sun.util.resources.TimeZoneNames_en,
- sun.util.resources.TimeZoneNamesBundle,
- sun.util.resources.LocaleNames,
- sun.util.resources.LocaleNames_en,
- sun.util.resources.LocalenamesBundles,
- sun.util.resources.CurrencyNames,
- sun.util.resources.CurrencyNames_en_US,
- sun.util.EmptyListResourceBundle;
-
- // resources file needed by
- // - sun.misc.ExtensionInfo
- // - sun.security.provider.PolicyFile
- // - com.sun.security.auth.PolicyFile
- include sun.misc.resources.Messages,
- sun.security.util.Resources,
- sun.security.util.AuthResources;
-
- // java.nio.channels and java.nio.file not in base
- include sun.nio.ch.Interruptible,
- sun.nio.ch.DirectBuffer,
- sun.nio.ByteBuffered;
-
- include sun.reflect.**;
-
- // protocol handlers
- include sun.net.www.protocol.file.*,
- sun.net.www.protocol.jar.*,
- sun.net.www.protocol.http.*;
-
- include sun.net.*,
- sun.net.spi.*,
- sun.net.idn.*,
- sun.net.util.*,
- sun.net.www.*,
- sun.net.www.http.*,
- sun.net.spi.nameservice.*;
-
- // resource file for sun.net.idn
- include sun/net/idn/*;
-
- // classes in net-compat
- exclude sun.net.Telnet*, sun.net.TransferProtocolClient;
-
- // classes in deploy
- exclude sun.net.www.protocol.http.AuthCacheBridge;
-
- // classes in security-jsse
- exclude java.net.SecureCacheResponse;
-
- // launcher
- include sun.launcher.LauncherHelper, sun.launcher.resources.launcher;
-
- include sun.misc.*;
- exclude sun.misc.FIFOQueueEnumerator,
- sun.misc.LIFOQueueEnumerator,
- sun.misc.GC,
- sun.misc.PerformanceLogger,
- sun.misc.Queue,
- sun.misc.QueueElement,
- sun.misc.Ref,
- sun.misc.VMSupport;
-
- // On Windows, OSEnvironment dependency
- include sun.io.Win32ErrorMode;
-}
-
-/**************************************************************************/
-
-module charsets {
- include sun.nio.cs.ext.**;
-
- include sun.nio.cs.AbstractCharsetProvider,
- sun.nio.cs.CharsetMapping,
- sun.nio.cs.IBM*,
- sun.nio.cs.ISO*,
- sun.nio.cs.KOI8_*,
- sun.nio.cs.MS125*,
- sun.nio.cs.SingleByte*,
- sun.nio.cs.UTF_32*;
-
- exclude sun.nio.cs.ISO_8859_1,
- sun.nio.cs.MS1252;
-
- // legacy sun.io converters
- include sun.io.*;
-}
-
-/**************************************************************************/
-
-// For now, retains the current JRE extensions where localedata.jar in jre/lib/ext
-module localedata {
- include sun.util.resources.*_ar,
- sun.util.resources.*_ar_*,
- sun.util.resources.*_hi,
- sun.util.resources.*_hi_*,
- sun.util.resources.*_iw,
- sun.util.resources.*_iw_*,
- sun.util.resources.*_ja,
- sun.util.resources.*_ja_*,
- sun.util.resources.*_ko,
- sun.util.resources.*_ko_*,
- sun.util.resources.*_th,
- sun.util.resources.*_th_*,
- sun.util.resources.*_vi,
- sun.util.resources.*_vi_*,
- sun.util.resources.*_zh,
- sun.util.resources.*_zh_*;
- include sun.text.resources.*_ar,
- sun.text.resources.*_ar_*,
- sun.text.resources.*_hi,
- sun.text.resources.*_hi_*,
- sun.text.resources.*_iw,
- sun.text.resources.*_iw_*,
- sun.text.resources.*_ja,
- sun.text.resources.*_ja_*,
- sun.text.resources.*_ko,
- sun.text.resources.*_ko_*,
- sun.text.resources.*_th,
- sun.text.resources.*_th_*,
- sun.text.resources.*_vi,
- sun.text.resources.*_vi_*,
- sun.text.resources.*_zh,
- sun.text.resources.*_zh_*;
-}
-
-module resources {
- include sun.text.resources.*, sun.util.resources.*, sun.misc.resources.*;
-}
-
-/**************************************************************************/
-
-module nio {
- include java.nio.channels.**, java.nio.file.**, com.sun.nio.file.**;
-
- // this is excluded from base
- include java.io.TempFileHelper;
-
- // provider implementations and their dependencies
- include sun.nio.ch.*, sun.nio.fs.**;
- exclude sun.nio.ch.Sctp*;
-}
-
-/**************************************************************************/
-
-module pack200 {
- include java.util.jar.Pack200*, com.sun.java.util.jar.pack.**;
-}
-
-/**************************************************************************/
-
-module logging {
- include java.util.logging.*, sun.util.logging.**;
- exclude java.util.logging.PlatformLoggingMXBean;
-
- // Formatter for HTTP messages
- include sun.net.www.protocol.http.logging.*;
-}
-
-/**************************************************************************/
-
-module management-snmp {
- include com.sun.jmx.snmp.**, sun.management.snmp.**;
-}
-
-module management-iiop {
- include com.sun.jmx.remote.protocol.iiop.*;
-
- // stubs and ties
- include javax.management.remote.rmi._*,
- org.omg.stub.javax.management.remote.rmi.**;
-}
-
-module management {
- include java.lang.management.*, com.sun.management.**, sun.management.**;
- include javax.management.**, com.sun.jmx.**;
-
- // other management interfaces
- include java.nio.BufferPoolMXBean;
- include java.util.logging.PlatformLoggingMXBean;
-
- // supporting classes in sun.misc
- include sun.misc.VMSupport;
-}
-
-/**************************************************************************/
-
-module tracing {
- // tracing
- include com.sun.tracing.**, sun.tracing.**;
-}
-
-module instrument {
- // java.lang.instrument
- include java.lang.instrument.*, sun.instrument.*;
-
- // HPROF support
- include com.sun.demo.jvmti.hprof.*;
-
- include tracing;
-}
-
-/**************************************************************************/
-
-module rmi-activation {
- include java.rmi.activation.**,
- sun.rmi.server.Act*,
- sun.rmi.server.InactiveGroupException;
-}
-
-module rmic {
- // rmic is included in tools
- include sun.rmi.rmic.**;
-}
-
-module rmi {
- include java.rmi.**, sun.rmi.**, com.sun.rmi.**;
-
- // SSL factories are in rmi
- include javax.rmi.ssl.**;
-
- // supporting classes in sun.misc and dependencies
- include sun.misc.GC;
-}
-
-/**************************************************************************/
-
-module prefs {
- include java.util.prefs.*;
-}
-
-/**************************************************************************/
-
-module security-jsse {
- include javax.net.**,
- javax.security.cert.*,
- java.net.SecureCacheResponse,
- com.sun.net.ssl.**,
- com.sun.security.cert.internal.x509.*,
- sun.security.ssl.*,
- sun.net.www.protocol.https.**,
- sun.security.internal.interfaces.Tls*,
- sun.security.internal.spec.Tls*,
- sun.security.util.HostnameChecker;
-}
-
-module security-sunpkcs11 {
- include sun.security.pkcs11.**;
-}
-
-module security-sunjce {
- include com.sun.crypto.provider.*;
-}
-
-module security-sunec {
- include sun.security.ec.*;
-}
-
-module security-sunmscapi {
- include sun.security.mscapi.*;
-}
-
-module security-kerberos {
- include javax.security.auth.kerberos.*,
- com.sun.security.jgss.**,
- com.sun.security.auth.module.Krb5LoginModule,
- com.sun.security.sasl.gsskerb.**, // GSSAPI SASL mechanism
- sun.security.jgss.**,
- sun.security.ssl.krb5.**,
- sun.security.krb5.**,
- org.ietf.jgss.**,
- sun.net.www.protocol.http.spnego.*;
-}
-
-module security-sasl {
- include javax.security.sasl.**,
- com.sun.security.sasl.**;
-}
-
-module security-xmldsig {
- include javax.xml.crypto.**,
- org.jcp.xml.dsig.**,
- com.sun.org.apache.xml.internal.security.**;
-}
-
-module security-smartcardio {
- include javax.smartcardio.**, sun.security.smartcardio.**;
-}
-
-module security-auth {
- include com.sun.security.auth.**, sun.security.util.AuthResources_*;
-}
-
-module security-misc {
- include security-auth;
-
- include sun.security.pkcs.*,
- sun.security.pkcs12.*;
-
- // this class is a candidate to be removed.
- include sun.security.util.BigInt;
-}
-
-module security-resources {
- include sun.security.util.Resources_*;
-}
-
-module security-compat {
- include java.security.acl.*, sun.security.acl.*;
-}
-
-/**************************************************************************/
-
-module jndi-ldap {
- include javax.naming.ldap.**,
- com.sun.jndi.ldap.**,
- com.sun.jndi.url.ldap.*,
- com.sun.jndi.url.ldaps.*,
- sun.security.provider.certpath.ldap.**;
-}
-
-module jndi-rmiregistry {
- include com.sun.jndi.rmi.**, com.sun.jndi.url.rmi.**;
-}
-
-module jndi-dns {
- include net-dns;
- include com.sun.jndi.dns.**, com.sun.jndi.url.dns.**;
-}
-
-module jndi-cosnaming {
- include com.sun.jndi.cosnaming.**,
- com.sun.jndi.toolkit.corba.**,
- com.sun.jndi.url.corbaname.**,
- com.sun.jndi.url.iiop.**,
- com.sun.jndi.url.iiopname.**;
-}
-
-// framework/API and classes used by providers
-module jndi {
- include javax.naming.**,
- com.sun.naming.**,
- com.sun.jndi.toolkit.ctx.**,
- com.sun.jndi.toolkit.dir.**,
- com.sun.jndi.toolkit.url.**;
-}
-
-/**************************************************************************/
-
-module jdbc-base {
- include java.sql.**, javax.sql.*;
- exclude javax.sql.XA*;
-}
-
-module jdbc-enterprise {
- include javax.sql.**, com.sun.rowset.**;
-}
-
-module jdbc-odbc {
- include sun.jdbc.odbc.**;
-}
-
-/**************************************************************************/
-
-module scripting {
- include javax.script.**;
-
- // supporting classes for scripting engines
- include com.sun.script.util.**;
-}
-
-module scripting-rhino {
- include com.sun.script.javascript.**, sun.org.mozilla.javascript.**;
-}
-
-/**************************************************************************/
-
-module httpserver {
- include com.sun.net.httpserver.**, sun.net.httpserver.**;
-}
-
-/**************************************************************************/
-
-module sctp {
- // API and dependencies
- include com.sun.nio.sctp.**, sun.nio.ch.Sctp*;
-}
-
-/**************************************************************************/
-
-module langtools {
- include javax.tools.**, javax.lang.model.**, javax.annotation.processing.**;
-
- // include mirror API for now
- include com.sun.mirror.**;
-
- // include the JSR292 APIs for now
- include java.dyn.**, sun.dyn.**;
-}
-
-/**************************************************************************/
-
-module beans {
- include java.beans.**, com.sun.beans.**, sun.beans.**;
-}
-
-/**************************************************************************/
-
-module jaxp-parsers-api {
- include javax.xml.*, javax.xml.parsers.**,
- org.w3c.dom.**, org.w3c.sax.**, org.xml.sax.**;
-}
-
-module jaxp-api {
- include javax.xml.**;
- exclude javax.xml.crypto.**, // XML-DSIG
- javax.xml.bind.**, // JAX-WS
- javax.xml.soap.**,
- javax.xml.ws.**;
-}
-
-module jaxp-xerces-impl {
- include com.sun.org.apache.xerces.internal.**;
-
- // include in xerces-impl due to circular dependencies
- include com.sun.org.apache.xml.internal.serialize.**,
- com.sun.xml.internal.stream.**;
- exclude com.sun.xml.internal.stream.buffer.**; // JAX-WS
-}
-
-// required by Xerces and JAX-WS
-module jaxp-xerces-resolver {
- include com.sun.org.apache.xml.internal.resolver.**;
-}
-
-module jaxp-xalan {
- include com.sun.org.apache.xalan.internal.**,
- com.sun.org.apache.xpath.internal.**,
- com.sun.org.apache.xml.internal.dtm.**,
- com.sun.org.apache.xml.internal.res.**,
- com.sun.org.apache.xml.internal.serializer.**,
- com.sun.org.apache.xml.internal.utils.**,
- com.sun.org.apache.bcel.internal.**,
- com.sun.org.apache.regexp.internal.**,
- com.sun.java_cup.internal.**;
-}
-
-/**************************************************************************/
-
-module jaxws-tools {
- include com.sun.codemodel.**,
- com.sun.xml.internal.dtdparser.**,
- com.sun.xml.internal.rngom.**,
- com.sun.xml.internal.xsom.**,
- com.sun.istack.internal.tools.**,
- com.sun.istack.internal.ws.**,
- com.sun.tools.internal.xjc.**,
- com.sun.tools.internal.ws.**,
- com.sun.tools.internal.jxc.**,
- org.relaxng.datatype.**;
-}
-
-module jaxws {
- include javax.jws.**,
- javax.xml.bind.**,
- javax.xml.soap.**,
- javax.xml.ws.**,
- org.relaxng.**,
- com.sun.istack.internal.*,
- com.sun.istack.internal.localization.*,
- com.sun.xml.internal.**;
-
- // include JAF in this module
- include javax.activation.**, com.sun.activation.**;
-
- include META-INF/mailcap.default,
- META-INF/mimetypes.default;
-}
-
-/**************************************************************************/
-module enterprise-base {
- include javax.transaction.**, // JTA
- javax.annotation.*; // Common annotations (JSR-250)
-}
-
-/**************************************************************************/
-module corba {
- include javax.activity.**,
- javax.rmi.*,
- javax.rmi.CORBA.*,
- javax.transaction.**,
- com.sun.corba.**,
- com.sun.org.omg.**,
- org.omg.**,
- sun.corba.**;
-
- // JMX remote API
- exclude org.omg.stub.javax.management.**;
-}
-
-/**************************************************************************/
-
-module applet {
- include java.applet.**,
- sun.applet.**;
-}
-
-module awt {
- include java.awt.**,
- sun.awt.**,
- com.sun.awt.**;
-}
-
-module font {
- include sun.font.**;
-}
-
-module imageio {
- include javax.imageio.**,
- com.sun.imageio.**;
-}
-
-module java2d {
- include sun.dc.**,
- sun.java2d.**,
- com.sun.image.**;
-}
-
-module media {
- include com.sun.media.**;
-}
-
-module print {
- include javax.print.**,
- sun.print.**;
-}
-
-module sound {
- include javax.sound.**;
-}
-
-module swing {
- include javax.swing.**,
- sun.swing.**,
- // sajdi also contains classes in subpackages of com.sun.java.swing;
- // so use '*' instead of '**'
- com.sun.java.swing.*,
- com.sun.java.swing.plaf.**,
- com.sun.swing.**;
-}
-
-module client {
- include applet,
- awt,
- font,
- imageio,
- java2d,
- media,
- print,
- sound,
- swing;
-
- include javax.accessibility.*,
- sun.audio.**,
- com.sun.accessibility.**;
-
- // Bidi class in client module for now
- include java.text.Bidi, sun.text.bidi.*;
-
- // PerformanceLogger and dependencies
- include sun.misc.Ref, sun.misc.PerformanceLogger;
-
- // misc. dependencies that we need to examine
- include sun.text.CodePointIterator,
- sun.text.Char*,
- sun.misc.Queue*,
- sun.misc.FIFOQueueEnumerator,
- sun.misc.LIFOQueueEnumerator;
-
- // content handlers
- include sun.net.www.content.audio.**,
- sun.net.www.content.image.**;
-}
-
-/**************************************************************************/
-
-module deploy {
-
- // For now, all plugin and JNLP
- include com.sun.java.browser.**,
- netscape.**,
- sun.plugin.**,
- sun.plugin2.**,,
- com.sun.deploy.**,
- com.sun.javaws.**,
- javax.jnlp.*,
- com.sun.jnlp.*;
-
- // Hook for http authentication
- include sun.net.www.protocol.http.AuthCacheBridge;
-}
-
-/**************************************************************************/
-
-module net-dns {
- include sun.net.dns.**; // to access DNS config.
- include sun.net.spi.nameservice.dns.**; // for DNS-only name service.
-}
-
-module net-compat {
- // NTLM authentication support
- include sun.net.www.protocol.http.ntlm.*;
-
- // ftp and mail clients
- include sun.net.ftp.**, sun.net.smtp.**;
-
- // Legacy protocol handlers
- include sun.net.www.protocol.**;
-
- // Legacy content handlers
- include sun.net.www.content.**;
-
- include sun.net.Telnet*,
- sun.net.TransferProtocolClient;
-}
-
-/**************************************************************************/
-
-// jar-tool and security-tools are JRE tools
-module jar-tool {
- include sun.tools.jar.**;
-}
-
-module policytool {
- include sun.security.tools.policytool.*;
-}
-
-module security-tools {
- include sun.security.tools.**;
-
- // Used by security tools
- include sun.security.util.PathList, sun.security.x509.CertAndKeyGen;
-
- exclude sun.security.tools.JarBASE64Encoder,
- sun.security.tools.JarSigner,
- sun.security.tools.JarSignerParameters,
- sun.security.tools.JarSignerResources*,
- sun.security.tools.SignatureFile,
- sun.security.tools.TimestampedSigner;
-}
-
-module jconsole {
- include sun.tools.jconsole.**,
- com.sun.tools.jconsole.*;
-}
-
-module serialver {
- include sun.tools.serialver.**;
-}
-
-module gui-tools {
- include jconsole,
- serialver;
-
- include com.sun.tools.example.debug.bdi.**,
- com.sun.tools.example.debug.gui.**,
- com.sun.tools.internal.xjc.**;
-}
-
-module attach {
- include com.sun.tools.attach.**,
- sun.tools.attach.**;
-}
-
-module debugging {
- include com.sun.jdi.**, com.sun.tools.jdi.**;
-}
-
-module jdb {
- include com.sun.tools.example.debug.**;
-}
-
-module sajdi {
- include sun.jvm.hotspot.**,
- com.sun.java.swing.ui.**,
- com.sun.java.swing.action.**;
-
- include toolbarButtonGraphics/**;
- include sa.properties;
-}
-
-module tools {
- include attach,
- debugging,
- jaxws-tools,
- jdb,
- rmic,
- sajdi;
-
- // include gui-tools in tools module unless the tool binaries
- // are modified to load the new gui-tools.jar
- include gui-tools;
-
- include com.sun.tools.**, sun.tools.**, sun.security.tools.**,
- com.sun.jarsigner.**,
- com.sun.javac.**,
- com.sun.javadoc.**, com.sun.source.**,
- sun.jvmstat.**;
-}
-
-/**************************************************************************/
-
-module servicetag {
- include com.sun.servicetag.**;
-}
-
-/**************************************************************************/
-
-// these classes will be removed from JRE - see 6909002
-module inputmethods-ext {
- include com.sun.inputmethods.internal.**;
-}
-
-/**************************************************************************/
-
-// Workaround for US export and local policy files
-// They are currently in signed jars under the jre/lib/security directory
-module US_export_policy {
- include default_US_export.policy;
-}
-
-module local_policy {
- include default_local.policy,
- exempt_local.policy;
-}
-
-/**************************************************************************/
-
-module other {
- include **;
-}
diff --git a/jdk/make/modules/modules.group b/jdk/make/modules/modules.group
deleted file mode 100644
index fe5f9a0c066..00000000000
--- a/jdk/make/modules/modules.group
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Example:
- * module jdbc {
- * include jdbc-base, jdbc-enterprise, jdbc-odbc;
- * }
- */
diff --git a/jdk/make/modules/optional.depconfig b/jdk/make/modules/optional.depconfig
deleted file mode 100644
index 65aa09c24e2..00000000000
--- a/jdk/make/modules/optional.depconfig
+++ /dev/null
@@ -1,149 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# public final java.nio.channels.SocketChannel getChannel()
-@Optional
- sun.security.ssl.BaseSSLSocketImpl -> java.nio.channels.SocketChannel
-
-# public XMLDecoder(java.io.InputStream)
-# public XMLDecoder(java.io.InputStream, java.lang.Object)
-# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener)
-# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader)
-# public XMLDecoder(org.xml.sax.InputSource)
-@Optional
- java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler
- java.beans.XMLDecoder -> org.xml.sax.InputSource
-
-# public static org.xml.sax.helpers.DefaultHandler createHandler(java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader)
-@Optional
- java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler
- java.beans.XMLDecoder -> org.xml.sax.helpers.DefaultHandler
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
- java.net.SocketInputStream -> java.nio.channels.FileChannel
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
- java.net.SocketOutputStream -> java.nio.channels.FileChannel
-
-# public Scanner(java.io.File)
-# public Scanner(java.io.File, java.lang.String)
-@Optional
- java.util.Scanner -> java.nio.channels.ReadableByteChannel
- java.util.Scanner -> java.nio.channels.Channels
-
-# public Scanner(java.nio.file.FileRef)
-# public Scanner(java.nio.file.FileRef, java.lang.String)
-@Optional
- java.util.Scanner -> java.nio.file.FileRef
- java.util.Scanner -> java.nio.file.OpenOption
-
-# public Scanner(java.nio.channels.ReadableByteChannel)
-# public Scanner(java.nio.channels.ReadableByteChannel, java.lang.String)
-@Optional
- java.util.Scanner -> java.nio.channels.ReadableByteChannel
- java.util.Scanner -> java.nio.channels.Channels
-
-# private static void loadSnmpAgent(java.lang.String, java.util.Properties)
-@Optional
- sun.management.Agent -> sun.management.snmp.AdaptorBootstrap
-
-# public void connect()
-@Optional
- sun.net.www.protocol.http.HttpURLConnection -> java.net.SecureCacheResponse
-
-# private static sun.security.util.PermissionFactory> permissionFactory()
-@Optional
- sun.security.util.SecurityConstants$AWT -> sun.awt.AWTPermissionFactory
-
-# sun.util.logging.LoggingSupport
-@Optional
- sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl
-
-# public java.nio.channels.DatagramChannel getChannel()
-@Optional
- java.net.DatagramSocket -> java.nio.channels.DatagramChannel
-
-# public java.nio.channels.SocketChannel getChannel()
-@Optional
- java.net.Socket -> java.nio.channels.SocketChannel
-
-# public java.nio.channels.ServerSocketChannel getChannel()
-@Optional
- java.net.ServerSocket -> java.nio.channels.ServerSocketChannel
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
- java.io.RandomAccessFile -> java.nio.channels.FileChannel
- java.io.RandomAccessFile -> sun.nio.ch.FileChannelImpl
-
-# public static sun.nio.cs.StreamDecoder forDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int)
-@Optional
- sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel
-
-# private static java.nio.channels.FileChannel getChannel(java.io.FileInputStream)
-# StreamDecoder(java.io.InputStream, java.lang.Object, java.nio.charset.CharsetDecoder)
-@Optional
- sun.nio.cs.StreamDecoder -> java.nio.channels.FileChannel
-
-# StreamDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int)
-@Optional
- sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel
-
-# public static java.io.File createTemporaryFile(java.lang.String, java.lang.String, java.nio.file.attribute.FileAttribute>[])
-@Optional
- java.io.File -> java.io.TempFileHelper
- java.io.File -> java.nio.file.attribute.FileAttribute
-
-# public java.nio.file.Path toPath()
-@Optional
- java.io.File -> java.nio.file.Paths
- java.io.File -> java.nio.file.Path
-
-# public static sun.nio.cs.StreamEncoder forEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int)
-# private StreamEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int)
-@Optional
- sun.nio.cs.StreamEncoder -> java.nio.channels.WritableByteChannel
-
-# public java.nio.channels.FileChannel getChannel()
-@Optional
- java.io.FileOutputStream -> java.nio.channels.FileChannel
- java.io.FileOutputStream -> sun.nio.ch.FileChannelImpl
-
-# public java.nio.channels.FileChannel getChannel()
-@Optional
- java.io.FileInputStream -> java.nio.channels.FileChannel
- java.io.FileInputStream -> sun.nio.ch.FileChannelImpl
-
-# public void loadFromXML(java.io.InputStream)
-# public void storeToXML(java.io.OutputStream, java.lang.String, java.lang.String)
-@Optional
- java.util.Properties -> java.util.XMLUtils
-
-# public static java.nio.channels.Channel inheritedChannel()
-@Optional
- java.lang.System -> java.nio.channels.Channel
- java.lang.System -> java.nio.channels.spi.SelectorProvider
diff --git a/jdk/make/modules/tools/Makefile b/jdk/make/modules/tools/Makefile
deleted file mode 100644
index d630469c9fd..00000000000
--- a/jdk/make/modules/tools/Makefile
+++ /dev/null
@@ -1,154 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building the classanalyzer tool
-#
-
-BUILDDIR = ../..
-include $(BUILDDIR)/common/Defs.gmk
-
-PKGDIR = com/sun/classanalyzer
-BUILDTOOL_SOURCE_ROOT = src
-BUILDTOOL_MAIN = $(PKGDIR)/ClassAnalyzer.java
-BUILTTOOL_MAINCLASS = $(subst /,.,$(BUILDTOOL_MAIN:%.java=%))
-
-BUILDTOOL_MAIN_SOURCE_FILE = $(BUILDTOOL_SOURCE_ROOT)/$(BUILDTOOL_MAIN)
-BUILDTOOL_MANIFEST_FILE = $(BUILDTOOLCLASSDIR)/classanalyzer_manifest.mf
-
-FILES_java := $(shell $(CD) $(BUILDTOOL_SOURCE_ROOT) \
- && $(FIND) $(PKGDIR) -type f -print)
-
-FILES_class = $(FILES_java:%.java=$(BUILDTOOLCLASSDIR)/%.class)
-
-CLASSANALYZER_JAR_FILE = $(BUILDTOOLJARDIR)/classanalyzer.jar
-
-#
-# ClassAnalyzer depends on the com.sun.tools.classfile API.
-# The tool is compiled with the latest version of the classfile
-# library in the langtools repo to make sure that synchronized
-# change is made if the classfile API is changed.
-#
-# If langtools repo exists, build its own copy of the
-# classfile library and use it for compile time and runtime.
-# If not exist (the top level repo is not a forest), use
-# the built jdk tools that imports tools.jar from the latest
-# promoted build.
-#
-# If the classfile API is changed but not yet in a promoted build,
-# the build might fail and the tool would need the langtools repo
-# to build in that case.
-#
-ifndef LANGTOOLS_TOPDIR
- LANGTOOLS_TOPDIR=$(JDK_TOPDIR)/../langtools
-endif
-
-LANGTOOLS_TOPDIR_EXISTS := $(shell \
- if [ -d $(LANGTOOLS_TOPDIR) ] ; then \
- echo true; \
- else \
- echo false; \
- fi)
-
-CLASSFILE_SRC = $(LANGTOOLS_TOPDIR)/src/share/classes
-CLASSFILE_PKGDIR = com/sun/tools/classfile
-
-ifeq ($(LANGTOOLS_TOPDIR_EXISTS), true)
- FILES_classfile_java := $(shell \
- $(CD) $(CLASSFILE_SRC) && \
- $(FIND) $(CLASSFILE_PKGDIR) -name '*.java' -print)
- FILES_classfile_class = $(FILES_classfile_java:%.java=$(BUILDTOOLCLASSDIR)/%.class)
- CLASSFILE_JAR_FILE = $(BUILDTOOLJARDIR)/classfile.jar
- BUILDTOOL_JAVAC = $(BOOT_JAVAC_CMD) $(JAVAC_JVM_FLAGS) \
- $(BOOT_JAVACFLAGS) -classpath $(CLASSFILE_JAR_FILE)
- BUILDTOOL_JAVA = $(BOOT_JAVA_CMD) $(JAVA_TOOLS_FLAGS) \
- -Xbootclasspath/p:$(CLASSFILE_JAR_FILE)
-else
- # if langtools doesn't exist, use tools from the built jdk
- BUILDTOOL_JAVAC = $(BINDIR)/javac $(JAVAC_JVM_FLAGS) \
- $(BOOT_JAVACFLAGS)
- BUILDTOOL_JAVA = $(BINDIR)/java $(JAVA_TOOLS_FLAGS)
-endif
-
-# Location of the output modules.list, .classlist
-# and other output files generated by the class analyzer tool.
-#
-MODULE_CLASSLIST = $(MODULES_TEMPDIR)/classlist
-
-all build: classanalyzer gen-classlist
-
-classanalyzer: $(CLASSFILE_JAR_FILE) $(CLASSANALYZER_JAR_FILE)
-
-gen-classlist:
- @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
- @$(RM) -rf $(MODULE_CLASSLIST)
- @$(MKDIR) -p $(MODULE_CLASSLIST)
- $(BUILDTOOL_JAVA) \
- -Dclassanalyzer.debug \
- -jar $(CLASSANALYZER_JAR_FILE) \
- -jdkhome $(OUTPUTDIR) \
- -config ../modules.config \
- -config ../modules.group \
- -depconfig ../jdk7.depconfig \
- -depconfig ../optional.depconfig \
- -showdynamic \
- -output $(MODULE_CLASSLIST)
- @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-$(BUILDTOOL_MANIFEST_FILE): $(BUILDTOOL_MAIN_SOURCE_FILE)
- @$(prep-target)
- $(ECHO) "Main-Class: $(BUILTTOOL_MAINCLASS)" > $@
-
-$(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)/%.class : $(CLASSFILE_SRC)/$(CLASSFILE_PKGDIR)/%.java
- @$(prep-target)
- @$(BUILDTOOL_JAVAC) \
- -sourcepath $(CLASSFILE_SRC) \
- -d $(BUILDTOOLCLASSDIR) $<
-
-$(BUILDTOOLCLASSDIR)/%.class : $(BUILDTOOL_SOURCE_ROOT)/%.java
- @$(prep-target)
- $(BUILDTOOL_JAVAC) \
- -sourcepath $(BUILDTOOL_SOURCE_ROOT) \
- -d $(BUILDTOOLCLASSDIR) $<
-
-$(CLASSANALYZER_JAR_FILE): $(BUILDTOOL_MANIFEST_FILE) $(FILES_class)
- @$(prep-target)
- $(BOOT_JAR_CMD) cfm $@ $(BUILDTOOL_MANIFEST_FILE) \
- -C $(BUILDTOOLCLASSDIR) $(PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@
- @$(java-vm-cleanup)
-
-$(BUILDTOOLJARDIR)/classfile.jar: $(FILES_classfile_class)
- @$(prep-target)
- $(CD) $(BUILDTOOLCLASSDIR) && \
- $(BOOT_JAR_CMD) cf $@ \
- $(CLASSFILE_PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@
- @$(java-vm-cleanup)
-
-clean clobber::
- @$(RM) -rf $(BUILDTOOLCLASSDIR)/$(PKGDIR)
- @$(RM) -rf $(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)
- @$(RM) $(BUILDTOOL_MANIFEST_FILE)
- @$(RM) $(CLASSANALYZER_JAR_FILE)
- @$(RM) $(CLASSFILE_JAR_FILE)
diff --git a/jdk/make/modules/tools/build.xml b/jdk/make/modules/tools/build.xml
deleted file mode 100644
index f8fe430578e..00000000000
--- a/jdk/make/modules/tools/build.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
diff --git a/jdk/make/modules/tools/nbproject/project.properties b/jdk/make/modules/tools/nbproject/project.properties
deleted file mode 100644
index 4bbbab44110..00000000000
--- a/jdk/make/modules/tools/nbproject/project.properties
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-application.title=classanalyzer
-application.vendor=mchung
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-
-cp.extra=${tools.jar}
-
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/classanalyzer.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-
-excludes=
-
-file.reference.tools.jar=${jdk.home}/lib/tools.jar
-file.reference.tools-src=src
-includes=**
-jar.compress=false
-javac.classpath=\
- ${file.reference.tools.jar}
-javac.deprecation=false
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=
-javadoc.author=false
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=false
-javadoc.use=false
-javadoc.version=false
-main.class=com.sun.classanalyzer.ClassAnalyzer
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-platform.active=JDK_1.6
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=-Xmx256m
-run.test.classpath=
-source.encoding=UTF-8
-src.dir=${file.reference.tools-src}
diff --git a/jdk/make/modules/tools/nbproject/project.xml b/jdk/make/modules/tools/nbproject/project.xml
deleted file mode 100644
index 895074bb42c..00000000000
--- a/jdk/make/modules/tools/nbproject/project.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- org.netbeans.modules.java.j2seproject
-
-
- classanalyzer
-
-
-
-
-
-
-
-
diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java
deleted file mode 100644
index a713eb1e54d..00000000000
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Map;
-
-import com.sun.classanalyzer.Module.Reference;
-import java.util.LinkedList;
-import java.util.TreeMap;
-
-/**
- *
- * @author Mandy Chung
- */
-public abstract class AnnotatedDependency implements Comparable {
-
- final Klass from;
- final List classes;
- protected boolean optional;
- String description;
- Klass.Method method;
- private List filters = null;
-
- public AnnotatedDependency(Klass klass) {
- this(klass, false);
- }
-
- public AnnotatedDependency(Klass klass, boolean optional) {
- this.from = klass;
- this.classes = new ArrayList();
- this.optional = optional;
- }
-
- abstract String getTag();
-
- abstract boolean isDynamic();
-
- void setMethod(Klass.Method m) {
- this.method = m;
- }
-
- void addElement(String element, List value) {
- if (element.equals("value")) {
- addValue(value);
- } else if (element.equals("description")) {
- description = value.get(0);
- } else if (element.equals("optional")) {
- optional = value.get(0).equals("1") || Boolean.parseBoolean(value.get(0));
- }
- }
-
- void addValue(List value) {
- for (String s : value) {
- if ((s = s.trim()).length() > 0) {
- classes.add(s);
- }
- }
- }
-
- List getValue() {
- return classes;
- }
-
- boolean isOptional() {
- return optional;
- }
-
- boolean isEmpty() {
- return classes.isEmpty();
- }
-
- boolean matches(String classname) {
- synchronized (this) {
- // initialize filters
- if (filters == null) {
- filters = new ArrayList();
- for (String pattern : classes) {
- filters.add(new Filter(pattern));
- }
-
- }
- }
-
- for (Filter f : filters) {
- if (f.matches(classname)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- for (String v : getValue()) {
- if (sb.length() == 0) {
- sb.append(getTag());
- sb.append("\n");
- } else {
- sb.append("\n");
- }
- sb.append(" ");
- sb.append(from.getClassName()).append(" -> ");
- sb.append(v);
- }
- return sb.toString();
- }
-
- @Override
- public int compareTo(AnnotatedDependency o) {
- if (from == o.from) {
- if (this.getClass().getName().equals(o.getClass().getName())) {
- String s1 = classes.isEmpty() ? "" : classes.get(0);
- String s2 = o.classes.isEmpty() ? "" : o.classes.get(0);
- return s1.compareTo(s2);
- } else {
- return this.getClass().getName().compareTo(o.getClass().getName());
- }
-
- } else {
- return from.compareTo(o.from);
- }
- }
-
- @Override
- public int hashCode() {
- int hashcode = 7 + 73 * from.hashCode();
- for (String s : classes) {
- hashcode ^= s.hashCode();
- }
- return hashcode;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof AnnotatedDependency)) {
- return false;
- }
- AnnotatedDependency other = (AnnotatedDependency) obj;
- boolean ret = this.from.equals(other.from) && this.classes.size() == other.classes.size();
- if (ret == true) {
- for (int i = 0; i < this.classes.size(); i++) {
- ret = ret && this.classes.get(i).equals(other.classes.get(i));
- }
- }
- return ret;
- }
-
- static class ClassForName extends AnnotatedDependency {
-
- public ClassForName(Klass klass, boolean optional) {
- super(klass, optional);
- }
-
- @Override
- String getTag() {
- if (this.optional) {
- return TAG + "(optional)";
- } else {
- return TAG;
- }
- }
-
- @Override
- boolean isDynamic() {
- return true;
- }
- static final String TYPE = "sun.annotation.ClassForName";
- static final String TAG = "@ClassForName";
- }
-
- static class NativeFindClass extends AnnotatedDependency {
-
- public NativeFindClass(Klass klass, boolean optional) {
- super(klass, optional);
- }
-
- @Override
- String getTag() {
- if (this.optional) {
- return TAG + "(optional)";
- } else {
- return TAG;
- }
- }
-
- @Override
- boolean isDynamic() {
- return true;
- }
- static final String TYPE = "sun.annotation.NativeFindClass";
- static final String TAG = "@NativeFindClass";
- }
-
- static class Provider extends AnnotatedDependency {
-
- private List services = new ArrayList();
-
- Provider(Klass klass) {
- super(klass, true);
- }
-
- @Override
- boolean isDynamic() {
- return true;
- }
-
- public List services() {
- return services;
- }
-
- @Override
- void addElement(String element, List value) {
- if (element.equals("service")) {
- List configFiles = new ArrayList();
- for (String s : value) {
- if ((s = s.trim()).length() > 0) {
- configFiles.add(metaInfPath + s);
- }
- }
- addValue(configFiles);
- }
- }
-
- @Override
- void addValue(List value) {
- for (String s : value) {
- if ((s = s.trim()).length() > 0) {
- if (s.startsWith("META-INF")) {
- services.add(s);
- readServiceConfiguration(s, classes);
- } else {
- throw new RuntimeException("invalid value" + s);
- }
- }
- }
- }
-
- boolean isEmpty() {
- return services.isEmpty();
- }
- static final String metaInfPath =
- "META-INF" + File.separator + "services" + File.separator;
-
- static void readServiceConfiguration(String config, List names) {
- BufferedReader br = null;
- try {
- InputStream is = ClassPath.open(config);
- if (is != null) {
- // Properties doesn't perserve the order of the input file
- br = new BufferedReader(new InputStreamReader(is, "utf-8"));
- int lc = 1;
- while ((lc = parseLine(br, lc, names)) >= 0);
- }
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- } finally {
- if (br != null) {
- try {
- br.close();
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
- }
- }
-
- // Parse a single line from the given configuration file, adding the name
- // on the line to the names list.
- //
- private static int parseLine(BufferedReader r, int lc, List names) throws IOException {
- String ln = r.readLine();
- if (ln == null) {
- return -1;
- }
- int ci = ln.indexOf('#');
- if (ci >= 0) {
- ln = ln.substring(0, ci);
- }
- ln = ln.trim();
- int n = ln.length();
- if (n != 0) {
- if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) {
- throw new RuntimeException("Illegal configuration-file syntax");
- }
- int cp = ln.codePointAt(0);
- if (!Character.isJavaIdentifierStart(cp)) {
- throw new RuntimeException("Illegal provider-class name: " + ln);
- }
- for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
- cp = ln.codePointAt(i);
- if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) {
- throw new RuntimeException("Illegal provider-class name: " + ln);
- }
- }
- if (!names.contains(ln)) {
- names.add(ln);
- }
- }
- return lc + 1;
- }
-
- @Override
- String getTag() {
- return TAG;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof AnnotatedDependency)) {
- return false;
- }
- Provider other = (Provider) obj;
- boolean ret = this.from.equals(other.from) &&
- this.services.size() == other.services.size();
- if (ret == true) {
- for (int i = 0; i < this.services.size(); i++) {
- ret = ret && this.services.get(i).equals(other.services.get(i));
- }
- }
- return ret;
- }
-
- @Override
- public int hashCode() {
- int hashcode = 7 + 73 * from.hashCode();
- for (String s : services) {
- hashcode ^= s.hashCode();
- }
- return hashcode;
- }
-
- @Override
- public List getValue() {
- List result = new ArrayList();
- result.addAll(services);
- return result;
- }
- static final String TYPE = "sun.annotation.Provider";
- static final String TAG = "@Provider";
- }
-
- static class OptionalDependency extends AnnotatedDependency {
-
- static boolean isOptional(Klass from, Klass to) {
- synchronized (OptionalDependency.class) {
- if (optionalDepsMap == null) {
- // Build a map of classes to its optional dependencies
- initDependencies();
- }
- }
- for (Reference ref : optionalDepsMap.keySet()) {
- if (ref.referrer() == from && ref.referree() == to) {
- return true;
- }
- }
- return false;
- }
-
- OptionalDependency(Klass klass) {
- super(klass, true);
- }
-
- @Override
- boolean isDynamic() {
- return false;
- }
-
- @Override
- String getTag() {
- return TAG;
- }
- static final String TYPE = "sun.annotation.Optional";
- static final String TAG = "@Optional";
- }
-
- static class CompilerInline extends AnnotatedDependency {
-
- public CompilerInline(Klass klass) {
- super(klass);
- }
-
- @Override
- String getTag() {
- return TAG;
- }
-
- @Override
- boolean isDynamic() {
- return false;
- }
- static final String TYPE = "sun.annotation.Inline";
- static final String TAG = "@Inline";
- }
-
- static class Filter {
-
- final String pattern;
- final String regex;
-
- Filter(String pattern) {
- this.pattern = pattern;
-
- boolean isRegex = false;
- for (int i = 0; i < pattern.length(); i++) {
- char p = pattern.charAt(i);
- if (p == '*' || p == '[' || p == ']') {
- isRegex = true;
- break;
- }
- }
-
- if (isRegex) {
- this.regex = convertToRegex(pattern);
- } else {
- this.regex = null;
- }
- }
-
- private String convertToRegex(String pattern) {
- StringBuilder sb = new StringBuilder();
- int i = 0;
- int index = 0;
- int plen = pattern.length();
- while (i < plen) {
- char p = pattern.charAt(i);
- if (p == '*') {
- sb.append("(").append(pattern.substring(index, i)).append(")");
- if (i + 1 < plen && pattern.charAt(i + 1) == '*') {
- sb.append(".*");
- index = i + 2;
- } else {
- sb.append("[^\\.]*");
- index = i + 1;
- }
- } else if (p == '[') {
- int j = i + 1;
- while (j < plen) {
- if (pattern.charAt(j) == ']') {
- break;
- }
- j++;
- }
- if (j >= plen || pattern.charAt(j) != ']') {
- throw new RuntimeException("Malformed pattern " + pattern);
- }
- sb.append("(").append(pattern.substring(index, i)).append(")");
- sb.append(pattern.substring(i, j + 1));
- index = j + 1;
- i = j;
- }
- i++;
- }
- if (index < plen) {
- sb.append("(").append(pattern.substring(index, plen)).append(")");
- }
- return sb.toString();
- }
-
- boolean matches(String name) {
- if (regex == null) {
- // the pattern is not a regex
- return name.equals(pattern);
- } else {
- return name.matches(regex);
- }
- }
- }
-
- static boolean isValidType(String type) {
- if (type.endsWith("(optional)")) {
- int len = type.length() - "(optional)".length();
- type = type.substring(0, len);
- }
- return type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG) ||
- type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG) ||
- type.equals(Provider.TYPE) || type.equals(Provider.TAG) ||
- type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG) ||
- type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG);
- }
-
- static AnnotatedDependency newAnnotatedDependency(String tag, String value, Klass klass) {
- AnnotatedDependency dep = newAnnotatedDependency(tag, klass);
- if (dep != null) {
- dep.addValue(Collections.singletonList(value));
- }
- return dep;
- }
- static List annotatedDependencies = new LinkedList();
- static List optionalDependencies = new LinkedList();
-
- static AnnotatedDependency newAnnotatedDependency(String type, Klass klass) {
- boolean optional = false;
- if (type.endsWith("(optional)")) {
- optional = true;
- int len = type.length() - "(optional)".length();
- type = type.substring(0, len);
- }
-
- if (type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG)) {
- return newOptionalDependency(klass);
- }
-
- AnnotatedDependency dep;
- if (type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG)) {
- dep = new ClassForName(klass, optional);
- } else if (type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG)) {
- dep = new NativeFindClass(klass, optional);
- } else if (type.equals(Provider.TYPE) || type.equals(Provider.TAG)) {
- dep = new Provider(klass);
- } else if (type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG)) {
- dep = new CompilerInline(klass);
- } else {
- return null;
- }
- klass.addAnnotatedDep(dep);
- annotatedDependencies.add(dep);
- return dep;
- }
-
- static OptionalDependency newOptionalDependency(Klass klass) {
- OptionalDependency dep = new OptionalDependency(klass);
- optionalDependencies.add(dep);
- return dep;
- }
- static Map> annotatedDepsMap = null;
- static Map> optionalDepsMap = null;
-
- static Map> getReferences(Module m) {
- // ensure it's initialized
- initDependencies();
-
- Map> result = new TreeMap>();
- for (Reference ref : annotatedDepsMap.keySet()) {
- if (m.contains(ref.referrer()) && m.isModuleDependence(ref.referree())) {
- result.put(ref, annotatedDepsMap.get(ref));
- }
- }
- return result;
- }
-
- static Set getDependencies(Module m) {
- // ensure it's initialized
- initDependencies();
-
- Set deps = new TreeSet();
- for (Reference ref : annotatedDepsMap.keySet()) {
- if (m.contains(ref.referrer())) {
- Module other = m.getModuleDependence(ref.referree());
- if (other != null) {
- for (AnnotatedDependency ad : annotatedDepsMap.get(ref)) {
- Module.Dependency d = new Module.Dependency(other, ad.isOptional(), ad.isDynamic());
- deps.add(d);
- }
- }
- }
- }
- return deps;
- }
-
- synchronized static void initDependencies() {
- if (annotatedDepsMap != null) {
- return;
- }
-
- // Build a map of references to its dependencies
- annotatedDepsMap = new TreeMap>();
- optionalDepsMap = new TreeMap>();
-
- for (Klass k : Klass.getAllClasses()) {
- for (AnnotatedDependency ad : annotatedDependencies) {
- if (ad.matches(k.getClassName())) {
- Reference ref = new Reference(ad.from, k);
- Set set = annotatedDepsMap.get(ref);
- if (set == null) {
- set = new TreeSet();
- annotatedDepsMap.put(ref, set);
- }
- set.add(ad);
- }
- }
-
- for (AnnotatedDependency ad : optionalDependencies) {
- if (ad.matches(k.getClassName())) {
- Reference ref = new Reference(ad.from, k);
- Set set = optionalDepsMap.get(ref);
- if (set == null) {
- set = new TreeSet();
- optionalDepsMap.put(ref, set);
- }
- set.add(ad);
- }
- }
- }
- }
-}
diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java
deleted file mode 100644
index 4d35635f467..00000000000
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Annotation;
-import com.sun.tools.classfile.ExtendedAnnotation;
-import com.sun.tools.classfile.Annotation.Annotation_element_value;
-import com.sun.tools.classfile.Annotation.Array_element_value;
-import com.sun.tools.classfile.Annotation.Class_element_value;
-import com.sun.tools.classfile.Annotation.Enum_element_value;
-import com.sun.tools.classfile.Annotation.Primitive_element_value;
-import com.sun.tools.classfile.ConstantPoolException;
-import com.sun.tools.classfile.Descriptor;
-import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.sun.classanalyzer.AnnotatedDependency.*;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.Map;
-import java.util.Set;
-
-/**
- *
- * @author Mandy Chung
- */
-public class AnnotationParser {
-
- static boolean parseAnnotation = false;
- static void setParseAnnotation(boolean newValue) {
- parseAnnotation = newValue;
- }
-
- private final ClassFileParser cfparser;
- public AnnotationParser(ClassFileParser cfparser) {
- this.cfparser = cfparser;
- }
-
- private AnnotatedDependency addAnnotation(Annotation annot, Klass.Method method) {
- String type = getType(annot.type_index);
- AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, cfparser.this_klass);
- if (dep != null) {
- for (int i = 0; i < annot.num_element_value_pairs; i++) {
- Element element = getElement(annot.element_value_pairs[i]);
- dep.addElement(element.name, element.value);
- }
- dep.setMethod(method);
- }
- return dep;
- }
-
- private AnnotatedDependency addAnnotation(ExtendedAnnotation annot, Klass.Method method) {
- return addAnnotation(annot.annotation, method);
- }
-
- class Element {
-
- String name;
- List value;
-
- Element(String name) {
- this.name = name;
- this.value = new ArrayList();
- }
-
- void add(String v) {
- value.add(v);
- }
- }
-
- Element getElement(Annotation.element_value_pair pair) {
- Element element = new Element(getName(pair.element_name_index));
- evp.parse(pair.value, element);
- return element;
- }
-
- private String getType(int index) {
- try {
- Descriptor d = new Descriptor(index);
- return d.getFieldType(cfparser.classfile.constant_pool);
- } catch (ConstantPoolException ignore) {
- } catch (InvalidDescriptor ignore) {
- }
- return "Unknown";
- }
-
- private String getName(int index) {
- return cfparser.constantPoolParser.stringValue(index);
- }
- element_value_Parser evp = new element_value_Parser();
-
- class element_value_Parser implements Annotation.element_value.Visitor {
-
- public Void parse(Annotation.element_value value, Element element) {
- value.accept(this, element);
- return null;
- }
-
- public Void visitPrimitive(Primitive_element_value ev, Element element) {
- String value = getName(ev.const_value_index);
- element.add(value);
- return null;
- }
-
- public Void visitEnum(Enum_element_value ev, Element element) {
- String value = getName(ev.type_name_index) + "." + getName(ev.const_name_index);
- element.add(value);
- return null;
- }
-
- public Void visitClass(Class_element_value ev, Element element) {
- String value = getName(ev.class_info_index) + ".class";
- element.add(value);
- return null;
- }
-
- public Void visitAnnotation(Annotation_element_value ev, Element element) {
- // AnnotationParser.this.addAnnotation(ev.annotation_value);
- throw new UnsupportedOperationException("Not supported: " + ev);
- }
-
- public Void visitArray(Array_element_value ev, Element element) {
- for (int i = 0; i < ev.num_values; i++) {
- parse(ev.values[i], element);
- }
- return null;
- }
- }
-
- void parseAttributes(Attributes attributes, Klass.Method method) {
- if (!parseAnnotation) {
- return;
- }
-
- visitRuntimeAnnotations((RuntimeVisibleAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleAnnotations), method);
- visitRuntimeAnnotations((RuntimeInvisibleAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleAnnotations), method);
- visitRuntimeTypeAnnotations((RuntimeVisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleTypeAnnotations), method);
- visitRuntimeTypeAnnotations((RuntimeInvisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleTypeAnnotations), method);
- visitRuntimeParameterAnnotations((RuntimeVisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleParameterAnnotations), method);
- visitRuntimeParameterAnnotations((RuntimeInvisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleParameterAnnotations), method);
- }
-
- public void visitRuntimeAnnotations(RuntimeAnnotations_attribute attr, Klass.Method method) {
- if (attr == null) {
- return;
- }
-
- for (int i = 0; i < attr.annotations.length; i++) {
- addAnnotation(attr.annotations[i], method);
- }
- }
-
- public void visitRuntimeTypeAnnotations(RuntimeTypeAnnotations_attribute attr, Klass.Method method) {
- if (attr == null) {
- return;
- }
-
- for (int i = 0; i < attr.annotations.length; i++) {
- addAnnotation(attr.annotations[i], method);
- }
- }
-
- public void visitRuntimeParameterAnnotations(RuntimeParameterAnnotations_attribute attr, Klass.Method method) {
- if (attr == null) {
- return;
- }
-
- for (int param = 0; param < attr.parameter_annotations.length; param++) {
- for (int i = 0; i < attr.parameter_annotations[param].length; i++) {
- addAnnotation(attr.parameter_annotations[param][i], method);
- }
- }
- }
-
- void parseAttributes(Attributes attributes) {
- parseAttributes(attributes, null);
- }
-
- public static void main(String[] args) throws Exception {
- String jdkhome = null;
- String output = ".";
-
- // process arguments
- int i = 0;
- while (i < args.length) {
- String arg = args[i++];
- if (arg.equals("-jdkhome")) {
- if (i < args.length) {
- jdkhome = args[i++];
- } else {
- usage();
- }
- } else if (arg.equals("-output")) {
- output = args[i++];
- } else {
- usage();
- }
- }
- if (jdkhome == null) {
- usage();
- }
-
- // parse annotation and code attribute to find all references
- // to Class.forName etc
- CodeAttributeParser.setParseCodeAttribute(true);
- AnnotationParser.setParseAnnotation(true);
-
- ClassPath.setJDKHome(jdkhome);
- ClassPath.parseAllClassFiles();
-
- PrintWriter writer = new PrintWriter(new File(output, "jdk7.depconfig"));
-
- try {
- for (Klass k : Klass.getAllClasses()) {
- for (AnnotatedDependency dep : k.getAnnotatedDeps()) {
- if (dep.isEmpty()) {
- continue;
- }
- writer.format("# %s \n", dep.method == null ? dep.from : dep.method);
- writer.format("%s\n\n", dep);
- }
- }
- } finally {
- writer.close();
- }
-
- writer = new PrintWriter(new File(output, "optional.depconfig"));
- try {
- AnnotatedDependency prev = null;
- for (AnnotatedDependency dep : AnnotatedDependency.optionalDependencies) {
- if (prev != null && !dep.equals(prev)) {
- writer.format("%s\n\n", prev);
- }
- writer.format("# %s \n", dep.method == null ? dep.from : dep.method);
- prev = dep;
- }
- if (prev != null) {
- writer.format("%s\n\n", prev);
- }
- } finally {
- writer.close();
- }
-
- writer = new PrintWriter(new File(output, "runtime.references"));
- try {
- for (Map.Entry> entry : CodeAttributeParser.runtimeReferences.entrySet()) {
- writer.format("References to %s\n", entry.getKey());
- Klass prev = null;
- for (Klass.Method m : entry.getValue()) {
- if (prev == null || prev != m.getKlass()) {
- writer.format(" %-50s # %s\n", m.getKlass(), m);
- } else if (prev == m.getKlass()) {
- writer.format(" %-50s # %s\n", "", m);
- }
- prev = m.getKlass();
- }
- }
- } finally {
- writer.close();
- }
- }
-
- private static void usage() {
- System.out.println("Usage: AnnotationParser ");
- System.out.println("Options: ");
- System.out.println("\t-jdkhome where all jars will be parsed");
- System.out.println("\t-depconfig