From ec9b7d57ac7490520769912f6c3f75f1b6e383cb Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Wed, 1 Feb 2012 03:52:37 -0800 Subject: [PATCH 01/26] 7120974: ManagementPermission "control" needs clarification Reviewed-by: mchung, dholmes --- .../lang/management/ManagementPermission.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/java/lang/management/ManagementPermission.java b/jdk/src/share/classes/java/lang/management/ManagementPermission.java index bf27f1dd1ae..6df6f1e3d42 100644 --- a/jdk/src/share/classes/java/lang/management/ManagementPermission.java +++ b/jdk/src/share/classes/java/lang/management/ManagementPermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, 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 @@ -46,12 +46,17 @@ at the permission allows, and associated risks"> * * control * Ability to control the runtime characteristics of the Java virtual - * machine, for example, setting the -verbose:gc and -verbose:class flag, - * setting the threshold of a memory pool, and enabling and disabling - * the thread contention monitoring support. + * machine, for example, enabling and disabling the verbose output for + * the class loading or memory system, setting the threshold of a memory + * pool, and enabling and disabling the thread contention monitoring + * support. Some actions controlled by this permission can disclose + * information about the running application, like the -verbose:class + * flag. * * This allows an attacker to control the runtime characteristics - * of the Java virtual machine and cause the system to misbehave. + * of the Java virtual machine and cause the system to misbehave. An + * attacker can also access some information related to the running + * application. * * * From 8ac9bc5858db9723efeef833ec26a2669d83c806 Mon Sep 17 00:00:00 2001 From: Bradford Wetmore Date: Wed, 1 Feb 2012 16:00:39 -0800 Subject: [PATCH 02/26] 7141910: Incorrect copyright dates on new test cases Reviewed-by: mullan --- .../ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java | 2 +- .../net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java index cd9564e46ae..0f69a0590d9 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh index 7fbbbed9c2c..cfc30267a25 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it From c750a3e42c9774bf351e403bb68ff1ceb0b6a772 Mon Sep 17 00:00:00 2001 From: Sonali Goel Date: Thu, 2 Feb 2012 15:37:22 -0800 Subject: [PATCH 03/26] 7141141: Add 3 new test scenarios for testing Main-Class attribute in jar manifest file Reviewed-by: ksrini, darcy --- jdk/test/tools/launcher/Arrrghs.java | 18 +-- .../launcher/MainClassAttributeTest.java | 103 ++++++++++++++++++ 2 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 jdk/test/tools/launcher/MainClassAttributeTest.java diff --git a/jdk/test/tools/launcher/Arrrghs.java b/jdk/test/tools/launcher/Arrrghs.java index 6c75737a911..6306e2c2f87 100644 --- a/jdk/test/tools/launcher/Arrrghs.java +++ b/jdk/test/tools/launcher/Arrrghs.java @@ -24,7 +24,7 @@ /** * @test * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938 - * 6894719 6968053 7067922 + * 6894719 6968053 * @summary Argument parsing validation. * @compile -XDignore.symbol.file Arrrghs.java * @run main Arrrghs @@ -373,21 +373,6 @@ public class Arrrghs extends TestHelper { System.out.println(tr); } - /* - * a missing manifest entry 7067922, we ignore this test for locales - * which are localized, thus the testing is limited to English locales. - */ - static void test7067922() { - if (!isEnglishLocale()) { - return; - } - TestResult tr = null; - createJar("cvf", "missingmainentry.jar", "."); - tr = doExec(javaCmd, "-jar", "missingmainentry.jar"); - tr.contains("no main manifest attribute"); - System.out.println(tr); - } - /** * @param args the command line arguments * @throws java.io.FileNotFoundException @@ -400,7 +385,6 @@ public class Arrrghs extends TestHelper { runBasicErrorMessageTests(); runMainMethodTests(); test6894719(); - test7067922(); runDiagOptionTests(); if (testExitValue > 0) { System.out.println("Total of " + testExitValue + " failed"); diff --git a/jdk/test/tools/launcher/MainClassAttributeTest.java b/jdk/test/tools/launcher/MainClassAttributeTest.java new file mode 100644 index 00000000000..425b0257643 --- /dev/null +++ b/jdk/test/tools/launcher/MainClassAttributeTest.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7067922 + * @author sogoel + * @summary Test negative scenarios for main class attribute + * @build MainClassAttributeTest + * @run main MainClassAttributeTest + */ + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/* + * This tests negative scenarios for Main class entry in a jar file. + * An error should be thrown for each of the test cases when such a + * jar is executed. + */ + +public class MainClassAttributeTest extends TestHelper { + + /* + * These tests compare messages which could be localized, therefore + * these tests compare messages only with English locales, and + * for all other locales, the exit values are checked. + */ + static void runTest(File jarFile, String expectedErrorMessage) { + TestResult tr = doExec(TestHelper.javaCmd, + "-jar", jarFile.getAbsolutePath()); + if (isEnglishLocale() && !tr.contains(expectedErrorMessage)) { + System.out.println(tr); + throw new RuntimeException("expected string not found"); + } + if (tr.isOK()) { + System.out.println(tr); + throw new RuntimeException("test exit with status 0"); + } + } + + // Missing manifest entry + static void test1() throws IOException { + File jarFile = new File("missingmainentry.jar"); + createJar("cvf", jarFile.getName(), "."); + runTest(jarFile, "no main manifest attribute"); + } + + // Entry point in manifest file has .class extension + static void test2() throws IOException { + File jarFile = new File("extensionmainentry.jar"); + createJar("Foo.class", jarFile, new File("Foo"), (String[])null); + runTest(jarFile, "Error: Could not find or load main class"); + } + + // Entry point in manifest file is misspelled + static void test3() throws IOException { + File jarFile = new File("misspelledmainentry.jar"); + createJar("FooMIS", jarFile, new File("Foo"), (String[])null); + runTest(jarFile, "Error: Could not find or load main class"); + } + + // Main-Class attribute is misspelled in manifest file + static void test4() throws IOException { + File jarFile = new File("misspelledMainAttribute.jar"); + File manifestFile = new File("manifest.txt"); + List contents = new ArrayList<>(); + contents.add("MainClassName: Foo"); + createFile(manifestFile, contents); + createJar("-cmf", manifestFile.getName(), jarFile.getName()); + runTest(jarFile, "no main manifest attribute"); + } + + public static void main(String[] args) throws IOException { + test1(); + test2(); + test3(); + test4(); + } +} From 511e7438d7b40fcd2a3ea01ee7e9698d9d13a075 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Sat, 4 Feb 2012 07:29:11 +0000 Subject: [PATCH 04/26] 7041778: Move SCTP implementation out of sun.nio.ch and into its own package Reviewed-by: alanb --- jdk/make/com/sun/nio/sctp/Exportedfiles.gmk | 14 +- jdk/make/com/sun/nio/sctp/FILES_java.gmk | 32 ++--- jdk/make/com/sun/nio/sctp/Makefile | 6 +- jdk/make/com/sun/nio/sctp/mapfile-vers | 48 +++---- .../classes/com/sun/nio/sctp/MessageInfo.java | 6 +- .../classes/com/sun/nio/sctp/SctpChannel.java | 2 +- .../com/sun/nio/sctp/SctpMultiChannel.java | 2 +- .../com/sun/nio/sctp/SctpServerChannel.java | 2 +- .../nio/sctp/SctpStandardSocketOptions.java | 16 +-- .../sun/nio/ch/AbstractPollArrayWrapper.java | 14 +- .../sun/nio/ch/AbstractPollSelectorImpl.java | 2 +- .../share/classes/sun/nio/ch/IOStatus.java | 24 ++-- jdk/src/share/classes/sun/nio/ch/IOUtil.java | 9 +- jdk/src/share/classes/sun/nio/ch/Net.java | 8 +- .../share/classes/sun/nio/ch/SelChImpl.java | 2 +- .../classes/sun/nio/ch/SelectionKeyImpl.java | 12 +- .../classes/sun/nio/ch/SelectorImpl.java | 4 +- jdk/src/share/classes/sun/nio/ch/Util.java | 8 +- .../MessageInfoImpl.java} | 26 ++-- .../ch/{ => sctp}/SctpStdSocketOption.java | 2 +- .../sun/nio/ch/DevPollSelectorImpl.java | 2 +- .../classes/sun/nio/ch/EPollSelectorImpl.java | 2 +- .../classes/sun/nio/ch/NativeThread.java | 8 +- .../classes/sun/nio/ch/PollArrayWrapper.java | 4 +- .../AssociationChange.java} | 12 +- .../AssociationImpl.java} | 10 +- .../PeerAddrChange.java} | 6 +- .../ResultContainer.java} | 34 ++--- .../nio/ch/{ => sctp}/SctpChannelImpl.java | 37 ++++-- .../ch/{ => sctp}/SctpMultiChannelImpl.java | 31 +++-- .../sun/nio/ch/{ => sctp}/SctpNet.java | 4 +- .../nio/ch/{ => sctp}/SctpNotification.java | 2 +- .../ch/{ => sctp}/SctpServerChannelImpl.java | 11 +- .../SendFailed.java} | 14 +- .../{SctpShutdown.java => sctp/Shutdown.java} | 6 +- .../native/sun/nio/ch/{ => sctp}/Sctp.h | 0 .../sun/nio/ch/{ => sctp}/SctpChannelImpl.c | 124 +++++++++--------- .../native/sun/nio/ch/{ => sctp}/SctpNet.c | 98 +++++++------- .../nio/ch/{ => sctp}/SctpServerChannelImpl.c | 10 +- .../sun/nio/ch/WindowsSelectorImpl.java | 2 +- .../nio/ch/{ => sctp}/SctpChannelImpl.java | 2 +- .../ch/{ => sctp}/SctpMultiChannelImpl.java | 2 +- .../ch/{ => sctp}/SctpServerChannelImpl.java | 2 +- 43 files changed, 348 insertions(+), 314 deletions(-) rename jdk/src/share/classes/sun/nio/ch/{SctpMessageInfoImpl.java => sctp/MessageInfoImpl.java} (86%) rename jdk/src/share/classes/sun/nio/ch/{ => sctp}/SctpStdSocketOption.java (98%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpAssocChange.java => sctp/AssociationChange.java} (92%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpAssociationImpl.java => sctp/AssociationImpl.java} (88%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpPeerAddrChange.java => sctp/PeerAddrChange.java} (95%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpResultContainer.java => sctp/ResultContainer.java} (82%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpChannelImpl.java (97%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpMultiChannelImpl.java (97%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpNet.java (99%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpNotification.java (98%) rename jdk/src/solaris/classes/sun/nio/ch/{ => sctp}/SctpServerChannelImpl.java (98%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpSendFailed.java => sctp/SendFailed.java} (91%) rename jdk/src/solaris/classes/sun/nio/ch/{SctpShutdown.java => sctp/Shutdown.java} (94%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/Sctp.h (100%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/SctpChannelImpl.c (83%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/SctpNet.c (87%) rename jdk/src/solaris/native/sun/nio/ch/{ => sctp}/SctpServerChannelImpl.c (86%) rename jdk/src/windows/classes/sun/nio/ch/{ => sctp}/SctpChannelImpl.java (99%) rename jdk/src/windows/classes/sun/nio/ch/{ => sctp}/SctpMultiChannelImpl.java (99%) rename jdk/src/windows/classes/sun/nio/ch/{ => sctp}/SctpServerChannelImpl.java (99%) diff --git a/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk b/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk index b56c69faff4..f2f6970a827 100644 --- a/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk +++ b/jdk/make/com/sun/nio/sctp/Exportedfiles.gmk @@ -29,11 +29,11 @@ ifneq ($(PLATFORM), windows) FILES_export = \ - sun/nio/ch/SctpAssocChange.java \ - sun/nio/ch/SctpChannelImpl.java \ - sun/nio/ch/SctpNet.java \ - sun/nio/ch/SctpPeerAddrChange.java \ - sun/nio/ch/SctpResultContainer.java \ - sun/nio/ch/SctpServerChannelImpl.java \ - sun/nio/ch/SctpStdSocketOption.java + sun/nio/ch/sctp/AssociationChange.java \ + sun/nio/ch/sctp/SctpChannelImpl.java \ + sun/nio/ch/sctp/SctpNet.java \ + sun/nio/ch/sctp/PeerAddrChange.java \ + sun/nio/ch/sctp/ResultContainer.java \ + sun/nio/ch/sctp/SctpServerChannelImpl.java \ + sun/nio/ch/sctp/SctpStdSocketOption.java endif diff --git a/jdk/make/com/sun/nio/sctp/FILES_java.gmk b/jdk/make/com/sun/nio/sctp/FILES_java.gmk index 725131e7280..667af33277b 100644 --- a/jdk/make/com/sun/nio/sctp/FILES_java.gmk +++ b/jdk/make/com/sun/nio/sctp/FILES_java.gmk @@ -42,25 +42,25 @@ FILES_java = \ com/sun/nio/sctp/SendFailedNotification.java \ com/sun/nio/sctp/ShutdownNotification.java \ \ - sun/nio/ch/SctpMessageInfoImpl.java \ - sun/nio/ch/SctpStdSocketOption.java + sun/nio/ch/sctp/MessageInfoImpl.java \ + sun/nio/ch/sctp/SctpStdSocketOption.java ifneq ($(PLATFORM), windows) FILES_java += \ - sun/nio/ch/SctpAssocChange.java \ - sun/nio/ch/SctpAssociationImpl.java \ - sun/nio/ch/SctpChannelImpl.java \ - sun/nio/ch/SctpMultiChannelImpl.java \ - sun/nio/ch/SctpNet.java \ - sun/nio/ch/SctpNotification.java \ - sun/nio/ch/SctpPeerAddrChange.java \ - sun/nio/ch/SctpResultContainer.java \ - sun/nio/ch/SctpSendFailed.java \ - sun/nio/ch/SctpServerChannelImpl.java \ - sun/nio/ch/SctpShutdown.java + sun/nio/ch/sctp/AssociationChange.java \ + sun/nio/ch/sctp/AssociationImpl.java \ + sun/nio/ch/sctp/PeerAddrChange.java \ + sun/nio/ch/sctp/ResultContainer.java \ + sun/nio/ch/sctp/SctpChannelImpl.java \ + sun/nio/ch/sctp/SctpMultiChannelImpl.java \ + sun/nio/ch/sctp/SctpNet.java \ + sun/nio/ch/sctp/SctpNotification.java \ + sun/nio/ch/sctp/SctpServerChannelImpl.java \ + sun/nio/ch/sctp/SendFailed.java \ + sun/nio/ch/sctp/Shutdown.java else FILES_java += \ - sun/nio/ch/SctpChannelImpl.java \ - sun/nio/ch/SctpMultiChannelImpl.java \ - sun/nio/ch/SctpServerChannelImpl.java + sun/nio/ch/sctp/SctpChannelImpl.java \ + sun/nio/ch/sctp/SctpMultiChannelImpl.java \ + sun/nio/ch/sctp/SctpServerChannelImpl.java endif diff --git a/jdk/make/com/sun/nio/sctp/Makefile b/jdk/make/com/sun/nio/sctp/Makefile index 4a9a5c36ff1..158077b78d1 100644 --- a/jdk/make/com/sun/nio/sctp/Makefile +++ b/jdk/make/com/sun/nio/sctp/Makefile @@ -47,14 +47,16 @@ include $(BUILDDIR)/common/Library.gmk # # Find platform-specific C source files # -vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch +vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch/sctp # # Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc # OTHER_INCLUDES += \ -I$(SHARE_SRC)/native/sun/nio/ch \ + -I$(SHARE_SRC)/native/sun/nio/ch/sctp \ -I$(SHARE_SRC)/native/java/net \ + -I$(PLATFORM_SRC)/native/sun/nio/ch \ -I$(PLATFORM_SRC)/native/java/net \ -I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders @@ -75,5 +77,5 @@ endif # ifneq windows clean clobber:: $(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp - $(RM) -r $(CLASSDESTDIR)/sun/nio/ch + $(RM) -r $(CLASSDESTDIR)/sun/nio/ch/sctp diff --git a/jdk/make/com/sun/nio/sctp/mapfile-vers b/jdk/make/com/sun/nio/sctp/mapfile-vers index 058995ecaa8..ceb27dab972 100644 --- a/jdk/make/com/sun/nio/sctp/mapfile-vers +++ b/jdk/make/com/sun/nio/sctp/mapfile-vers @@ -25,30 +25,30 @@ SUNWprivate_1.1 { global: - Java_sun_nio_ch_SctpNet_init; - Java_sun_nio_ch_SctpNet_socket0; - Java_sun_nio_ch_SctpNet_bindx; - Java_sun_nio_ch_SctpNet_branch0; - Java_sun_nio_ch_SctpNet_listen0; - Java_sun_nio_ch_SctpNet_connect0; - Java_sun_nio_ch_SctpNet_close0; - Java_sun_nio_ch_SctpNet_preClose0; - Java_sun_nio_ch_SctpNet_getLocalAddresses0; - Java_sun_nio_ch_SctpNet_getRemoteAddresses0; - Java_sun_nio_ch_SctpNet_getPrimAddrOption0; - Java_sun_nio_ch_SctpNet_setPrimAddrOption0; - Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0; - Java_sun_nio_ch_SctpNet_getInitMsgOption0; - Java_sun_nio_ch_SctpNet_setInitMsgOption0; - Java_sun_nio_ch_SctpNet_getIntOption0; - Java_sun_nio_ch_SctpNet_setIntOption0; - Java_sun_nio_ch_SctpNet_shutdown0; - Java_sun_nio_ch_SctpChannelImpl_initIDs; - Java_sun_nio_ch_SctpChannelImpl_checkConnect; - Java_sun_nio_ch_SctpChannelImpl_receive0; - Java_sun_nio_ch_SctpChannelImpl_send0; - Java_sun_nio_ch_SctpServerChannelImpl_initIDs; - Java_sun_nio_ch_SctpServerChannelImpl_accept0; + Java_sun_nio_ch_sctp_SctpNet_init; + Java_sun_nio_ch_sctp_SctpNet_socket0; + Java_sun_nio_ch_sctp_SctpNet_bindx; + Java_sun_nio_ch_sctp_SctpNet_branch0; + Java_sun_nio_ch_sctp_SctpNet_listen0; + Java_sun_nio_ch_sctp_SctpNet_connect0; + Java_sun_nio_ch_sctp_SctpNet_close0; + Java_sun_nio_ch_sctp_SctpNet_preClose0; + Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0; + Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0; + Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0; + Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0; + Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0; + Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0; + Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0; + Java_sun_nio_ch_sctp_SctpNet_getIntOption0; + Java_sun_nio_ch_sctp_SctpNet_setIntOption0; + Java_sun_nio_ch_sctp_SctpNet_shutdown0; + Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs; + Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect; + Java_sun_nio_ch_sctp_SctpChannelImpl_receive0; + Java_sun_nio_ch_sctp_SctpChannelImpl_send0; + Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs; + Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0; JNI_OnLoad; local: *; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java index b851b77ac43..85cac09f50d 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java @@ -94,7 +94,7 @@ public abstract class MessageInfo { if (streamNumber < 0 || streamNumber > 65536) throw new IllegalArgumentException("Invalid stream number"); - return new sun.nio.ch.SctpMessageInfoImpl(null, address, streamNumber); + return new sun.nio.ch.sctp.MessageInfoImpl(null, address, streamNumber); } /** * Creates a {@code MessageInfo} instance suitable for use when @@ -133,8 +133,8 @@ public abstract class MessageInfo { if (streamNumber < 0 || streamNumber > 65536) throw new IllegalArgumentException("Invalid stream number"); - return new sun.nio.ch.SctpMessageInfoImpl(association, address, - streamNumber); + return new sun.nio.ch.sctp.MessageInfoImpl(association, + address, streamNumber); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java index d040a7a07ea..27666981319 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -162,7 +162,7 @@ public abstract class SctpChannel */ public static SctpChannel open() throws IOException { - return new sun.nio.ch.SctpChannelImpl((SelectorProvider)null); + return new sun.nio.ch.sctp.SctpChannelImpl((SelectorProvider)null); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index 229d18ec039..e1df42e2d11 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -162,7 +162,7 @@ public abstract class SctpMultiChannel */ public static SctpMultiChannel open() throws IOException { - return new sun.nio.ch.SctpMultiChannelImpl((SelectorProvider)null); + return new sun.nio.ch.sctp.SctpMultiChannelImpl((SelectorProvider)null); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java index 3867fc9ca34..49bb0bc83a2 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -98,7 +98,7 @@ public abstract class SctpServerChannel */ public static SctpServerChannel open() throws IOException { - return new sun.nio.ch.SctpServerChannelImpl((SelectorProvider)null); + return new sun.nio.ch.sctp.SctpServerChannelImpl((SelectorProvider)null); } /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java index 22c5f4a005b..82d70be8e84 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java @@ -25,7 +25,7 @@ package com.sun.nio.sctp; import java.net.SocketAddress; -import sun.nio.ch.SctpStdSocketOption; +import sun.nio.ch.sctp.SctpStdSocketOption; /** * SCTP channels supports the socket options defined by this class @@ -50,7 +50,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SCTP_DISABLE_FRAGMENTS = new SctpStdSocketOption("SCTP_DISABLE_FRAGMENTS", Boolean.class, - sun.nio.ch.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS); /** * Enables or disables explicit message completion. @@ -69,7 +69,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SCTP_EXPLICIT_COMPLETE = new SctpStdSocketOption("SCTP_EXPLICIT_COMPLETE", Boolean.class, - sun.nio.ch.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE); /** * Fragmented interleave controls how the presentation of messages occur @@ -120,7 +120,7 @@ public class SctpStandardSocketOptions { public static final SctpSocketOption SCTP_FRAGMENT_INTERLEAVE = new SctpStdSocketOption("SCTP_FRAGMENT_INTERLEAVE", Integer.class, - sun.nio.ch.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE); /** * The maximum number of streams requested by the local endpoint during @@ -171,7 +171,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SCTP_NODELAY = new SctpStdSocketOption("SCTP_NODELAY", Boolean.class, - sun.nio.ch.SctpStdSocketOption.SCTP_NODELAY); + sun.nio.ch.sctp.SctpStdSocketOption.SCTP_NODELAY); /** * Requests that the local SCTP stack use the given peer address as @@ -246,7 +246,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SO_SNDBUF = new SctpStdSocketOption("SO_SNDBUF", Integer.class, - sun.nio.ch.SctpStdSocketOption.SO_SNDBUF); + sun.nio.ch.sctp.SctpStdSocketOption.SO_SNDBUF); /** * The size of the socket receive buffer. @@ -273,7 +273,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SO_RCVBUF = new SctpStdSocketOption("SO_RCVBUF", Integer.class, - sun.nio.ch.SctpStdSocketOption.SO_RCVBUF); + sun.nio.ch.sctp.SctpStdSocketOption.SO_RCVBUF); /** * Linger on close if data is present. @@ -304,7 +304,7 @@ public class SctpStandardSocketOptions { */ public static final SctpSocketOption SO_LINGER = new SctpStdSocketOption("SO_LINGER", Integer.class, - sun.nio.ch.SctpStdSocketOption.SO_LINGER); + sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER); /** * This class is used to set the maximum number of inbound/outbound streams diff --git a/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java b/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java index b4d0d72e8a4..b0f943def2d 100644 --- a/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java +++ b/jdk/src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java @@ -35,15 +35,15 @@ import sun.misc.*; * @since 1.4 */ -abstract class AbstractPollArrayWrapper { +public abstract class AbstractPollArrayWrapper { // Event masks - static final short POLLIN = 0x0001; - static final short POLLOUT = 0x0004; - static final short POLLERR = 0x0008; - static final short POLLHUP = 0x0010; - static final short POLLNVAL = 0x0020; - static final short POLLREMOVE = 0x0800; + public static final short POLLIN = 0x0001; + public static final short POLLOUT = 0x0004; + public static final short POLLERR = 0x0008; + public static final short POLLHUP = 0x0010; + public static final short POLLNVAL = 0x0020; + public static final short POLLREMOVE = 0x0800; // Miscellaneous constants static final short SIZE_POLLFD = 8; diff --git a/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java b/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java index 8f3a7dce185..225ac63bbf2 100644 --- a/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/AbstractPollSelectorImpl.java @@ -67,7 +67,7 @@ abstract class AbstractPollSelectorImpl this.channelOffset = offset; } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { synchronized (closeLock) { if (closed) throw new ClosedSelectorException(); diff --git a/jdk/src/share/classes/sun/nio/ch/IOStatus.java b/jdk/src/share/classes/sun/nio/ch/IOStatus.java index 92b99fe126a..68802c099e4 100644 --- a/jdk/src/share/classes/sun/nio/ch/IOStatus.java +++ b/jdk/src/share/classes/sun/nio/ch/IOStatus.java @@ -28,16 +28,16 @@ package sun.nio.ch; // Constants for reporting I/O status -final class IOStatus { +public final class IOStatus { private IOStatus() { } - static final int EOF = -1; // End of file - static final int UNAVAILABLE = -2; // Nothing available (non-blocking) - static final int INTERRUPTED = -3; // System call interrupted - static final int UNSUPPORTED = -4; // Operation not supported - static final int THROWN = -5; // Exception thrown in JNI code - static final int UNSUPPORTED_CASE = -6; // This case not supported + public static final int EOF = -1; // End of file + public static final int UNAVAILABLE = -2; // Nothing available (non-blocking) + public static final int INTERRUPTED = -3; // System call interrupted + public static final int UNSUPPORTED = -4; // Operation not supported + public static final int THROWN = -5; // Exception thrown in JNI code + public static final int UNSUPPORTED_CASE = -6; // This case not supported // The following two methods are for use in try/finally blocks where a // status value needs to be normalized before being returned to the invoker @@ -55,28 +55,28 @@ final class IOStatus { // } // - static int normalize(int n) { + public static int normalize(int n) { if (n == UNAVAILABLE) return 0; return n; } - static boolean check(int n) { + public static boolean check(int n) { return (n >= UNAVAILABLE); } - static long normalize(long n) { + public static long normalize(long n) { if (n == UNAVAILABLE) return 0; return n; } - static boolean check(long n) { + public static boolean check(long n) { return (n >= UNAVAILABLE); } // Return true iff n is not one of the IOStatus values - static boolean checkAll(long n) { + public static boolean checkAll(long n) { return ((n > EOF) || (n < UNSUPPORTED_CASE)); } diff --git a/jdk/src/share/classes/sun/nio/ch/IOUtil.java b/jdk/src/share/classes/sun/nio/ch/IOUtil.java index 559d647c8ff..e5320bc86b0 100644 --- a/jdk/src/share/classes/sun/nio/ch/IOUtil.java +++ b/jdk/src/share/classes/sun/nio/ch/IOUtil.java @@ -34,7 +34,7 @@ import java.nio.ByteBuffer; * File-descriptor based I/O utilities that are shared by NIO classes. */ -class IOUtil { +public class IOUtil { private IOUtil() { } // No instantiation @@ -309,7 +309,7 @@ class IOUtil { } } - static FileDescriptor newFD(int i) { + public static FileDescriptor newFD(int i) { FileDescriptor fd = new FileDescriptor(); setfdVal(fd, i); return fd; @@ -326,10 +326,11 @@ class IOUtil { static native boolean drain(int fd) throws IOException; - static native void configureBlocking(FileDescriptor fd, boolean blocking) + public static native void configureBlocking(FileDescriptor fd, + boolean blocking) throws IOException; - static native int fdVal(FileDescriptor fd); + public static native int fdVal(FileDescriptor fd); static native void setfdVal(FileDescriptor fd, int value); diff --git a/jdk/src/share/classes/sun/nio/ch/Net.java b/jdk/src/share/classes/sun/nio/ch/Net.java index aecbc7ba5bc..9f2d1f01776 100644 --- a/jdk/src/share/classes/sun/nio/ch/Net.java +++ b/jdk/src/share/classes/sun/nio/ch/Net.java @@ -33,7 +33,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; -class Net { // package-private +public class Net { private Net() { } @@ -75,7 +75,7 @@ class Net { // package-private return canJoin6WithIPv4Group0(); } - static InetSocketAddress checkAddress(SocketAddress sa) { + public static InetSocketAddress checkAddress(SocketAddress sa) { if (sa == null) throw new NullPointerException(); if (!(sa instanceof InetSocketAddress)) @@ -330,7 +330,7 @@ class Net { // package-private // Due to oddities SO_REUSEADDR on windows reuse is ignored private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse); - static void bind(FileDescriptor fd, InetAddress addr, int port) + public static void bind(FileDescriptor fd, InetAddress addr, int port) throws IOException { bind(UNSPEC, fd, addr, port); @@ -383,7 +383,7 @@ class Net { // package-private private static native InetAddress localInetAddress(FileDescriptor fd) throws IOException; - static InetSocketAddress localAddress(FileDescriptor fd) + public static InetSocketAddress localAddress(FileDescriptor fd) throws IOException { return new InetSocketAddress(localInetAddress(fd), localPort(fd)); diff --git a/jdk/src/share/classes/sun/nio/ch/SelChImpl.java b/jdk/src/share/classes/sun/nio/ch/SelChImpl.java index 580bc33dd54..2f97faff80e 100644 --- a/jdk/src/share/classes/sun/nio/ch/SelChImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SelChImpl.java @@ -36,7 +36,7 @@ import java.io.IOException; * @since 1.4 */ -interface SelChImpl extends Channel { +public interface SelChImpl extends Channel { FileDescriptor getFD(); diff --git a/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java b/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java index fd2c28f9d5d..ce1783ee735 100644 --- a/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SelectionKeyImpl.java @@ -34,12 +34,12 @@ import java.nio.channels.spi.*; * An implementation of SelectionKey for Solaris. */ -class SelectionKeyImpl +public class SelectionKeyImpl extends AbstractSelectionKey { final SelChImpl channel; // package-private - final SelectorImpl selector; // package-private + public final SelectorImpl selector; // Index for a pollfd array in Selector that this key is registered with private int index; @@ -91,15 +91,15 @@ class SelectionKeyImpl // The nio versions of these operations do not care if a key // has been invalidated. They are for internal use by nio code. - void nioReadyOps(int ops) { // package-private + public void nioReadyOps(int ops) { readyOps = ops; } - int nioReadyOps() { // package-private + public int nioReadyOps() { return readyOps; } - SelectionKey nioInterestOps(int ops) { // package-private + public SelectionKey nioInterestOps(int ops) { if ((ops & ~channel().validOps()) != 0) throw new IllegalArgumentException(); channel.translateAndSetInterestOps(ops, this); @@ -107,7 +107,7 @@ class SelectionKeyImpl return this; } - int nioInterestOps() { // package-private + public int nioInterestOps() { return interestOps; } diff --git a/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java b/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java index bf93513fada..c881e3fe525 100644 --- a/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java @@ -36,7 +36,7 @@ import java.util.*; * Base Selector implementation class. */ -abstract class SelectorImpl +public abstract class SelectorImpl extends AbstractSelector { @@ -118,7 +118,7 @@ abstract class SelectorImpl protected abstract void implClose() throws IOException; - void putEventOps(SelectionKeyImpl sk, int ops) { } + public void putEventOps(SelectionKeyImpl sk, int ops) { } protected final SelectionKey register(AbstractSelectableChannel ch, int ops, diff --git a/jdk/src/share/classes/sun/nio/ch/Util.java b/jdk/src/share/classes/sun/nio/ch/Util.java index fafc48f3552..56aa1f65e39 100644 --- a/jdk/src/share/classes/sun/nio/ch/Util.java +++ b/jdk/src/share/classes/sun/nio/ch/Util.java @@ -40,7 +40,7 @@ import sun.misc.Cleaner; import sun.security.action.GetPropertyAction; -class Util { +public class Util { // -- Caches -- @@ -158,7 +158,7 @@ class Util { /** * Returns a temporary buffer of at least the given size */ - static ByteBuffer getTemporaryDirectBuffer(int size) { + public static ByteBuffer getTemporaryDirectBuffer(int size) { BufferCache cache = bufferCache.get(); ByteBuffer buf = cache.get(size); if (buf != null) { @@ -178,7 +178,7 @@ class Util { /** * Releases a temporary buffer by returning to the cache or freeing it. */ - static void releaseTemporaryDirectBuffer(ByteBuffer buf) { + public static void releaseTemporaryDirectBuffer(ByteBuffer buf) { offerFirstTemporaryDirectBuffer(buf); } @@ -467,7 +467,7 @@ class Util { private static boolean loaded = false; - static void load() { + public static void load() { synchronized (Util.class) { if (loaded) return; diff --git a/jdk/src/share/classes/sun/nio/ch/SctpMessageInfoImpl.java b/jdk/src/share/classes/sun/nio/ch/sctp/MessageInfoImpl.java similarity index 86% rename from jdk/src/share/classes/sun/nio/ch/SctpMessageInfoImpl.java rename to jdk/src/share/classes/sun/nio/ch/sctp/MessageInfoImpl.java index 676ac9c3ca5..3bc023562e7 100644 --- a/jdk/src/share/classes/sun/nio/ch/SctpMessageInfoImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/sctp/MessageInfoImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import com.sun.nio.sctp.MessageInfo; @@ -31,7 +31,7 @@ import com.sun.nio.sctp.Association; /** * An implementation of a MessageInfo. */ -public class SctpMessageInfoImpl extends MessageInfo { +public class MessageInfoImpl extends MessageInfo { private final SocketAddress address; private final int bytes; /* 0 */ @@ -43,9 +43,9 @@ public class SctpMessageInfoImpl extends MessageInfo { private long timeToLive; /* 0L */ private int ppid; /* 0 */ - public SctpMessageInfoImpl(Association association, - SocketAddress address, - int streamNumber) { + public MessageInfoImpl(Association association, + SocketAddress address, + int streamNumber) { this.association = association; this.address = address; this.streamNumber = streamNumber; @@ -53,13 +53,13 @@ public class SctpMessageInfoImpl extends MessageInfo { } /* Invoked from native */ - private SctpMessageInfoImpl(int assocId, - SocketAddress address, - int bytes, - int streamNumber, - boolean complete, - boolean unordered, - int ppid) { + private MessageInfoImpl(int assocId, + SocketAddress address, + int bytes, + int streamNumber, + boolean complete, + boolean unordered, + int ppid) { this.assocId = assocId; this.address = address; this.bytes = bytes; @@ -75,7 +75,7 @@ public class SctpMessageInfoImpl extends MessageInfo { } /** - * SctpMessageInfoImpl instances created from native will need to have their + * MessageInfoImpl instances created from native will need to have their * association set from the channel. */ void setAssociation(Association association) { diff --git a/jdk/src/share/classes/sun/nio/ch/SctpStdSocketOption.java b/jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java similarity index 98% rename from jdk/src/share/classes/sun/nio/ch/SctpStdSocketOption.java rename to jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java index f94c7598bbe..b5d5ee5e6f3 100644 --- a/jdk/src/share/classes/sun/nio/ch/SctpStdSocketOption.java +++ b/jdk/src/share/classes/sun/nio/ch/sctp/SctpStdSocketOption.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.SctpSocketOption; diff --git a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java index 1badd793fb5..05862e2356a 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java @@ -180,7 +180,7 @@ class DevPollSelectorImpl ((SelChImpl)selch).kill(); } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { if (closed) throw new ClosedSelectorException(); int fd = IOUtil.fdVal(sk.channel.getFD()); diff --git a/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java index c6a09ba4ed5..c18650372ca 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java @@ -181,7 +181,7 @@ class EPollSelectorImpl ((SelChImpl)selch).kill(); } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { if (closed) throw new ClosedSelectorException(); pollWrapper.setInterest(sk.channel, ops); diff --git a/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java b/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java index 968484233cf..574c33d3c50 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java +++ b/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java @@ -37,21 +37,21 @@ package sun.nio.ch; // always returns -1 and the signal(long) method has no effect. -class NativeThread { +public class NativeThread { // Returns an opaque token representing the native thread underlying the // invoking Java thread. On systems that do not require signalling, this // method always returns -1. // - static native long current(); + public static native long current(); // Signals the given native thread so as to release it from a blocking I/O // operation. On systems that do not require signalling, this method has // no effect. // - static native void signal(long nt); + public static native void signal(long nt); - static native void init(); + private static native void init(); static { Util.load(); diff --git a/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java b/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java index 3fe4421f7cf..70c189e2318 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java +++ b/jdk/src/solaris/classes/sun/nio/ch/PollArrayWrapper.java @@ -41,9 +41,9 @@ import sun.misc.*; * @since 1.4 */ -class PollArrayWrapper extends AbstractPollArrayWrapper { +public class PollArrayWrapper extends AbstractPollArrayWrapper { - static final short POLLCONN = POLLOUT; + public static final short POLLCONN = POLLOUT; // File descriptor to write for interrupt int interruptFD; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpAssocChange.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationChange.java similarity index 92% rename from jdk/src/solaris/classes/sun/nio/ch/SctpAssocChange.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationChange.java index fe4c5334968..950c0b02923 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpAssocChange.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationChange.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; import com.sun.nio.sctp.AssociationChangeNotification; @@ -30,7 +30,7 @@ import com.sun.nio.sctp.AssociationChangeNotification; /** * An implementation of AssociationChangeNotification */ -public class SctpAssocChange extends AssociationChangeNotification +public class AssociationChange extends AssociationChangeNotification implements SctpNotification { /* static final ints so that they can be referenced from native */ @@ -50,10 +50,10 @@ public class SctpAssocChange extends AssociationChangeNotification private int maxInStreams; /* Invoked from native */ - private SctpAssocChange(int assocId, - int intEvent, - int maxOutStreams, - int maxInStreams) { + private AssociationChange(int assocId, + int intEvent, + int maxOutStreams, + int maxInStreams) { switch (intEvent) { case SCTP_COMM_UP : this.event = AssocChangeEvent.COMM_UP; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpAssociationImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationImpl.java similarity index 88% rename from jdk/src/solaris/classes/sun/nio/ch/SctpAssociationImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationImpl.java index c6688c33419..225f541298a 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpAssociationImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/AssociationImpl.java @@ -22,17 +22,17 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; /** * An implementation of Association */ -public class SctpAssociationImpl extends Association { - public SctpAssociationImpl(int associationID, - int maxInStreams, - int maxOutStreams) { +public class AssociationImpl extends Association { + public AssociationImpl(int associationID, + int maxInStreams, + int maxOutStreams) { super(associationID, maxInStreams, maxOutStreams); } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpPeerAddrChange.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/PeerAddrChange.java similarity index 95% rename from jdk/src/solaris/classes/sun/nio/ch/SctpPeerAddrChange.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/PeerAddrChange.java index 1b89f63db3e..52bdbefc2bc 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpPeerAddrChange.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/PeerAddrChange.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import com.sun.nio.sctp.Association; @@ -31,7 +31,7 @@ import com.sun.nio.sctp.PeerAddressChangeNotification; /** * An implementation of PeerAddressChangeNotification */ -public class SctpPeerAddrChange extends PeerAddressChangeNotification +public class PeerAddrChange extends PeerAddressChangeNotification implements SctpNotification { /* static final ints so that they can be referenced from native */ @@ -51,7 +51,7 @@ public class SctpPeerAddrChange extends PeerAddressChangeNotification private AddressChangeEvent event; /* Invoked from native */ - private SctpPeerAddrChange(int assocId, SocketAddress address, int intEvent) { + private PeerAddrChange(int assocId, SocketAddress address, int intEvent) { switch (intEvent) { case SCTP_ADDR_AVAILABLE : this.event = AddressChangeEvent.ADDR_AVAILABLE; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpResultContainer.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/ResultContainer.java similarity index 82% rename from jdk/src/solaris/classes/sun/nio/ch/SctpResultContainer.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/ResultContainer.java index f6c09d3f79a..69935d2dacb 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpResultContainer.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/ResultContainer.java @@ -22,13 +22,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; /** * Wraps the actual message or notification so that it can be * set and returned from the native receive implementation. */ -public class SctpResultContainer { +public class ResultContainer { /* static final ints so that they can be referenced from native */ static final int NOTHING = 0; static final int MESSAGE = 1; @@ -63,47 +63,47 @@ public class SctpResultContainer { return (SctpNotification) value; } - SctpMessageInfoImpl getMessageInfo() { + MessageInfoImpl getMessageInfo() { assert type() == MESSAGE; - if (value instanceof SctpMessageInfoImpl) - return (SctpMessageInfoImpl) value; + if (value instanceof MessageInfoImpl) + return (MessageInfoImpl) value; return null; } - SctpSendFailed getSendFailed() { + SendFailed getSendFailed() { assert type() == SEND_FAILED; - if (value instanceof SctpSendFailed) - return (SctpSendFailed) value; + if (value instanceof SendFailed) + return (SendFailed) value; return null; } - SctpAssocChange getAssociationChanged() { + AssociationChange getAssociationChanged() { assert type() == ASSOCIATION_CHANGED; - if (value instanceof SctpAssocChange) - return (SctpAssocChange) value; + if (value instanceof AssociationChange) + return (AssociationChange) value; return null; } - SctpPeerAddrChange getPeerAddressChanged() { + PeerAddrChange getPeerAddressChanged() { assert type() == PEER_ADDRESS_CHANGED; - if (value instanceof SctpPeerAddrChange) - return (SctpPeerAddrChange) value; + if (value instanceof PeerAddrChange) + return (PeerAddrChange) value; return null; } - SctpShutdown getShutdown() { + Shutdown getShutdown() { assert type() == SHUTDOWN; - if (value instanceof SctpShutdown) - return (SctpShutdown) value; + if (value instanceof Shutdown) + return (Shutdown) value; return null; } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java similarity index 97% rename from jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java index 699f80a9277..25afcff2695 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.InetAddress; import java.net.SocketAddress; @@ -53,11 +53,20 @@ import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpSocketOption; +import sun.nio.ch.DirectBuffer; +import sun.nio.ch.IOStatus; +import sun.nio.ch.IOUtil; +import sun.nio.ch.NativeThread; +import sun.nio.ch.Net; +import sun.nio.ch.PollArrayWrapper; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.Util; import static com.sun.nio.sctp.SctpStandardSocketOptions.*; -import static sun.nio.ch.SctpResultContainer.SEND_FAILED; -import static sun.nio.ch.SctpResultContainer.ASSOCIATION_CHANGED; -import static sun.nio.ch.SctpResultContainer.PEER_ADDRESS_CHANGED; -import static sun.nio.ch.SctpResultContainer.SHUTDOWN; +import static sun.nio.ch.sctp.ResultContainer.SEND_FAILED; +import static sun.nio.ch.sctp.ResultContainer.ASSOCIATION_CHANGED; +import static sun.nio.ch.sctp.ResultContainer.PEER_ADDRESS_CHANGED; +import static sun.nio.ch.sctp.ResultContainer.SHUTDOWN; /** * An implementation of an SctpChannel @@ -745,7 +754,7 @@ public class SctpChannelImpl extends SctpChannel receiveInvoked.set(Boolean.TRUE); try { - SctpResultContainer resultContainer = new SctpResultContainer(); + ResultContainer resultContainer = new ResultContainer(); do { resultContainer.clear(); synchronized (receiveLock) { @@ -775,7 +784,7 @@ public class SctpChannelImpl extends SctpChannel /* message or nothing */ if (resultContainer.hasSomething()) { /* Set the association before returning */ - SctpMessageInfoImpl info = + MessageInfoImpl info = resultContainer.getMessageInfo(); synchronized (stateLock) { assert association != null; @@ -812,7 +821,7 @@ public class SctpChannelImpl extends SctpChannel private int receive(int fd, ByteBuffer dst, - SctpResultContainer resultContainer, + ResultContainer resultContainer, boolean peek) throws IOException { int pos = dst.position(); @@ -837,7 +846,7 @@ public class SctpChannelImpl extends SctpChannel } private int receiveIntoNativeBuffer(int fd, - SctpResultContainer resultContainer, + ResultContainer resultContainer, ByteBuffer bb, int rem, int pos, @@ -854,7 +863,7 @@ public class SctpChannelImpl extends SctpChannel private InternalNotificationHandler internalNotificationHandler = new InternalNotificationHandler(); - private void handleNotificationInternal(SctpResultContainer resultContainer) + private void handleNotificationInternal(ResultContainer resultContainer) { invokeNotificationHandler(resultContainer, internalNotificationHandler, null); @@ -869,8 +878,8 @@ public class SctpChannelImpl extends SctpChannel if (not.event().equals( AssociationChangeNotification.AssocChangeEvent.COMM_UP) && association == null) { - SctpAssocChange sac = (SctpAssocChange) not; - association = new SctpAssociationImpl + AssociationChange sac = (AssociationChange) not; + association = new AssociationImpl (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); } return HandlerResult.CONTINUE; @@ -878,7 +887,7 @@ public class SctpChannelImpl extends SctpChannel } private HandlerResult invokeNotificationHandler - (SctpResultContainer resultContainer, + (ResultContainer resultContainer, NotificationHandler handler, T attachment) { SctpNotification notification = resultContainer.notification(); @@ -1078,7 +1087,7 @@ public class SctpChannelImpl extends SctpChannel /* Native */ private static native void initIDs(); - static native int receive0(int fd, SctpResultContainer resultContainer, + static native int receive0(int fd, ResultContainer resultContainer, long address, int length, boolean peek) throws IOException; static native int send0(int fd, long address, int length, diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java similarity index 97% rename from jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java index 8ef16fac404..e00247f3970 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.InetAddress; import java.net.SocketAddress; @@ -53,8 +53,17 @@ import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpMultiChannel; import com.sun.nio.sctp.SctpSocketOption; +import sun.nio.ch.DirectBuffer; +import sun.nio.ch.NativeThread; +import sun.nio.ch.IOStatus; +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; +import sun.nio.ch.PollArrayWrapper; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.Util; import static com.sun.nio.sctp.SctpStandardSocketOptions.*; -import static sun.nio.ch.SctpResultContainer.*; +import static sun.nio.ch.sctp.ResultContainer.*; /** * An implementation of SctpMultiChannel @@ -466,7 +475,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel receiveInvoked.set(Boolean.TRUE); try { - SctpResultContainer resultContainer = new SctpResultContainer(); + ResultContainer resultContainer = new ResultContainer(); do { resultContainer.clear(); synchronized (receiveLock) { @@ -498,7 +507,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel /* message or nothing */ if (resultContainer.hasSomething()) { /* Set the association before returning */ - SctpMessageInfoImpl info = + MessageInfoImpl info = resultContainer.getMessageInfo(); info.setAssociation(lookupAssociation(info. associationID())); @@ -542,7 +551,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel private int receive(int fd, ByteBuffer dst, - SctpResultContainer resultContainer) + ResultContainer resultContainer) throws IOException { int pos = dst.position(); int lim = dst.limit(); @@ -566,7 +575,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel } private int receiveIntoNativeBuffer(int fd, - SctpResultContainer resultContainer, + ResultContainer resultContainer, ByteBuffer bb, int rem, int pos) @@ -580,7 +589,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel private InternalNotificationHandler internalNotificationHandler = new InternalNotificationHandler(); - private void handleNotificationInternal(SctpResultContainer resultContainer) + private void handleNotificationInternal(ResultContainer resultContainer) { invokeNotificationHandler(resultContainer, internalNotificationHandler, null); @@ -592,12 +601,12 @@ public class SctpMultiChannelImpl extends SctpMultiChannel @Override public HandlerResult handleNotification( AssociationChangeNotification not, Object unused) { - SctpAssocChange sac = (SctpAssocChange) not; + AssociationChange sac = (AssociationChange) not; /* Update map to reflect change in association */ switch (not.event()) { case COMM_UP : - Association newAssociation = new SctpAssociationImpl + Association newAssociation = new AssociationImpl (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); addAssociation(newAssociation); break; @@ -612,7 +621,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel } private HandlerResult invokeNotificationHandler( - SctpResultContainer resultContainer, + ResultContainer resultContainer, NotificationHandler handler, T attachment) { HandlerResult result; @@ -956,7 +965,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel /* Use common native implementation shared between * one-to-one and one-to-many */ private static int receive0(int fd, - SctpResultContainer resultContainer, + ResultContainer resultContainer, long address, int length) throws IOException{ diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java similarity index 99% rename from jdk/src/solaris/classes/sun/nio/ch/SctpNet.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java index a275c99cf9c..efe25b335a4 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.io.FileDescriptor; import java.io.IOException; @@ -34,6 +34,8 @@ import java.util.Set; import java.util.HashSet; import java.security.AccessController; import sun.security.action.GetPropertyAction; +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; import com.sun.nio.sctp.SctpSocketOption; import static com.sun.nio.sctp.SctpStandardSocketOptions.*; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpNotification.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNotification.java similarity index 98% rename from jdk/src/solaris/classes/sun/nio/ch/SctpNotification.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNotification.java index d35ea804473..c901964b832 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpNotification.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNotification.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; import com.sun.nio.sctp.Notification; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java similarity index 98% rename from jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java index 85a2d73d4be..15d281bd309 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetSocketAddress; @@ -41,6 +41,15 @@ import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpServerChannel; import com.sun.nio.sctp.SctpSocketOption; import com.sun.nio.sctp.SctpStandardSocketOptions; +import sun.nio.ch.DirectBuffer; +import sun.nio.ch.NativeThread; +import sun.nio.ch.IOStatus; +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; +import sun.nio.ch.PollArrayWrapper; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.Util; /** * An implementation of SctpServerChannel diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpSendFailed.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SendFailed.java similarity index 91% rename from jdk/src/solaris/classes/sun/nio/ch/SctpSendFailed.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/SendFailed.java index ff71bdf1091..25717d5ce11 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpSendFailed.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SendFailed.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.nio.ByteBuffer; import java.net.SocketAddress; @@ -32,7 +32,7 @@ import com.sun.nio.sctp.SendFailedNotification; /** * An implementation of SendFailedNotification */ -public class SctpSendFailed extends SendFailedNotification +public class SendFailed extends SendFailedNotification implements SctpNotification { private Association association; @@ -45,11 +45,11 @@ public class SctpSendFailed extends SendFailedNotification private int streamNumber; /* Invoked from native */ - private SctpSendFailed(int assocId, - SocketAddress address, - ByteBuffer buffer, - int errorCode, - int streamNumber) { + private SendFailed(int assocId, + SocketAddress address, + ByteBuffer buffer, + int errorCode, + int streamNumber) { this.assocId = assocId; this.errorCode = errorCode; this.streamNumber = streamNumber; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpShutdown.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/Shutdown.java similarity index 94% rename from jdk/src/solaris/classes/sun/nio/ch/SctpShutdown.java rename to jdk/src/solaris/classes/sun/nio/ch/sctp/Shutdown.java index 9da2375c1cf..b3cf6691d77 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpShutdown.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/Shutdown.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import com.sun.nio.sctp.Association; import com.sun.nio.sctp.ShutdownNotification; @@ -30,7 +30,7 @@ import com.sun.nio.sctp.ShutdownNotification; /** * An implementation of ShutdownNotification */ -public class SctpShutdown extends ShutdownNotification +public class Shutdown extends ShutdownNotification implements SctpNotification { private Association association; @@ -39,7 +39,7 @@ public class SctpShutdown extends ShutdownNotification private int assocId; /* Invoked from native */ - private SctpShutdown(int assocId) { + private Shutdown(int assocId) { this.assocId = assocId; } diff --git a/jdk/src/solaris/native/sun/nio/ch/Sctp.h b/jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h similarity index 100% rename from jdk/src/solaris/native/sun/nio/ch/Sctp.h rename to jdk/src/solaris/native/sun/nio/ch/sctp/Sctp.h diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c similarity index 83% rename from jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c rename to jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c index 8e40204e442..4333720c3d8 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c @@ -32,21 +32,21 @@ #include "nio.h" #include "net_util.h" #include "net_util_md.h" -#include "sun_nio_ch_SctpNet.h" -#include "sun_nio_ch_SctpChannelImpl.h" -#include "sun_nio_ch_SctpAssocChange.h" -#include "sun_nio_ch_SctpResultContainer.h" -#include "sun_nio_ch_SctpPeerAddrChange.h" +#include "sun_nio_ch_sctp_SctpNet.h" +#include "sun_nio_ch_sctp_SctpChannelImpl.h" +#include "sun_nio_ch_sctp_AssociationChange.h" +#include "sun_nio_ch_sctp_ResultContainer.h" +#include "sun_nio_ch_sctp_PeerAddrChange.h" /* sizeof(union sctp_notification */ #define NOTIFICATION_BUFFER_SIZE 280 -#define MESSAGE_IMPL_CLASS "sun/nio/ch/SctpMessageInfoImpl" -#define RESULT_CONTAINER_CLASS "sun/nio/ch/SctpResultContainer" -#define SEND_FAILED_CLASS "sun/nio/ch/SctpSendFailed" -#define ASSOC_CHANGE_CLASS "sun/nio/ch/SctpAssocChange" -#define PEER_CHANGE_CLASS "sun/nio/ch/SctpPeerAddrChange" -#define SHUTDOWN_CLASS "sun/nio/ch/SctpShutdown" +#define MESSAGE_IMPL_CLASS "sun/nio/ch/sctp/MessageInfoImpl" +#define RESULT_CONTAINER_CLASS "sun/nio/ch/sctp/ResultContainer" +#define SEND_FAILED_CLASS "sun/nio/ch/sctp/SendFailed" +#define ASSOC_CHANGE_CLASS "sun/nio/ch/sctp/AssociationChange" +#define PEER_CHANGE_CLASS "sun/nio/ch/sctp/PeerAddrChange" +#define SHUTDOWN_CLASS "sun/nio/ch/sctp/Shutdown" struct controlData { int assocId; @@ -55,38 +55,40 @@ struct controlData { unsigned int ppid; }; -static jclass smi_class; /* sun.nio.ch.SctpMessageInfoImpl */ -static jmethodID smi_ctrID; /* sun.nio.ch.SctpMessageInfoImpl. */ -static jfieldID src_valueID; /* sun.nio.ch.SctpResultContainer.value */ -static jfieldID src_typeID; /* sun.nio.ch.SctpResultContainer.type */ -static jclass ssf_class; /* sun.nio.ch.SctpSendFailed */ -static jmethodID ssf_ctrID; /* sun.nio.ch.SctpSendFailed. */ -static jclass sac_class; /* sun.nio.ch.SctpAssociationChanged */ -static jmethodID sac_ctrID; /* sun.nio.ch.SctpAssociationChanged. */ -static jclass spc_class; /* sun.nio.ch.SctpPeerAddressChanged */ -static jmethodID spc_ctrID; /* sun.nio.ch.SctpPeerAddressChanged. */ -static jclass ss_class; /* sun.nio.ch.SctpShutdown */ -static jmethodID ss_ctrID; /* sun.nio.ch.SctpShutdown. */ -static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */ -static jfieldID isa_portID; /* java.net.InetSocketAddress.port */ +static jclass smi_class; /* sun.nio.ch.sctp.MessageInfoImpl */ +static jmethodID smi_ctrID; /* sun.nio.ch.sctp.MessageInfoImpl. */ +static jfieldID src_valueID; /* sun.nio.ch.sctp.ResultContainer.value */ +static jfieldID src_typeID; /* sun.nio.ch.sctp.ResultContainer.type */ +static jclass ssf_class; /* sun.nio.ch.sctp.SendFailed */ +static jmethodID ssf_ctrID; /* sun.nio.ch.sctp.SendFailed. */ +static jclass sac_class; /* sun.nio.ch.sctp.AssociationChange */ +static jmethodID sac_ctrID; /* sun.nio.ch.sctp.AssociationChange. */ +static jclass spc_class; /* sun.nio.ch.sctp.PeerAddressChanged */ +static jmethodID spc_ctrID; /* sun.nio.ch.sctp.PeerAddressChanged. */ +static jclass ss_class; /* sun.nio.ch.sctp.Shutdown */ +static jmethodID ss_ctrID; /* sun.nio.ch.sctp.Shutdown. */ +static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */ +static jfieldID isa_portID; /* java.net.InetSocketAddress.port */ /* defined in SctpNet.c */ jobject SockAddrToInetSocketAddress(JNIEnv* env, struct sockaddr* addr); +jint handleSocketError(JNIEnv *env, jint errorValue); + /* use SocketChannelImpl's checkConnect implementation */ extern jint Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready); /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: initIDs * Signature: ()V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs (JNIEnv *env, jclass klass) { jclass cls; - /* SctpMessageInfoImpl */ + /* MessageInfoImpl */ cls = (*env)->FindClass(env, MESSAGE_IMPL_CLASS); CHECK_NULL(cls); smi_class = (*env)->NewGlobalRef(env, cls); @@ -95,7 +97,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs "(ILjava/net/SocketAddress;IIZZI)V"); CHECK_NULL(smi_ctrID); - /* SctpResultContainer */ + /* ResultContainer */ cls = (*env)->FindClass(env, RESULT_CONTAINER_CLASS); CHECK_NULL(cls); src_valueID = (*env)->GetFieldID(env, cls, "value", "Ljava/lang/Object;"); @@ -103,7 +105,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs src_typeID = (*env)->GetFieldID(env, cls, "type", "I"); CHECK_NULL(src_typeID); - /* SctpSendFailed */ + /* SendFailed */ cls = (*env)->FindClass(env, SEND_FAILED_CLASS); CHECK_NULL(cls); ssf_class = (*env)->NewGlobalRef(env, cls); @@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs "(ILjava/net/SocketAddress;Ljava/nio/ByteBuffer;II)V"); CHECK_NULL(ssf_ctrID); - /* SctpAssocChange */ + /* AssociationChange */ cls = (*env)->FindClass(env, ASSOC_CHANGE_CLASS); CHECK_NULL(cls); sac_class = (*env)->NewGlobalRef(env, cls); @@ -120,7 +122,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs sac_ctrID = (*env)->GetMethodID(env, cls, "", "(IIII)V"); CHECK_NULL(sac_ctrID); - /* SctpPeerAddrChange */ + /* PeerAddrChange */ cls = (*env)->FindClass(env, PEER_CHANGE_CLASS); CHECK_NULL(cls); spc_class = (*env)->NewGlobalRef(env, cls); @@ -129,7 +131,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs "(ILjava/net/SocketAddress;I)V"); CHECK_NULL(spc_ctrID); - /* sun.nio.ch.SctpShutdown */ + /* Shutdown */ cls = (*env)->FindClass(env, SHUTDOWN_CLASS); CHECK_NULL(cls); ss_class = (*env)->NewGlobalRef(env, cls); @@ -266,13 +268,13 @@ void handleSendFailed } } - /* create SctpSendFailed */ + /* create SendFailed */ resultObj = (*env)->NewObject(env, ssf_class, ssf_ctrID, ssf->ssf_assoc_id, isaObj, bufferObj, ssf->ssf_error, sri->sinfo_stream); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_SEND_FAILED); + sun_nio_ch_sctp_ResultContainer_SEND_FAILED); } void handleAssocChange @@ -282,38 +284,38 @@ void handleAssocChange switch (sac->sac_state) { case SCTP_COMM_UP : - state = sun_nio_ch_SctpAssocChange_SCTP_COMM_UP; + state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_UP; break; case SCTP_COMM_LOST : - state = sun_nio_ch_SctpAssocChange_SCTP_COMM_LOST; + state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_LOST; break; case SCTP_RESTART : - state = sun_nio_ch_SctpAssocChange_SCTP_RESTART; + state = sun_nio_ch_sctp_AssociationChange_SCTP_RESTART; break; case SCTP_SHUTDOWN_COMP : - state = sun_nio_ch_SctpAssocChange_SCTP_SHUTDOWN; + state = sun_nio_ch_sctp_AssociationChange_SCTP_SHUTDOWN; break; case SCTP_CANT_STR_ASSOC : - state = sun_nio_ch_SctpAssocChange_SCTP_CANT_START; + state = sun_nio_ch_sctp_AssociationChange_SCTP_CANT_START; } - /* create SctpAssociationChanged */ + /* create AssociationChange */ resultObj = (*env)->NewObject(env, sac_class, sac_ctrID, sac->sac_assoc_id, state, sac->sac_outbound_streams, sac->sac_inbound_streams); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_ASSOCIATION_CHANGED); + sun_nio_ch_sctp_ResultContainer_ASSOCIATION_CHANGED); } void handleShutdown (JNIEnv* env, jobject resultContainerObj, struct sctp_shutdown_event* sse) { - /* create SctpShutdown */ + /* create Shutdown */ jobject resultObj = (*env)->NewObject(env, ss_class, ss_ctrID, sse->sse_assoc_id); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_SHUTDOWN); + sun_nio_ch_sctp_ResultContainer_SHUTDOWN); } void handlePeerAddrChange @@ -324,35 +326,35 @@ void handlePeerAddrChange switch (state) { case SCTP_ADDR_AVAILABLE : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_AVAILABLE; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_AVAILABLE; break; case SCTP_ADDR_UNREACHABLE : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_UNREACHABLE; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_UNREACHABLE; break; case SCTP_ADDR_REMOVED : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_REMOVED; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_REMOVED; break; case SCTP_ADDR_ADDED : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_ADDED; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_ADDED; break; case SCTP_ADDR_MADE_PRIM : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_MADE_PRIM; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM; #ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ break; case SCTP_ADDR_CONFIRMED : - event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_CONFIRMED; + event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED; #endif /* __linux__ */ } addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr); - /* create SctpPeerAddressChanged */ + /* create PeerAddressChanged */ resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id, addressObj, event); CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_PEER_ADDRESS_CHANGED); + sun_nio_ch_sctp_ResultContainer_PEER_ADDRESS_CHANGED); } void handleUninteresting @@ -403,7 +405,7 @@ void handleMessage isa = SockAddrToInetSocketAddress(env, sap); getControlData(msg, cdata); - /* create SctpMessageInfoImpl */ + /* create MessageInfoImpl */ resultObj = (*env)->NewObject(env, smi_class, smi_ctrID, cdata->assocId, isa, read, cdata->streamNumber, isEOR ? JNI_TRUE : JNI_FALSE, @@ -411,15 +413,15 @@ void handleMessage CHECK_NULL(resultObj); (*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj); (*env)->SetIntField(env, resultContainerObj, src_typeID, - sun_nio_ch_SctpResultContainer_MESSAGE); + sun_nio_ch_sctp_ResultContainer_MESSAGE); } /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: receive0 - * Signature: (ILsun/nio/ch/SctpResultContainer;JIZ)I + * Signature: (ILsun/nio/ch/sctp/ResultContainer;JIZ)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0 (JNIEnv *env, jclass klass, jint fd, jobject resultContainerObj, jlong address, jint length, jboolean peek) { SOCKADDR sa; @@ -505,11 +507,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0 } /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: send0 * Signature: (IJILjava/net/SocketAddress;IIZI)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_send0 (JNIEnv *env, jclass klass, jint fd, jlong address, jint length, jobject saTarget, jint assocId, jint streamNumber, jboolean unordered, jint ppid) { @@ -582,11 +584,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0 } /* - * Class: sun_nio_ch_SctpChannelImpl + * Class: sun_nio_ch_sctp_SctpChannelImpl * Method: checkConnect * Signature: (Ljava/io/FileDescriptor;ZZ)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_checkConnect +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect (JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready) { return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this, fdo, block, ready); diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c similarity index 87% rename from jdk/src/solaris/native/sun/nio/ch/SctpNet.c rename to jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c index 3eaf402ee80..35f7315de98 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c @@ -34,8 +34,8 @@ #include "nio.h" #include "net_util.h" #include "net_util_md.h" -#include "sun_nio_ch_SctpNet.h" -#include "sun_nio_ch_SctpStdSocketOption.h" +#include "sun_nio_ch_sctp_SctpNet.h" +#include "sun_nio_ch_sctp_SctpStdSocketOption.h" static jclass isaCls = 0; static jmethodID isaCtrID = 0; @@ -143,12 +143,12 @@ handleSocketError(JNIEnv *env, jint errorValue) } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: init * Signature: ()V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_init +Java_sun_nio_ch_sctp_SctpNet_init (JNIEnv *env, jclass cl) { int sp[2]; if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) { @@ -160,11 +160,11 @@ Java_sun_nio_ch_SctpNet_init } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: socket0 * Signature: (Z)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpNet_socket0 (JNIEnv *env, jclass klass, jboolean oneToOne) { int fd; struct sctp_event_subscribe event; @@ -202,11 +202,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: bindx * Signature: (I[Ljava/net/InetAddress;IIZ)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_bindx (JNIEnv *env, jclass klass, jint fd, jobjectArray addrs, jint port, jint addrsLength, jboolean add, jboolean preferIPv6) { SOCKADDR *sap, *tmpSap; @@ -241,24 +241,24 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: listen0 * Signature: (II)V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_listen0 +Java_sun_nio_ch_sctp_SctpNet_listen0 (JNIEnv *env, jclass cl, jint fd, jint backlog) { if (listen(fd, backlog) < 0) handleSocketError(env, errno); } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: connect0 * Signature: (ILjava/net/InetAddress;I)I */ JNIEXPORT jint JNICALL -Java_sun_nio_ch_SctpNet_connect0 +Java_sun_nio_ch_sctp_SctpNet_connect0 (JNIEnv *env, jclass clazz, int fd, jobject iao, jint port) { SOCKADDR sa; int sa_len = SOCKADDR_LEN; @@ -282,12 +282,12 @@ Java_sun_nio_ch_SctpNet_connect0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: close0 * Signature: (I)V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_close0 +Java_sun_nio_ch_sctp_SctpNet_close0 (JNIEnv *env, jclass clazz, jint fd) { if (fd != -1) { int rv = close(fd); @@ -297,12 +297,12 @@ Java_sun_nio_ch_SctpNet_close0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: preClose0 * Signature: (I)V */ JNIEXPORT void JNICALL -Java_sun_nio_ch_SctpNet_preClose0 +Java_sun_nio_ch_sctp_SctpNet_preClose0 (JNIEnv *env, jclass clazz, jint fd) { if (preCloseFD >= 0) { if (dup2(preCloseFD, fd) < 0) @@ -340,11 +340,11 @@ jobject SockAddrToInetSocketAddress } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getLocalAddresses0 * Signature: (I)[Ljava/net/SocketAddress; */ -JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_SctpNet_getLocalAddresses0 +JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0 (JNIEnv *env, jclass klass, jint fd) { void *addr_buf, *laddr; struct sockaddr* sap; @@ -448,11 +448,11 @@ jobjectArray getRemoteAddresses } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getRemoteAddresses0 * Signature: (II)[Ljava/net/SocketAddress; */ -JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_SctpNet_getRemoteAddresses0 +JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { return getRemoteAddresses(env, fd, assocId); } @@ -465,13 +465,13 @@ int mapSocketOption int level; int optname; } const opts[] = { - { sun_nio_ch_SctpStdSocketOption_SCTP_DISABLE_FRAGMENTS, IPPROTO_SCTP, SCTP_DISABLE_FRAGMENTS }, - { sun_nio_ch_SctpStdSocketOption_SCTP_EXPLICIT_COMPLETE, IPPROTO_SCTP, SCTP_EXPLICIT_EOR }, - { sun_nio_ch_SctpStdSocketOption_SCTP_FRAGMENT_INTERLEAVE, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE }, - { sun_nio_ch_SctpStdSocketOption_SCTP_NODELAY, IPPROTO_SCTP, SCTP_NODELAY }, - { sun_nio_ch_SctpStdSocketOption_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF }, - { sun_nio_ch_SctpStdSocketOption_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF }, - { sun_nio_ch_SctpStdSocketOption_SO_LINGER, SOL_SOCKET, SO_LINGER } }; + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_DISABLE_FRAGMENTS, IPPROTO_SCTP, SCTP_DISABLE_FRAGMENTS }, + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_EXPLICIT_COMPLETE, IPPROTO_SCTP, SCTP_EXPLICIT_EOR }, + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_FRAGMENT_INTERLEAVE, IPPROTO_SCTP, SCTP_FRAGMENT_INTERLEAVE }, + { sun_nio_ch_sctp_SctpStdSocketOption_SCTP_NODELAY, IPPROTO_SCTP, SCTP_NODELAY }, + { sun_nio_ch_sctp_SctpStdSocketOption_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF }, + { sun_nio_ch_sctp_SctpStdSocketOption_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF }, + { sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER, SOL_SOCKET, SO_LINGER } }; int i; for (i=0; i<(int)(sizeof(opts) / sizeof(opts[0])); i++) { @@ -487,11 +487,11 @@ int mapSocketOption } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setIntOption0 * Signature: (III)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setIntOption0 (JNIEnv *env, jclass klass, jint fd, jint opt, int arg) { int klevel, kopt; int result; @@ -505,7 +505,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 return; } - if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) { + if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) { parg = (void *)&linger; arglen = sizeof(linger); if (arg >= 0) { @@ -522,16 +522,16 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", - "sun_nio_ch_SctpNet.setIntOption0"); + "sun_nio_ch_sctp_SctpNet.setIntOption0"); } } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getIntOption0 * Signature: (II)I */ -JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 +JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_getIntOption0 (JNIEnv *env, jclass klass, jint fd, jint opt) { int klevel, kopt; int result; @@ -545,7 +545,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 return -1; } - if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) { + if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) { arg = (void *)&linger; arglen = sizeof(linger); } else { @@ -559,18 +559,18 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 return -1; } - if (opt == sun_nio_ch_SctpStdSocketOption_SO_LINGER) + if (opt == sun_nio_ch_sctp_SctpStdSocketOption_SO_LINGER) return linger.l_onoff ? linger.l_linger : -1; else return result; } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getPrimAddrOption0 * Signature: (II)Ljava/net/SocketAddress; */ -JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0 +JNIEXPORT jobject JNICALL Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { struct sctp_setprim prim; unsigned int prim_len = sizeof(prim); @@ -588,11 +588,11 @@ JNIEXPORT jobject JNICALL Java_sun_nio_ch_SctpNet_getPrimAddrOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setPrimAddrOption0 * Signature: (IILjava/net/InetAddress;I)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0 (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) { struct sctp_setprim prim; struct sockaddr* sap = (struct sockaddr*)&prim.ssp_addr; @@ -612,11 +612,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setPeerPrimAddrOption0 * Signature: (IILjava/net/InetAddress;I)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0 (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port, jboolean preferIPv6) { struct sctp_setpeerprim prim; @@ -638,11 +638,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: getInitMsgOption0 * Signature: (I[I)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0 (JNIEnv *env, jclass klass, jint fd, jintArray retVal) { struct sctp_initmsg sctp_initmsg; unsigned int sim_len = sizeof(sctp_initmsg); @@ -661,11 +661,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_getInitMsgOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: setInitMsgOption0 * Signature: (III)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0 (JNIEnv *env, jclass klass, jint fd, jint inArg, jint outArg) { struct sctp_initmsg sctp_initmsg; @@ -682,11 +682,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setInitMsgOption0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: shutdown0 * Signature: (II)V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0 +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_shutdown0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { int rv; struct msghdr msg[1]; @@ -738,11 +738,11 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_shutdown0 } /* - * Class: sun_nio_ch_SctpNet + * Class: sun_nio_ch_sctp_SctpNet * Method: branch * Signature: (II)I */ -JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_branch0 +JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_branch0 (JNIEnv *env, jclass klass, jint fd, jint assocId) { int newfd = 0; if ((newfd = nio_sctp_peeloff(fd, assocId)) < 0) { diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpServerChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpServerChannelImpl.c similarity index 86% rename from jdk/src/solaris/native/sun/nio/ch/SctpServerChannelImpl.c rename to jdk/src/solaris/native/sun/nio/ch/sctp/SctpServerChannelImpl.c index 5d23ae18806..4469cf2ea4d 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpServerChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/sctp/SctpServerChannelImpl.c @@ -23,7 +23,7 @@ * questions. */ -#include "sun_nio_ch_SctpServerChannelImpl.h" +#include "sun_nio_ch_sctp_SctpServerChannelImpl.h" extern void Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(JNIEnv* env, jclass c); @@ -32,21 +32,21 @@ extern jint Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv* env, jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa); /* - * Class: sun_nio_ch_SctpServerChannelImpl + * Class: sun_nio_ch_sctp_SctpServerChannelImpl * Method: initIDs * Signature: ()V */ -JNIEXPORT void JNICALL Java_sun_nio_ch_SctpServerChannelImpl_initIDs +JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs (JNIEnv* env, jclass c) { Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(env, c); } /* - * Class: sun_nio_ch_SctpServerChannelImpl + * Class: sun_nio_ch_sctp_SctpServerChannelImpl * Method: accept0 * Signature: (Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;[Ljava/net/InetSocketAddress;)I */ -JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpServerChannelImpl_accept0 +JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0 (JNIEnv* env, jobject this, jobject ssfdo, jobject newfdo, jobjectArray isaa) { return Java_sun_nio_ch_ServerSocketChannelImpl_accept0(env, this, ssfdo, newfdo, isaa); diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java index 2011b85a0fd..b755e6ef0c4 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java @@ -585,7 +585,7 @@ final class WindowsSelectorImpl extends SelectorImpl { ((SelChImpl)selch).kill(); } - void putEventOps(SelectionKeyImpl sk, int ops) { + public void putEventOps(SelectionKeyImpl sk, int ops) { synchronized (closeLock) { if (pollWrapper == null) throw new ClosedSelectorException(); diff --git a/jdk/src/windows/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpChannelImpl.java similarity index 99% rename from jdk/src/windows/classes/sun/nio/ch/SctpChannelImpl.java rename to jdk/src/windows/classes/sun/nio/ch/sctp/SctpChannelImpl.java index 562a97f21d6..52fcb8ea1f8 100644 --- a/jdk/src/windows/classes/sun/nio/ch/SctpChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetAddress; diff --git a/jdk/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java similarity index 99% rename from jdk/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java rename to jdk/src/windows/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java index b2300f9dfc8..afb52a92f65 100644 --- a/jdk/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetAddress; diff --git a/jdk/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java similarity index 99% rename from jdk/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java rename to jdk/src/windows/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java index 842e4b0f1a4..a8c50d3257a 100644 --- a/jdk/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.nio.ch; +package sun.nio.ch.sctp; import java.net.SocketAddress; import java.net.InetAddress; From 33859eda7af8a168de45f0625bafcac4158aa763 Mon Sep 17 00:00:00 2001 From: Miroslav Kos Date: Sun, 5 Feb 2012 12:29:31 +0000 Subject: [PATCH 05/26] 7140918: Remove dependency on apt and com.sun.mirror API Co-authored-by: Martin Grebac Reviewed-by: darcy --- jdk/make/common/Release.gmk | 11 +++++------ jdk/make/common/internal/Defs-jaxws.gmk | 10 ++++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index 5e3b0330110..e5593b83b2f 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -362,10 +362,11 @@ TOOLS = \ com/sun/tools/corba \ com/sun/tools/internal/xjc \ com/sun/tools/internal/ws \ - META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \ - META-INF/services/com.sun.tools.xjc.Plugin \ + META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ + META-INF/services/com.sun.tools.internal.xjc.Plugin \ com/sun/istack/internal/tools \ - com/sun/istack/internal/ws \ + com/sun/tools/internal/jxc/ap \ + com/sun/tools/internal/ws/wscompile/plugin/at_generated \ com/sun/codemodel \ com/sun/tools/internal/jxc \ com/sun/xml/internal/rngom \ @@ -528,10 +529,8 @@ $(NOT_RT_JAR_LIST): FRC $(ECHO) "com/sun/mirror/" >> $@ $(ECHO) "com/sun/source/" >> $@ $(ECHO) "com/sun/istack/internal/tools/" >> $@ - $(ECHO) "com/sun/istack/internal/ws/" >> $@ $(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@ $(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@ - $(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@ $(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@ $(ECHO) "com/sun/tools/" >> $@ $(ECHO) "sun/jvmstat/" >> $@ @@ -1000,7 +999,7 @@ initial-image-jdk:: initial-image-jdk-setup \ @# @# files that might not exist need to be touched. @# - $(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.xjc.Plugin + $(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin @# @# lib/tools.jar @# diff --git a/jdk/make/common/internal/Defs-jaxws.gmk b/jdk/make/common/internal/Defs-jaxws.gmk index 105651c79fc..f0ba12b292a 100644 --- a/jdk/make/common/internal/Defs-jaxws.gmk +++ b/jdk/make/common/internal/Defs-jaxws.gmk @@ -34,7 +34,6 @@ IMPORT_RT_PACKAGES += \ javax/xml/ws \ javax/jws \ javax/annotation \ - com/sun/istack/internal \ com/sun/xml/internal/bind \ com/sun/xml/internal/fastinfoset \ com/sun/xml/internal/messaging \ @@ -42,13 +41,13 @@ IMPORT_RT_PACKAGES += \ com/sun/xml/internal/txw2 \ com/sun/xml/internal/ws \ com/sun/xml/internal/stream/buffer + NOT_USED_PACKAGES += \ com/sun/tools/internal/txw2 IMPORT_TOOLS_PACKAGES += \ com/sun/codemodel \ com/sun/istack/internal/tools \ - com/sun/istack/internal/ws \ com/sun/xml/internal/rngom \ com/sun/xml/internal/xsom \ com/sun/xml/internal/dtdparser \ @@ -56,6 +55,9 @@ IMPORT_TOOLS_PACKAGES += \ com/sun/tools/internal/ws \ com/sun/tools/internal/jxc \ org/relaxng \ - META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \ - META-INF/services/com.sun.tools.internal.xjc.Plugin + META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ + META-INF/services/com.sun.tools.internal.xjc.Plugin \ + com/sun/tools/internal/jxc/ap \ + com/sun/tools/internal/ws/wscompile/plugin/at_generated + From 6667bfa0a92c1959fb4f87f5ac08cb1d06959af5 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Sun, 5 Feb 2012 21:49:45 -0800 Subject: [PATCH 06/26] 7041249: Remove apt tool and API from the JDK Reviewed-by: jjg, ohair --- jdk/make/com/sun/Makefile | 1 - jdk/make/common/Release.gmk | 6 - jdk/make/common/internal/Defs-langtools.gmk | 4 +- jdk/make/docs/Makefile | 60 +------- jdk/make/docs/NON_CORE_PKGS.gmk | 7 +- jdk/make/launchers/Makefile | 3 +- jdk/make/launchers/Makefile.launcher | 6 +- jdk/src/linux/doc/man/apt.1 | 153 -------------------- jdk/src/linux/doc/man/ja/apt.1 | 153 -------------------- jdk/src/solaris/doc/sun/man/man1/apt.1 | 153 -------------------- jdk/src/solaris/doc/sun/man/man1/ja/apt.1 | 153 -------------------- 11 files changed, 5 insertions(+), 694 deletions(-) delete mode 100644 jdk/src/linux/doc/man/apt.1 delete mode 100644 jdk/src/linux/doc/man/ja/apt.1 delete mode 100644 jdk/src/solaris/doc/sun/man/man1/apt.1 delete mode 100644 jdk/src/solaris/doc/sun/man/man1/ja/apt.1 diff --git a/jdk/make/com/sun/Makefile b/jdk/make/com/sun/Makefile index 33d5824773c..7c436af52d1 100644 --- a/jdk/make/com/sun/Makefile +++ b/jdk/make/com/sun/Makefile @@ -47,7 +47,6 @@ SUBDIRS_enterprise = crypto/provider jndi \ org rowset net/httpserver SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo -# Omit mirror since it's built with the apt tool. SUBDIRS_tools = tools include $(BUILDDIR)/common/Subdirs.gmk diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index e5593b83b2f..cd042ff0191 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -132,7 +132,6 @@ endif JDK_MAN_PAGES = \ $(JRE_MAN_PAGES) \ appletviewer.1 \ - apt.1 \ extcheck.1 \ idlj.1 \ jar.1 \ @@ -264,7 +263,6 @@ SOURCES = \ com/sun/java/swing \ com/sun/javadoc \ com/sun/jmx \ - com/sun/mirror \ com/sun/source \ com/sun/naming \ com/sun/security/auth \ @@ -346,7 +344,6 @@ TOOLS = \ com/sun/javadoc \ com/sun/jdi \ com/sun/jarsigner \ - com/sun/mirror \ com/sun/source \ com/sun/tools/classfile \ com/sun/tools/doclets \ @@ -356,7 +353,6 @@ TOOLS = \ com/sun/tools/hat \ com/sun/tools/javac \ com/sun/tools/javadoc \ - com/sun/tools/apt \ com/sun/tools/javah \ com/sun/tools/javap \ com/sun/tools/corba \ @@ -439,7 +435,6 @@ NOTJRETOOLS = \ java-rmi.cgi \ javac$(EXE_SUFFIX) \ javadoc$(EXE_SUFFIX) \ - apt$(EXE_SUFFIX) \ javah$(EXE_SUFFIX) \ javap$(EXE_SUFFIX) \ jcmd$(EXE_SUFFIX) \ @@ -526,7 +521,6 @@ $(NOT_RT_JAR_LIST): FRC $(ECHO) "com/sun/javadoc/" >> $@ $(ECHO) "com/sun/jdi/" >> $@ $(ECHO) "com/sun/jarsigner/" >> $@ - $(ECHO) "com/sun/mirror/" >> $@ $(ECHO) "com/sun/source/" >> $@ $(ECHO) "com/sun/istack/internal/tools/" >> $@ $(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@ diff --git a/jdk/make/common/internal/Defs-langtools.gmk b/jdk/make/common/internal/Defs-langtools.gmk index d20180b1265..e5649583fa5 100644 --- a/jdk/make/common/internal/Defs-langtools.gmk +++ b/jdk/make/common/internal/Defs-langtools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -32,9 +32,7 @@ IMPORT_RT_PACKAGES += \ IMPORT_TOOLS_PACKAGES += \ com/sun/javadoc \ - com/sun/mirror \ com/sun/source \ - com/sun/tools/apt \ com/sun/tools/classfile \ com/sun/tools/doclets \ com/sun/tools/javac \ diff --git a/jdk/make/docs/Makefile b/jdk/make/docs/Makefile index 61756eab7e9..a4247e5bf72 100644 --- a/jdk/make/docs/Makefile +++ b/jdk/make/docs/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -356,64 +356,6 @@ $(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_P $(prep-target) $(call PackageFilter,$(CORE_PKGS)) -############################################################# -# -# mirrordocs -# - -# Part of langtools -ifdef LANGTOOLS_DIST - ALL_OTHER_TARGETS += mirrordocs -endif - -MIRROR_DOCDIR := $(JDK_API_DOCSDIR)/apt/mirror -MIRROR2COREAPI := ../../$(JDKJRE2COREAPI) -MIRROR_DOCTITLE := Mirror API -MIRROR_WINDOWTITLE := Mirror API -MIRROR_HEADER := Mirror API -MIRROR_BOTTOM := $(call CommonBottom,$(MIRROR_FIRST_COPYRIGHT_YEAR)) -MIRROR_GROUPNAME := Packages -MIRROR_OVERVIEW := $(IMPORTSRCDIR)/com/sun/mirror/overview.html -MIRROR_REGEXP := com.sun.mirror.* -# MIRROR_PKGS is located in NON_CORE_PKGS.gmk - -# The index.html, options, and packages files -MIRROR_INDEX_FILE = $(MIRROR_DOCDIR)/index.html -MIRROR_OPTIONS_FILE = $(DOCSTMPDIR)/mirror.options -MIRROR_PACKAGES_FILE = $(DOCSTMPDIR)/mirror.packages - -mirrordocs: $(MIRROR_INDEX_FILE) - -# Set relative location to core api document root -$(MIRROR_INDEX_FILE): GET2DOCSDIR=$(MIRROR2COREAPI)/.. - -# Run javadoc if the index file is out of date or missing -$(MIRROR_INDEX_FILE): $(MIRROR_OPTIONS_FILE) $(MIRROR_PACKAGES_FILE) - $(prep-javadoc) - $(call JavadocSummary,$(MIRROR_OPTIONS_FILE),$(MIRROR_PACKAGES_FILE)) - $(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \ - @$(MIRROR_OPTIONS_FILE) @$(MIRROR_PACKAGES_FILE) - -# Create file with javadoc options in it -$(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW) - $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionPair,-overview,$(MIRROR_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(MIRROR_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(MIRROR_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)) ; \ - $(call OptionTrip,-group,$(MIRROR_GROUPNAME),$(MIRROR_REGEXP)); \ - $(call OptionTrip,-linkoffline,$(MIRROR2COREAPI),$(COREAPI_DOCSDIR)); \ - ) >> $@ - -# Create a file with the package names in it -$(MIRROR_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MIRROR_PKGS)) - $(prep-target) - $(call PackageFilter,$(MIRROR_PKGS)) - ############################################################# # # docletapidocs diff --git a/jdk/make/docs/NON_CORE_PKGS.gmk b/jdk/make/docs/NON_CORE_PKGS.gmk index e8eda9dfd92..8f4e36dcbdb 100644 --- a/jdk/make/docs/NON_CORE_PKGS.gmk +++ b/jdk/make/docs/NON_CORE_PKGS.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -71,11 +71,6 @@ DOCLETAPI_PKGS = com.sun.javadoc TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java -MIRROR_PKGS = com.sun.mirror.apt \ - com.sun.mirror.declaration \ - com.sun.mirror.type \ - com.sun.mirror.util - ATTACH_PKGS = com.sun.tools.attach \ com.sun.tools.attach.spi diff --git a/jdk/make/launchers/Makefile b/jdk/make/launchers/Makefile index 5fe13cdf13e..9979d973b39 100644 --- a/jdk/make/launchers/Makefile +++ b/jdk/make/launchers/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,6 @@ endif define make-all-launchers $(make-appletviewer) -$(call make-launcher, apt, com.sun.tools.apt.Main, , ) $(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , ) $(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , ) $(call make-launcher, jar, sun.tools.jar.Main, , ) diff --git a/jdk/make/launchers/Makefile.launcher b/jdk/make/launchers/Makefile.launcher index 0908d613b82..6d98efc4994 100644 --- a/jdk/make/launchers/Makefile.launcher +++ b/jdk/make/launchers/Makefile.launcher @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -47,10 +47,6 @@ ifndef MAIN_CLASS endif # Some tools need the wildcard expansion option -ifeq ($(PROGRAM),apt) - WILDCARDS=true - NEVER_ACT_AS_SERVER_CLASS_MACHINE=true -endif ifeq ($(PROGRAM),javac) WILDCARDS=true MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools... diff --git a/jdk/src/linux/doc/man/apt.1 b/jdk/src/linux/doc/man/apt.1 deleted file mode 100644 index 2d77108a5d4..00000000000 --- a/jdk/src/linux/doc/man/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 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. -." -.TH apt 1 "10 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- annotation processing tool -.LP -.SH "SYNOPSIS" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "PARAMETERS" -.LP -.LP -Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below. -.LP -.RS 3 -.TP 3 -sourcefiles -Zero or more source files to be processed. -.TP 3 -@files -One or more files that list source files or other options -.RE - -.LP -.SH "DESCRIPTION" -.LP -.LP -\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.LP -The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP. -.LP -.LP -A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in -.na -\f4Getting Started with \fP\f4apt\fP. @ -.fi -http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html -.LP -.SH "OPTIONS" -.LP -.SS -apt specific options -.LP -.RS 3 -.TP 3 -\-s dir -Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace. -.TP 3 -\-nocompile -Do not compile source files to class files. -.TP 3 -\-print -Print out textual representation of specified types; perform no annotation processing or compilation. -.TP 3 -\-A[key[=val]] -Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors -.TP 3 -\-factorypath path -Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories. -.TP 3 -\-factory classname -Name of annotation processor factory to use; bypasses default discovery process -.TP 3 -\-version -Print version information. -.TP 3 -\-X -Display information about non\-standard options. -.RE - -.LP -.SS -Options shared with javac -.LP -.RS 3 -.TP 3 -\-d dir -Specify where to place processor and javac generated class files -.TP 3 -\-cp path or \-classpath path -Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories. -.RE - -.LP -.LP -Consult the javac(1) man page for information on \f2javac\fP options. -.LP -.SS -Non\-Standard Options -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -List found annotation types. -.TP 3 -\-XListDeclarations -List specified and included declarations. -.TP 3 -\-XPrintAptRounds -Print information about initial and recursive \f2apt\fP rounds. -.TP 3 -\-XPrintFactoryInfo -Print information about which annotations a factory is asked to process. -.TP 3 -\-XclassesAsDecls -Treat both class and source files as declarations to process. -.RE - -.LP -.LP -\f3Note\fP: Because these options are non\-standard, they are subject to change without notice. -.LP -.SH "NOTES" -.LP -.LP -The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.SH "SEE ALSO" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - diff --git a/jdk/src/linux/doc/man/ja/apt.1 b/jdk/src/linux/doc/man/ja/apt.1 deleted file mode 100644 index bd788983f81..00000000000 --- a/jdk/src/linux/doc/man/ja/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 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. -." -.TH apt 1 "07 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- Ãí¼á½èÍý¥Ä¡¼¥ë -.LP -.SH "·Á¼°" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "¥Ñ¥é¥á¡¼¥¿" -.LP -.LP -¥ª¥×¥·¥ç¥ó¤Î»ØÄê½ç½ø¤Ë·è¤Þ¤ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ËŬÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤Î¡Ö¥ª¥×¥·¥ç¥ó¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.RS 3 -.TP 3 -sourcefiles -¥¼¥í¡¢1 ¤Ä¡¢¤Þ¤¿¤ÏÊ£¿ô¤Î½èÍýÂоݤΥ½¡¼¥¹¥Õ¥¡¥¤¥ë -.TP 3 -@files -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¾¤Î¥ª¥×¥·¥ç¥ó¤ò°ìÍ÷ɽ¼¨¤¹¤ë 1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Õ¥¡¥¤¥ë -.RE - -.LP -.SH "ÀâÌÀ" -.LP -.LP -\f3Ãí\fP: \f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.LP -Ãí¼á½èÍý¥Ä¡¼¥ë \f2apt\fP ¤Ï¡¢¥ê¥Õ¥ì¥¯¥È API ¤È¥µ¥Ý¡¼¥È¥¤¥ó¥Õ¥é¥¹¥È¥é¥¯¥Á¥ã¡¼¤«¤é¹½À®¤µ¤ì¡¢¥×¥í¥°¥é¥àÃí¼á¤ò½èÍý¤·¤Þ¤¹¡£\f2apt\fP ¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢ ¹½ÃÛ»þ¤Î¥½¡¼¥¹¥Ù¡¼¥¹¤Ç¡¢¥×¥í¥°¥é¥à¹½Â¤¤Ë´Ø¤¹¤ëÆÉ¤ß¼è¤êÀìÍѥӥ塼¤òÄ󶡤·¤Þ¤¹¡£¤³¤ì¤é¤Î¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢Áí¾Î¤òÄɲä·¤¿¸å¤Ë¡¢Java(TM) ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Î·¿¥·¥¹¥Æ¥à¤òÀµ¤·¤¯¥â¥Ç¥ë²½¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ºÇ½é¤Ë¡¢\f2apt\fP ¤Ï¡¢¿·¤·¤¤¥½¡¼¥¹¥³¡¼¥É¤È¾¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¼¡¤Ë¡¢\f2apt\fP ¤Ï¡¢¸µ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÈÀ¸À®¤·¤¿¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¡¢³«È¯¤¬³Ú¤Ë¤Ê¤ê¤Þ¤¹¡£¥Ä¡¼¥ë¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë»ÈÍѤµ¤ì¤ë¥ê¥Õ¥ì¥¯¥È API ¤Ê¤É¤Î API ¤Ï¡¢\f2com.sun.mirror\fP ¤Î¥µ¥Ö¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¹¡£ -.LP -.LP -¥Ä¡¼¥ë¤Îµ¡Ç½¤Ë´Ø¤¹¤ë¾ÜºÙ¤È¡¢\f2apt\fP ¤ò»ÈÍѤ·¤¿³«È¯ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢ -.na -\f4¡Öapt ÆþÌç¡×\fP @ -.fi -http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.html¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "¥ª¥×¥·¥ç¥ó" -.LP -.SS -apt ¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-s dir -¥×¥í¥»¥Ã¥µ¤ÎÀ¸À®¤¹¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¥ë¡¼¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ñ¥Ã¥±¡¼¥¸¤Î̾Á°¶õ´Ö¤Ë´ð¤Å¤¤¤Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤Þ¤¹¡£ -.TP 3 -\-nocompile -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤»¤ó¡£ -.TP 3 -\-print -»ØÄꤷ¤¿¥¿¥¤¥×¤Î¥Æ¥­¥¹¥Èɽ¸½¤ò½ÐÎϤ·¤Þ¤¹¡£ Ãí¼á½èÍý¤Þ¤¿¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ï¹Ô¤¤¤Þ¤»¤ó¡£ -.TP 3 -\-A[key[=val]] -Ãí¼á¥×¥í¥»¥Ã¥µ¤ØÅϤ¹¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢\f2apt\fP ¤¬Ä¾Àܲò¼á¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥Ã¥µ¤Ë¤è¤Ã¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤ËÊѤ¨¤é¤ì¤Þ¤¹¡£ -.TP 3 -\-factorypath path -Ãí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.TP 3 -\-factory classname -»ÈÍѤ¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤Î̾Á°¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î¸¡½Ð¥×¥í¥»¥¹¤ò¾Êά¤·¤Þ¤¹¡£ -.TP 3 -\-version -¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£ -.TP 3 -\-X -Èóɸ½à¥ª¥×¥·¥ç¥ó¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ -.RE - -.LP -.SS -javac ¤È¶¦ÍѤ¹¤ë¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-d dir -¥×¥í¥»¥Ã¥µ¤È javac À¸À®¤Î¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ -.TP 3 -\-cp path ¤Þ¤¿¤Ï \-classpath path -¥æ¡¼¥¶¡¼¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÈÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£\f2\-factorypath\fP ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.RE - -.LP -.LP -\f2javac\fP ¥ª¥×¥·¥ç¥ó¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢javac(1) ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SS -Èóɸ½à¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -Ãí¼á¤Î·¿¤Ë¸¡½Ð¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XListDeclarations -»ØÄꤪ¤è¤ÓÀë¸À¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XPrintAptRounds -½é´ü¤ª¤è¤ÓºÆµ¢Åª¤Ê \f2apt\fP ¥é¥¦¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XPrintFactoryInfo -½èÍý¤òÍ׵᤹¤ë¥Õ¥¡¥¯¥È¥ê¤ÎÃí¼á¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XclassesAsDecls -¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤È¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¡¢½èÍýÂоݤÎÀë¸À¤È¤·¤Æ½èÍý¤·¤Þ¤¹¡£ -.RE - -.LP -.LP -\f3Ãí\fP: ¤³¤ì¤é¤ÏÈóɸ½à¥ª¥×¥·¥ç¥ó¤Ê¤Î¤Ç¡¢Í½¹ð¤Ê¤¯Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ -.LP -.SH "Ãí" -.LP -.LP -\f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "´ØÏ¢¹àÌÜ" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - diff --git a/jdk/src/solaris/doc/sun/man/man1/apt.1 b/jdk/src/solaris/doc/sun/man/man1/apt.1 deleted file mode 100644 index 2d77108a5d4..00000000000 --- a/jdk/src/solaris/doc/sun/man/man1/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 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. -." -.TH apt 1 "10 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- annotation processing tool -.LP -.SH "SYNOPSIS" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "PARAMETERS" -.LP -.LP -Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below. -.LP -.RS 3 -.TP 3 -sourcefiles -Zero or more source files to be processed. -.TP 3 -@files -One or more files that list source files or other options -.RE - -.LP -.SH "DESCRIPTION" -.LP -.LP -\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.LP -The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP. -.LP -.LP -A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in -.na -\f4Getting Started with \fP\f4apt\fP. @ -.fi -http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html -.LP -.SH "OPTIONS" -.LP -.SS -apt specific options -.LP -.RS 3 -.TP 3 -\-s dir -Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace. -.TP 3 -\-nocompile -Do not compile source files to class files. -.TP 3 -\-print -Print out textual representation of specified types; perform no annotation processing or compilation. -.TP 3 -\-A[key[=val]] -Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors -.TP 3 -\-factorypath path -Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories. -.TP 3 -\-factory classname -Name of annotation processor factory to use; bypasses default discovery process -.TP 3 -\-version -Print version information. -.TP 3 -\-X -Display information about non\-standard options. -.RE - -.LP -.SS -Options shared with javac -.LP -.RS 3 -.TP 3 -\-d dir -Specify where to place processor and javac generated class files -.TP 3 -\-cp path or \-classpath path -Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories. -.RE - -.LP -.LP -Consult the javac(1) man page for information on \f2javac\fP options. -.LP -.SS -Non\-Standard Options -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -List found annotation types. -.TP 3 -\-XListDeclarations -List specified and included declarations. -.TP 3 -\-XPrintAptRounds -Print information about initial and recursive \f2apt\fP rounds. -.TP 3 -\-XPrintFactoryInfo -Print information about which annotations a factory is asked to process. -.TP 3 -\-XclassesAsDecls -Treat both class and source files as declarations to process. -.RE - -.LP -.LP -\f3Note\fP: Because these options are non\-standard, they are subject to change without notice. -.LP -.SH "NOTES" -.LP -.LP -The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations. -.LP -.SH "SEE ALSO" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/apt.1 b/jdk/src/solaris/doc/sun/man/man1/ja/apt.1 deleted file mode 100644 index bd788983f81..00000000000 --- a/jdk/src/solaris/doc/sun/man/man1/ja/apt.1 +++ /dev/null @@ -1,153 +0,0 @@ -." Copyright (c) 2004, 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. -." -.TH apt 1 "07 May 2011" - -.LP -.SH "NAME" -.LP -.LP -\f2apt\fP \- Ãí¼á½èÍý¥Ä¡¼¥ë -.LP -.SH "·Á¼°" -.LP -.LP -\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files] -.LP -.SH "¥Ñ¥é¥á¡¼¥¿" -.LP -.LP -¥ª¥×¥·¥ç¥ó¤Î»ØÄê½ç½ø¤Ë·è¤Þ¤ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ËŬÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¼µ­¤Î¡Ö¥ª¥×¥·¥ç¥ó¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.RS 3 -.TP 3 -sourcefiles -¥¼¥í¡¢1 ¤Ä¡¢¤Þ¤¿¤ÏÊ£¿ô¤Î½èÍýÂоݤΥ½¡¼¥¹¥Õ¥¡¥¤¥ë -.TP 3 -@files -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¾¤Î¥ª¥×¥·¥ç¥ó¤ò°ìÍ÷ɽ¼¨¤¹¤ë 1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Õ¥¡¥¤¥ë -.RE - -.LP -.SH "ÀâÌÀ" -.LP -.LP -\f3Ãí\fP: \f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.LP -Ãí¼á½èÍý¥Ä¡¼¥ë \f2apt\fP ¤Ï¡¢¥ê¥Õ¥ì¥¯¥È API ¤È¥µ¥Ý¡¼¥È¥¤¥ó¥Õ¥é¥¹¥È¥é¥¯¥Á¥ã¡¼¤«¤é¹½À®¤µ¤ì¡¢¥×¥í¥°¥é¥àÃí¼á¤ò½èÍý¤·¤Þ¤¹¡£\f2apt\fP ¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢ ¹½ÃÛ»þ¤Î¥½¡¼¥¹¥Ù¡¼¥¹¤Ç¡¢¥×¥í¥°¥é¥à¹½Â¤¤Ë´Ø¤¹¤ëÆÉ¤ß¼è¤êÀìÍѥӥ塼¤òÄ󶡤·¤Þ¤¹¡£¤³¤ì¤é¤Î¥ê¥Õ¥ì¥¯¥È API ¤Ï¡¢Áí¾Î¤òÄɲä·¤¿¸å¤Ë¡¢Java(TM) ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Î·¿¥·¥¹¥Æ¥à¤òÀµ¤·¤¯¥â¥Ç¥ë²½¤¹¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ºÇ½é¤Ë¡¢\f2apt\fP ¤Ï¡¢¿·¤·¤¤¥½¡¼¥¹¥³¡¼¥É¤È¾¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¼¡¤Ë¡¢\f2apt\fP ¤Ï¡¢¸µ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÈÀ¸À®¤·¤¿¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¡¢³«È¯¤¬³Ú¤Ë¤Ê¤ê¤Þ¤¹¡£¥Ä¡¼¥ë¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë»ÈÍѤµ¤ì¤ë¥ê¥Õ¥ì¥¯¥È API ¤Ê¤É¤Î API ¤Ï¡¢\f2com.sun.mirror\fP ¤Î¥µ¥Ö¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¹¡£ -.LP -.LP -¥Ä¡¼¥ë¤Îµ¡Ç½¤Ë´Ø¤¹¤ë¾ÜºÙ¤È¡¢\f2apt\fP ¤ò»ÈÍѤ·¤¿³«È¯ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢ -.na -\f4¡Öapt ÆþÌç¡×\fP @ -.fi -http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.html¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "¥ª¥×¥·¥ç¥ó" -.LP -.SS -apt ¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-s dir -¥×¥í¥»¥Ã¥µ¤ÎÀ¸À®¤¹¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¥ë¡¼¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ñ¥Ã¥±¡¼¥¸¤Î̾Á°¶õ´Ö¤Ë´ð¤Å¤¤¤Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤Þ¤¹¡£ -.TP 3 -\-nocompile -¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤Ë¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤»¤ó¡£ -.TP 3 -\-print -»ØÄꤷ¤¿¥¿¥¤¥×¤Î¥Æ¥­¥¹¥Èɽ¸½¤ò½ÐÎϤ·¤Þ¤¹¡£ Ãí¼á½èÍý¤Þ¤¿¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ï¹Ô¤¤¤Þ¤»¤ó¡£ -.TP 3 -\-A[key[=val]] -Ãí¼á¥×¥í¥»¥Ã¥µ¤ØÅϤ¹¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢\f2apt\fP ¤¬Ä¾Àܲò¼á¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥Ã¥µ¤Ë¤è¤Ã¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤ËÊѤ¨¤é¤ì¤Þ¤¹¡£ -.TP 3 -\-factorypath path -Ãí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.TP 3 -\-factory classname -»ÈÍѤ¹¤ëÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤Î̾Á°¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î¸¡½Ð¥×¥í¥»¥¹¤ò¾Êά¤·¤Þ¤¹¡£ -.TP 3 -\-version -¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£ -.TP 3 -\-X -Èóɸ½à¥ª¥×¥·¥ç¥ó¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ -.RE - -.LP -.SS -javac ¤È¶¦ÍѤ¹¤ë¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-d dir -¥×¥í¥»¥Ã¥µ¤È javac À¸À®¤Î¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£ -.TP 3 -\-cp path ¤Þ¤¿¤Ï \-classpath path -¥æ¡¼¥¶¡¼¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤ÈÃí¼á¥×¥í¥»¥Ã¥µ¥Õ¥¡¥¯¥È¥ê¤ò¸¡º÷¤¹¤ë¾ì½ê¤ò»ØÄꤷ¤Þ¤¹¡£\f2\-factorypath\fP ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¹¥Ñ¥¹¤Î¥Õ¥¡¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡£ -.RE - -.LP -.LP -\f2javac\fP ¥ª¥×¥·¥ç¥ó¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢javac(1) ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SS -Èóɸ½à¥ª¥×¥·¥ç¥ó -.LP -.RS 3 -.TP 3 -\-XListAnnotationTypes -Ãí¼á¤Î·¿¤Ë¸¡½Ð¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XListDeclarations -»ØÄꤪ¤è¤ÓÀë¸À¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ë¥ê¥¹¥È. -.TP 3 -\-XPrintAptRounds -½é´ü¤ª¤è¤ÓºÆµ¢Åª¤Ê \f2apt\fP ¥é¥¦¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XPrintFactoryInfo -½èÍý¤òÍ׵᤹¤ë¥Õ¥¡¥¯¥È¥ê¤ÎÃí¼á¤Ë´Ø¤¹¤ë¾ðÊó¤ò½ÐÎϤ¹¤ë. -.TP 3 -\-XclassesAsDecls -¥¯¥é¥¹¥Õ¥¡¥¤¥ë¤È¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎξÊý¤ò¡¢½èÍýÂоݤÎÀë¸À¤È¤·¤Æ½èÍý¤·¤Þ¤¹¡£ -.RE - -.LP -.LP -\f3Ãí\fP: ¤³¤ì¤é¤ÏÈóɸ½à¥ª¥×¥·¥ç¥ó¤Ê¤Î¤Ç¡¢Í½¹ð¤Ê¤¯Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ -.LP -.SH "Ãí" -.LP -.LP -\f2apt\fP ¥Ä¡¼¥ë¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2com.sun.mirror\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤½¤ì¤Ë´ØÏ¢¤·¤¿ API ¤Ï¡¢JDK 7 °Ê¹ßÈó¿ä¾©¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢JDK ¤Î¼¡¤Î¥á¥¸¥ã¡¼¥ê¥ê¡¼¥¹¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£\f2javac(1)\fP ¥Ä¡¼¥ë¤ÇÍøÍѲÄǽ¤Ê¥ª¥×¥·¥ç¥ó¤È¡¢¥Ñ¥Ã¥±¡¼¥¸ \f2javax.annotation.processing\fP ¤ª¤è¤Ó \f2javax.lang.model\fP ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë API ¤ò»ÈÍѤ·¤Æ¡¢Ãí¼á¤ò½èÍý¤·¤Æ¤¯¤À¤µ¤¤¡£ -.LP -.SH "´ØÏ¢¹àÌÜ" -.LP -.RS 3 -.TP 2 -o -javac(1), java(1) -.RE - -.LP - From b37db2a9db7eeff4005236da8dd735604da3a62b Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 7 Feb 2012 13:28:32 +0000 Subject: [PATCH 07/26] 7142847: TEST_BUG: java/nio/file/WatchService/SensitivityModifier.java has incorrect @run tag, runs Basic Reviewed-by: chegar --- jdk/test/java/nio/file/WatchService/Basic.java | 10 +++++----- .../nio/file/WatchService/SensitivityModifier.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jdk/test/java/nio/file/WatchService/Basic.java b/jdk/test/java/nio/file/WatchService/Basic.java index fd1dee4b007..019ec96c30f 100644 --- a/jdk/test/java/nio/file/WatchService/Basic.java +++ b/jdk/test/java/nio/file/WatchService/Basic.java @@ -25,7 +25,7 @@ * @bug 4313887 6838333 7017446 * @summary Unit test for java.nio.file.WatchService * @library .. - * @run main/timeout=120 Basic + * @run main Basic */ import java.nio.file.*; @@ -281,11 +281,11 @@ public class Basic { System.out.println("poll with timeout..."); try { - long start = System.currentTimeMillis(); + long start = System.nanoTime(); key = watcher.poll(3000, TimeUnit.MILLISECONDS); if (key != null) throw new RuntimeException("no keys registered"); - long waited = System.currentTimeMillis() - start; + long waited = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); if (waited < 2900) throw new RuntimeException("poll was too short"); } catch (InterruptedException x) { @@ -358,14 +358,14 @@ public class Basic { } // assume that poll throws exception immediately - long start = System.currentTimeMillis(); + long start = System.nanoTime(); try { watcher.poll(10000, TimeUnit.MILLISECONDS); throw new RuntimeException("ClosedWatchServiceException not thrown"); } catch (InterruptedException x) { throw new RuntimeException(x); } catch (ClosedWatchServiceException x) { - long waited = System.currentTimeMillis() - start; + long waited = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); if (waited > 5000) throw new RuntimeException("poll was too long"); } diff --git a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java index 3027d8d4e09..b0cafb330c2 100644 --- a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java +++ b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java @@ -23,9 +23,9 @@ /* @test * @bug 4313887 - * @summary Sanity test for Sun-specific sensitivyt level watch event modifier + * @summary Sanity test for Sun-specific sensitivity level watch event modifier * @library .. - * @run main/timeout=330 Basic + * @run main/timeout=240 SensitivityModifier */ import java.nio.file.*; From d8c00fda7b4ac591cb44e1c3ded89153e8e87685 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 7 Feb 2012 17:39:13 -0800 Subject: [PATCH 08/26] 7143629: JDK jar/zip code should use unsigned library support Reviewed-by: sherman --- jdk/src/share/classes/java/util/jar/JarOutputStream.java | 4 ++-- jdk/src/share/classes/java/util/jar/Manifest.java | 4 ++-- jdk/src/share/classes/java/util/zip/InflaterInputStream.java | 4 ++-- jdk/src/share/classes/java/util/zip/ZipInputStream.java | 4 ++-- .../demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/jdk/src/share/classes/java/util/jar/JarOutputStream.java b/jdk/src/share/classes/java/util/jar/JarOutputStream.java index 843b16aa8d7..36942772619 100644 --- a/jdk/src/share/classes/java/util/jar/JarOutputStream.java +++ b/jdk/src/share/classes/java/util/jar/JarOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,7 +135,7 @@ class JarOutputStream extends ZipOutputStream { * The bytes are assumed to be in Intel (little-endian) byte order. */ private static int get16(byte[] b, int off) { - return (b[off] & 0xff) | ((b[off+1] & 0xff) << 8); + return Byte.toUnsignedInt(b[off]) | ( Byte.toUnsignedInt(b[off+1]) << 8); } /* diff --git a/jdk/src/share/classes/java/util/jar/Manifest.java b/jdk/src/share/classes/java/util/jar/Manifest.java index 3bb56715282..49612938ab8 100644 --- a/jdk/src/share/classes/java/util/jar/Manifest.java +++ b/jdk/src/share/classes/java/util/jar/Manifest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -339,7 +339,7 @@ public class Manifest implements Cloneable { return -1; } } - return buf[pos++] & 0xff; + return Byte.toUnsignedInt(buf[pos++]); } public int read(byte[] b, int off, int len) throws IOException { diff --git a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java index 53e16ee22e3..b948905d0e8 100644 --- a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java +++ b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,7 +119,7 @@ class InflaterInputStream extends FilterInputStream { */ public int read() throws IOException { ensureOpen(); - return read(singleByteBuf, 0, 1) == -1 ? -1 : singleByteBuf[0] & 0xff; + return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]); } /** diff --git a/jdk/src/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/share/classes/java/util/zip/ZipInputStream.java index a60adb8040e..7076f9be5d8 100644 --- a/jdk/src/share/classes/java/util/zip/ZipInputStream.java +++ b/jdk/src/share/classes/java/util/zip/ZipInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -435,7 +435,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants { * The bytes are assumed to be in Intel (little-endian) byte order. */ private static final int get16(byte b[], int off) { - return (b[off] & 0xff) | ((b[off+1] & 0xff) << 8); + return Byte.toUnsignedInt(b[off]) | (Byte.toUnsignedInt(b[off+1]) << 8); } /* diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java index dd15bf87e68..0fab957b37a 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java @@ -185,11 +185,11 @@ class ZipConstants { */ /////////////////////////////////////////////////////// static final int CH(byte[] b, int n) { - return b[n] & 0xff; + return Byte.toUnsignedInt(b[n]); } static final int SH(byte[] b, int n) { - return (b[n] & 0xff) | ((b[n + 1] & 0xff) << 8); + return Byte.toUnsignedInt(b[n]) | (Byte.toUnsignedInt(b[n + 1]) << 8); } static final long LG(byte[] b, int n) { From 18a83d872ba9b7982606e9518bcc193a9e261d39 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 8 Feb 2012 11:44:36 +0800 Subject: [PATCH 09/26] 6880619: reg tests for 6879540 Reviewed-by: valeriep --- .../sun/security/krb5/auto/EmptyPassword.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 jdk/test/sun/security/krb5/auto/EmptyPassword.java diff --git a/jdk/test/sun/security/krb5/auto/EmptyPassword.java b/jdk/test/sun/security/krb5/auto/EmptyPassword.java new file mode 100644 index 00000000000..d66b202ec37 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/EmptyPassword.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6879540 + * @summary enable empty password for kerberos 5 + * @compile -XDignore.symbol.file EmptyPassword.java + * @run main/othervm EmptyPassword + */ + +public class EmptyPassword { + + public static void main(String[] args) + throws Exception { + + OneKDC kdc = new OneKDC("aes128-cts"); + kdc.addPrincipal("empty", "".toCharArray()); + + Context c = Context.fromUserPass("empty", "".toCharArray(), false); + c.status(); + } +} + From 5070eb57b624f0cf0f815c8c5037cfbef6350190 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Wed, 8 Feb 2012 11:16:52 +0000 Subject: [PATCH 10/26] 7105929: java/util/concurrent/FutureTask/BlockingTaskExecutor.java fails on solaris sparc Reviewed-by: dholmes --- .../java/util/concurrent/FutureTask/BlockingTaskExecutor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java b/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java index 00aed7c47f0..05b37082989 100644 --- a/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java +++ b/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java @@ -75,10 +75,10 @@ public class BlockingTaskExecutor { throw new Error("Executor stuck"); // Wait for the invocation thread to complete. - thread.join(1000); + thread.join(5000); if (thread.isAlive()) { thread.interrupt(); - thread.join(1000); + thread.join(5000); throw new Error("invokeAll stuck"); } } From ba9ddb94fa922678bce6ebc328b51c82793b2e26 Mon Sep 17 00:00:00 2001 From: Gary Adams Date: Wed, 8 Feb 2012 11:18:29 +0000 Subject: [PATCH 11/26] 6736316: Timeout value in java/util/concurrent/locks/Lock/FlakyMutex.java is insufficient Reviewed-by: chegar, dholmes, alanb --- jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java index 8422c33fa5c..7722e84e686 100644 --- a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java +++ b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java @@ -86,7 +86,7 @@ public class FlakyMutex implements Lock { } catch (Throwable t) { unexpected(t); }}});} barrier.await(); es.shutdown(); - check(es.awaitTermination(10, TimeUnit.SECONDS)); + check(es.awaitTermination(30, TimeUnit.SECONDS)); } private static class FlakySync extends AbstractQueuedLongSynchronizer { From d53f00fb69145125eb05ebfd2af2f65ff1943777 Mon Sep 17 00:00:00 2001 From: Gary Adams Date: Wed, 8 Feb 2012 11:19:25 +0000 Subject: [PATCH 12/26] 6957683: test/java/util/concurrent/ThreadPoolExecutor/Custom.java failing Reviewed-by: chegar, dholmes, alanb --- .../java/util/concurrent/ThreadPoolExecutor/Custom.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java index ac666b68951..b05b3e826b7 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java @@ -100,8 +100,8 @@ public class Custom { equal(countExecutorThreads(), threadCount); equal(CustomTask.births.get(), threadCount); tpe.shutdown(); - tpe.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); - Thread.sleep(10); + tpe.awaitTermination(120, TimeUnit.SECONDS); + Thread.sleep(1000); equal(countExecutorThreads(), 0); CustomSTPE stpe = new CustomSTPE(); @@ -110,8 +110,8 @@ public class Custom { equal(CustomSTPE.decorations.get(), threadCount); equal(countExecutorThreads(), threadCount); stpe.shutdown(); - stpe.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); - Thread.sleep(10); + stpe.awaitTermination(120, TimeUnit.SECONDS); + Thread.sleep(1000); equal(countExecutorThreads(), 0); System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); From d228d3127c19cafad375501672f82d0940ecac92 Mon Sep 17 00:00:00 2001 From: Carlos Lucasius Date: Thu, 9 Feb 2012 13:43:15 +0000 Subject: [PATCH 13/26] 7114611: (fs) DirectoryStream fails with SIGBUS on some embedded platforms, dirent alignment Reviewed-by: dholmes, alanb --- jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c index 57882b6a473..596dd990e1e 100644 --- a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -605,9 +605,12 @@ Java_sun_nio_fs_UnixNativeDispatcher_closedir(JNIEnv* env, jclass this, jlong di JNIEXPORT jbyteArray JNICALL Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong value) { - char entry[sizeof(struct dirent64) + PATH_MAX + 1]; - struct dirent64* ptr = (struct dirent64*)&entry; struct dirent64* result; + struct { + struct dirent64 buf; + char name_extra[PATH_MAX + 1 - sizeof result->d_name]; + } entry; + struct dirent64* ptr = &entry.buf; int res; DIR* dirp = jlong_to_ptr(value); From 9ace5d5b19858a3d4f707d0ff6434e15df2e8df2 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Thu, 9 Feb 2012 16:38:36 +0000 Subject: [PATCH 14/26] 7144086: TEST_BUG: java/nio/file/WatchService/SensitivityModifier.java failing intermittently Reviewed-by: chegar --- jdk/test/java/nio/file/WatchService/SensitivityModifier.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java index b0cafb330c2..f990870acae 100644 --- a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java +++ b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java @@ -96,6 +96,7 @@ public class SensitivityModifier { // drain events (to avoid interference) do { + key.pollEvents(); key.reset(); key = watcher.poll(1, TimeUnit.SECONDS); } while (key != null); From 9b65dbabc1e9632f223f46c990d18b924d43953a Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 10 Feb 2012 11:41:22 +0800 Subject: [PATCH 15/26] 6879539: enable empty password support for pkcs12 keystore Reviewed-by: vinnie, weijun --- .../com/sun/crypto/provider/PBEKey.java | 9 +- .../crypto/provider/PKCS12PBECipherCore.java | 12 +- .../sun/security/pkcs12/PKCS12KeyStore.java | 52 ++- jdk/test/sun/security/pkcs12/Bug6415637.java | 313 ++++++++++++++++++ 4 files changed, 366 insertions(+), 20 deletions(-) create mode 100644 jdk/test/sun/security/pkcs12/Bug6415637.java diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java index a650133fe4a..22a315e8378 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java @@ -55,9 +55,12 @@ final class PBEKey implements SecretKey { // Should allow an empty password. passwd = new char[0]; } - for (int i=0; i '\u007E')) { - throw new InvalidKeySpecException("Password is not ASCII"); + // Accept "\0" to signify "zero-length password with no terminator". + if (!(passwd.length == 1 && passwd[0] == 0)) { + for (int i=0; i '\u007E')) { + throw new InvalidKeySpecException("Password is not ASCII"); + } } } this.key = new byte[passwd.length]; diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java index e091e90e2c1..7c15de2c954 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java @@ -60,11 +60,16 @@ final class PKCS12PBECipherCore { static byte[] derive(char[] chars, byte[] salt, int ic, int n, int type) { - // Add in trailing NULL terminator. + // Add in trailing NULL terminator. Special case: + // no terminator if password is "\0". int length = chars.length*2; - if (length != 0) { + if (length == 2 && chars[0] == 0) { + chars = new char[0]; + length = 0; + } else { length += 2; } + byte[] passwd = new byte[length]; for (int i = 0, j = 0; i < chars.length; i++, j+=2) { passwd[j] = (byte) ((chars[i] >>> 8) & 0xFF); @@ -133,6 +138,9 @@ final class PKCS12PBECipherCore { } private static void concat(byte[] src, byte[] dst, int start, int len) { + if (src.length == 0) { + return; + } int loop = len / src.length; int off, i; for (i = 0, off = 0; i < loop; i++, off += src.length) diff --git a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index f6bada9390f..e4ba4252590 100644 --- a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -253,11 +253,25 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } try { - // Use JCE - SecretKey skey = getPBEKey(password); - Cipher cipher = Cipher.getInstance(algOid.toString()); - cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - byte[] privateKeyInfo = cipher.doFinal(encryptedKey); + byte[] privateKeyInfo; + while (true) { + try { + // Use JCE + SecretKey skey = getPBEKey(password); + Cipher cipher = Cipher.getInstance(algOid.toString()); + cipher.init(Cipher.DECRYPT_MODE, skey, algParams); + privateKeyInfo = cipher.doFinal(encryptedKey); + break; + } catch (Exception e) { + if (password.length == 0) { + // Retry using an empty password + // without a NULL terminator. + password = new char[1]; + continue; + } + throw e; + } + } PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(privateKeyInfo); @@ -1251,16 +1265,24 @@ public final class PKCS12KeyStore extends KeyStoreSpi { ObjectIdentifier algOid = in.getOID(); AlgorithmParameters algParams = parseAlgParameters(in); - try { - // Use JCE - SecretKey skey = getPBEKey(password); - Cipher cipher = Cipher.getInstance(algOid.toString()); - cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - safeContentsData = cipher.doFinal(safeContentsData); - - } catch (Exception e) { - throw new IOException("failed to decrypt safe" - + " contents entry: " + e, e); + while (true) { + try { + // Use JCE + SecretKey skey = getPBEKey(password); + Cipher cipher = Cipher.getInstance(algOid.toString()); + cipher.init(Cipher.DECRYPT_MODE, skey, algParams); + safeContentsData = cipher.doFinal(safeContentsData); + break; + } catch (Exception e) { + if (password.length == 0) { + // Retry using an empty password + // without a NULL terminator. + password = new char[1]; + continue; + } + throw new IOException( + "failed to decrypt safe contents entry: " + e, e); + } } } else { throw new IOException("public key protected PKCS12" + diff --git a/jdk/test/sun/security/pkcs12/Bug6415637.java b/jdk/test/sun/security/pkcs12/Bug6415637.java new file mode 100644 index 00000000000..3e4603804e5 --- /dev/null +++ b/jdk/test/sun/security/pkcs12/Bug6415637.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6415637 + * @summary Support PKCS#12 key stores protected with an empty password + */ + +import java.io.ByteArrayInputStream; +import java.math.BigInteger; +import java.security.KeyStore; +import java.security.cert.X509Certificate; +import java.security.interfaces.RSAPrivateCrtKey; + +public class Bug6415637 { + + public static void main(String[] args) throws Exception { + check(WITH_NULL); + check(WITHOUT_NULL); + } + + private static void check(String encodedBlob) throws Exception { + byte[] blob = new byte[encodedBlob.length() * 2]; + for (int i = 0; i < blob.length; ) { + final char ch = encodedBlob.charAt(i / 2); + blob[i++] = (byte) (ch >> 8); + blob[i++] = (byte) ch; + } + KeyStore store = KeyStore.getInstance("PKCS12"); + store.load(new ByteArrayInputStream(blob), new char[0]); + if (!store.aliases().nextElement().equals("test")) + throw new Exception("test alias not found"); + KeyStore.PrivateKeyEntry e = + (KeyStore.PrivateKeyEntry) store.getEntry("test", + new KeyStore.PasswordProtection(new char[0])); + X509Certificate cert = (X509Certificate) e.getCertificateChain()[0]; + if (!cert.getSubjectDN().toString().equals("CN=Test Key")) + throw new Exception("invalid certificate subject DN"); + RSAPrivateCrtKey key = (RSAPrivateCrtKey) e.getPrivateKey(); + if (!key.getPublicExponent().equals(BigInteger.valueOf(65537))) + throw new Exception("invalid public exponent"); + } + + private static final String WITH_NULL = + "\u3082\u097c\u0201\u0330\u8209\u3606\u092a\u8648\u86f7\u0d01" + + "\u0701\ua082\u0927\u0482\u0923\u3082\u091f\u3082\u0564\u0609" + + "\u2a86\u4886\uf70d\u0107\u01a0\u8205\u5504\u8205\u5130\u8205" + + "\u4d30\u8205\u4906\u0b2a\u8648\u86f7\u0d01\u0c0a\u0102\ua082" + + "\u04fa\u3082\u04f6\u3028\u060a\u2a86\u4886\uf70d\u010c\u0103" + + "\u301a\u0414\u8317\ucfd6\u89ab\uc03b\u79d6\u4c45\u1b10\uc3bd" + + "\u3923\ub806\u0202\u0400\u0482\u04c8\ud51d\uf953\ud79e\u92c6" + + "\u83c0\u92dc\ucd05\u69ab\ucc1b\ud538\u2ed9\u7796\ua426\uc14e" + + "\udcbf\ue541\u40be\ud264\u3b5b\uf51f\u8e1a\u892f\u2813\ucdd6" + + "\uf72e\uef55\u35ef\u4620\ude18\ued5e\ufae0\ubed4\uf84e\u276b" + + "\u3596\uc33f\ub251\ue617\u6e00\ua80f\u6c82\u4acd\u7303\u26be" + + "\uffb5\u1e49\u5fb1\uf87c\ua873\ue60a\u7415\u655c\u39f1\ucf16" + + "\u8f5c\u85c6\u4100\u4130\u565b\u649a\u60d6\u6054\u868d\u7267" + + "\u97a8\u8492\uc5a0\udb5e\u2880\udf55\ub0ee\ua641\u8224\u76d2" + + "\u9b1e\u2a67\u1e32\ue1fc\u0a77\u435b\u669f\ued00\u6c30\u963f" + + "\u7ee3\uc5c8\u198f\u8ede\u30e1\u015d\u1195\uc850\u3371\ub9e5" + + "\u6968\u84c3\ub0e4\u22b7\u2a08\u4a9d\u9166\ua9ba\ud945\u0529" + + "\ue1e7\u8aba\ub4ef\u7445\udc9a\ucf73\ud77b\ufafe\ue1df\u3180" + + "\u9585\ued73\uca40\u06b0\ufdee\u95ba\u1aa3\ubd67\ua5c1\u84b4" + + "\u4b50\uc1e1\u4547\ud837\u21bc\uac0d\u0a65\uebb5\u7281\ud9bc" + + "\u2e2c\ua9bc\u7714\u0fc0\uab41\uce09\ud5e8\u5f8c\uc35d\uba6e" + + "\u98a2\u95c3\u87ff\uba8c\u056a\udc9f\uf254\u3d38\uf40a\u77dd" + + "\u4e30\u01de\ubef7\ud288\ue59c\ua143\ub30b\ud0ae\u63b9\u138b" + + "\uc793\u3474\u18ca\udeed\u78d9\u2ae8\u63cc\ua5d1\u6779\u0229" + + "\u7b72\ucfd4\ueecb\ue167\u08c0\u7556\u181d\u8d62\uc401\ub092" + + "\u8cf5\ued71\uf29f\u843e\u13e1\u7e7b\uf589\u0329\u92bd\ud0e3" + + "\u8dcc\u7541\uf195\ueef2\u3f3a\ueb01\uf5b0\u1869\u2216\uf351" + + "\u488d\udffb\u6243\u1121\u9447\u8a3a\u006f\u008c\ue2b3\ued31" + + "\u7f57\u6492\ue02f\u6f68\u387d\u58c0\uaadf\u2ee3\uf304\u3de9" + + "\u9741\u47fa\udde8\ufe8a\u679a\u597d\u8c7c\u9c71\u570e\u1dbd" + + "\ud555\ue853\uff63\u0fcb\u4b28\u3691\u33c8\uc31f\uc510\u6cba" + + "\ud92c\u6462\u733a\u739e\uc792\ud861\u743e\u3bd3\u006b\u2276" + + "\u9fb3\u0a31\u1eb3\ub97e\u4a80\uc076\uaabc\u35a0\u678d\u17c3" + + "\ua225\ua77c\u7d9c\uef2d\u83e2\u6996\uba70\uf6f8\u79a1\u9399" + + "\uc86b\u1cc5\ub2a5\u02c1\ud676\ua274\u4933\u6c60\u6832\ub0be" + + "\u5354\u5af9\uae23\u0963\u722d\u9ad2\u4461\ub768\u2068\u0ccb" + + "\u94fd\u88ac\u0f58\u3bc0\u212d\u30c8\u8860\uf7c9\u1dde\ub6b4" + + "\u3549\u5bcd\ucf83\u9420\u3a40\u16ad\uc4d7\ucd87\ue73a\ue1c7" + + "\u21df\u7f4f\u8659\u9f79\u5b36\uf206\uac66\uc9f3\u6336\u164d" + + "\u9046\uf4d5\u285d\ufcd8\ubd55\u1fb9\ua533\u9101\u1e87\uc7b0" + + "\u64e9\u3817\u216c\u8d41\uba51\u743a\uc74e\ue4ab\u2820\u972f" + + "\ue191\u85b4\u0ea7\ud896\u23cf\u7df5\u1653\ua9f3\ub724\ucbc9" + + "\u9738\ud2f8\u464e\ucf12\u99b8\u64e0\uf03b\u8d02\u85a8\uab52" + + "\u8da3\uea34\ube99\ue5f8\u2b38\ub082\u399d\ue61e\u64a1\u7f90" + + "\u26e9\ueb74\u6107\ufe2f\u82ca\u87a5\u3028\u8e1f\ue859\u61d4" + + "\ud26d\u23a9\uaadc\u02a7\u8ab2\u43d4\uf6b9\udf7a\u8935\u45a4" + + "\ufad6\ue7e4\u92b7\u35d7\u1044\u8ed3\u74ef\uaaa9\u713f\u6ebc" + + "\u1158\u5e5c\u7522\ufe17\ua515\u59a1\u75dd\ue7ac\uafd9\u16a9" + + "\u190e\u18fc\uc041\ufc9e\u3e16\u60c4\ufe51\u6d53\ufa52\u4c08" + + "\uce2a\ue546\u017b\ud96b\ube18\u8cb9\udd50\ued40\u14b0\u7da1" + + "\u2f2c\ubf9d\uc7c7\u1b73\ua155\ucaf8\ue54d\uebb0\u160a\ubd64" + + "\u5ef7\ue1cf\u4633\u86c1\ubc91\u839d\ub148\u9f31\uf2b1\ud133" + + "\u168f\u9374\u4667\u6aa9\u0482\ua2a6\ub5c0\ud9b7\ua070\uf6bd" + + "\u16fe\u0f41\u986b\u3d33\u7cb9\u291d\u24f0\u704a\uc946\u10a2" + + "\udbcf\u6c5f\u5a83\u5507\u036e\ube9f\uf60a\u9da8\u72dd\u23c9" + + "\u8878\udd67\uf486\u1384\u751f\u4694\uee3c\udc2e\ud5d7\ud99a" + + "\u5ee2\u5455\ub82d\u1837\u336d\u5724\u635b\ubd0b\u2e7c\u92be" + + "\u2110\u9c0e\u1662\u43f6\u62ae\u32e3\uaea4\u1cc5\uadc0\u7511" + + "\u6ad4\u0228\ue399\u5741\u2050\ue31a\u7dc8\uf6db\u67bb\u994a" + + "\u5b5a\uaac6\u2210\u95b0\u462e\u0684\u335e\uac36\u7ab9\uab1e" + + "\u0b75\u0f05\u74c5\ufcb3\ua0a5\ube7e\u45f8\u92d5\u3399\u7dd6" + + "\uf96e\u7e01\u7823\u6690\u231c\u4c47\u2d10\u7e7f\u5eb8\u70dd" + + "\u98d2\u6204\u3a92\u3990\u502b\u7cdb\u952a\ufa97\uea3b\ud990" + + "\u436f\uf33a\u070d\u2aff\u7497\u2591\u37e4\ua590\ue7ba\u2c1e" + + "\u53d9\u73fa\udc53\u944f\ua3a5\u5093\u33a4\uf080\u1193\u37f2" + + "\u7642\ub033\u7f90\u9b44\uff89\ue6ef\u81be\u9e6e\u68a4\u5a00" + + "\u9232\u4372\u40aa\u2748\u229d\u534d\u316b\u6e89\ufcb7\uff2e" + + "\ub654\u1649\ucb13\u3c28\u4940\u43aa\uc07d\u247c\u313c\u3017" + + "\u0609\u2a86\u4886\uf70d\u0109\u1431\u0a1e\u0800\u7400\u6500" + + "\u7300\u7430\u2106\u092a\u8648\u86f7\u0d01\u0915\u3114\u0412" + + "\u5469\u6d65\u2031\u3330\u3833\u3132\u3234\u3236\u3437\u3082" + + "\u03b3\u0609\u2a86\u4886\uf70d\u0107\u06a0\u8203\ua430\u8203" + + "\ua002\u0100\u3082\u0399\u0609\u2a86\u4886\uf70d\u0107\u0130" + + "\u2806\u0a2a\u8648\u86f7\u0d01\u0c01\u0630\u1a04\u14de\ud8d8" + + "\ua792\uf9d9\u6875\ua51d\u98ec\udf03\uc2b6\u5100\u8a02\u0204" + + "\u0080\u8203\u6074\ub909\u3c60\ua522\ue4ac\u0f60\u2396\u7baa" + + "\ud208\ub76c\u89a5\ue4ef\u205d\u2062\u4a5b\ua684\uceae\u01b9" + + "\u1e7a\u6e03\ud996\u555a\u615b\uba70\u406f\u80a9\u901e\ua947" + + "\u5b8f\u73f3\udea3\ud8b1\u9782\uac87\u231a\udcd2\u3ef0\u3a17" + + "\u4092\u509f\u0e79\u4cd7\u8516\u5111\uebe1\u86e0\uc548\u5ffc" + + "\u9a99\u11ed\uef13\u17af\u2707\u8984\u8770\u7064\u1943\u1dd3" + + "\u45cf\u9f80\u65f8\u9b3e\u1f70\u6bd0\uc726\u5506\ufb20\u6bdc" + + "\uba8c\u0b19\ucd01\ud0f0\u7040\udf63\u48a5\udf5f\u6559\u1b33" + + "\ubdae\u8183\uc13f\ued10\ud6dc\ud0f0\u6a7f\ubc36\uc7ca\u320f" + + "\u50b8\ud422\ufd99\u8843\u65e8\ue201\u843b\u64ee\ub891\u3ba2" + + "\uecae\ufda0\u72d6\u8394\u2551\ufc44\u3778\u27c3\u061a\u6d3b" + + "\ubd80\ue010\u06df\u39e7\u3d6a\u5ae2\u93fa\u4de4\u938f\u6f27" + + "\ufd39\u4380\u60da\uf215\u79d4\uf6f1\ua02f\u959a\ua0ea\u1c38" + + "\u80e3\u2744\u7506\u54b3\u77ad\u18ce\ucfec\u555e\u7bbe\u2e2f" + + "\u9900\ub2ef\ua5b9\ubdf0\u5e15\ua681\u92c7\u4f86\u2e1a\ub893" + + "\u01fc\u01d2\ub674\uff19\u04c3\ua1a0\u2cea\u72e0\ua8f1\u1358" + + "\ube79\u7caa\u269d\u728a\ue435\u37bd\u6495\uc106\u8830\u9b17" + + "\ue16d\uef78\uae2b\u5313\u1c96\uc0ee\u3098\ud743\ucd1c\u7407" + + "\uf4f9\uee72\ub95e\u31e7\u6435\u0173\u0336\u93c5\u8a1b\u05b4" + + "\u4359\uc4be\ud92b\u8d21\u83a9\u32b7\u6433\ua9bc\u27c2\ud842" + + "\ua4f2\u81c5\ua86c\u2fd2\uba30\u53bd\uc277\u659f\u203b\u60e5" + + "\u37f7\u0984\u31c2\u838a\u2107\u5840\u6411\u1b8d\u044e\ub0b6" + + "\uf558\ue6d3\u62bb\u5464\uf83a\u4d5b\uf153\u9e18\ua353\ubd05" + + "\uf204\ud543\u037d\ue5aa\u473a\ueb13\uac19\u0494\ua08e\u76c3" + + "\ufbd7\u9f1c\u8ca9\u57ad\ud218\uc018\u67ac\u0ae9\ub559\ufe38" + + "\u5641\uec0c\ue0ee\u606c\u1989\ue5a2\uff09\u8c61\u1386\ueb51" + + "\u7cbd\u95cd\u80c5\u3532\u8605\u596d\u4cfd\u7797\u1e82\ud2fe" + + "\uad6b\ua16e\ub6cf\u8fce\ud5a9\u207f\u1d0a\udabe\uc3a6\u5633" + + "\u2023\u925f\u809f\uee7c\u5362\u5fd9\u8dfc\u6b5f\uc95b\u0ae9" + + "\u7b26\u9e5b\u97e8\u9d6e\uaf91\u6d1a\u1d19\ufc27\u0815\uccbc" + + "\u83d4\u2ce2\ue06e\u21a1\u88da\u09af\u9671\uc510\uac23\u398d" + + "\ubea2\ua9a1\uf0d3\u490d\ub94b\u7ff7\u6636\ub1fa\u9b10\u1be3" + + "\u179b\u6a8a\u4a6c\ude1f\u5da7\u7c02\u96ec\u70ac\u5045\udd2c" + + "\u9f6d\uc37d\u5ba6\u4895\ue142\u0db9\uf2dc\uba2e\ud054\ud33e" + + "\u1ed9\u144b\u5d85\u9156\u3a90\ue8cd\u0a01\u67f5\ua81b\u4f56" + + "\u99dd\u4950\ua551\uacdb\udf31\u1f05\u7169\u3231\u0071\u80ec" + + "\ua4e9\ud74e\u62cf\u8931\u11f1\uc925\u0319\uabd4\ufb86\u73c2" + + "\u1479\u005b\uf05d\u4f8d\u44e4\u942b\ud338\ud05d\u2b3b\uf6f5" + + "\udc0d\uf741\u798b\ud8e9\u36a5\u577b\u8a95\ud773\uffcb\u17b3" + + "\u7174\u9616\u9b5e\ua577\u983c\u6e7a\u6cc8\u4a04\u042b\u503e" + + "\ud744\ub65e\ue5de\ufa24\u8c71\u1127\ud47f\ud290\ufd4c\u5cbb" + + "\u0e21\u77fd\u6553\ub82b\ucb49\u41e7\u8e3d\u4539\u925d\u6ba9" + + "\uae47\u391c\ua79e\ub6e2\u7142\u7cb3\u02f5\u6495\u7a85\u2dea" + + "\u787b\u22b7\u6ec2\uea8d\uf930\u3d30\u2130\u0906\u052b\u0e03" + + "\u021a\u0500\u0414\ubfef\u99f5\u0bb0\uc9b3\uf96a\ue267\u6bc0" + + "\u0202\u6d78\ub923\u0414\u5500\u095a\u2a04\u2d7e\u708d\u9779" + + "\u9bdb\u2c4f\u82f2\uf89f\u0202\u0400"; + + private static final String WITHOUT_NULL = + "\u3082\u097c\u0201\u0330\u8209\u3606\u092a\u8648\u86f7\u0d01" + + "\u0701\ua082\u0927\u0482\u0923\u3082\u091f\u3082\u0564\u0609" + + "\u2a86\u4886\uf70d\u0107\u01a0\u8205\u5504\u8205\u5130\u8205" + + "\u4d30\u8205\u4906\u0b2a\u8648\u86f7\u0d01\u0c0a\u0102\ua082" + + "\u04fa\u3082\u04f6\u3028\u060a\u2a86\u4886\uf70d\u010c\u0103" + + "\u301a\u0414\ud258\ubbe7\ub641\ud196\u4969\u3c88\u70f1\u8c97" + + "\u95b1\u8bf3\u0202\u0400\u0482\u04c8\u096a\u4686\uf519\u61da" + + "\u1b3b\uebfd\u89b1\u044b\u3bd8\u79a7\ud022\ud880\ud173\ucde1" + + "\ud2c1\u2c5d\u8ebb\u6bd4\u46db\ub90b\u04b9\ub091\ud1f3\ud468" + + "\u3e93\u2c88\uca5a\u1c54\u5342\u1eca\u8565\ubbbd\ua022\u1ead" + + "\ud0bb\u1a8c\u69cf\uf0f4\ucbfb\u488a\ube99\uf190\ue01c\ud87d" + + "\u78ca\u9e5c\u82f9\u76ad\u811f\u37d0\u272b\u0481\u500c\u0a27" + + "\u08d3\ub637\u3e39\u6db1\ubcba\ue354\u6924\ua9d5\u3555\u20d6" + + "\u4c6b\u3189\u5f91\u382c\uf351\u4de2\ubade\u2a14\uea84\u16b6" + + "\uf7f7\u36de\ubba6\ue952\u5f5d\u8243\u2318\ucf3d\u8ac8\u33d3" + + "\u706c\ue3db\u6619\u7935\u7300\u89b3\u0bcd\uca9f\u0333\ua450" + + "\u1be1\u3e42\ub465\uced5\ub055\u5843\uf40f\ua0f2\u6fea\u94fa" + + "\ua51e\u4b5d\u93c9\ucb2e\u977e\uafd9\u2a2f\u784b\u0320\u5550" + + "\u273f\u469f\uc42b\u2ce7\uedea\u4e0d\u54a5\u1a25\u4fac\ue346" + + "\u2102\u7ab6\uea86\u554f\u7706\u8a80\uf6dd\u04f8\u3b37\u005a" + + "\u4562\u2ef8\u59f9\u32b7\u31c0\ue7dc\ucbde\ue0e1\u2fd9\u0960" + + "\u3e7a\ub4e5\u2a58\u1e2b\uef14\u9a44\u5444\u806d\uc475\u12ab" + + "\ucc3d\ua03b\ubd52\ubf1c\ua9a6\u58aa\uee8b\u96c2\ud0c9\ua029" + + "\u1db4\ub118\u4807\uecaa\ue182\uabb7\ud9ed\u66c5\u2c80\uc6a6" + + "\u3f54\ubc73\u2632\ue1b0\u0d74\u001c\u5740\uc74b\ufadb\u25b4" + + "\ua10e\u3191\u69e6\u0861\u452b\u955c\uac56\ud3c4\u86b7\u45f8" + + "\u777a\uc336\u8cc7\ud471\u76b6\u11d8\ueb84\u14e4\uf44f\uc9ff" + + "\u8929\u0d84\ubcfe\u8cc2\u9d07\u94e6\u1cf9\u19b5\u773a\u012d" + + "\u0453\u4ff3\u40f2\ub144\ufc80\u571c\u0e13\uf890\u9fed\u2045" + + "\u7baf\ufd88\u4920\u2b86\u491d\uecf8\ua5d9\u1e12\u48c7\u2c84" + + "\u3fbe\u4df5\u11ce\u7b81\u83fc\u3efa\u697d\u1f3d\u8d81\u01b0" + + "\u0bf1\u9012\u697f\u3b25\u3574\u5286\udded\u5be0\u7e92\u0a02" + + "\ua486\ud19b\ue0b5\ua05c\u5ac2\u0ad5\u0d04\ua763\ub5c8\uf7e6" + + "\u6e77\u2df3\ub9e7\uda30\ufccb\u7642\u5dc1\udf1f\uc922\uff69" + + "\u4471\u4749\u937a\ud77d\u7c0d\u917c\uf2ef\u122c\u13b2\u8943" + + "\u33aa\uad59\u86e8\u21c4\ueaa0\uf200\ue5f3\u6da0\ue8ef\uce7e" + + "\u37b2\u3ddf\u0480\u08fc\uf89a\ud927\u3f5b\u75d3\ubdfe\u6ebd" + + "\ufab1\u9f54\u1c20\u625b\u1391\u2af0\u43ba\u4395\udf22\u299e" + + "\uf3bf\u7750\u5f68\u0120\u0ee0\u6960\ud939\u621f\uf845\u0025" + + "\ue33c\u7ed9\ueadf\u0005\u6306\u7274\u5e67\ucf7a\uf3c6\u7371" + + "\u487b\u79d7\u2142\ubc1a\ubfe4\u3536\u15db\ufe23\u4352\u6321" + + "\u329d\uc251\u84c8\ufc0e\uc0ca\u5be6\uf530\u0177\ud9cb\ud132" + + "\uf752\u3f26\uda90\ud9cf\u2e46\u3e09\u5d9a\u6902\udb3e\ub06c" + + "\u722d\uf498\u3e93\u6cae\u43b5\u535a\u1cd1\uf0b2\u8d80\u9e53" + + "\ue02e\uf782\u01ce\u5063\u73d1\u5571\uf0e7\ufa22\u7e48\u0c31" + + "\u4642\u29fd\udcab\ue8d4\u7a77\u0880\u4855\u88c7\u7aa5\u0d9c" + + "\uf8b7\uc91c\u127d\u2dd7\ude53\u9d3f\u132b\u965c\ubc80\udd97" + + "\u87bf\ua0e8\ub2a2\u4e1f\u98fd\u72f3\u16ea\uc415\u5be3\ue8df" + + "\u5681\u1f11\u4e3a\uac5d\u1684\u6602\ueb14\u0a96\ufcef\uaebf" + + "\u1f2e\ud1a9\u435c\uf4e5\ub6b4\uaae2\u8244\u96a4\u0d3a\u752f" + + "\uce21\u1bc9\u219e\uf17b\ud95e\ucd12\u1b0a\ucb85\ub0cd\u4ecb" + + "\u6bb4\u5f7c\u2a93\ubb24\u9d7c\u6822\u80cd\u3f54\u78ad\u4fde" + + "\ud57f\uec1d\ub54c\u0d78\u5946\u84c1\ua9ad\u0dea\u0292\ub279" + + "\u1c76\u817e\ub910\ub1fa\ub1c0\u839d\u9eca\u6f83\u8211\u4112" + + "\u440c\u4fbd\u6ef2\u897d\udfa9\ude9e\u1aef\u0f21\u26fb\uaca4" + + "\u637e\ub072\u264f\ud24d\u9357\uc801\u0b84\u2d34\ueddf\u6063" + + "\udc5d\u90dd\u5c62\ufb48\u8c5e\u7c4e\u3bdb\ub590\u7a75\udbd1" + + "\udd78\uc8be\u5915\u7c8b\u8874\u578d\u3116\ub65a\uab8e\ud2ef" + + "\u5d35\ubf8b\u2828\u8983\ua790\uedcf\u9698\ue023\u5786\u627b" + + "\u9037\u1db7\u900e\u1f45\u0001\u7cf8\u14fd\ue437\u0dfd\ucacc" + + "\u5edf\u1742\u7f6e\u612a\ud57d\udca0\u73a4\ud601\uc7f0\uca0e" + + "\u5a44\u00b4\u233a\u84f2\u95b5\u5f16\uc291\u04fb\u369d\u6b99" + + "\ue127\u493f\u66be\u86e9\u9672\u2849\u64a7\u851b\ue420\u8491" + + "\ueb07\u6563\uc753\uc28e\ucad5\uec05\u6920\u8955\u5605\u25f6" + + "\u6193\ubee5\u7a1a\ub73d\ucc27\uc8ce\u7179\u57c1\u7a2a\u37c1" + + "\ua6c7\u2d8a\u4025\uc97d\u8c9d\u7b4b\u1ad5\uc6d7\u50fc\u246d" + + "\u91a9\ua55d\u677a\udc83\u04c7\u3e14\u9950\u420c\udf02\u749b" + + "\ude88\u5459\u2074\ua4ae\ud12d\uaf60\uba98\u630d\u313c\u3017" + + "\u0609\u2a86\u4886\uf70d\u0109\u1431\u0a1e\u0800\u7400\u6500" + + "\u7300\u7430\u2106\u092a\u8648\u86f7\u0d01\u0915\u3114\u0412" + + "\u5469\u6d65\u2031\u3330\u3833\u3132\u3431\u3138\u3238\u3082" + + "\u03b3\u0609\u2a86\u4886\uf70d\u0107\u06a0\u8203\ua430\u8203" + + "\ua002\u0100\u3082\u0399\u0609\u2a86\u4886\uf70d\u0107\u0130" + + "\u2806\u0a2a\u8648\u86f7\u0d01\u0c01\u0630\u1a04\u14af\ud4f5" + + "\u0ff4\u0ede\u0da0\u6cc5\ufd9d\u3502\uae5e\u4cef\u3102\u0204" + + "\u0080\u8203\u6028\ua7e6\u088b\u56b6\uf453\u9747\u68ec\uc064" + + "\u2254\u693f\u25c5\uaa39\u3d87\uc97c\uc558\u5194\u7553\ude3a" + + "\u4575\u9d85\ud843\u2bd0\ua2e8\u244f\u8593\uac84\u54b4\ubdc6" + + "\ucea6\uba1a\ud3da\ua510\uee9d\uaf31\ub5c2\u3329\u0fed\u0e08" + + "\u426b\u46fe\udcc5\u0979\ua9ed\u3123\u9a50\ud222\u3fc0\u771a" + + "\u6f55\u9664\ud56f\u6b03\u6020\u78a4\u63b2\ue35e\u0816\u43a7" + + "\u1909\u52e1\u8183\u1b8d\u9f5b\u19e4\uad73\u8461\ucc86\u3b49" + + "\u322e\ue9d9\u3c66\uea22\u091e\u6621\ua8bf\u0169\u72d0\u535e" + + "\u77dc\u1002\ubded\u7a91\u6cee\u58fa\uc295\uae8e\ue009\uabe9" + + "\u6638\ucaea\u8bbf\uca27\udef5\u2881\u72ec\u8aa5\u582b\u9d6e" + + "\u26bb\u3c70\u8bd6\uf5ec\u34ae\ua967\u5bb1\u22cb\u4b74\u0e50" + + "\u5062\uc6f7\u7cb4\u58a3\uf43d\u57c0\u9654\u2f9c\u9308\u4546" + + "\u6f4a\u37fe\u8d5d\u1465\u8621\u4cd8\u68d6\u0456\u96a4\ud3e2" + + "\u76d1\u2675\u7654\u7649\u10e9\u9d0e\u8b04\uffb6\u020a\u2eb4" + + "\uf24f\u150e\u7f0d\uf41b\u2c76\u538f\uc2df\u79dc\u0472\u1119" + + "\uc148\ue2e8\u1820\ucd45\u08a7\u6bcd\u6eb0\ubd0a\ufff4\uec28" + + "\u819b\u2adb\uefc8\ue8f7\ue233\u6535\uc938\u9771\u3681\u87cf" + + "\u3a24\u4c71\ue1df\u3e19\u259c\uae5b\u27ed\u8a67\uf3e6\u7af0" + + "\u48e1\uc542\uc471\ud8f4\ue317\u46e9\u0b4f\uec45\ua1d3\u2b88" + + "\u8a22\udda1\u7c1a\u273c\ua0f7\u8bac\u3771\u28d2\u6ef8\u28d2" + + "\ud83c\u196f\ue3fd\u9c79\u4305\u01b8\u3490\u0a91\ue4f3\uebc6" + + "\u25a2\u7dd2\u72db\u7531\ucfca\u432f\u2beb\uc649\uf9c5\uc533" + + "\u9f3a\ua611\u935c\ubca6\ud293\u54d6\u0dd1\u0aff\u82fb\u2d69" + + "\u3da0\u3b33\u0986\u45b3\u3353\ub968\u7348\u454f\u9117\ub3dc" + + "\ud7af\u06ca\ua34a\u9357\ue22f\uad3d\u4c76\ub386\ua8d7\u2a90" + + "\u6d17\u9321\u7b00\u21e4\u1994\u9d18\u6439\u04c8\u8282\ub269" + + "\uf786\u75c6\ua505\u983a\ua075\uffa0\ud662\u6ae5\ub126\u96d1" + + "\u9e5e\u346b\ub7ee\ub0a3\u4ee8\ud204\u77ec\u2325\u5da8\ua326" + + "\ua018\u0fd8\ue50e\u93cc\ucc40\u2d89\u2ffb\u54e0\u091a\u19fd" + + "\u45d7\uc0ab\u77a2\u66ae\u794b\u6644\u21c3\ud782\u1e9e\u53e5" + + "\u782e\u55e8\ud44e\u93e8\u379e\u5aa8\u353b\u95de\u7bc1\ucaf3" + + "\u5223\ub5e9\uacbb\ub86b\u6014\u0626\ue7ad\ufd93\ue43a\ud864" + + "\u1e6d\u14b2\ua12a\u94c5\u2ed9\ua7f7\u14f4\u0cbd\uca3b\u7c21" + + "\ua85a\uf834\u6c99\ue1aa\u3832\u2515\u8170\u3c93\u7def\u94fe" + + "\u9c3d\u4ab0\u73ed\u6c72\u8b94\ua407\uc719\uad1e\u6306\u4167" + + "\u921e\uae53\u3fd4\uf569\u6f0b\u82b0\u0ca6\ud61f\ud526\u23c9" + + "\u168d\u4baf\ucc4f\ud8a2\uc64a\ud649\u55e3\u7019\u8f20\u680c" + + "\u5581\u2cb1\ub3a4\u3e37\u5fd3\ua3ca\uc115\u979c\uf910\u3797" + + "\u05cb\u51d6\u74a4\uc5c0\u597b\uf27f\ud5e2\ue8ac\u4f3d\uc0c3" + + "\u9594\u7799\u6876\ub1a3\u059a\uff03\uc2ee\uc8c2\uf224\u3720" + + "\u9177\uabdb\u9202\u18d8\uffbe\u0516\u2a76\uedb5\ufe9e\u6d65" + + "\u4c35\ue4cb\u75aa\u02be\ud24c\ua482\ufc67\ue4f9\u70c7\u3567" + + "\ufc3f\uaa89\ue80a\u6507\u0a65\u4e18\uf919\u071d\u423c\u1756" + + "\u30e5\u37f3\u19b3\u10fb\u6c30\u3d30\u2130\u0906\u052b\u0e03" + + "\u021a\u0500\u0414\ufd05\u4444\ud347\u673c\u6da4\udb7c\u0733" + + "\ud7bf\ud263\uc6b2\u0414\udd17\u155e\u2d4c\u25cb\ua028\u1a23" + + "\ub8b0\uf6be\u925f\ude3a\u0202\u0400"; + +} From 533795bb75dbb6a69b8b5ac6e03cf70374165401 Mon Sep 17 00:00:00 2001 From: Bradford Wetmore Date: Fri, 10 Feb 2012 19:07:23 -0800 Subject: [PATCH 16/26] 7142509: Cipher.doFinal(ByteBuffer,ByteBuffer) fails to process when in.remaining() == 0 Reviewed-by: valeriep --- .../share/classes/javax/crypto/CipherSpi.java | 10 +- .../crypto/CipherSpi/DirectBBRemaining.java | 181 ++++++++++++++++++ 2 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java diff --git a/jdk/src/share/classes/javax/crypto/CipherSpi.java b/jdk/src/share/classes/javax/crypto/CipherSpi.java index c3442ea2d81..e563e920eb6 100644 --- a/jdk/src/share/classes/javax/crypto/CipherSpi.java +++ b/jdk/src/share/classes/javax/crypto/CipherSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -775,7 +775,7 @@ public abstract class CipherSpi { int outOfs = output.arrayOffset() + outPos; byte[] inArray = new byte[getTempArraySize(inLen)]; int total = 0; - while (inLen > 0) { + do { int chunk = Math.min(inLen, inArray.length); input.get(inArray, 0, chunk); int n; @@ -787,7 +787,7 @@ public abstract class CipherSpi { total += n; outOfs += n; inLen -= chunk; - } + } while (inLen > 0); output.position(outPos + total); return total; } else { // output is not backed by an accessible byte[] @@ -804,7 +804,7 @@ public abstract class CipherSpi { int outSize = outArray.length; int total = 0; boolean resized = false; - while (inLen > 0) { + do { int chunk = Math.min(inLen, outSize); if ((a1 == false) && (resized == false)) { input.get(inArray, 0, chunk); @@ -834,7 +834,7 @@ public abstract class CipherSpi { int newOut = engineGetOutputSize(chunk); outArray = new byte[newOut]; } - } + } while (inLen > 0); input.position(inLimit); return total; } diff --git a/jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java b/jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java new file mode 100644 index 00000000000..9cc840664c0 --- /dev/null +++ b/jdk/test/javax/crypto/CipherSpi/DirectBBRemaining.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7142509 + * @summary Cipher.doFinal(ByteBuffer,ByteBuffer) fails to + * process when in.remaining() == 0 + */ + +import java.nio.ByteBuffer; +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +/* + * Simple test case to show that Cipher.doFinal(ByteBuffer, ByteBuffer) fails to + * process the data internally buffered inBB the cipher when input.remaining() + * == 0 and at least one buffer is a direct buffer. + */ +public class DirectBBRemaining { + + private static Random random = new SecureRandom(); + private static int testSizes = 40; + private static int outputFrequency = 5; + + public static void main(String args[]) throws Exception { + boolean failedOnce = false; + Exception failedReason = null; + + byte[] keyBytes = new byte[8]; + random.nextBytes(keyBytes); + SecretKey key = new SecretKeySpec(keyBytes, "DES"); + + Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE"); + cipher.init(Cipher.ENCRYPT_MODE, key); + + /* + * Iterate through various sizes to make sure that the code does empty + * blocks, single partial blocks, 1 full block, full + partial blocks, + * multiple full blocks, etc. 5 blocks (using DES) is probably overkill + * but will feel more confident the fix isn't breaking anything. + */ + System.out.println("Output test results for every " + + outputFrequency + " tests..."); + + for (int size = 0; size <= testSizes; size++) { + boolean output = (size % outputFrequency) == 0; + if (output) { + System.out.print("\nTesting buffer size: " + size + ":"); + } + + int outSize = cipher.getOutputSize(size); + + try { + encrypt(cipher, size, + ByteBuffer.allocate(size), + ByteBuffer.allocate(outSize), + ByteBuffer.allocateDirect(size), + ByteBuffer.allocateDirect(outSize), + output); + } catch (Exception e) { + System.out.print("\n Failed with size " + size); + failedOnce = true; + failedReason = e; + + // If we got an exception, let's be safe for future + // testing and reset the cipher to a known good state. + cipher.init(Cipher.ENCRYPT_MODE, key); + } + } + if (failedOnce) { + throw failedReason; + } + System.out.println("\nTest Passed..."); + } + + private enum TestVariant { + + HEAP_HEAP, HEAP_DIRECT, DIRECT_HEAP, DIRECT_DIRECT + }; + + private static void encrypt(Cipher cipher, int size, + ByteBuffer heapIn, ByteBuffer heapOut, + ByteBuffer directIn, ByteBuffer directOut, + boolean output) throws Exception { + + ByteBuffer inBB = null; + ByteBuffer outBB = null; + + // Set up data and encrypt to known/expected values. + byte[] testdata = new byte[size]; + random.nextBytes(testdata); + byte[] expected = cipher.doFinal(testdata); + + for (TestVariant tv : TestVariant.values()) { + if (output) { + System.out.print(" " + tv); + } + + switch (tv) { + case HEAP_HEAP: + inBB = heapIn; + outBB = heapOut; + break; + case HEAP_DIRECT: + inBB = heapIn; + outBB = directOut; + break; + case DIRECT_HEAP: + inBB = directIn; + outBB = heapOut; + break; + case DIRECT_DIRECT: + inBB = directIn; + outBB = directOut; + break; + } + + inBB.clear(); + outBB.clear(); + + inBB.put(testdata); + inBB.flip(); + + // Process all data in one shot, but don't call doFinal() yet. + // May store up to n-1 bytes (w/block size n) internally. + cipher.update(inBB, outBB); + if (inBB.hasRemaining()) { + throw new Exception("buffer not empty"); + } + + // finish encryption and process all data buffered + cipher.doFinal(inBB, outBB); + outBB.flip(); + + // validate output size + if (outBB.remaining() != expected.length) { + throw new Exception( + "incomplete encryption output, expected " + + expected.length + " bytes but was only " + + outBB.remaining() + " bytes"); + } + + // validate output data + byte[] encrypted = new byte[outBB.remaining()]; + outBB.get(encrypted); + if (!Arrays.equals(expected, encrypted)) { + throw new Exception("bad encryption output"); + } + + if (!Arrays.equals(cipher.doFinal(), cipher.doFinal())) { + throw new Exception("Internal buffers still held data!"); + } + } + } +} From 7ddcb409b62118b1f7bfeb475edd840837092be2 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 10 Feb 2012 22:17:44 -0800 Subject: [PATCH 17/26] 7144781: incorrect URLs in JSSE java doc Reviewed-by: wetmore, skannan --- jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java | 6 +++--- jdk/src/share/classes/javax/net/ssl/SSLParameters.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java b/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java index a9a5ed2968a..8afd963458d 100644 --- a/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java +++ b/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public abstract class ExtendedSSLSession implements SSLSession { * The signature algorithm name must be a standard Java Security * name (such as "SHA1withRSA", "SHA256withECDSA", and so on). * See Appendix A in the + * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> * Java Cryptography Architecture API Specification & Reference * for information about standard algorithm names. *

@@ -71,7 +71,7 @@ public abstract class ExtendedSSLSession implements SSLSession { * The signature algorithm name must be a standard Java Security * name (such as "SHA1withRSA", "SHA256withECDSA", and so on). * See Appendix A in the + * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> * Java Cryptography Architecture API Specification & Reference * for information about standard algorithm names. * diff --git a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java index 4bb20a164eb..0cb5b7d424c 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -242,7 +242,7 @@ public class SSLParameters { * * @param algorithm The standard string name of the endpoint * identification algorithm (or null). See Appendix A in the + * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA"> * Java Cryptography Architecture API Specification & Reference * for information about standard algorithm names. * From cfe8581b9b20c8dbda9225d035ed78f831832f41 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Sun, 12 Feb 2012 08:47:36 +0000 Subject: [PATCH 18/26] 7133367: ResponseCache.put should not be called when setUseCaches(false) Reviewed-by: michaelm --- .../www/protocol/http/HttpURLConnection.java | 4 +- .../sun/net/www/protocol/http/NoCache.java | 85 +++++++++++++++++++ 2 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 jdk/test/sun/net/www/protocol/http/NoCache.java diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 719ddc46a74..50cecb0e079 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -270,7 +270,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { protected Proxy instProxy; private CookieHandler cookieHandler; - private ResponseCache cacheHandler; + private final ResponseCache cacheHandler; // the cached response, and cached response headers and body protected CacheResponse cachedResponse; @@ -1579,7 +1579,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (respCode == 200 || respCode == 203 || respCode == 206 || respCode == 300 || respCode == 301 || respCode == 410) { - if (cacheHandler != null) { + if (cacheHandler != null && getUseCaches()) { // give cache a chance to save response in cache URI uri = ParseUtil.toURI(url); if (uri != null) { diff --git a/jdk/test/sun/net/www/protocol/http/NoCache.java b/jdk/test/sun/net/www/protocol/http/NoCache.java new file mode 100644 index 00000000000..f452bc3d497 --- /dev/null +++ b/jdk/test/sun/net/www/protocol/http/NoCache.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7133367 + * @summary ResponseCache.put should not be called when setUseCaches(false) + */ + +import java.net.*; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +public class NoCache +{ + public static void main(String[] args) throws IOException { + ResponseCache.setDefault(new ThrowingCache()); + + HttpServer server = startHttpServer(); + try { + URL url = new URL("http://" + InetAddress.getLocalHost().getHostAddress() + + ":" + server.getAddress().getPort() + "/NoCache/"); + URLConnection uc = url.openConnection(); + uc.setUseCaches(false); + uc.getInputStream().close(); + } finally { + server.stop(0); + // clear the system-wide cache handler, samevm/agentvm mode + ResponseCache.setDefault(null); + } + } + + static class ThrowingCache extends ResponseCache { + @Override + public CacheResponse get(URI uri, String rqstMethod, + Map> rqstHeaders) { + throw new RuntimeException("ResponseCache.get should not be called"); + } + + @Override + public CacheRequest put(URI uri, URLConnection conn) { + throw new RuntimeException("ResponseCache.put should not be called"); + } + } + + // HTTP Server + static HttpServer startHttpServer() throws IOException { + HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0); + httpServer.createContext("/NoCache/", new SimpleHandler()); + httpServer.start(); + return httpServer; + } + + static class SimpleHandler implements HttpHandler { + @Override + public void handle(HttpExchange t) throws IOException { + t.sendResponseHeaders(200, -1); + t.close(); + } + } +} From 6e1303417cff4faa5a64404ba1cb5d014f295358 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Sun, 12 Feb 2012 21:09:09 +0000 Subject: [PATCH 19/26] 7144895: ProblemList.txt updates (2/2012) Reviewed-by: darcy, ohair --- jdk/test/Makefile | 4 +- jdk/test/ProblemList.txt | 158 +++++---------------------------------- jdk/test/TEST.ROOT | 6 ++ 3 files changed, 25 insertions(+), 143 deletions(-) diff --git a/jdk/test/Makefile b/jdk/test/Makefile index 75979ce82f1..9f443817469 100644 --- a/jdk/test/Makefile +++ b/jdk/test/Makefile @@ -517,14 +517,14 @@ jdk_nio1: $(call TestDirs, java/nio/file) JDK_ALL_TARGETS += jdk_nio2 JDK_DEFAULT_TARGETS += jdk_nio2 jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \ - java/nio/channels java/nio/MappedByteBuffer) + java/nio/channels java/nio/MappedByteBuffer sun/nio/ch) $(call SharedLibraryPermissions,java/nio/channels) $(call RunAgentvmBatch) # Stable agentvm testruns (minus items from PROBLEM_LIST) JDK_ALL_TARGETS += jdk_nio3 JDK_DEFAULT_TARGETS += jdk_nio3 -jdk_nio3: $(call TestDirs, sun/nio) +jdk_nio3: $(call TestDirs, java/nio/charset sun/nio/cs) $(call RunAgentvmBatch) # All nio tests diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 7e59e1d21ad..901ff09abb5 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -211,78 +211,9 @@ java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all # jdk_management -# Failing, bug was filed: 6959636 -javax/management/loading/LibraryLoader/LibraryLoaderTest.java generic-all - -# Access denied messages on windows/mks, filed 6954450 -sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh windows-all - -# Fails on linux: KO: StringMonitor notification missed or not emitted -javax/management/monitor/NonComparableAttributeValueTest.java generic-all - -# Port conflict? Fails with communication error -sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh generic-all - -# Fails on Windows 2000, Test failed for iiop java.lang.NullPointerException -# at org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(Unknown Source) -# at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:653) -javax/management/remote/mandatory/connection/ReconnectTest.java generic-all - -# Solaris 10 sparc, NPE from org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke -javax/management/remote/mandatory/threads/ExecutorTest.java generic-all - -# Linux 32bit Fedora 9, IllegalStateException -javax/management/monitor/RuntimeExceptionTest.java generic-all - -# Problems with rmi connection, othervm -javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java generic-all - -# Fails with port already in use -sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh generic-all - -# Fails with port already in use -sun/management/jmxremote/bootstrap/RmiRegistrySslTest.sh generic-all - -# Windows, connection can't last that long -javax/management/eventService/LeaseTest.java generic-all - -# Linux othervm, X64, java.lang.Exception: Failed: ratio=102.4027795593753 -javax/management/remote/mandatory/notif/ListenerScaleTest.java generic-all - -# Windows run seems to have triggered a hotspot gc error (see 6801625) -com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh generic-all - -# rmi problem? othervm, java.lang.reflect.UndeclaredThrowableException -javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java generic-all - -# Linux Fedora 9 32bit NPE in rmi server somehere??? othervm -javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java generic-all - -# Times out on solaris sparc, with othervm -javax/management/eventService/AddRemoveListenerTest.java generic-all - -# Linux i586 and x64 -server, timed out waiting for threads to expire? othervm -javax/management/eventService/EventClientThreadTest.java generic-all - -# Linux i586 -server, Expected to receive 20, but got 21, othervm -# Fails on Linux X64 -server 20!=21 -javax/management/eventService/FetchingTest.java generic-all - -# NPE on windows 2000 i586 -client and -server -javax/management/eventService/CustomForwarderTest.java windows-all - -# Windows i586 failure, callback did not complete -javax/management/eventService/LeaseManagerDeadlockTest.java windows-all - -# Port already in use -sun/management/jmxremote/bootstrap/LocalManagementTest.sh generic-all - -# Failed to initialize connector (also overflowing jtreg io buffers) -sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh generic-all -sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh generic-all - -# Windows X64, java.lang.IllegalStateException -javax/management/monitor/AttributeArbitraryDataTypeTest.java generic-all +# 7073626 +sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh windows-all +sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh windows-all ############################################################################ @@ -410,71 +341,11 @@ java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java windows-all # jdk_rmi -# Port already in use, fails on sparc, othervm -java/rmi/reliability/benchmark/runRmiBench.sh generic-all - -# Already in use port issues? othervm solaris -java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java generic-all -java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java generic-all - -java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java generic-all -java/rmi/transport/dgcDeadLock/TestImpl_Stub.java generic-all - -# Address already in use, othervm mode, solaris -java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java generic-all -java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java generic-all - -# Registry already running on port, solaris -java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java generic-all - -# Fails on Linux 32 and 64bit -server?, impl not garbage collected??? -java/rmi/transport/pinLastArguments/PinLastArguments.java generic-all - -# Times out on solaris sparc -java/rmi/server/RemoteServer/AddrInUse.java generic-all - -# Connection error on Windows i586 -server -# Also connection errors in othervm on Solaris 10 sparc, same port??? -sun/rmi/transport/tcp/DeadCachedConnection.java generic-all - -# Connection errors in othervm on Solaris 10 sparc, same port??? -java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java generic-all -java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java generic-all -java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java generic-all -java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java generic-all -java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java generic-all -java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java generic-all -java/rmi/activation/Activatable/extLoadedImpl/ext.sh generic-all -java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java generic-all -java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java generic-all -java/rmi/activation/Activatable/nestedActivate/NestedActivate.java generic-all -java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java generic-all -java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java generic-all -java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java generic-all -java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java generic-all -java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java generic-all -java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java generic-all -java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java generic-all -java/rmi/reliability/juicer/AppleUserImpl.java generic-all -java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java generic-all -java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java generic-all -java/rmi/transport/handshakeTimeout/HandshakeTimeout.java generic-all -java/rmi/activation/Activatable/restartService/RestartService.java generic-all -java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java generic-all -java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java generic-all -java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java generic-all -java/rmi/activation/CommandEnvironment/SetChildEnv.java generic-all -java/rmi/registry/classPathCodebase/ClassPathCodebase.java generic-all -java/rmi/registry/reexport/Reexport.java generic-all +# 7140992 java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java generic-all -java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java generic-all -java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java generic-all -java/rmi/server/useCustomRef/UseCustomRef.java generic-all -java/rmi/transport/checkFQDN/CheckFQDN.java generic-all -java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java generic-all -java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java generic-all -java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java generic-all -java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java generic-all + +# 6948101 +java/rmi/transport/pinLastArguments/PinLastArguments.java generic-all # 7132247 java/rmi/registry/readTest/readTest.sh windows-all @@ -557,6 +428,9 @@ java/text/Bidi/Bug6665028.java linux-x64 # jdk_tools +# 6461635 +com/sun/tools/attach/BasicTests.sh generic-all + # Filed 6952105 com/sun/jdi/SuspendThreadTest.java generic-all @@ -572,6 +446,9 @@ com/sun/jdi/FieldWatchpoints.java generic-all # Filed 6402201 com/sun/jdi/ProcessAttachTest.sh generic-all +# 7144833 +sun/tools/jcmd/jcmd-Defaults.sh generic-all + # Filed 6986875 sun/tools/jps/jps-Vvml.sh generic-all @@ -581,6 +458,10 @@ sun/tools/jconsole/ResourceCheckTest.sh generic-all # 7132203 sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all +# Tests take too long +tools/pack200/CommandLineTests.java generic-all +tools/pack200/Pack200Test.java generic-all + ############################################################################ # jdk_util @@ -588,11 +469,6 @@ sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all # Filed 6933803 java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all -# Filed 7022325 -# Fails with assertion error on windows -# 11 separate stacktraces created... file reuse problem? -java/util/zip/ZipFile/ReadLongZipFileName.java generic-all - # Filed 6772009 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 6512c34009f..8aa398f60bb 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -4,3 +4,9 @@ # The list of keywords supported in the entire test suite keys=2d dnd i18n + +# Tests that must run in othervm mode +othervm.dirs=java/rmi sun/rmi javax/management + +# Tests that cannot run concurrently +exclusiveAccess.dirs=java/rmi sun/rmi sun/management/jmxremote sun/tools/jstatd From 7abee00e9754ce45b8586ecc31bd40e7be24f86a Mon Sep 17 00:00:00 2001 From: Mani Sarkar Date: Sun, 12 Feb 2012 21:56:24 -0800 Subject: [PATCH 20/26] 7143230: fix warnings in java.util.jar, sun.tools.jar, zipfs demo, etc Co-authored-by: Michael Barker Co-authored-by: Carl Jokl Co-authored-by: Dinuk Weerasinghe Co-authored-by: Markus Stoy Co-authored-by: Tom Anderson Reviewed-by: alanb, chegar, lancea, smarks --- .../classes/java/util/jar/Attributes.java | 14 +-- .../classes/java/util/jar/JarVerifier.java | 117 +++++++++--------- .../classes/sun/tools/jar/CommandLine.java | 8 +- .../share/classes/sun/tools/jar/Manifest.java | 14 +-- .../classes/sun/tools/jar/SignatureFile.java | 26 ++-- .../MemoryMonitor/MemoryMonitor.java | 14 +-- .../src/com/sun/nio/zipfs/ZipFileStore.java | 2 +- .../src/com/sun/nio/zipfs/ZipFileSystem.java | 4 +- .../sun/nio/zipfs/ZipFileSystemProvider.java | 2 +- .../zipfs/src/com/sun/nio/zipfs/ZipInfo.java | 4 +- 10 files changed, 102 insertions(+), 103 deletions(-) diff --git a/jdk/src/share/classes/java/util/jar/Attributes.java b/jdk/src/share/classes/java/util/jar/Attributes.java index e09071172b6..1eb28d41678 100644 --- a/jdk/src/share/classes/java/util/jar/Attributes.java +++ b/jdk/src/share/classes/java/util/jar/Attributes.java @@ -71,7 +71,7 @@ public class Attributes implements Map, Cloneable { * @param size the initial number of attributes */ public Attributes(int size) { - map = new HashMap(size); + map = new HashMap<>(size); } /** @@ -81,7 +81,7 @@ public class Attributes implements Map, Cloneable { * @param attr the specified Attributes */ public Attributes(Attributes attr) { - map = new HashMap(attr); + map = new HashMap<>(attr); } @@ -296,9 +296,9 @@ public class Attributes implements Map, Cloneable { * XXX Need to handle UTF8 values and break up lines longer than 72 bytes */ void write(DataOutputStream os) throws IOException { - Iterator it = entrySet().iterator(); + Iterator> it = entrySet().iterator(); while (it.hasNext()) { - Map.Entry e = (Map.Entry)it.next(); + Map.Entry e = it.next(); StringBuffer buffer = new StringBuffer( ((Name)e.getKey()).toString()); buffer.append(": "); @@ -340,9 +340,9 @@ public class Attributes implements Map, Cloneable { // write out all attributes except for the version // we wrote out earlier - Iterator it = entrySet().iterator(); + Iterator> it = entrySet().iterator(); while (it.hasNext()) { - Map.Entry e = (Map.Entry)it.next(); + Map.Entry e = it.next(); String name = ((Name)e.getKey()).toString(); if ((version != null) && ! (name.equalsIgnoreCase(vername))) { @@ -499,7 +499,7 @@ public class Attributes implements Map, Cloneable { */ public boolean equals(Object o) { if (o instanceof Name) { - Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER; + Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER; return c.compare(name, ((Name)o).name) == 0; } else { return false; diff --git a/jdk/src/share/classes/java/util/jar/JarVerifier.java b/jdk/src/share/classes/java/util/jar/JarVerifier.java index 6a9a8b55667..5c80d5013db 100644 --- a/jdk/src/share/classes/java/util/jar/JarVerifier.java +++ b/jdk/src/share/classes/java/util/jar/JarVerifier.java @@ -48,21 +48,21 @@ class JarVerifier { /* a table mapping names to code signers, for jar entries that have had their actual hashes verified */ - private Hashtable verifiedSigners; + private Hashtable verifiedSigners; /* a table mapping names to code signers, for jar entries that have passed the .SF/.DSA/.EC -> MANIFEST check */ - private Hashtable sigFileSigners; + private Hashtable sigFileSigners; /* a hash table to hold .SF bytes */ - private Hashtable sigFileData; + private Hashtable sigFileData; /** "queue" of pending PKCS7 blocks that we couldn't parse * until we parsed the .SF file */ - private ArrayList pendingBlocks; + private ArrayList pendingBlocks; /* cache of CodeSigner objects */ - private ArrayList signerCache; + private ArrayList signerCache; /* Are we parsing a block? */ private boolean parsingBlockOrSF = false; @@ -94,10 +94,10 @@ class JarVerifier { public JarVerifier(byte rawBytes[]) { manifestRawBytes = rawBytes; - sigFileSigners = new Hashtable(); - verifiedSigners = new Hashtable(); - sigFileData = new Hashtable(11); - pendingBlocks = new ArrayList(); + sigFileSigners = new Hashtable<>(); + verifiedSigners = new Hashtable<>(); + sigFileData = new Hashtable<>(11); + pendingBlocks = new ArrayList<>(); baos = new ByteArrayOutputStream(); manifestDigests = new ArrayList<>(); } @@ -248,10 +248,9 @@ class JarVerifier { sigFileData.put(key, bytes); // check pending blocks, we can now process // anyone waiting for this .SF file - Iterator it = pendingBlocks.iterator(); + Iterator it = pendingBlocks.iterator(); while (it.hasNext()) { - SignatureFileVerifier sfv = - (SignatureFileVerifier) it.next(); + SignatureFileVerifier sfv = it.next(); if (sfv.needSignatureFile(key)) { if (debug != null) { debug.println( @@ -270,7 +269,7 @@ class JarVerifier { String key = uname.substring(0, uname.lastIndexOf(".")); if (signerCache == null) - signerCache = new ArrayList(); + signerCache = new ArrayList<>(); if (manDig == null) { synchronized(manifestRawBytes) { @@ -287,7 +286,7 @@ class JarVerifier { if (sfv.needSignatureFileBytes()) { // see if we have already parsed an external .SF file - byte[] bytes = (byte[]) sigFileData.get(key); + byte[] bytes = sigFileData.get(key); if (bytes == null) { // put this block on queue for later processing @@ -343,7 +342,7 @@ class JarVerifier { */ public CodeSigner[] getCodeSigners(String name) { - return (CodeSigner[])verifiedSigners.get(name); + return verifiedSigners.get(name); } public CodeSigner[] getCodeSigners(JarFile jar, JarEntry entry) @@ -376,15 +375,14 @@ class JarVerifier { CodeSigner[] signers) { if (signers != null) { - ArrayList certChains = new ArrayList(); + ArrayList certChains = new ArrayList<>(); for (int i = 0; i < signers.length; i++) { certChains.addAll( signers[i].getSignerCertPath().getCertificates()); } // Convert into a Certificate[] - return (java.security.cert.Certificate[]) - certChains.toArray( + return certChains.toArray( new java.security.cert.Certificate[certChains.size()]); } return null; @@ -418,8 +416,8 @@ class JarVerifier { // MANIFEST.MF is always treated as signed and verified, // move its signers from sigFileSigners to verifiedSigners. if (sigFileSigners.containsKey(JarFile.MANIFEST_NAME)) { - verifiedSigners.put(JarFile.MANIFEST_NAME, - sigFileSigners.remove(JarFile.MANIFEST_NAME)); + CodeSigner[] codeSigners = sigFileSigners.remove(JarFile.MANIFEST_NAME); + verifiedSigners.put(JarFile.MANIFEST_NAME, codeSigners); } } @@ -493,10 +491,10 @@ class JarVerifier { // Extended JavaUtilJarAccess CodeSource API Support - private Map urlToCodeSourceMap = new HashMap(); - private Map signerToCodeSource = new HashMap(); + private Map> urlToCodeSourceMap = new HashMap<>(); + private Map signerToCodeSource = new HashMap<>(); private URL lastURL; - private Map lastURLMap; + private Map lastURLMap; /* * Create a unique mapping from codeSigner cache entries to CodeSource. @@ -504,19 +502,19 @@ class JarVerifier { * and shared JAR file although in practice there will be a single URL in use. */ private synchronized CodeSource mapSignersToCodeSource(URL url, CodeSigner[] signers) { - Map map; + Map map; if (url == lastURL) { map = lastURLMap; } else { - map = (Map) urlToCodeSourceMap.get(url); + map = urlToCodeSourceMap.get(url); if (map == null) { - map = new HashMap(); + map = new HashMap<>(); urlToCodeSourceMap.put(url, map); } lastURLMap = map; lastURL = url; } - CodeSource cs = (CodeSource) map.get(signers); + CodeSource cs = map.get(signers); if (cs == null) { cs = new VerifierCodeSource(csdomain, url, signers); signerToCodeSource.put(signers, cs); @@ -524,16 +522,16 @@ class JarVerifier { return cs; } - private CodeSource[] mapSignersToCodeSources(URL url, List signers, boolean unsigned) { - List sources = new ArrayList(); + private CodeSource[] mapSignersToCodeSources(URL url, List signers, boolean unsigned) { + List sources = new ArrayList<>(); for (int i = 0; i < signers.size(); i++) { - sources.add(mapSignersToCodeSource(url, (CodeSigner[]) signers.get(i))); + sources.add(mapSignersToCodeSource(url, signers.get(i))); } if (unsigned) { sources.add(mapSignersToCodeSource(url, null)); } - return (CodeSource[]) sources.toArray(new CodeSource[sources.size()]); + return sources.toArray(new CodeSource[sources.size()]); } private CodeSigner[] emptySigner = new CodeSigner[0]; @@ -553,7 +551,7 @@ class JarVerifier { * but this handles a CodeSource of any type, just in case. */ CodeSource[] sources = mapSignersToCodeSources(cs.getLocation(), getJarCodeSigners(), true); - List sourceList = new ArrayList(); + List sourceList = new ArrayList<>(); for (int i = 0; i < sources.length; i++) { sourceList.add(sources[i]); } @@ -574,6 +572,7 @@ class JarVerifier { * signing data that can be compared by object reference identity. */ private static class VerifierCodeSource extends CodeSource { + private static final long serialVersionUID = -9047366145967768825L; URL vlocation; CodeSigner[] vsigners; @@ -641,16 +640,16 @@ class JarVerifier { return vcerts; } } - private Map signerMap; + private Map signerMap; - private synchronized Map signerMap() { + private synchronized Map signerMap() { if (signerMap == null) { /* * Snapshot signer state so it doesn't change on us. We care * only about the asserted signatures. Verification of * signature validity happens via the JarEntry apis. */ - signerMap = new HashMap(verifiedSigners.size() + sigFileSigners.size()); + signerMap = new HashMap<>(verifiedSigners.size() + sigFileSigners.size()); signerMap.putAll(verifiedSigners); signerMap.putAll(sigFileSigners); } @@ -658,15 +657,15 @@ class JarVerifier { } public synchronized Enumeration entryNames(JarFile jar, final CodeSource[] cs) { - final Map map = signerMap(); - final Iterator itor = map.entrySet().iterator(); + final Map map = signerMap(); + final Iterator> itor = map.entrySet().iterator(); boolean matchUnsigned = false; /* * Grab a single copy of the CodeSigner arrays. Check * to see if we can optimize CodeSigner equality test. */ - List req = new ArrayList(cs.length); + List req = new ArrayList<>(cs.length); for (int i = 0; i < cs.length; i++) { CodeSigner[] match = findMatchingSigners(cs[i]); if (match != null) { @@ -678,8 +677,8 @@ class JarVerifier { } } - final List signersReq = req; - final Enumeration enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration; + final List signersReq = req; + final Enumeration enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration; return new Enumeration() { @@ -691,14 +690,14 @@ class JarVerifier { } while (itor.hasNext()) { - Map.Entry e = (Map.Entry) itor.next(); - if (signersReq.contains((CodeSigner[]) e.getValue())) { - name = (String) e.getKey(); + Map.Entry e = itor.next(); + if (signersReq.contains(e.getValue())) { + name = e.getKey(); return true; } } while (enum2.hasMoreElements()) { - name = (String) enum2.nextElement(); + name = enum2.nextElement(); return true; } return false; @@ -719,13 +718,13 @@ class JarVerifier { * Like entries() but screens out internal JAR mechanism entries * and includes signed entries with no ZIP data. */ - public Enumeration entries2(final JarFile jar, Enumeration e) { - final Map map = new HashMap(); + public Enumeration entries2(final JarFile jar, Enumeration e) { + final Map map = new HashMap<>(); map.putAll(signerMap()); - final Enumeration enum_ = e; + final Enumeration enum_ = e; return new Enumeration() { - Enumeration signers = null; + Enumeration signers = null; JarEntry entry; public boolean hasMoreElements() { @@ -733,7 +732,7 @@ class JarVerifier { return true; } while (enum_.hasMoreElements()) { - ZipEntry ze = (ZipEntry) enum_.nextElement(); + ZipEntry ze = enum_.nextElement(); if (JarVerifier.isSigningRelated(ze.getName())) { continue; } @@ -744,7 +743,7 @@ class JarVerifier { signers = Collections.enumeration(map.keySet()); } while (signers.hasMoreElements()) { - String name = (String) signers.nextElement(); + String name = signers.nextElement(); entry = jar.newEntry(new ZipEntry(name)); return true; } @@ -764,7 +763,7 @@ class JarVerifier { } }; } - private Enumeration emptyEnumeration = new Enumeration() { + private Enumeration emptyEnumeration = new Enumeration() { public boolean hasMoreElements() { return false; @@ -797,8 +796,8 @@ class JarVerifier { } private Enumeration unsignedEntryNames(JarFile jar) { - final Map map = signerMap(); - final Enumeration entries = jar.entries(); + final Map map = signerMap(); + final Enumeration entries = jar.entries(); return new Enumeration() { String name; @@ -813,7 +812,7 @@ class JarVerifier { } while (entries.hasMoreElements()) { String value; - ZipEntry e = (ZipEntry) entries.nextElement(); + ZipEntry e = entries.nextElement(); value = e.getName(); if (e.isDirectory() || isSigningRelated(value)) { continue; @@ -836,14 +835,14 @@ class JarVerifier { } }; } - private List jarCodeSigners; + private List jarCodeSigners; - private synchronized List getJarCodeSigners() { + private synchronized List getJarCodeSigners() { CodeSigner[] signers; if (jarCodeSigners == null) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); set.addAll(signerMap().values()); - jarCodeSigners = new ArrayList(); + jarCodeSigners = new ArrayList<>(); jarCodeSigners.addAll(set); } return jarCodeSigners; @@ -858,7 +857,7 @@ class JarVerifier { public CodeSource getCodeSource(URL url, String name) { CodeSigner[] signers; - signers = (CodeSigner[]) signerMap().get(name); + signers = signerMap().get(name); return mapSignersToCodeSource(url, signers); } diff --git a/jdk/src/share/classes/sun/tools/jar/CommandLine.java b/jdk/src/share/classes/sun/tools/jar/CommandLine.java index acb13082f7b..b9ddeb84b54 100644 --- a/jdk/src/share/classes/sun/tools/jar/CommandLine.java +++ b/jdk/src/share/classes/sun/tools/jar/CommandLine.java @@ -55,7 +55,7 @@ public class CommandLine { public static String[] parse(String[] args) throws IOException { - ArrayList newArgs = new ArrayList(args.length); + List newArgs = new ArrayList<>(args.length); for (int i = 0; i < args.length; i++) { String arg = args[i]; if (arg.length() > 1 && arg.charAt(0) == '@') { @@ -69,10 +69,10 @@ public class CommandLine { newArgs.add(arg); } } - return (String[])newArgs.toArray(new String[newArgs.size()]); + return newArgs.toArray(new String[newArgs.size()]); } - private static void loadCmdFile(String name, List args) + private static void loadCmdFile(String name, List args) throws IOException { Reader r = new BufferedReader(new FileReader(name)); @@ -83,7 +83,7 @@ public class CommandLine { st.commentChar('#'); st.quoteChar('"'); st.quoteChar('\''); - while (st.nextToken() != st.TT_EOF) { + while (st.nextToken() != StreamTokenizer.TT_EOF) { args.add(st.sval); } r.close(); diff --git a/jdk/src/share/classes/sun/tools/jar/Manifest.java b/jdk/src/share/classes/sun/tools/jar/Manifest.java index 370c9edb6b0..b49d1e8eda0 100644 --- a/jdk/src/share/classes/sun/tools/jar/Manifest.java +++ b/jdk/src/share/classes/sun/tools/jar/Manifest.java @@ -47,10 +47,10 @@ public class Manifest { /* list of headers that all pertain to a particular * file in the archive */ - private Vector entries = new Vector(); + private Vector entries = new Vector<>(); private byte[] tmpbuf = new byte[512]; /* a hashtable of entries, for fast lookup */ - private Hashtable tableEntries = new Hashtable(); + private Hashtable tableEntries = new Hashtable<>(); static final String[] hashes = {"SHA"}; static final byte[] EOL = {(byte)'\r', (byte)'\n'}; @@ -115,14 +115,14 @@ public class Manifest { } public MessageHeader getEntry(String name) { - return (MessageHeader) tableEntries.get(name); + return tableEntries.get(name); } public MessageHeader entryAt(int i) { - return (MessageHeader) entries.elementAt(i); + return entries.elementAt(i); } - public Enumeration entries() { + public Enumeration entries() { return entries.elements(); } @@ -214,7 +214,7 @@ public class Manifest { /* the first header in the file should be the global one. * It should say "Manifest-Version: x.x"; if not add it */ - MessageHeader globals = (MessageHeader) entries.elementAt(0); + MessageHeader globals = entries.elementAt(0); if (globals.findValue("Manifest-Version") == null) { /* Assume this is a user-defined manifest. If it has a Name: <..> @@ -238,7 +238,7 @@ public class Manifest { globals.print(ps); for (int i = 1; i < entries.size(); ++i) { - MessageHeader mh = (MessageHeader) entries.elementAt(i); + MessageHeader mh = entries.elementAt(i); mh.print(ps); } } diff --git a/jdk/src/share/classes/sun/tools/jar/SignatureFile.java b/jdk/src/share/classes/sun/tools/jar/SignatureFile.java index 0ce8951b60a..fd67ce195d4 100644 --- a/jdk/src/share/classes/sun/tools/jar/SignatureFile.java +++ b/jdk/src/share/classes/sun/tools/jar/SignatureFile.java @@ -47,7 +47,7 @@ import sun.security.x509.AlgorithmId; * *

Each entry section contains the name of an entry (which must * have a counterpart in the manifest). Like the manifest it contains - * a hash, the hash of the manifest section correspondind to the + * a hash, the hash of the manifest section corresponding to the * name. Since the manifest entry contains the hash of the data, this * is equivalent to a signature of the data, plus the attributes of * the manifest entry. @@ -66,7 +66,7 @@ public class SignatureFile { /* list of headers that all pertain to a particular file in the * archive */ - private Vector entries = new Vector(); + private Vector entries = new Vector<>(); /* Right now we only support SHA hashes */ static final String[] hashes = {"SHA"}; @@ -98,7 +98,7 @@ public class SignatureFile { * character in length. */ private SignatureFile(String name) throws JarException { - entries = new Vector(); + entries = new Vector<>(); if (name != null) { if (name.length() > 8 || name.indexOf('.') != -1) { @@ -142,9 +142,9 @@ public class SignatureFile { this(name, true); this.manifest = manifest; - Enumeration enum_ = manifest.entries(); + Enumeration enum_ = manifest.entries(); while (enum_.hasMoreElements()) { - MessageHeader mh = (MessageHeader)enum_.nextElement(); + MessageHeader mh = enum_.nextElement(); String entryName = mh.findValue("Name"); if (entryName != null) { add(entryName); @@ -269,9 +269,9 @@ public class SignatureFile { *the entry does not exist. */ public MessageHeader getEntry(String name) { - Enumeration enum_ = entries(); + Enumeration enum_ = entries(); while(enum_.hasMoreElements()) { - MessageHeader mh = (MessageHeader)enum_.nextElement(); + MessageHeader mh = enum_.nextElement(); if (name.equals(mh.findValue("Name"))) { return mh; } @@ -282,13 +282,13 @@ public class SignatureFile { /** * Returns the n-th entry. The global header is a entry 0. */ public MessageHeader entryAt(int n) { - return (MessageHeader) entries.elementAt(n); + return entries.elementAt(n); } /** * Returns an enumeration of the entries. */ - public Enumeration entries() { + public Enumeration entries() { return entries.elements(); } @@ -322,11 +322,11 @@ public class SignatureFile { } } - private Hashtable digests = new Hashtable(); + private Hashtable digests = new Hashtable<>(); private MessageDigest getDigest(String algorithm) throws NoSuchAlgorithmException { - MessageDigest dig = (MessageDigest)digests.get(algorithm); + MessageDigest dig = digests.get(algorithm); if (dig == null) { dig = MessageDigest.getInstance(algorithm); digests.put(algorithm, dig); @@ -344,7 +344,7 @@ public class SignatureFile { /* the first header in the file should be the global one. * It should say "SignatureFile-Version: x.x"; barf if not */ - MessageHeader globals = (MessageHeader) entries.elementAt(0); + MessageHeader globals = entries.elementAt(0); if (globals.findValue("Signature-Version") == null) { throw new JarException("Signature file requires " + "Signature-Version: 1.0 in 1st header"); @@ -354,7 +354,7 @@ public class SignatureFile { globals.print(ps); for (int i = 1; i < entries.size(); ++i) { - MessageHeader mh = (MessageHeader) entries.elementAt(i); + MessageHeader mh = entries.elementAt(i); mh.print(ps); } } diff --git a/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java b/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java index 717e34b13cf..ca6ab6e410f 100644 --- a/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java +++ b/jdk/src/share/demo/management/MemoryMonitor/MemoryMonitor.java @@ -213,10 +213,10 @@ public class MemoryMonitor extends JPanel { // Calculate remaining size float ssH = ascent + descent; - float remainingHeight = (float) (y2 - (ssH*2) - 0.5f); + float remainingHeight = y2 - (ssH*2) - 0.5f; float blockHeight = remainingHeight/10; float blockWidth = 20.0f; - float remainingWidth = (float) (x2 - blockWidth - 10); + float remainingWidth = x2 - blockWidth - 10; // .. Memory Free .. big.setColor(mfColor); @@ -224,7 +224,7 @@ public class MemoryMonitor extends JPanel { int i = 0; for ( ; i < MemUsage ; i++) { mfRect.setRect(x1+5,(float) y1+ssH+i*blockHeight, - blockWidth,(float) blockHeight-1); + blockWidth, blockHeight-1); big.fill(mfRect); } @@ -232,13 +232,13 @@ public class MemoryMonitor extends JPanel { big.setColor(Color.green); for ( ; i < 10; i++) { muRect.setRect(x1+5,(float) y1 + ssH+i*blockHeight, - blockWidth,(float) blockHeight-1); + blockWidth, blockHeight-1); big.fill(muRect); } // .. Draw History Graph .. if (remainingWidth <= 30) remainingWidth = (float)30; - if (remainingHeight <= ssH) remainingHeight = (float)ssH; + if (remainingHeight <= ssH) remainingHeight = ssH; big.setColor(graphColor); int graphX = x1+30; int graphY = y1 + (int) ssH; @@ -347,8 +347,8 @@ public class MemoryMonitor extends JPanel { big = bimg.createGraphics(); big.setFont(font); FontMetrics fm = big.getFontMetrics(font); - ascent = (int) fm.getAscent(); - descent = (int) fm.getDescent(); + ascent = fm.getAscent(); + descent = fm.getDescent(); } repaint(); try { diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java index 996f7cc0ef9..5f79218631c 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java @@ -61,7 +61,7 @@ public class ZipFileStore extends FileStore { private final ZipFileSystem zfs; ZipFileStore(ZipPath zpath) { - this.zfs = (ZipFileSystem)zpath.getFileSystem(); + this.zfs = zpath.getFileSystem(); } @Override 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 d09da8e6dd9..d68388a97f3 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 @@ -1609,7 +1609,7 @@ public class ZipFileSystem extends FileSystem { synchronized (inflaters) { int size = inflaters.size(); if (size > 0) { - Inflater inf = (Inflater)inflaters.remove(size - 1); + Inflater inf = inflaters.remove(size - 1); return inf; } else { return new Inflater(true); @@ -1638,7 +1638,7 @@ public class ZipFileSystem extends FileSystem { synchronized (deflaters) { int size = deflaters.size(); if (size > 0) { - Deflater def = (Deflater)deflaters.remove(size - 1); + Deflater def = deflaters.remove(size - 1); return def; } else { return new Deflater(Deflater.DEFAULT_COMPRESSION, true); diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java index 49d9ee7b908..49bb826e003 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java @@ -211,7 +211,7 @@ public class ZipFileSystemProvider extends FileSystemProvider { public V getFileAttributeView(Path path, Class type, LinkOption... options) { - return (V)ZipFileAttributeView.get(toZipPath(path), type); + return ZipFileAttributeView.get(toZipPath(path), type); } @Override diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java index 71274e2a111..a869d3af50c 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java @@ -78,12 +78,12 @@ public class ZipInfo { // twice long len = LOCHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENHDR; if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) - zfs.zerror("read loc header failed"); + ZipFileSystem.zerror("read loc header failed"); if (LOCEXT(buf) > CENEXT(cen, pos) + CENHDR) { // have to read the second time; len = LOCHDR + LOCNAM(buf) + LOCEXT(buf); if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) - zfs.zerror("read loc header failed"); + ZipFileSystem.zerror("read loc header failed"); } printLOC(buf); pos += CENHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENCOM(cen, pos); From 7c7523d9686f9369c218246631551058093009c1 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Mon, 13 Feb 2012 14:26:25 +0000 Subject: [PATCH 21/26] 7142339: PKCS7.java is needlessly creating SHA1PRNG SecureRandom instances when timestamping is not done Reviewed-by: xuelei, wetmore --- .../classes/sun/security/pkcs/PKCS7.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java index a3198784729..657842c0017 100644 --- a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java +++ b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,16 +72,19 @@ public class PKCS7 { /* * Random number generator for creating nonce values + * (Lazy initialization) */ - private static final SecureRandom RANDOM; - static { - SecureRandom tmp = null; - try { - tmp = SecureRandom.getInstance("SHA1PRNG"); - } catch (NoSuchAlgorithmException e) { - // should not happen + private static class SecureRandomHolder { + static final SecureRandom RANDOM; + static { + SecureRandom tmp = null; + try { + tmp = SecureRandom.getInstance("SHA1PRNG"); + } catch (NoSuchAlgorithmException e) { + // should not happen + } + RANDOM = tmp; } - RANDOM = tmp; } /* @@ -862,8 +865,8 @@ public class PKCS7 { // Generate a nonce BigInteger nonce = null; - if (RANDOM != null) { - nonce = new BigInteger(64, RANDOM); + if (SecureRandomHolder.RANDOM != null) { + nonce = new BigInteger(64, SecureRandomHolder.RANDOM); tsQuery.setNonce(nonce); } tsQuery.requestCertificate(true); From abfc726cc44496d2d0b98e65654743154d3b046f Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Tue, 14 Feb 2012 11:47:41 +0000 Subject: [PATCH 22/26] 7142888: sun/security/tools/jarsigner/ec.sh fail on sparc Reviewed-by: xuelei --- jdk/test/sun/security/tools/jarsigner/ec.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/tools/jarsigner/ec.sh b/jdk/test/sun/security/tools/jarsigner/ec.sh index 7e400c9b902..fc66bbc8f9e 100644 --- a/jdk/test/sun/security/tools/jarsigner/ec.sh +++ b/jdk/test/sun/security/tools/jarsigner/ec.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,8 @@ $JAR cvf $JFILE A $KT -alias a -dname CN=a -keyalg ec -genkey -validity 300 || exit 11 $KT -alias b -dname CN=b -keyalg ec -genkey -validity 300 || exit 12 -$KT -alias c -dname CN=c -keyalg ec -genkey -validity 300 || exit 13 +# Ensure that key length is sufficient for the intended hash (SHA512withECDSA) +$KT -alias c -dname CN=c -keyalg ec -genkey -validity 300 -keysize 521 || exit 13 $KT -alias x -dname CN=x -keyalg ec -genkey -validity 300 || exit 14 $JARSIGNER -keystore $KS -storepass changeit $JFILE a -debug -strict || exit 21 From 52739303dbf0a2f46a97bcec7d1ba6e00734ad97 Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Tue, 14 Feb 2012 07:28:29 -0800 Subject: [PATCH 23/26] 7140868: TEST_BUG: jcmd tests need to use -XX:+UsePerfData Reviewed-by: fparain, dholmes --- jdk/test/sun/tools/jcmd/jcmd-Defaults.sh | 4 ++-- jdk/test/sun/tools/jcmd/jcmd-f.sh | 2 +- jdk/test/sun/tools/jcmd/jcmd-help-help.sh | 2 +- jdk/test/sun/tools/jcmd/jcmd-help.sh | 4 ++-- jdk/test/sun/tools/jcmd/jcmd-pid.sh | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh b/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh index 277c8548c0c..cf791358922 100644 --- a/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh +++ b/jdk/test/sun/tools/jcmd/jcmd-Defaults.sh @@ -28,6 +28,6 @@ JCMD="${TESTJAVA}/bin/jcmd" -${JCMD} 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk +${JCMD} -J-XX:+UsePerfData 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk -${JCMD} -l 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk +${JCMD} -J-XX:+UsePerfData -l 2>&1 | awk -f ${TESTSRC}/jcmd_Output1.awk diff --git a/jdk/test/sun/tools/jcmd/jcmd-f.sh b/jdk/test/sun/tools/jcmd/jcmd-f.sh index acbe0b322fe..5cbd1b93236 100644 --- a/jdk/test/sun/tools/jcmd/jcmd-f.sh +++ b/jdk/test/sun/tools/jcmd/jcmd-f.sh @@ -46,7 +46,7 @@ failed=0 # -f